:root {
  --banana: #ffe36d;
  --banana-deep: #ffc93d;
  --banana-brown: #6e4b18;
  --mint: #9ee7c5;
  --felt: #39b978;
  --felt-dark: #168052;
  --ink: #2a2419;
  --muted: #7d725e;
  --paper: #fffaf0;
  --panel: rgba(255, 252, 239, 0.96);
  --danger: #f06464;
  --success: #25a45a;
  --shadow: 0 18px 45px rgba(95, 63, 13, 0.18);
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  font-family: ui-rounded, "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 16% 10%, rgba(255, 245, 153, 0.95), transparent 28%),
    radial-gradient(circle at 90% 4%, rgba(158, 231, 197, 0.7), transparent 30%),
    linear-gradient(135deg, #fff3a8 0%, #ffe2bd 48%, #d6f6d9 100%);
}

body {
  display: flex;
  justify-content: center;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
}

body::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

button, input {
  font: inherit;
}

button {
  cursor: pointer;
  border: 0;
}

.phone-frame {
  width: min(460px, 100vw);
  height: 100vh;
  height: 100dvh;
  flex: 0 0 auto;
  border-radius: 0;
  padding: 0;
  background: linear-gradient(155deg, #4b3320, #1f1710 70%);
  box-shadow: none;
}

.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 0;
  padding: calc(18px + env(safe-area-inset-top)) 16px calc(22px + env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 15% 16%, rgba(255,255,255,0.72), transparent 22%),
    linear-gradient(180deg, #fff8c7 0%, #fff7df 38%, #eefce9 100%);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.phone-screen::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.app-header,
.hand-topline,
.result-header,
.learner-card,
.context-grid,
.notice-ribbon {
  display: flex;
  align-items: center;
}

.app-header {
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 16px;
  background: #fff5b9;
  box-shadow: 0 8px 18px rgba(156, 114, 16, 0.2);
}

h1, h2, p { margin: 0; }

h1 {
  font-size: 24px;
  line-height: 1;
  letter-spacing: -0.04em;
}

h2 {
  font-size: 20px;
  line-height: 1.18;
  letter-spacing: -0.03em;
}

.eyebrow {
  margin-bottom: 3px;
  color: #997126;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.reset-button {
  padding: 9px 12px;
  border-radius: 999px;
  background: #fff;
  color: var(--banana-brown);
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(120, 86, 23, 0.13);
}

.notice-ribbon {
  flex-direction: column;
  gap: 4px;
  justify-content: center;
  min-height: 62px;
  padding: 10px 12px;
  border: 2px dashed rgba(122, 90, 25, 0.28);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
  box-shadow: var(--shadow);
}

.notice-ribbon span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.notice-ribbon strong {
  color: #6e4b18;
  font-size: 15px;
}

.learner-card {
  justify-content: flex-start;
  gap: 8px;
  margin: 12px 0;
  padding: 11px 12px;
  border-radius: 20px;
  background: rgba(255,255,255,0.74);
  box-shadow: 0 12px 28px rgba(92, 67, 13, 0.12);
}

.learner-card > div,
.context-grid > div {
  min-width: 0;
}

.small-label {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.learner-card strong,
.context-grid strong {
  display: block;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hand-card,
.choice-card,
.result-card {
  margin-top: 12px;
  padding: 14px;
  border-radius: 26px;
  background: var(--panel);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,0.78);
}

.hand-topline,
.result-header {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.street-pill,
.result-badge {
  flex: 0 0 auto;
  padding: 8px 10px;
  border-radius: 999px;
  background: #fff2a4;
  color: var(--banana-brown);
  font-size: 12px;
  font-weight: 900;
}

.table-wrap {
  padding: 10px;
  border-radius: 24px;
  background: linear-gradient(180deg, #825321, #4e2d14);
  box-shadow: inset 0 0 0 3px rgba(255,255,255,0.12), 0 12px 28px rgba(67, 41, 9, 0.2);
}

.poker-table {
  position: relative;
  height: 278px;
  border-radius: 48% / 38%;
  background:
    radial-gradient(circle at 50% 42%, rgba(255,255,255,0.18), transparent 32%),
    linear-gradient(145deg, var(--felt), var(--felt-dark));
  box-shadow: inset 0 0 0 10px rgba(255, 236, 155, 0.18), inset 0 0 0 3px rgba(36, 91, 57, 0.7);
}

.seat {
  position: absolute;
  min-width: 70px;
  padding: 7px 9px;
  border-radius: 16px;
  background: #fffaf0;
  color: #4b3414;
  text-align: center;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.1;
  box-shadow: 0 8px 18px rgba(27, 67, 42, 0.22);
}

.seat span {
  color: #8f7b52;
  font-size: 10px;
}

.seat-top { top: -4px; left: 50%; transform: translateX(-50%); }
.seat-left { top: 46%; left: -2px; transform: translateY(-50%); }
.seat-right { top: 46%; right: -2px; transform: translateY(-50%); }

.board-zone {
  position: absolute;
  left: 50%;
  top: 44%;
  width: 250px;
  transform: translate(-50%, -50%);
  text-align: center;
}

.pot-badge {
  display: inline-flex;
  margin-bottom: 9px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 249, 210, 0.95);
  color: #5d4217;
  font-size: 13px;
  font-weight: 900;
}

.board-cards,
.hole-cards {
  display: flex;
  justify-content: center;
  gap: 6px;
  min-height: 58px;
}

.card {
  width: 40px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: linear-gradient(180deg, #fff, #fff7e8);
  color: #1f1a13;
  font-weight: 1000;
  font-size: 16px;
  box-shadow: 0 7px 14px rgba(14, 68, 41, 0.25), inset 0 0 0 1px rgba(75, 54, 15, 0.08);
}

.card.red { color: #d43b36; }
.card.back {
  color: transparent;
  background:
    radial-gradient(circle, rgba(255,255,255,0.35) 12%, transparent 13%) 0 0 / 10px 10px,
    linear-gradient(145deg, #ffe36d, #f5a623);
}

.hero-zone {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  min-width: 150px;
  text-align: center;
}

.hero-zone p {
  display: inline-block;
  margin-bottom: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,0.88);
  color: #4f3715;
  font-size: 12px;
  font-weight: 900;
}

.context-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0;
}

.context-grid > div {
  padding: 10px 11px;
  border-radius: 16px;
  background: #fff7d6;
}

.history-box {
  padding: 12px;
  border-radius: 18px;
  background: #f6ffef;
  border: 1px solid rgba(73, 149, 82, 0.16);
}

.section-title {
  margin-bottom: 8px;
  color: #5d4217;
  font-size: 13px;
  font-weight: 1000;
}

.history-box p {
  color: #4b4435;
  font-size: 13px;
  line-height: 1.55;
}

.choices {
  display: grid;
  gap: 9px;
}

.choice-button {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 9px;
  align-items: center;
  width: 100%;
  padding: 11px 12px;
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 8px 18px rgba(101, 73, 17, 0.1);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.choice-button:hover,
.choice-button:focus-visible {
  transform: translateY(-1px);
  outline: none;
  box-shadow: 0 12px 22px rgba(101, 73, 17, 0.16);
}

.choice-button.disabled {
  pointer-events: none;
  opacity: 0.72;
}

.choice-key {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #ffe36d;
  color: #614111;
  font-weight: 1000;
}

.choice-title {
  font-size: 15px;
  font-weight: 1000;
}

.choice-desc {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.hidden { display: none !important; }

.result-card {
  border-color: rgba(65, 165, 101, 0.2);
}

.result-badge.correct {
  background: rgba(74, 211, 120, 0.2);
  color: #166534;
}

.result-badge.wrong {
  background: rgba(240, 100, 100, 0.16);
  color: #a92e2e;
}

.best-action {
  margin-bottom: 9px;
  padding: 12px;
  border-radius: 18px;
  background: linear-gradient(135deg, #fff3a6, #fffdf4);
  color: #5d4217;
  font-weight: 1000;
}

.analysis-copy,
.pro-note {
  color: #463c2b;
  font-size: 13px;
  line-height: 1.58;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  margin: 12px 0;
}

.metric {
  padding: 11px;
  border-radius: 16px;
  background: #fff7d6;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.metric strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
  line-height: 1;
}

.solver-table-wrap,
.chart-wrap,
.pro-note {
  margin-top: 12px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255,255,255,0.72);
}

.solver-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  font-size: 12px;
}

.solver-table th,
.solver-table td {
  padding: 8px 6px;
  border-bottom: 1px solid rgba(110, 75, 24, 0.1);
  text-align: left;
}

.solver-table th {
  color: #7a5c22;
  font-size: 11px;
}

.solver-table tr.best-row td {
  color: #166534;
  font-weight: 1000;
}

.bar-chart {
  display: grid;
  gap: 8px;
}

.bar-row {
  display: grid;
  grid-template-columns: 86px 1fr 52px;
  gap: 7px;
  align-items: center;
  font-size: 12px;
}

.bar-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 900;
}

.bar-track {
  height: 13px;
  border-radius: 999px;
  background: #f2e6bc;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  min-width: 2%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffe36d, #34c77b);
}

.bar-value {
  text-align: right;
  color: #5d4217;
  font-weight: 900;
}

.next-button,
.enter-button {
  width: 100%;
  margin-top: 14px;
  padding: 13px 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, #ffdf4d, #ffb12b);
  color: #4d3308;
  font-weight: 1000;
  box-shadow: 0 12px 24px rgba(167, 105, 11, 0.24);
}

.app-footer {
  margin: 14px 4px 2px;
  color: #7d725e;
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
}

.modal-backdrop,
.loading-layer {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(50, 36, 13, 0.54);
  backdrop-filter: blur(8px);
}

.modal-card,
.loader-card {
  width: min(396px, calc(100vw - 36px));
  padding: 22px;
  border-radius: 28px;
  background: #fffaf0;
  box-shadow: 0 28px 80px rgba(48, 32, 7, 0.3);
  border: 1px solid rgba(255,255,255,0.82);
}

.modal-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

.modal-logo-wrap img {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  box-shadow: 0 12px 28px rgba(159, 110, 17, 0.2);
}

.modal-card h2 {
  margin-bottom: 10px;
}

.modal-card p {
  margin-top: 10px;
  color: #4e4434;
  font-size: 14px;
  line-height: 1.6;
}

.nickname-label {
  display: block;
  margin-top: 14px;
  color: #6e4b18;
  font-size: 12px;
  font-weight: 900;
}

.nickname-input {
  width: 100%;
  margin-top: 7px;
  padding: 12px 13px;
  border: 2px solid #f2db86;
  border-radius: 16px;
  background: #fffdf6;
  color: var(--ink);
  outline: none;
}

.nickname-input:focus {
  border-color: #ffc93d;
}

.loader-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.banana-spinner {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: #fff2a4;
  font-size: 42px;
  animation: spinBanana 0.95s linear infinite;
}

.loader-card strong {
  font-size: 22px;
}

.loader-card span {
  color: var(--muted);
  font-size: 13px;
}

@keyframes spinBanana {
  from { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.06); }
  to { transform: rotate(360deg) scale(1); }
}

@media (max-width: 480px) {
  .phone-frame {
    width: 100vw;
  }
}
