:root {
  --bg: #0b6b3a;
  --panel: rgba(255,255,255,0.12);
  --line: rgba(255,255,255,0.25);
  --text: #ffffff;
  --card-bg: #ffffff;
  --card-back: #1f4ea3;
  --black: #111111;
  --red: #c62828;
  --shadow: 0 4px 12px rgba(0,0,0,0.25);
  --card-w: 64px;
  --card-h: 90px;
  --gap: 10px;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.app {
  max-width: 760px;
  margin: 0 auto;
  padding: 12px;
  padding-bottom: 120px;
}

.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
}

button {
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.12);
  color: white;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  cursor: pointer;
}

button:active { transform: translateY(1px); }

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.oracle-wrap {
  position: relative;
  display: inline-block;
}

.oracle-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: rgba(10, 50, 25, 0.97);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 10px;
  padding: 6px;
  z-index: 100;
  min-width: 160px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

.oracle-menu.open { display: flex; flex-direction: column; gap: 4px; }

.oracle-menu button {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 13px;
  white-space: nowrap;
}

.oracle-menu button:hover { background: rgba(255,255,255,0.15); }

.oracle-label {
  font-size: 11px;
  opacity: 0.6;
  padding: 4px 12px 2px;
}

/* 2026/5/13 AnalyzeTextの追加 */
.analysis-badge {
  font-size:smaller;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 500;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.analysis-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #aaa;
  flex: 0 0 auto;
}

.analysis-win .analysis-dot {
  background: #2ecc71;
  box-shadow: 0 0 10px rgba(46, 204, 113, 0.9);
}

.analysis-unknown .analysis-dot {
  background: #f1c40f;
  box-shadow: 0 0 10px rgba(241, 196, 15, 0.9);
}

.analysis-lose .analysis-dot {
  background: #e74c3c;
  box-shadow: 0 0 10px rgba(231, 76, 60, 0.9);
}

#personaSelect {
  background: rgba(255,255,255,0.12);
  color: white;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 14px;
}

#personaSelect option {
  color: black;
}

/* persona.descriptionの追加　2026/2/26 */
.persona-description {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  min-height: 38px;
  padding: 0 10px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status {
  font-size: 14px;
  opacity: 0.95;
}

.top-row {
  display: grid;
  grid-template-columns: repeat(2, var(--card-w)) 1fr repeat(4, var(--card-w));
  gap: var(--gap);
  align-items: start;
  margin-bottom: 16px;
}

.pile, .foundation, .tableau {
  width: var(--card-w);
  min-height: var(--card-h);
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  position: relative;
  background: rgba(255,255,255,0.06);
}

.waste {
  border-style: solid;
  border-color: transparent;
  background: transparent;
}

.spacer { min-width: 1px; }

.tableau-row {
  display: grid;
  grid-template-columns: repeat(7, var(--card-w));
  gap: var(--gap);
  align-items: start;
}

.tableau {
  min-height: 360px;
}

.card {
  width: var(--card-w);
  height: var(--card-h);
  border-radius: var(--radius);
  background: var(--card-bg);
  color: var(--black);
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,0.15);
  position: absolute;
  left: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px;
  font-weight: 700;
  cursor: pointer;
}

.card.red { color: var(--red); }

.card.back {
  background: linear-gradient(135deg, #2f64c6, #163a7d);
  color: transparent;
  border-color: rgba(255,255,255,0.15);
}

.card.selected {
  outline: 3px solid #ffd54f;
  transform: translateY(-2px);
}

.corner {
  line-height: 1;
  font-size: 16px;
}

.center {
  text-align: center;
  font-size: 22px;
  margin-top: auto;
  margin-bottom: auto;
}

.placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255,255,255,0.75);
  font-size: 24px;
  font-weight: 700;
}

.pile-label {
  text-align: center;
  font-size: 12px;
  margin-top: 4px;
  opacity: 0.8;
}

/* フッターの設定 */

.bottom-area {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(760px, 100%);
  z-index: 200;
  padding: 8px 12px 10px;
  background: var(--bg);
}

.bottom-action button {
  background: rgba(255, 255, 255, 0.2);
  border:1px solid rgba(255, 255, 255, 0.3);
}

#footer a {
  text-decoration-color: rgba(255, 255, 255, 0.75);
  font-size:15px;
}

#exitButton{
  display:none;
}


@media (max-width: 560px) {
  :root {
    --card-w: 44px;
    --card-h: 66px;
    --gap: 6px;
  }

  .corner { font-size: 12px; }
  .center { font-size: 16px; }
  button { font-size: 13px; padding: 8px 10px; }
  .status { font-size: 13px; }
  .tableau { min-height: 300px; }
}