:root {
  --felt: #0d5b3d;
  --felt-dark: #073a28;
  --felt-light: #16724f;
  --gold: #e0b55a;
  --cream: #fff7e6;
  --ink: #17231f;
  --muted: #c7d8cf;
  --danger: #f06449;
  --success: #5fd38d;
  --panel: rgba(5, 27, 20, 0.72);
  --line: rgba(255, 255, 255, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--cream);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.09), transparent 24rem),
    linear-gradient(135deg, var(--felt-light), var(--felt-dark));
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
}

.screen {
  min-height: 100vh;
  padding: 18px;
}

@media (display-mode: standalone) {
  .screen {
    min-height: 100dvh;
  }
}

.auth-screen {
  display: grid;
  place-items: center;
}

.auth-shell {
  width: min(100%, 420px);
}

.brand {
  margin-bottom: 26px;
  text-align: center;
}

.brand-mark {
  display: inline-grid;
  width: 62px;
  height: 62px;
  margin-bottom: 14px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(2, 18, 12, 0.48);
  color: var(--gold);
  font-size: 22px;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(34px, 10vw, 54px);
  letter-spacing: 0;
}

h2 {
  margin-bottom: 8px;
  font-size: 26px;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 16px;
}

.subtle {
  color: var(--muted);
  line-height: 1.45;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(18px);
}

.auth-panel {
  padding: 18px;
}

.tabs,
.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}

.tab,
.segment {
  min-height: 42px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.tab.active,
.segment.active {
  background: var(--cream);
  color: var(--ink);
}

.segment.locked {
  opacity: 0.5;
}

.field {
  display: grid;
  gap: 7px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  min-height: 46px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--cream);
  padding: 0 12px;
  outline: none;
}

option {
  color: var(--ink);
}

.money-field {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
}

.inline-money-field {
  grid-template-columns: auto minmax(92px, 132px);
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.inline-money-field > span {
  color: var(--muted);
}

.money-field span {
  padding-left: 12px;
  color: var(--gold);
  font-weight: 900;
}

.money-field input {
  border: 0;
  background: transparent;
}

.primary,
.secondary,
.danger-button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 0 14px;
  font-weight: 800;
}

.primary {
  width: 100%;
  margin-top: 16px;
  background: var(--gold);
  color: #1e1608;
}

.full-button {
  width: 100%;
  margin-top: 10px;
}

.secondary {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.1);
  color: var(--cream);
}

.danger-button {
  border: 1px solid rgba(240, 100, 73, 0.5);
  background: rgba(240, 100, 73, 0.14);
  color: #ffd7cf;
}

.message {
  min-height: 22px;
  margin: 12px 0 0;
  color: #ffd2c8;
  font-size: 14px;
}

.password-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
}

.password-wrap input {
  border: 0;
  background: transparent;
}

.reveal-password {
  min-width: 58px;
  border-left: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
  color: var(--cream);
  font-size: 12px;
  font-weight: 900;
}

.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

.auth-links button {
  background: transparent;
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
}

.password-rules {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 10px;
}

.password-rules span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  padding: 6px 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.app-screen {
  max-width: 720px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 6px 0 18px;
}

.tiny-logo {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(2, 18, 12, 0.55);
  color: var(--gold);
  font-weight: 900;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-menu,
.help-menu {
  position: relative;
}

.account-menu summary,
.help-menu summary {
  display: inline-flex;
  width: 44px;
  height: 42px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  padding: 0;
  color: var(--cream);
  cursor: pointer;
  list-style: none;
}

.help-menu summary {
  flex-direction: row;
  border-radius: 50%;
  color: var(--gold);
  font-size: 19px;
  font-weight: 900;
}

.account-menu summary span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--cream);
}

.account-menu summary::-webkit-details-marker,
.help-menu summary::-webkit-details-marker {
  display: none;
}

.account-menu-panel,
.help-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  width: min(280px, 78vw);
  gap: 8px;
  padding: 12px;
  z-index: 5;
}

.help-menu-panel {
  width: min(320px, 84vw);
}

.help-menu-panel h3 {
  margin-bottom: 4px;
}

.help-menu-panel p {
  margin: 4px 0;
  line-height: 1.45;
}

.support-box {
  display: grid;
  gap: 3px;
  margin-top: 6px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.support-box strong {
  color: var(--cream);
}

.support-box a {
  color: var(--gold);
  font-weight: 900;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.account-menu-panel span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.access-status {
  display: block;
  border: 1px solid rgba(224, 181, 90, 0.36);
  border-radius: 999px;
  background: rgba(224, 181, 90, 0.12);
  padding: 7px 10px;
  color: var(--gold);
  font-size: 12px;
}

.account-menu-panel .secondary,
.account-menu-panel .primary,
.account-menu-panel .danger-button {
  width: 100%;
}

.menu-toggle {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  padding: 0 10px;
  color: var(--cream);
  font-size: 13px;
  font-weight: 800;
}

.menu-toggle input {
  min-height: auto;
  width: auto;
}

.settings-grid {
  display: grid;
  gap: 12px;
}

.setting-panel {
  padding: 16px;
}

.disabled-panel {
  opacity: 0.52;
}

.base-bet-inline {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.base-bet-inline strong {
  display: block;
}

.compact-money-field {
  flex: 0 0 128px;
  min-height: 48px;
  margin: 0;
  padding: 0 12px;
}

.compact-money-field input {
  min-height: 44px;
  text-align: left;
}

.practice-types {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.length-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wide-segment {
  grid-column: 1 / -1;
}

.reset-stats-button {
  width: 100%;
  margin: -4px 0 14px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.toggle-row:last-child {
  border-bottom: 0;
}

.rule-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.rule-list span {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  padding: 0 11px;
  color: var(--cream);
  font-size: 13px;
  font-weight: 800;
}

.switch {
  position: relative;
  width: 54px;
  height: 30px;
  flex: 0 0 auto;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.slider::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--cream);
  content: "";
  transition: 0.18s ease;
}

.switch input:checked + .slider {
  background: var(--gold);
}

.switch input:checked + .slider::after {
  transform: translateX(24px);
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0;
}

.stat {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}

.stat strong {
  display: block;
  font-size: 22px;
}

.stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.today-strip {
  margin-top: 8px;
}

.today-strip .stat {
  background: rgba(255, 255, 255, 0.08);
}

.today-heading {
  margin: 2px 0 -4px;
  color: var(--muted);
}

.access-banner {
  display: grid;
  gap: 12px;
  margin: 12px 0 16px;
  border: 1px solid rgba(224, 181, 90, 0.34);
  border-radius: 8px;
  background: rgba(224, 181, 90, 0.11);
  padding: 12px;
}

.access-banner.full-access {
  border-color: rgba(95, 211, 141, 0.34);
  background: rgba(95, 211, 141, 0.11);
}

.access-banner strong {
  display: block;
  color: var(--gold);
}

.access-banner.full-access strong {
  color: var(--success);
}

.access-banner p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.beta-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.beta-form input {
  min-height: 40px;
  text-transform: uppercase;
}

.beta-form button {
  min-height: 40px;
  padding: 0 14px;
}

.table {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  padding: 14px;
}

.table::before {
  position: absolute;
  inset: 14px;
  border: 2px solid rgba(224, 181, 90, 0.52);
  border-radius: 50%;
  content: "";
  opacity: 0.5;
  transform: scaleX(1.2) translateY(18px);
}

.table > * {
  position: relative;
  z-index: 1;
}

.practice-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mini-stats {
  display: flex;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.session-progress {
  height: 6px;
  max-width: 460px;
  margin: 12px auto 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
}

.session-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), #ffe3a0);
  transition: width 0.22s ease;
}

.felt-area {
  display: grid;
  gap: 30px;
  padding: 22px 0;
}

.table:not(.answered) .hand-zone {
  animation: deal-zone 0.38s ease both;
}

.table:not(.answered) .hand-zone:nth-child(2) {
  animation-delay: 0.06s;
}

.table.answered .felt-area {
  gap: 12px;
  padding: 10px 0;
}

.hand-zone {
  text-align: center;
}

.label {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cards {
  display: flex;
  min-height: 126px;
  align-items: center;
  justify-content: center;
}

.table.answered .cards {
  min-height: 76px;
}

.dealer-cards .card + .card {
  margin-left: -34px;
  --deal-resting-transform: translateY(-16px);
  transform: var(--deal-resting-transform);
}

.table.answered .dealer-cards .card + .card {
  margin-left: -22px;
  --deal-resting-transform: translateY(-9px);
  transform: var(--deal-resting-transform);
}

.player-cards .card + .card {
  margin-left: -20px;
  --deal-resting-transform: translateY(10px);
  transform: var(--deal-resting-transform);
}

.table.answered .player-cards .card + .card {
  margin-left: -14px;
  --deal-resting-transform: translateY(6px);
  transform: var(--deal-resting-transform);
}

.card {
  display: grid;
  width: 82px;
  height: 116px;
  grid-template-rows: auto 1fr auto;
  border-radius: 8px;
  background: #fffdf8;
  color: #151515;
  padding: 8px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32);
  font-weight: 900;
  --deal-resting-transform: translateY(0);
  transform-origin: center bottom;
  transform: var(--deal-resting-transform);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    opacity 0.18s ease;
}

.table:not(.answered) .card {
  animation: deal-card 0.76s cubic-bezier(0.2, 0.82, 0.2, 1) both;
}

.table:not(.answered) .player-cards .card:nth-child(2),
.table:not(.answered) .dealer-cards .card:nth-child(2) {
  animation-delay: 0.12s;
}

.table.answered .card {
  width: 54px;
  height: 76px;
  border-radius: 6px;
  padding: 5px;
}

.table.answered .card.back {
  border-width: 4px;
}

.card.red {
  color: #c32336;
}

.card.back {
  border: 6px solid #fffdf8;
  background:
    repeating-linear-gradient(45deg, #842333 0 8px, #5e1724 8px 16px);
}

.card-rank {
  align-self: start;
  justify-self: start;
  font-size: 19px;
}

.card-suit {
  align-self: center;
  justify-self: center;
  font-size: 34px;
}

.table.answered .card-rank {
  font-size: 13px;
}

.table.answered .card-suit {
  font-size: 22px;
}

.card-rank.bottom {
  align-self: end;
  justify-self: end;
  transform: rotate(180deg);
}

.total-pill {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  padding: 0 12px;
  color: var(--cream);
  font-weight: 800;
}

.actions {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: min(100%, 460px);
  margin: 0 auto;
  padding: 10px 0 calc(8px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(5, 38, 27, 0.92) 22%);
}

.table.answered .actions {
  margin: 0 auto;
  padding: 8px 14px calc(8px + env(safe-area-inset-bottom));
  background: rgba(5, 38, 27, 0.96);
}

.action-button {
  min-height: 58px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 247, 230, 0.96);
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
  transition:
    transform 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease,
    opacity 0.16s ease;
}

.action-button:active {
  transform: translateY(1px) scale(0.99);
}

.action-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.next-button {
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
}

.table.answered .action-button {
  min-height: 52px;
}

.feedback {
  max-width: 640px;
  margin: 2px 0 8px;
  padding: 12px;
  animation: result-in 0.24s ease both;
}

.table.answered .feedback {
  margin-right: auto;
  margin-left: auto;
}

.feedback.correct {
  border-color: rgba(95, 211, 141, 0.6);
  background:
    linear-gradient(90deg, rgba(95, 211, 141, 0.16), transparent 52%),
    var(--panel);
}

.feedback.incorrect {
  border-color: rgba(240, 100, 73, 0.6);
  background: rgba(240, 100, 73, 0.32);
}

.feedback-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 18px;
  font-weight: 900;
}

.feedback-title::before {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  color: #062719;
  font-size: 14px;
  line-height: 1;
  content: "";
}

.feedback.correct .feedback-title::before {
  background: var(--success);
  content: "";
}

.feedback.incorrect .feedback-title::before {
  background: #ffb2a4;
  color: #401209;
  content: "!";
}

.table.dealing .felt-area,
.table.dealing .feedback {
  opacity: 0.46;
  transform: translateY(3px) scale(0.99);
}

.table.dealing .feedback,
.table.dealing .card {
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
}

@keyframes result-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes deal-zone {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes deal-card {
  from {
    opacity: 0;
    transform: var(--deal-resting-transform) translate(170px, -190px) rotate(8deg) scale(0.9);
  }
  72% {
    opacity: 1;
    transform: var(--deal-resting-transform) translate(-4px, 3px) rotate(-0.6deg) scale(1.01);
  }
  to {
    opacity: 1;
    transform: var(--deal-resting-transform);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

.table.answered .feedback-title {
  font-size: 16px;
}

@media (max-width: 520px) {
  .table {
    padding-top: calc(34px + env(safe-area-inset-top));
  }

  .table.answered {
    padding: calc(34px + env(safe-area-inset-top)) 14px 0;
  }

  .table.answered .practice-header {
    align-items: flex-start;
  }

  .table.answered .secondary {
    min-height: 40px;
    padding: 0 12px;
  }

  .table.answered .mini-stats {
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    font-size: 12px;
  }

  .table.answered .felt-area {
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 8px;
    padding: 10px 0;
  }

  .table.answered .label {
    margin-bottom: 5px;
    font-size: 10px;
  }

  .table.answered .cards {
    min-height: 84px;
  }

  .table.answered .card {
    width: 58px;
    height: 82px;
    padding: 5px;
  }

  .table.answered .card-rank {
    font-size: 13px;
  }

  .table.answered .card-suit {
    font-size: 22px;
  }

  .table.answered .total-pill {
    min-height: 28px;
    padding: 0 9px;
    font-size: 13px;
  }

  .table.answered .feedback {
    padding: 10px;
    font-size: 14px;
  }

  .table.answered .feedback p {
    margin-bottom: 8px;
    line-height: 1.3;
  }

  .table.answered .ev-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-top: 8px;
  }

  .table.answered .ev-item {
    padding: 7px;
  }

  .table.answered .ev-money {
    font-size: 14px;
  }

  .table.answered .ev-units {
    font-size: 11px;
  }

  .table.answered .actions {
    width: auto;
    margin: 0 -14px;
  }
}

.feedback.correct .feedback-title {
  color: var(--success);
}

.feedback.incorrect .feedback-title {
  color: #ffb2a4;
}

.ev-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  max-width: 460px;
  margin: 10px auto 0;
}

.ev-item {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px;
  background: rgba(0, 0, 0, 0.18);
}

.ev-item.best {
  border-color: rgba(224, 181, 90, 0.9);
  background: rgba(224, 181, 90, 0.18);
  box-shadow: inset 0 0 0 1px rgba(224, 181, 90, 0.24);
}

.ev-item.best strong {
  color: var(--gold);
}

.ev-item.chosen-wrong {
  border-color: rgba(240, 100, 73, 0.95);
  background: rgba(240, 100, 73, 0.95);
  color: #fff7f4;
}

.ev-item.chosen-wrong strong,
.ev-item.chosen-wrong .ev-money,
.ev-item.chosen-wrong .ev-units {
  color: #fff7f4;
}

.ev-item strong {
  display: block;
}

.ev-cue {
  display: block;
  margin: 4px 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.chart-ev-value {
  display: grid;
  gap: 2px;
  margin-top: 6px;
  color: var(--cream);
  font-size: 13px;
  font-weight: 900;
}

.chart-ev-value span:last-child {
  color: var(--muted);
  font-size: 12px;
}

.ev-money {
  display: block;
  color: var(--cream);
  font-size: 16px;
  font-weight: 900;
}

.ev-units {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.58);
  padding: 18px;
}

.ev-dialog {
  width: min(480px, 100%);
  max-height: min(680px, 92vh);
  overflow: auto;
  padding: 16px;
}

.dialog-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.dialog-head h3 {
  margin: 2px 0 0;
}

.chart-ev-grid {
  max-width: none;
}

.ev-loss {
  color: #ffd7cf;
}

.summary-screen {
  padding-bottom: 28px;
}

.summary-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.summary-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  padding: 11px;
}

.summary-row strong,
.summary-row span {
  display: block;
}

.summary-row div span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.summary-row > span {
  color: var(--gold);
  font-weight: 900;
  text-align: right;
}

.summary-actions {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.summary-actions .secondary {
  width: 100%;
}

.reference-screen {
  padding-bottom: 28px;
}

.reference-link {
  width: 100%;
  margin-top: 14px;
}

.chart-tabs {
  margin: 12px 0;
}

.chart-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.chart-tools div {
  display: flex;
  gap: 6px;
}

.chart-scroll-button {
  min-height: 34px;
  padding: 0 12px;
}

.reference-panel h3 {
  margin-bottom: 12px;
}

.chart-scroll {
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-color: var(--gold) rgba(0, 0, 0, 0.18);
}

.strategy-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}

.strategy-table th,
.strategy-table td {
  min-width: 54px;
  border: 1px solid var(--line);
  padding: 9px 8px;
  text-align: center;
  font-weight: 900;
}

.strategy-table thead th:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
}

.strategy-table thead th,
.strategy-table tbody th {
  color: var(--muted);
  background: #073a28;
}

.strategy-table tbody th {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 84px;
  box-shadow: 10px 0 14px rgba(0, 0, 0, 0.16);
}

.strategy-table td {
  padding: 0;
  color: var(--cream);
}

.chart-cell-button,
.chart-cell-static {
  display: inline-flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}

.chart-cell-button {
  cursor: pointer;
}

.chart-cell-static {
  cursor: default;
  opacity: 0.72;
}

.chart-cell-button:hover,
.chart-cell-button:focus-visible {
  outline: 2px solid rgba(255, 244, 222, 0.62);
  outline-offset: -2px;
}

.strategy-table .move-hit {
  background: rgba(255, 255, 255, 0.08);
}

.strategy-table .move-stand {
  background: rgba(95, 211, 141, 0.18);
}

.strategy-table .move-double {
  background: rgba(224, 181, 90, 0.22);
  color: var(--gold);
}

.strategy-table .move-split {
  background: rgba(84, 170, 255, 0.18);
  color: #cfe8ff;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.chart-legend span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
  padding: 7px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.hidden {
  display: none;
}

@media (max-width: 430px) {
  .help-menu-panel {
    right: -52px;
  }

  .base-bet-inline,
  .chart-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .compact-money-field {
    width: 100%;
    flex-basis: auto;
  }

  .chart-tools div {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 620px) {
  .settings-grid {
    grid-template-columns: 1.1fr 0.9fr;
  }

  .setting-panel.wide {
    grid-column: 1 / -1;
  }

  .card {
    width: 96px;
    height: 136px;
  }
}
