:root {
  --bg-deep: #1b1220;
  --bg-mid: #4f2130;
  --panel: rgba(248, 241, 232, 0.96);
  --panel-soft: rgba(252, 248, 241, 0.94);
  --ink: #25151a;
  --muted: #685159;
  --line: rgba(54, 31, 41, 0.14);
  --accent: #d17a3c;
  --accent-deep: #a63b42;
  --table: #21543f;
  --table-dark: #163b2d;
  --shadow: 0 22px 48px rgba(12, 6, 9, 0.28);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 16% 10%, rgba(209, 122, 60, 0.17), transparent 20%),
    radial-gradient(circle at 84% 14%, rgba(107, 168, 131, 0.15), transparent 18%),
    linear-gradient(150deg, var(--bg-deep), var(--bg-mid));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.03), transparent 28%),
    linear-gradient(rgba(255, 255, 255, 0.018) 0, rgba(255, 255, 255, 0.018) 1px, transparent 1px, transparent 80px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 0, rgba(255, 255, 255, 0.018) 1px, transparent 1px, transparent 80px);
  pointer-events: none;
  opacity: 0.3;
}

.maumau-app {
  width: min(1220px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 42px;
}

.maumau-topbar,
.maumau-controls-panel,
.table-panel,
.player-card,
.rules-card,
.maumau-seo-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.maumau-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-radius: 24px;
}

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

.maumau-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--ink);
}

.maumau-brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f6d09f, var(--accent));
  color: #1a130d;
  font-weight: 900;
}

.maumau-brand-copy {
  display: grid;
  gap: 2px;
}

.maumau-brand-copy strong {
  font-size: 1.04rem;
}

.maumau-brand-copy span {
  color: var(--muted);
  font-size: 0.92rem;
}

.maumau-return,
.maumau-support,
.action-button,
.card-button,
.pile-card {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border-radius: 999px;
  font: inherit;
}

.maumau-return,
.maumau-support,
.action-button {
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid rgba(37, 21, 26, 0.12);
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

.maumau-return,
.action-button {
  background: linear-gradient(145deg, #fcf8f3, #ead7ca);
  color: var(--ink);
}

.maumau-support {
  background: linear-gradient(145deg, #ffdc42, #f0b90a);
  color: #24150f;
}

.action-button.primary {
  background: linear-gradient(145deg, #e9b47b, var(--accent));
  color: #24120f;
}

.maumau-return:hover,
.maumau-return:focus-visible,
.maumau-support:hover,
.maumau-support:focus-visible,
.action-button:hover,
.action-button:focus-visible,
.card-button:hover,
.card-button:focus-visible,
.pile-card:hover,
.pile-card:focus-visible {
  transform: translateY(-1px);
}

.action-button:disabled,
.card-button:disabled,
.pile-card:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.maumau-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(380px, 1.1fr);
  gap: 20px;
  align-items: start;
  padding: 28px 0 18px;
}

.eyebrow {
  margin: 0 0 12px;
  color: rgba(255, 245, 230, 0.78);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow.dark {
  color: #83545f;
}

.maumau-copy h1,
.status-copy h2,
.rules-card h3,
.result-overlay h2,
.wish-overlay h2,
.maumau-seo-card h2 {
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
}

.maumau-copy h1 {
  margin: 0 0 14px;
  max-width: 12ch;
  color: #fff8ec;
  font-size: clamp(2.3rem, 5vw, 4.6rem);
  line-height: 0.95;
}

.maumau-copy p:last-child {
  margin: 0;
  max-width: 60ch;
  color: rgba(250, 242, 232, 0.86);
  line-height: 1.65;
}

.maumau-controls-panel {
  border-radius: 30px;
  padding: 22px;
}

.status-copy h2 {
  margin: 0;
  font-size: clamp(1.28rem, 2.4vw, 1.82rem);
  line-height: 1.12;
}

.notice-text,
.mode-hint,
.maumau-note {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.setup-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(160px, 0.8fr);
  gap: 16px;
  align-items: end;
  margin-top: 18px;
}

.setup-group,
.select-field {
  display: grid;
  gap: 10px;
}

.setup-label {
  margin: 0;
  color: #6b3f49;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mode-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.choice-pill {
  position: relative;
  display: inline-flex;
  min-height: 48px;
  align-items: center;
}

.choice-pill input {
  position: absolute;
  opacity: 0;
  inset: 0;
}

.choice-pill span {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(54, 31, 41, 0.12);
  background: #fffaf4;
  font-weight: 700;
}

.choice-pill input:checked + span {
  background: linear-gradient(145deg, #f3d0b0, #e6a772);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.select-input {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(54, 31, 41, 0.12);
  border-radius: 16px;
  background: #fffaf4;
  font: inherit;
  color: var(--ink);
}

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

.metric-card {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 251, 245, 0.92);
  border: 1px solid rgba(54, 31, 41, 0.08);
}

.metric-card span {
  color: #85666e;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.metric-card strong {
  font-size: 1.18rem;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.maumau-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.55fr);
  gap: 20px;
  align-items: start;
}

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

.table-surface {
  position: relative;
  display: grid;
  gap: 16px;
  min-height: 720px;
  padding: 18px;
  border-radius: 30px;
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.1), transparent 22%),
    radial-gradient(circle at 80% 78%, rgba(255, 255, 255, 0.06), transparent 16%),
    linear-gradient(145deg, var(--table), var(--table-dark));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.player-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 26px;
  background: rgba(248, 241, 232, 0.92);
}

.player-card.active {
  box-shadow: 0 0 0 2px rgba(229, 167, 114, 0.55), var(--shadow);
}

.player-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.player-token {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.player-one-token {
  background: linear-gradient(145deg, #ffd98d, #d17a3c);
}

.player-two-token {
  background: linear-gradient(145deg, #f6bbc4, #a63b42);
}

.player-name,
.player-role,
.round-label {
  margin: 0;
}

.player-name {
  font-weight: 800;
}

.player-role {
  color: var(--muted);
  font-size: 0.94rem;
}

.hand-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.top-hand {
  justify-content: center;
}

.bottom-hand {
  justify-content: center;
}

.center-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 180px;
}

.pile-card,
.card-button,
.top-hand .card-shell,
.discard-pile .card-shell {
  position: relative;
  width: 96px;
  height: 136px;
  border-radius: 22px;
}

.pile-card,
.card-button {
  border: 0;
  padding: 0;
  background: transparent;
}

.card-shell,
.pile-card {
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: linear-gradient(160deg, #fffdfa, #f3e5cf);
  box-shadow:
    inset 0 0 0 1px rgba(74, 43, 31, 0.08),
    0 14px 30px rgba(19, 11, 13, 0.22);
}

.card-shell.red,
.discard-pile.red .card-shell {
  color: #a52132;
}

.card-shell.black,
.discard-pile.black .card-shell {
  color: #1f2026;
}

.card-shell.is-playable {
  box-shadow:
    0 0 0 3px rgba(233, 180, 123, 0.75),
    0 18px 36px rgba(19, 11, 13, 0.24);
}

.card-shell.back {
  background:
    radial-gradient(circle at 24% 20%, rgba(255, 255, 255, 0.18), transparent 22%),
    linear-gradient(145deg, #6e2845, #3b1630);
  color: #f8dfcc;
}

.card-rank-top,
.card-rank-bottom {
  position: absolute;
  left: 12px;
  font-size: 1.05rem;
  font-weight: 800;
}

.card-rank-top {
  top: 10px;
}

.card-rank-bottom {
  bottom: 10px;
  transform: rotate(180deg);
}

.card-suit {
  font-size: 3.2rem;
}

.pile-mark {
  font-size: 2rem;
  font-weight: 900;
  color: #f1dfd0;
}

.pile-label {
  position: absolute;
  bottom: 14px;
  color: rgba(248, 242, 228, 0.82);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.draw-pile {
  background:
    radial-gradient(circle at 22% 20%, rgba(255, 255, 255, 0.18), transparent 22%),
    linear-gradient(145deg, #6e2845, #3b1630);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 18px 36px rgba(19, 11, 13, 0.26);
}

.draw-pile::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 16px;
  border: 1px solid rgba(255, 230, 214, 0.2);
}

.discard-pile {
  display: grid;
  place-items: center;
}

.round-info {
  display: grid;
  gap: 8px;
  max-width: 240px;
  color: #fff3e2;
}

.round-label {
  color: rgba(255, 241, 223, 0.72);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.round-info strong {
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  font-size: 1.35rem;
  line-height: 1.15;
}

.maumau-note {
  color: rgba(255, 241, 223, 0.84);
}

.maumau-sidebar {
  display: grid;
  gap: 16px;
}

.rules-card {
  border-radius: 26px;
  padding: 20px;
}

.rules-card h3 {
  margin: 0 0 12px;
  font-size: 1.5rem;
}

.rules-card ol,
.rules-card ul,
.maumau-seo-card ol,
.maumau-seo-card ul {
  margin: 0;
  padding-left: 1.2rem;
  line-height: 1.65;
}

.maumau-seo {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 22px;
}

.maumau-seo-card {
  border-radius: 28px;
  padding: 24px;
  background: rgba(248, 241, 232, 0.92);
}

.maumau-seo-card h2 {
  margin: 0 0 12px;
  font-size: 1.9rem;
  line-height: 1.05;
}

.maumau-seo-card p,
.maumau-seo-card dd {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.maumau-seo-card a {
  color: var(--accent-deep);
  font-weight: 700;
}

.faq-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.faq-list dt {
  font-weight: 800;
}

.faq-list dd {
  margin-left: 0;
}

.result-overlay,
.wish-overlay {
  position: absolute;
  inset: 26px;
  display: grid;
  place-content: center;
  gap: 12px;
  padding: 28px;
  border-radius: 28px;
  background: rgba(15, 12, 13, 0.76);
  color: #fff7ec;
  text-align: center;
  z-index: 4;
}

.result-overlay[hidden],
.wish-overlay[hidden] {
  display: none;
}

.overlay-kicker {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 242, 230, 0.74);
}

.result-overlay h2,
.wish-overlay h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
}

.overlay-message,
.overlay-stats {
  margin: 0;
}

.overlay-stats,
.overlay-actions,
.wish-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.wish-button {
  min-width: 120px;
}

@media (max-width: 1120px) {
  .maumau-hero,
  .maumau-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .center-zone {
    flex-direction: column;
  }

  .table-surface {
    min-height: 820px;
  }
}

@media (max-width: 640px) {
  .maumau-app {
    width: min(100%, calc(100% - 18px));
    padding-top: 18px;
  }

  .maumau-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .maumau-topbar-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .maumau-copy h1 {
    max-width: none;
  }

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

  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }

  .pile-card,
  .card-button,
  .top-hand .card-shell,
  .discard-pile .card-shell {
    width: 84px;
    height: 122px;
  }

  .card-suit {
    font-size: 2.8rem;
  }
}
