:root {
  --bg: #081611;
  --bg-soft: #10231c;
  --panel: rgba(15, 52, 41, 0.82);
  --panel-strong: rgba(23, 71, 57, 0.95);
  --line: rgba(244, 211, 94, 0.16);
  --gold: #f4d35e;
  --gold-soft: #ffd987;
  --ink: #f6f1e7;
  --muted: #bfd4ca;
  --danger: #ff8c69;
  --shadow: 0 20px 48px rgba(0, 0, 0, 0.28);
  --radius: 24px;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, serif;
  --font-body: "Avenir Next", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top, rgba(244, 211, 94, 0.12), transparent 30%),
    linear-gradient(180deg, #10271f 0%, #081611 48%, #06110d 100%);
  color: var(--ink);
  font-family: var(--font-body);
}

body {
  padding: 0 0 calc(24px + env(safe-area-inset-bottom));
}

button,
select,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), #ee964b);
  color: #172118;
  cursor: pointer;
  font-weight: 700;
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow);
}

button:disabled {
  cursor: not-allowed;
}

button.secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  box-shadow: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

button.danger {
  background: rgba(255, 140, 105, 0.18);
  color: #ffd9cf;
  border: 1px solid rgba(255, 140, 105, 0.24);
  box-shadow: none;
}

select,
input,
textarea {
  width: 100%;
  padding: 0.85rem 0.95rem;
  background: rgba(0, 0, 0, 0.2);
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
}

textarea {
  resize: none;
}

button.link-button {
  display: inline;
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--gold-soft);
  box-shadow: none;
  text-decoration: underline;
}

button.mini {
  padding: 0.45rem 0.7rem;
  font-size: 0.8rem;
}

.shell {
  width: min(1120px, calc(100% - 24px));
  max-width: 100%;
  margin: 0 auto;
  padding: 22px 0 32px;
  overflow: hidden;
}

.top-strip {
  display: grid;
  gap: 12px;
  padding: 8px 2px 18px;
}

.eyebrow {
  margin: 0;
  color: var(--gold-soft);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.7rem;
}

h1,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 0.98;
  max-width: 12ch;
}

.panel {
  background: linear-gradient(180deg, rgba(18, 53, 43, 0.94), rgba(9, 32, 25, 0.92));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.panel + .panel,
.hero-stage,
.two-up,
.library-panel,
.action-panel,
.filter-panel,
.create-callout {
  margin-top: 16px;
}

.panel-title-row,
.summary-top,
.seat-head,
.review-top,
.library-card,
.library-actions,
.summary-actions,
.button-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.seat-head > div,
.library-card > div,
.summary-top > div {
  min-width: 0;
}

.summary-actions,
.button-row,
.library-actions {
  flex-wrap: wrap;
}

.summary-actions button,
.button-row button,
.library-actions button {
  min-width: 0;
}

.filters-grid,
.summary-grid,
.action-grid,
.practice-grid,
.two-up,
.form-grid,
.form-stack {
  display: grid;
  gap: 14px;
}

.filters-grid,
.summary-grid,
.form-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin-top: 16px;
}

.two-up > .panel + .panel {
  margin-top: 0;
}

.practice-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: 16px;
}

.practice-card {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}

.practice-card h3 {
  margin-top: 8px;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
}

.practice-status .summary-grid {
  margin-top: 18px;
}

.summary-grid {
  padding-top: 16px;
}

.form-stack {
  margin-top: 16px;
}

.form-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
}

.metric-label,
label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
}

.field-help {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.form-actions button {
  min-width: min(180px, 100%);
}

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

.hero-stage {
  display: grid;
  gap: 16px;
}

.board-row,
.card-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.board-row {
  margin: 16px 0;
}

.card-slot {
  display: inline-flex;
  width: 44px;
  height: 62px;
  border-radius: 14px;
  align-items: center;
  justify-content: center;
  background: #fffaf0;
  color: #202018;
  font-weight: 800;
  border: 2px solid rgba(0, 0, 0, 0.08);
}

.card-image {
  display: block;
  width: 44px;
  height: 62px;
  border-radius: 8px;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.18));
}

.card-slot.red {
  color: #be3a48;
}

.card-slot.hidden,
.card-slot.empty {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.25);
  border: 1px dashed rgba(255, 255, 255, 0.14);
}

.seat-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.84rem;
}

.table-layout {
  position: relative;
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.felt {
  position: relative;
  z-index: 0;
  min-height: 228px;
  padding: 22px 14px;
  border-radius: 48% / 36%;
  background:
    radial-gradient(circle at center, rgba(38, 110, 84, 0.95) 0%, rgba(19, 77, 59, 0.96) 48%, rgba(10, 40, 31, 0.98) 100%);
  border: 2px solid rgba(244, 211, 94, 0.18);
  box-shadow:
    inset 0 0 0 16px rgba(7, 26, 20, 0.42),
    inset 0 0 64px rgba(4, 14, 11, 0.58),
    0 24px 56px rgba(0, 0, 0, 0.34);
}

.felt::before {
  content: "";
  position: absolute;
  inset: 22px;
  border-radius: 44% / 34%;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

.felt-center {
  min-height: 100%;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  width: 100%;
}

.pot-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  background: rgba(7, 18, 14, 0.5);
  border: 1px solid rgba(244, 211, 94, 0.22);
  color: var(--gold-soft);
  font-weight: 700;
}

.hero-pocket {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 20px;
  background: rgba(5, 21, 16, 0.36);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.seat-row {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.seat-pod {
  position: relative;
  z-index: 3;
  min-height: 120px;
  padding: 42px 12px 12px;
  border-radius: 22px;
  background: rgba(9, 25, 20, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.22);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  min-width: 0;
}

.seat-pod strong,
.seat-pod span,
.library-card strong,
.library-card p {
  overflow-wrap: anywhere;
}

.seat-playline {
  display: none;
}

.seat-tableline,
.seat-card-backs {
  display: none;
}

.seat-pod.hero {
  border-color: rgba(244, 211, 94, 0.36);
  background: rgba(55, 47, 13, 0.3);
}

.seat-pod.acting {
  border-color: rgba(244, 211, 94, 0.74);
  box-shadow:
    0 0 0 1px rgba(244, 211, 94, 0.34),
    0 22px 42px rgba(0, 0, 0, 0.28),
    0 0 32px rgba(244, 211, 94, 0.2);
  transform: translateY(-4px);
}

.seat-pod.folded {
  opacity: 0.58;
}

.seat-pod.allin {
  border-color: rgba(255, 140, 105, 0.3);
}

.seat-pod.winner {
  border-color: rgba(244, 211, 94, 0.82);
  box-shadow:
    0 0 0 1px rgba(244, 211, 94, 0.32),
    0 18px 36px rgba(0, 0, 0, 0.22),
    0 0 30px rgba(244, 211, 94, 0.18);
}

.seat-action-badge {
  position: absolute;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(5, 14, 11, 0.9);
  color: var(--gold-soft);
  border: 1px solid rgba(244, 211, 94, 0.22);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  backdrop-filter: blur(8px);
  top: 10px;
  left: 10px;
  right: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seat-winner-badge {
  position: absolute;
  z-index: 5;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--ps-gold), #f4a146);
  color: #071f18;
  border: 1px solid rgba(255, 245, 198, 0.45);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 10px 22px rgba(244, 161, 70, 0.18);
}

.dealer-button {
  position: absolute;
  z-index: 6;
  right: 12px;
  bottom: 12px;
  width: 38px;
  height: 38px;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.28));
  pointer-events: none;
}

.table-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.86rem;
}

.action-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin-top: 14px;
}

.pill,
.result,
.verdict {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  font-size: 0.84rem;
}

.pill {
  background: rgba(255, 255, 255, 0.08);
  color: var(--gold-soft);
}

.pill.locked {
  color: #d1bca0;
}

.completion-summary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  color: var(--ps-muted);
  font-weight: 800;
}

.result.win,
.verdict {
  background: rgba(54, 177, 118, 0.18);
  color: #bbf7d0;
}

.result.loss,
.tone-bad .verdict {
  background: rgba(255, 140, 105, 0.18);
  color: #ffd9cf;
}

.tone-warn .verdict,
.tone-okay .verdict {
  background: rgba(244, 211, 94, 0.16);
  color: var(--gold-soft);
}

.review-list,
.library-list,
.log-list,
.comment-list {
  display: grid;
  gap: 12px;
}

.community-results {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.community-results h4 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
}

.result-breakdown {
  display: grid;
  gap: 10px;
}

.street-results {
  display: grid;
  gap: 14px;
}

.street-result-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
}

.street-result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.street-result-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

.result-bar-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.9fr) minmax(120px, 1.7fr) auto;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}

.result-bar-row strong {
  color: var(--ink);
}

.result-bar {
  appearance: none;
  width: 100%;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  border: 0;
  background: transparent;
}

.result-bar::-webkit-progress-bar {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.result-bar::-webkit-progress-value {
  border-radius: inherit;
  background: linear-gradient(135deg, var(--gold), #ee964b);
}

.result-bar::-moz-progress-bar {
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), #ee964b);
}

.leak-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.leak-strip .chip {
  background: rgba(244, 211, 94, 0.12);
  border-color: rgba(244, 211, 94, 0.24);
  color: var(--gold-soft);
}

.review-card,
.library-card,
.log-row,
.comment-card {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.log-row {
  display: grid;
  grid-template-columns: minmax(86px, 0.28fr) minmax(0, 1fr);
  align-items: start;
  column-gap: 18px;
  color: var(--muted);
  font-size: 0.84rem;
}

.log-row span {
  white-space: nowrap;
}

.log-row p {
  overflow-wrap: anywhere;
  text-align: left;
}

.review-card p,
.library-card p,
.log-row p,
.comment-card p {
  margin: 0;
}

.comment-card {
  display: grid;
  gap: 8px;
}

.comment-card > div,
.app-nav,
.profile-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.comment-card > div {
  justify-content: space-between;
  color: var(--muted);
}

.app-chrome {
  position: sticky;
  top: 12px;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 10px;
  border: 1px solid rgba(244, 211, 94, 0.16);
  border-radius: 999px;
  background: rgba(7, 24, 18, 0.86);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(16px);
}

.brand-mark {
  display: grid;
  gap: 2px;
  min-height: 54px;
  padding: 0.55rem 1rem;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--ps-cream);
  text-align: left;
}

.brand-mark span {
  color: var(--ps-gold);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.brand-mark strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1;
}

.app-nav {
  flex-wrap: nowrap;
  justify-content: flex-end;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

.app-nav button {
  min-height: 46px;
  padding: 0.65rem 1rem;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--ps-muted);
}

.app-nav button.active {
  background: linear-gradient(135deg, var(--gold), #ee964b);
  color: #172118;
}

.share-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.auth-heading {
  display: grid;
  gap: 14px;
}

.auth-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-toggle button {
  box-shadow: none;
  background: transparent;
  color: var(--muted);
  border: 0;
}

.auth-toggle button.active {
  background: linear-gradient(135deg, var(--gold), #ee964b);
  color: #172118;
}

.auth-form {
  max-width: 460px;
}

.profile-head {
  align-items: flex-start;
}

.create-callout {
  display: grid;
  gap: 16px;
  background:
    radial-gradient(circle at right, rgba(244, 211, 94, 0.18), transparent 34%),
    linear-gradient(135deg, rgba(43, 81, 65, 0.96), rgba(9, 32, 25, 0.94));
}

.create-callout h3 {
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.create-callout p {
  margin-bottom: 0;
}

.avatar {
  width: 72px;
  height: 72px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(244, 211, 94, 0.24), rgba(238, 150, 75, 0.18));
  border: 1px solid rgba(244, 211, 94, 0.2);
  color: var(--gold-soft);
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.library-actions {
  flex-wrap: wrap;
}

.toast {
  position: sticky;
  top: calc(10px + env(safe-area-inset-top));
  z-index: 20;
  width: min(720px, calc(100% - 18px));
  margin: 0 auto 14px;
  padding: 0.8rem 1rem;
  border-radius: 18px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(14px);
  font-weight: 800;
}

.toast.info {
  background: rgba(255, 255, 255, 0.1);
  color: var(--gold-soft);
  border: 1px solid rgba(244, 211, 94, 0.22);
}

.toast.error {
  background: rgba(89, 20, 20, 0.94);
  color: #ffe1d8;
  border: 1px solid rgba(255, 140, 105, 0.55);
}

@keyframes float-in {
  from {
    transform: translateY(14px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (min-width: 880px) {
  .create-callout {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .hero-stage {
    grid-template-columns: 1.1fr 0.9fr;
  }

  .two-up {
    grid-template-columns: 1.05fr 0.95fr;
  }

  .table-layout {
    gap: 18px;
  }

  .seat-row {
    gap: 14px;
  }

  .seat-pod {
    min-height: 132px;
    padding: 44px 14px 14px;
  }

  .felt {
    min-height: 300px;
    padding: 28px 24px;
  }
}

@media (max-width: 700px) {
  .street-result-head {
    display: grid;
  }

  .result-bar-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 879px) {
  .seat-row {
    gap: 8px;
  }

  .seat-pod {
    min-height: 110px;
    padding: 40px 10px 10px;
    border-radius: 18px;
  }

  .seat-head strong,
  .seat-stack strong {
    font-size: 0.95rem;
  }

  .seat-head span,
  .seat-meta,
  .seat-stack span {
    font-size: 0.74rem;
  }

  .seat-action-badge {
    min-height: 26px;
    padding: 0.25rem 0.5rem;
    font-size: 0.68rem;
  }

  .felt {
    min-height: 196px;
    border-radius: 42% / 30%;
  }

  .felt-center {
    gap: 10px;
  }

  .board-row {
    justify-content: center;
  }

  .card-slot {
    width: 38px;
    height: 54px;
  }

  .card-image {
    width: 38px;
    height: 54px;
  }
}

@media (max-width: 700px) {
  body {
    padding-bottom: calc(92px + env(safe-area-inset-bottom));
  }

  .shell {
    width: min(1120px, calc(100% - 16px));
    padding-top: 14px;
  }

  .app-chrome {
    position: fixed;
    top: auto;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: 10px;
    z-index: 100;
    display: block;
    margin: 0;
    padding: 6px;
    border-radius: 28px;
  }

  .brand-mark {
    display: none;
  }

  .app-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    width: 100%;
    padding: 0;
    background: transparent;
  }

  .app-nav button {
    min-height: 58px;
    padding: 0.45rem 0.3rem;
    border-radius: 22px;
    font-size: 0.88rem;
  }

  .panel {
    padding: 14px;
    border-radius: 18px;
  }

  .summary-top,
  .panel-title-row,
  .library-card {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .panel-title-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .summary-actions,
  .button-row,
  .library-actions {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .summary-actions button,
  .button-row button,
  .library-actions button {
    width: 100%;
    min-width: 0;
    padding-inline: 0.65rem;
  }

  .summary-actions .result,
  .panel-title-row .pill {
    justify-self: start;
  }

  .filters-grid,
  .summary-grid,
  .action-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .seat-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .seat-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .seat-stack {
    text-align: left;
  }
}

@media (max-width: 420px) {

  .seat-row {
    gap: 6px;
  }

  .seat-pod {
    min-height: 104px;
    padding: 36px 8px 8px;
  }

  .seat-pod .card-row {
    gap: 4px;
  }

  .seat-pod .card-slot {
    width: 30px;
    height: 42px;
    border-radius: 10px;
    font-size: 0.78rem;
  }

  .seat-pod .card-image {
    width: 30px;
    height: 42px;
    border-radius: 6px;
  }

  .seat-action-badge {
    left: 6px;
    right: 6px;
    top: 7px;
  }
}

/* Design refresh from supplied mobile comps */
:root {
  --ps-bg: #071e17;
  --ps-panel: #0f372a;
  --ps-panel-2: #103d2f;
  --ps-line: #225845;
  --ps-line-strong: #3d8069;
  --ps-cream: #f3eee3;
  --ps-muted: #9bb4aa;
  --ps-gold: #ffd05a;
  --ps-orange: #f6a04a;
  --ps-danger: #4a3c31;
}

html,
body {
  background: var(--ps-bg);
  color: var(--ps-cream);
}

button {
  min-height: 56px;
  box-shadow: none;
  font-size: 1rem;
}

.shell {
  width: min(780px, 100%);
  padding: 56px 24px calc(32px + env(safe-area-inset-bottom));
  overflow: visible;
}

.route-random,
.route-create,
.is-playing {
  min-height: 100vh;
}

.eyebrow,
.design-label {
  color: var(--ps-gold);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  max-width: none;
  color: var(--ps-cream);
  font-size: clamp(4.6rem, 12vw, 6rem);
  line-height: 0.82;
  letter-spacing: -0.06em;
}

h3 {
  color: var(--ps-cream);
}

.panel {
  background: var(--ps-panel);
  border: 2px solid var(--ps-line);
  border-radius: 28px;
  box-shadow: none;
  backdrop-filter: none;
}

.home-hero {
  min-height: calc(100vh - 112px);
  display: flex;
  flex-direction: column;
}

.home-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 72px;
}

.profile-pill {
  min-height: 78px;
  padding: 0 32px;
  background: #11372b;
  color: var(--ps-cream);
  border: 2px solid var(--ps-line);
}

.home-subtitle {
  max-width: 10em;
  margin: 38px 0 64px;
  color: var(--ps-muted);
  font-size: clamp(1.85rem, 5vw, 2.25rem);
  line-height: 1.18;
}

.design-filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.design-select-card {
  position: relative;
  min-height: 146px;
  padding: 30px 32px;
  border-radius: 30px;
  background: #10372a;
  border: 2px solid var(--ps-line);
}

.design-select-card span {
  margin: 0 0 14px;
  color: var(--ps-muted);
  font-size: 1.55rem;
}

.design-select-card strong {
  display: block;
  color: var(--ps-cream);
  font-size: 2rem;
}

.design-select-card select {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.home-action-stack {
  display: grid;
  gap: 14px;
  margin-top: 40px;
}

.primary-cta {
  width: 100%;
  min-height: 120px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--ps-gold), var(--ps-orange));
  color: #06140f;
  font-size: 2rem;
  font-weight: 900;
}

.build-hand-cta {
  width: 100%;
  min-height: 84px;
  border-radius: 28px;
  background: #123f31;
  border: 2px solid var(--ps-line-strong);
  color: var(--ps-cream);
  font-size: 1.45rem;
  font-weight: 900;
}

.create-callout {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  gap: 18px;
  margin-top: 36vh;
  padding: 36px;
  border-radius: 32px;
  background: #123f31;
  border: 2px solid var(--ps-line-strong);
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.create-callout h3 {
  font-size: 2.3rem;
  letter-spacing: -0.04em;
}

.create-callout p {
  margin: 10px 0 0;
  color: var(--ps-muted);
  font-size: 1.6rem;
}

.arrow-button {
  display: inline-grid;
  place-items: center;
  min-width: 58px;
  background: transparent;
  color: var(--ps-gold);
  font-size: 3rem;
  padding: 0;
}

.auth-panel,
.library-panel {
  margin-top: 28px;
}

.create-screen {
  min-height: calc(100vh - 88px);
}

.create-screen .eyebrow {
  margin-bottom: 24px;
}

.title-field span,
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.title-field textarea {
  display: block;
  width: 100%;
  min-height: 1.9em;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--ps-cream);
  font-family: var(--font-display);
  font-size: clamp(2.7rem, 7vw, 4rem);
  font-weight: 900;
  line-height: 0.95;
  overflow: visible;
  resize: vertical;
}

.section-rule {
  height: 2px;
  margin: 24px 0 44px;
  background: var(--ps-line);
}

.create-section {
  margin-top: 42px;
}

.design-label {
  margin: 0 0 22px;
  color: var(--ps-muted);
}

.hero-card-editor,
.board-editor {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.hero-card-editor > span {
  color: var(--ps-muted);
  font-size: 1.7rem;
}

.card-input {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: stretch;
  width: 128px;
  height: 180px;
  border-radius: 18px;
  background: var(--ps-cream);
  border: 2px solid rgba(255, 245, 225, 0.5);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.card-input > span:first-child {
  display: none;
}

.card-preview {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 8px 8px 2px;
}

.card-preview .card-image {
  width: 100%;
  height: 100%;
  max-height: 126px;
  object-fit: contain;
  border-radius: 10px;
}

.card-input input {
  width: 100%;
  min-height: 42px;
  padding: 0 10px 8px;
  border: 0;
  background: transparent;
  color: rgba(23, 24, 20, 0.88);
  text-align: center;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 900;
  text-transform: uppercase;
}

.auto-card-field {
  background: transparent;
  border: 3px dashed var(--ps-line-strong);
}

.auto-card-preview {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 92px;
  color: var(--ps-muted);
  font-size: 1.15rem;
  font-weight: 900;
  text-transform: uppercase;
}

.auto-card-field input,
.card-input.is-auto input {
  color: var(--ps-muted);
}

.segmented-control {
  position: relative;
  padding: 0;
  border: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

.position-option {
  display: grid;
  place-items: center;
  min-height: 88px;
  margin: 0;
  border-radius: 22px;
  background: #10372a;
  border: 2px solid var(--ps-line);
  color: var(--ps-cream);
  font-size: 1.5rem;
  font-weight: 900;
  cursor: pointer;
}

.position-option.active {
  background: linear-gradient(135deg, var(--ps-gold), var(--ps-orange));
  color: #07130f;
  border-color: transparent;
}

.position-option:focus-visible {
  outline: 3px solid rgba(244, 211, 94, 0.42);
  outline-offset: 3px;
}

.selected-position {
  font-size: 1.1rem;
}

.create-help {
  margin: 18px 0 0;
  color: var(--ps-muted);
  font-size: 1.6rem;
}

.options-card {
  margin-top: 48px;
  padding: 0;
}

.options-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 112px;
  padding: 0 36px;
  border-radius: 28px;
  background: #123b2e;
  border: 2px solid var(--ps-line);
}

.options-heading h3,
.options-heading span {
  font-family: var(--font-body);
  color: var(--ps-cream);
  font-size: 1.55rem;
  font-weight: 900;
}

.stack-stepper {
  display: grid;
  grid-template-columns: 104px 1fr 104px;
  align-items: center;
  gap: 28px;
  margin: 42px 0 22px;
}

.round-control {
  width: 104px;
  height: 104px;
  min-height: 104px;
  border-radius: 50%;
  background: #10372a;
  border: 2px solid var(--ps-line);
  color: var(--ps-cream);
  font-size: 2.2rem;
}

.stack-stepper label span {
  color: var(--ps-muted);
  text-align: center;
}

.stack-stepper input {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ps-cream);
  text-align: center;
  font-family: var(--font-display);
  font-size: 4.6rem;
  font-weight: 900;
}

.options-link {
  display: inline-block;
  margin: 0 0 42px;
  color: var(--ps-gold);
  font-size: 1.55rem;
  font-weight: 900;
}

.blind-grid,
.seat-stack-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.blind-grid label span,
.seat-stack-grid label span,
.pill-select > span,
.note-field > span {
  color: var(--ps-muted);
  font-size: 1.25rem;
}

.blind-grid input,
.seat-stack-grid input {
  min-height: 104px;
  margin-top: 12px;
  padding: 0 32px;
  border-radius: 26px;
  border: 2px solid var(--ps-line);
  background: transparent;
  color: var(--ps-cream);
  font-size: 2rem;
  font-weight: 900;
}

.pill-select {
  position: relative;
  display: grid;
  gap: 14px;
  margin-top: 40px;
}

.pill-select select {
  width: 100%;
  min-height: 88px;
  padding: 0 56px 0 28px;
  border-radius: 28px;
  border: 2px solid var(--ps-line);
  background:
    linear-gradient(135deg, rgba(244, 211, 94, 0.14), transparent 42%),
    #123b2e;
  color: var(--ps-cream);
  font-size: 1.45rem;
  font-weight: 900;
  cursor: pointer;
  appearance: auto;
}

.visibility-select {
  margin-top: 28px;
}

.advanced-actions {
  margin-top: 40px;
  border-radius: 28px;
  border: 2px solid var(--ps-line);
  background: rgba(18, 59, 46, 0.58);
  overflow: hidden;
}

.advanced-actions summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 28px;
  color: var(--ps-cream);
  cursor: pointer;
  list-style: none;
}

.advanced-actions summary::-webkit-details-marker {
  display: none;
}

.advanced-actions summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(244, 211, 94, 0.14);
  color: var(--ps-gold);
  font-size: 1.7rem;
  font-weight: 900;
}

.advanced-actions[open] summary::after {
  content: "-";
}

.advanced-actions summary span {
  display: block;
  color: var(--ps-cream);
  font-size: 1.45rem;
  font-weight: 900;
}

.advanced-actions summary strong {
  display: block;
  margin-top: 6px;
  color: var(--ps-muted);
  font-size: 1rem;
  font-weight: 700;
}

.scripted-action-grid {
  display: grid;
  grid-template-columns: 1.1fr repeat(4, minmax(120px, 1fr));
  gap: 12px;
  padding: 0 28px 28px;
}

.scripted-action-head {
  color: var(--ps-muted);
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scripted-player {
  display: grid;
  align-content: center;
  min-height: 68px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(5, 24, 18, 0.58);
  border: 1px solid rgba(78, 143, 119, 0.32);
}

.scripted-player strong {
  color: var(--ps-cream);
  font-size: 1.15rem;
}

.scripted-player span {
  margin-top: 3px;
  color: var(--ps-muted);
  font-size: 0.78rem;
}

.scripted-action-cell {
  display: grid;
  gap: 8px;
}

.scripted-select,
.scripted-bet-size,
.scripted-custom-bb {
  display: block;
}

.scripted-select span,
.scripted-bet-size span,
.scripted-custom-bb span {
  display: none;
}

.scripted-action-cell:not(.is-bet) .scripted-bet-size,
.scripted-action-cell:not(.is-custom) .scripted-custom-bb {
  display: none;
}

.scripted-action-cell.is-disabled {
  opacity: 0.38;
}

.scripted-select select,
.scripted-bet-size select,
.scripted-custom-bb input {
  width: 100%;
  min-height: 68px;
  padding: 0 12px;
  border-radius: 18px;
  border: 1px solid rgba(78, 143, 119, 0.48);
  background: #092a20;
  color: var(--ps-cream);
  font-size: 0.95rem;
  font-weight: 800;
}

.scripted-bet-size select,
.scripted-custom-bb input {
  min-height: 52px;
  border-radius: 15px;
  font-size: 0.85rem;
}

.note-field {
  display: block;
  margin-top: 40px;
}

.note-field textarea {
  min-height: 166px;
  border-radius: 26px;
  border: 2px solid var(--ps-line);
  background: transparent;
  font-size: 1.5rem;
}

.seat-stack-grid {
  margin-top: 28px;
}

.sticky-cta {
  margin-top: 76px;
}

.is-playing .shell,
.is-playing {
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
}

.is-playing .hero-stage {
  display: block;
}

.is-playing .hero-summary {
  padding: 0;
  border: 0;
  background: transparent;
}

.is-playing .summary-top {
  align-items: flex-start;
  gap: 18px;
}

.is-playing .summary-top h1 {
  max-width: 12ch;
  font-size: clamp(1.65rem, 5vw, 2.1rem);
  letter-spacing: -0.04em;
  line-height: 1;
}

.is-playing .summary-top p {
  margin: 6px 0 0;
  color: var(--ps-muted);
  font-size: clamp(1rem, 3vw, 1.25rem);
  line-height: 1.25;
}

.is-playing .summary-grid,
.is-playing .table-legend,
.is-playing .table-panel > .panel-title-row {
  display: none;
}

.is-playing .summary-actions {
  display: flex;
  width: auto;
  gap: 12px;
}

.is-playing .summary-actions button {
  width: auto;
  min-height: 56px;
  padding: 0 22px;
  border-radius: 999px;
  background: #10372a;
  border: 2px solid var(--ps-line);
  color: var(--ps-cream);
}

.is-playing .table-panel {
  margin-top: 16px;
  padding: 0;
  border: 0;
  background: transparent;
}

.is-playing .table-layout {
  display: grid;
  gap: 0;
}

.is-playing .seat-row {
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  position: relative;
  z-index: 3;
}

.is-playing .seat-row-top {
  margin-bottom: -36px;
}

.is-playing .seat-row-bottom {
  grid-template-columns: repeat(3, 1fr);
  margin-top: -36px;
}

.is-playing .seat-pod {
  min-height: 112px;
  padding: 22px 20px 16px;
  border-radius: 22px;
  background: #10372a;
  border: 2px solid var(--ps-line);
  overflow: hidden;
}

.is-playing .seat-pod.winner {
  border-color: rgba(244, 211, 94, 0.86);
  box-shadow:
    0 0 0 1px rgba(244, 211, 94, 0.26),
    0 18px 34px rgba(0, 0, 0, 0.24),
    0 0 28px rgba(244, 211, 94, 0.14);
}

.is-playing .seat-pod .seat-action-badge {
  position: static;
  justify-content: flex-start;
  min-height: auto;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ps-gold);
  font-size: 1rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.is-playing .seat-pod .seat-winner-badge {
  position: absolute;
  top: 12px;
  right: 14px;
  min-height: 24px;
  padding: 0.28rem 0.54rem;
  font-size: 0.68rem;
}

.is-playing .seat-pod .dealer-button {
  right: 12px;
  bottom: 10px;
  width: 34px;
  height: 34px;
}

.is-playing .seat-tableline {
  display: grid;
  gap: 5px;
  margin-top: 7px;
  min-width: 0;
}

.is-playing .seat-tableline strong {
  color: var(--ps-cream);
  font-size: 1.25rem;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.is-playing .seat-tableline span {
  color: var(--ps-muted);
  font-size: 0.86rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.is-playing .seat-card-backs {
  display: flex;
  align-items: center;
  margin-top: 12px;
  min-height: 30px;
}

.is-playing .seat-card-backs span {
  width: 31px;
  height: 42px;
  margin-right: -10px;
  border: 2px solid var(--ps-cream);
  border-radius: 6px;
  background:
    repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.2) 0 5px,
      transparent 5px 11px
    ),
    #1d7358;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.16);
}

.is-playing .seat-chip-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  color: var(--ps-gold);
  font-size: 0.94rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.is-playing .chip-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border-radius: 999px;
  background:
    radial-gradient(circle at center, #7f2d28 0 34%, transparent 36%),
    conic-gradient(
      #f7d56b 0 12%,
      #8f332c 12% 25%,
      #f7d56b 25% 38%,
      #8f332c 38% 50%,
      #f7d56b 50% 62%,
      #8f332c 62% 75%,
      #f7d56b 75% 88%,
      #8f332c 88% 100%
    );
  box-shadow:
    0 0 0 2px rgba(255, 241, 184, 0.28),
    0 2px 4px rgba(0, 0, 0, 0.22);
}

.is-playing .seat-chip-badge.scale-2 .chip-icon {
  width: 22px;
  height: 22px;
}

.is-playing .seat-chip-badge.scale-3 .chip-icon {
  width: 26px;
  height: 26px;
}

.is-playing .seat-head,
.is-playing .seat-meta,
.is-playing .seat-playline {
  display: none;
}

.is-playing .seat-stack {
  display: none;
}

.is-playing .seat-pod .card-row {
  display: none;
}

.is-playing.is-complete .seat-pod .card-row,
.is-playing .seat-pod.hero .card-row {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px;
  margin-top: 8px;
  min-height: 30px;
}

.is-playing.is-complete .seat-pod .seat-card-backs {
  display: none;
}

.is-playing.is-complete .seat-pod .card-image {
  width: 31px;
  height: 42px;
  border-radius: 6px;
}

.is-playing .seat-pod.hero .card-image {
  width: 31px;
  height: 42px;
  border-radius: 6px;
}

.is-playing .felt {
  z-index: 1;
  min-height: 260px;
  margin: 0;
  padding-top: 82px;
  border-radius: 42% / 35%;
  background: #17684f;
  border: 3px solid #405f33;
  box-shadow: none;
}

.is-playing .felt::before {
  border-color: transparent;
}

.is-playing .pot-pill {
  background: #06140f;
  border: 0;
  color: var(--ps-gold);
  font-size: 1.55rem;
}

.is-playing .seat-pod.hero .seat-card-backs {
  display: none;
}

.is-playing .seat-pod.hero {
  border-color: var(--ps-gold);
}

.is-playing .action-panel {
  position: sticky;
  bottom: 18px;
  z-index: 12;
  padding: 0;
  border: 0;
  background: transparent;
}

.is-playing .action-panel .panel-title-row {
  display: none;
}

.is-playing .complete-panel {
  display: grid;
  gap: 16px;
}

.is-playing .complete-panel .supporting {
  margin: 0;
  color: var(--ps-muted);
  font-size: 1.1rem;
}

.is-playing .replay-cta {
  width: 100%;
  min-height: 76px;
  border-radius: 999px;
  background: #f6e9cf;
  border: 2px solid #fff7df;
  color: #06140f;
  font-size: 1.35rem;
  font-weight: 900;
}

.is-playing .action-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.is-playing .action-grid button {
  min-height: 112px;
  border-radius: 999px;
  font-size: 1.45rem;
}

.is-playing .action-grid button.secondary {
  background: #1a4939;
  border: 2px solid var(--ps-line-strong);
}

.is-playing .action-grid button.danger {
  background: var(--ps-danger);
  border: 2px solid #855841;
  color: #ffd8d0;
}

.is-playing .two-up {
  grid-template-columns: 1fr 1fr;
}

.is-playing .two-up .panel {
  min-height: 86px;
}

@media (min-width: 701px) {
  .card-slot,
  .card-image {
    width: 58px;
    height: 81px;
    border-radius: 10px;
  }

  .is-playing .felt .card-slot,
  .is-playing .felt .card-image {
    width: 62px;
    height: 87px;
    border-radius: 11px;
  }

  .is-playing .seat-pod.hero .card-image {
    width: 42px;
    height: 59px;
    border-radius: 8px;
  }
}

@media (max-width: 700px) {
  .shell {
    padding-inline: 24px;
  }

  h1 {
    font-size: clamp(4.3rem, 18vw, 5.4rem);
  }

  .design-filter-grid {
    gap: 20px;
  }

  .design-select-card {
    min-height: 146px;
    padding: 30px 32px;
  }

  .card-input {
    width: 128px;
    height: 180px;
  }

  .board-editor {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
  }

  .board-editor .card-input {
    width: 100%;
    height: 156px;
  }

  .board-editor .card-input input {
    font-size: 0.95rem;
  }

  .segmented-control {
    gap: 12px;
  }

  .position-option {
    min-height: 88px;
    font-size: 1.35rem;
  }

  .blind-grid,
  .seat-stack-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .is-playing .shell {
    padding-inline: 20px;
  }

  .is-playing .summary-actions {
    display: flex;
    flex-wrap: nowrap;
  }

  .is-playing .summary-actions button {
    min-height: 64px;
    padding-inline: 20px;
  }
}

@media (max-width: 520px) {
  .shell {
    padding-inline: 20px;
  }

  h1 {
    font-size: 4.1rem;
  }

  .home-subtitle {
    font-size: 1.5rem;
  }

  .design-filter-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .design-select-card {
    min-height: 118px;
    padding: 22px;
  }

  .design-select-card span {
    font-size: 1.05rem;
  }

  .design-select-card strong {
    font-size: 1.45rem;
  }

  .primary-cta {
    min-height: 92px;
    font-size: 1.55rem;
  }

  .build-hand-cta {
    min-height: 68px;
    border-radius: 24px;
    font-size: 1.2rem;
  }

  .create-callout {
    margin-top: 28vh;
    padding: 28px;
  }

  .create-callout h3 {
    font-size: 1.8rem;
  }

  .create-callout p {
    font-size: 1.25rem;
  }

  .title-field textarea {
    font-size: 2.55rem;
  }

  .hero-card-editor {
    gap: 14px;
  }

  .hero-card-editor > span {
    font-size: 1.2rem;
  }

  .card-input {
    width: 92px;
    height: 130px;
  }

  .card-input input {
    font-size: 0.9rem;
  }

  .board-editor {
    gap: 10px;
  }

  .board-editor .card-input {
    height: 112px;
    border-radius: 14px;
  }

  .board-editor .card-input input {
    font-size: 0.82rem;
  }

  .segmented-control {
    grid-template-columns: repeat(3, 1fr);
  }

  .blind-grid,
  .seat-stack-grid {
    grid-template-columns: 1fr;
  }

  .advanced-actions summary {
    align-items: flex-start;
    padding: 22px;
  }

  .scripted-action-grid {
    grid-template-columns: 1fr;
    padding: 0 22px 22px;
  }

  .scripted-action-head {
    display: none;
  }

  .scripted-select span,
  .scripted-bet-size span,
  .scripted-custom-bb span {
    display: block;
    margin: 0 0 6px;
    color: var(--ps-muted);
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: capitalize;
  }

  .stack-stepper {
    grid-template-columns: 78px 1fr 78px;
  }

  .round-control {
    width: 78px;
    height: 78px;
    min-height: 78px;
  }

  .is-playing .seat-row,
  .is-playing .seat-row-bottom,
  .is-playing .action-grid,
  .is-playing .two-up {
    grid-template-columns: 1fr;
  }

  .is-playing .seat-pod {
    min-height: 118px;
  }

  .is-playing .action-panel {
    position: static;
  }
}
