:root {
  --bg: #070808;
  --panel: #181a1c;
  --panel-2: #202225;
  --line: #31353b;
  --text: #edf2f6;
  --muted: #9aa2ad;
  --green: #90f7a7;
  --green-2: #10b98c;
  --red: #ff5e66;
  --blue: #2f9fe8;
  --amber: #d6b35e;
  font-family: "Avenir Next", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}

button {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 26%, rgba(16, 185, 140, 0.11), transparent 34%),
    linear-gradient(180deg, #101112 0%, #070808 100%);
}

.topbar {
  height: 52px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  background: #191a1c;
  border-bottom: 1px solid #25272b;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  color: var(--green);
  font-size: 28px;
  font-weight: 1000;
  transform: skew(-10deg);
  text-shadow: 0 0 18px rgba(144, 247, 167, 0.42);
}

.brand-name {
  font-size: 16px;
  font-weight: 900;
  white-space: nowrap;
}

.brand-sub {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.top-stats,
.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-stats span {
  height: 31px;
  display: grid;
  place-items: center;
  padding: 0 11px;
  border-radius: 5px;
  background: #0f1112;
  border: 1px solid #2d3238;
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.top-actions button {
  white-space: nowrap;
}

.primary-button,
.ghost-button,
.icon-button,
.mode-buttons button,
.action-buttons button {
  border: 0;
  cursor: pointer;
  color: inherit;
  transition:
    transform 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease;
}

.primary-button {
  height: 34px;
  padding: 0 15px;
  border-radius: 5px;
  background: linear-gradient(180deg, #a6ffb9, #83e99b);
  color: #0b2010;
  font-weight: 900;
}

.ghost-button,
.icon-button {
  height: 34px;
  border-radius: 5px;
  background: #292c30;
  color: #e8edf3;
  font-weight: 900;
}

.ghost-button {
  padding: 0 14px;
}

.icon-button {
  width: 34px;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  cursor: default;
  opacity: 0.52;
  transform: none;
}

.trainer {
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: 22px;
  display: grid;
  grid-template-columns: 280px minmax(520px, 1fr) 380px;
  gap: 16px;
  align-items: start;
}

.panel-card,
.decision-panel {
  border: 1px solid #2e3238;
  border-radius: 8px;
  background: rgba(29, 31, 34, 0.92);
  box-shadow: 0 16px 46px rgba(0, 0, 0, 0.32);
}

.panel-card {
  padding: 14px;
  margin-bottom: 12px;
}

.panel-heading {
  color: #aeb6c1;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  margin-bottom: 11px;
}

.mode-buttons {
  display: grid;
  gap: 7px;
}

.mode-buttons button {
  height: 38px;
  border-radius: 5px;
  background: #292c30;
  color: #cfd5dc;
  font-weight: 900;
}

.mode-buttons button.is-active {
  background: #3f464d;
  color: var(--green);
  box-shadow: 0 0 0 1px rgba(144, 247, 167, 0.4) inset;
}

.small-note,
.spot-detail {
  margin-top: 11px;
  color: #a9b0ba;
  font-size: 13px;
  line-height: 1.55;
}

.spot-name {
  font-size: 21px;
  font-weight: 900;
  line-height: 1.2;
}

.history-list {
  display: grid;
  gap: 7px;
}

.empty {
  color: #737b85;
  font-size: 13px;
}

.history-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 46px;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: #24272b;
  color: #edf2f6;
  font-size: 13px;
  text-align: left;
}

.history-item b,
.history-item small {
  display: block;
}

.history-item b {
  font-size: 13px;
}

.history-item small {
  margin-top: 3px;
  color: #858e99;
  font-size: 11px;
  font-weight: 800;
}

.history-item.is-selected {
  border-color: rgba(144, 247, 167, 0.62);
  background: rgba(16, 185, 140, 0.17);
}

.history-item.is-ok strong {
  color: var(--green);
}

.history-item.is-miss strong {
  color: var(--red);
}

.review-summary {
  color: #cbd2da;
  font-size: 13px;
  line-height: 1.55;
}

.review-title {
  color: var(--green);
  font-size: 15px;
  font-weight: 1000;
  margin-bottom: 9px;
}

.review-detail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 0 0 10px;
}

.review-detail div {
  min-height: 48px;
  padding: 8px;
  border: 1px solid #30353b;
  border-radius: 6px;
  background: #202327;
}

.review-detail dt,
.review-detail dd {
  margin: 0;
}

.review-detail dt {
  color: #949da8;
  font-size: 11px;
  font-weight: 900;
}

.review-detail dd {
  margin-top: 4px;
  color: #f2f7fb;
  font-size: 13px;
  font-weight: 1000;
}

.review-summary p {
  margin: 8px 0 0;
  color: #aeb6c1;
}

.review-line {
  color: #858e99;
  font-size: 12px;
}

.game-table {
  min-width: 0;
}

.table-felt {
  position: relative;
  min-height: 500px;
  border-radius: 999px;
  border: 5px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at center, rgba(20, 72, 54, 0.28), transparent 42%),
    #0b0d0e;
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  margin: 24px 0 18px;
}

.seat {
  position: absolute;
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 50%;
  border: 4px solid #30343a;
  background: #17191b;
  color: #7f8791;
  font-weight: 900;
  text-align: center;
}

.seat span,
.seat strong {
  display: block;
  line-height: 1.05;
}

.seat.is-hero {
  color: #fff;
  border-color: var(--green-2);
  box-shadow: 0 0 28px rgba(16, 185, 140, 0.36);
}

.seat.is-current {
  color: #fff;
  border-color: var(--amber);
  box-shadow: 0 0 28px rgba(214, 179, 94, 0.38);
}

.seat.is-folded {
  opacity: 0.35;
}

.seat.is-hero.is-current {
  border-color: var(--green);
}

.seat.is-active-villain {
  border-color: #516272;
}

.seat-utg {
  left: 45%;
  bottom: -4%;
}

.seat-hj {
  left: 2%;
  top: 44%;
}

.seat-co {
  left: 28%;
  top: -6%;
}

.seat-btn {
  right: 28%;
  top: -6%;
}

.seat-sb {
  right: 2%;
  top: 44%;
}

.seat-bb {
  right: 28%;
  bottom: -4%;
}

.dealer {
  position: absolute;
  right: 34%;
  top: 14%;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: #151719;
  font-weight: 900;
}

.pot-box {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}

.pot-box span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.pot-box strong {
  font-size: 38px;
  font-weight: 1000;
}

.board-cards {
  position: absolute;
  left: 50%;
  top: 59%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  align-items: center;
}

.board-card,
.playing-card {
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(145deg, #fbffff, #dfe8ea);
  color: #101418;
  font-weight: 1000;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32);
}

.board-card {
  width: 48px;
  height: 64px;
  font-size: 18px;
}

.no-board {
  color: #8e96a0;
  font-weight: 900;
}

.action-line {
  position: absolute;
  left: 50%;
  bottom: 16%;
  width: min(560px, 78%);
  transform: translateX(-50%);
  padding: 10px 14px;
  border-radius: 6px;
  background: rgba(28, 31, 34, 0.9);
  color: #d8dde4;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  line-height: 1.45;
}

.hero-zone {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid #2e3238;
  border-radius: 8px;
  background: #191b1e;
}

.hero-label span,
.hero-label strong {
  display: block;
}

.hero-label span {
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.hero-label strong {
  margin-top: 3px;
  font-size: 31px;
  font-weight: 1000;
}

.hole-cards {
  display: flex;
  gap: 10px;
}

.playing-card {
  width: 86px;
  height: 116px;
  font-size: 28px;
}

.playing-card.is-red,
.board-card.is-red {
  color: #d72e3a;
}

.decision-panel {
  padding: 16px;
}

.decision-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 13px;
}

.decision-head span {
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.decision-head strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.action-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.action-buttons button {
  min-height: 84px;
  padding: 12px;
  border: 1px solid #3a3f46;
  border-radius: 7px;
  background: #272a2e;
  color: #eef3f7;
  text-align: left;
}

.action-buttons button strong,
.action-buttons button span {
  display: block;
}

.action-buttons button strong {
  font-size: 18px;
}

.action-buttons button span {
  margin-top: 8px;
  color: #aab1ba;
  font-size: 13px;
  font-weight: 900;
}

.action-buttons button.is-best {
  border-color: var(--green);
  background: rgba(16, 185, 140, 0.2);
}

.action-buttons button:disabled {
  cursor: default;
  opacity: 0.82;
}

.feedback {
  min-height: 72px;
  margin-top: 13px;
  padding: 13px;
  border-radius: 7px;
  background: #141618;
  color: #c1c8d1;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.55;
}

.feedback.is-good {
  color: #e7ffec;
  background: rgba(16, 185, 140, 0.2);
}

.feedback.is-bad {
  color: #ffe4e6;
  background: rgba(255, 94, 102, 0.16);
}

.feedback.is-hint {
  color: #fff5c9;
  background: rgba(214, 179, 94, 0.18);
}

.math-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.math-panel div {
  min-height: 68px;
  padding: 10px;
  border-radius: 7px;
  background: #1f2226;
  border: 1px solid #2d3238;
}

.math-panel span,
.math-panel strong {
  display: block;
}

.math-panel span {
  color: #97a0aa;
  font-size: 12px;
  font-weight: 900;
}

.math-panel strong {
  margin-top: 7px;
  color: #f1f6fb;
  font-size: 16px;
  line-height: 1.35;
}

.math-panel .math-formula {
  grid-column: 1 / -1;
  min-height: 58px;
  background: rgba(16, 185, 140, 0.12);
  border-color: rgba(144, 247, 167, 0.22);
}

.math-panel .math-formula strong {
  color: var(--green);
  font-size: 14px;
}

.coach-grid {
  display: grid;
  grid-template-columns: 1fr 0.7fr 1.4fr;
  gap: 8px;
  margin-top: 12px;
}

.coach-grid div {
  min-height: 76px;
  padding: 11px;
  border-radius: 7px;
  background: #222529;
}

.coach-grid span,
.coach-grid strong {
  display: block;
}

.coach-grid span {
  color: #929ba6;
  font-size: 12px;
  font-weight: 900;
}

.coach-grid strong {
  margin-top: 7px;
  font-size: 15px;
  line-height: 1.42;
}

@media (max-width: 1120px) {
  .trainer {
    grid-template-columns: 1fr;
  }

  .control-panel {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }

  .panel-card {
    margin-bottom: 0;
  }
}

@media (max-width: 720px) {
  .topbar {
    height: auto;
    grid-template-columns: 1fr;
    padding: 10px 12px;
  }

  .top-stats,
  .top-actions {
    width: 100%;
    justify-content: stretch;
  }

  .top-stats {
    display: grid;
    grid-template-columns: 0.78fr 1.1fr 1fr;
  }

  .top-actions {
    display: grid;
    grid-template-columns: 1.45fr 0.68fr 0.78fr 1.05fr 34px;
  }

  .top-stats span,
  .top-actions button {
    min-width: 0;
    width: 100%;
    padding-left: 6px;
    padding-right: 6px;
    font-size: 12px;
  }

  .top-actions .primary-button {
    min-width: 0;
  }

  .trainer {
    padding: 12px;
  }

  .control-panel {
    grid-template-columns: 1fr;
  }

  .table-felt {
    min-height: 360px;
    border-radius: 34px;
  }

  .seat {
    width: 56px;
    height: 56px;
    border-width: 3px;
    font-size: 12px;
  }

  .pot-box strong {
    font-size: 28px;
  }

  .action-line {
    bottom: 10%;
    width: 86%;
  }

  .playing-card {
    width: 70px;
    height: 96px;
    font-size: 23px;
  }

  .hero-zone,
  .decision-head,
  .math-panel,
  .coach-grid {
    grid-template-columns: 1fr;
  }

  .math-panel .math-formula {
    grid-column: auto;
  }

  .decision-head {
    display: grid;
  }

  .action-buttons {
    grid-template-columns: 1fr;
  }
}
