@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@500&family=Manrope:wght@500;700;800&display=swap');

:root {
  --ink: #183b42;
  --muted: #638187;
  --aqua: #4dbfc1;
  --aqua-deep: #269da4;
  --cream: #fff8e7;
  --paper: #fffdf6;
  --red: #ed5b51;
  --red-deep: #c74440;
  --blue: #3489bd;
  --blue-deep: #256795;
  --yellow: #f6c932;
  --wood: #e9bd71;
  --wood-light: #f3d493;
  --wood-dark: #bd8442;
  --shadow: rgba(20, 91, 98, .22);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: #dff4ee;
  color: var(--ink);
  font-family: Manrope, system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
}

.game-guide {
  max-width: 880px;
  margin: 8px auto 28px;
  padding: 22px 26px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  color: #56483b;
  line-height: 1.75;
}

.game-guide h2 {
  margin: 0 0 10px;
  color: #3d332b;
}

.game-guide p {
  margin: 8px 0 0;
}
button { font: inherit; }

.game-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  padding: 22px clamp(16px, 4vw, 72px) 30px;
  background:
    radial-gradient(circle at 12% 0%, rgba(255,255,255,.74) 0 16%, transparent 39%),
    radial-gradient(circle at 95% 92%, rgba(255,255,255,.34) 0 17%, transparent 40%),
    linear-gradient(145deg, #e5f6ef 0%, #c8eeeb 48%, #a7dde0 100%);
}
.game-shell::before, .game-shell::after {
  position: absolute; content: ""; pointer-events: none; opacity: .35;
  border: 1px solid rgba(38, 157, 164, .16); border-radius: 50%;
}
.game-shell::before { width: 460px; height: 460px; top: -220px; right: 10%; }
.game-shell::after { width: 540px; height: 540px; bottom: -330px; left: -180px; }

.topbar, .score-row, .bonus-strip, .table-wrap, .game-footer { position: relative; z-index: 1; max-width: 1060px; margin-inline: auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; }
.brand-lockup { display: flex; gap: 12px; align-items: center; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--cream); background: var(--ink); font-size: 20px; box-shadow: 0 4px 0 rgba(24,59,66,.18); }
.eyebrow { margin: 0 0 3px; color: var(--muted); font: 500 10px/1.2 "DM Mono", monospace; letter-spacing: .18em; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(20px, 3vw, 26px); letter-spacing: -.06em; line-height: 1; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.invite-button { border: 1px solid rgba(24,59,66,.16); border-radius: 999px; padding: 9px 13px; color: var(--ink); background: rgba(255,255,255,.43); font-size: 11px; font-weight: 800; cursor: pointer; transition: transform .18s ease, background .18s ease; }
.invite-button:hover { transform: translateY(-2px); background: var(--paper); }
.icon-button { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid rgba(24,59,66,.16); border-radius: 50%; color: var(--ink); background: rgba(255,255,255,.43); cursor: pointer; transition: transform .18s ease, background .18s ease; }
.icon-button:hover { transform: translateY(-2px); background: var(--paper); }

.score-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: clamp(12px, 3vw, 32px); align-items: center; margin-top: clamp(22px, 5vh, 52px); }
.player-card { min-width: 0; display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid rgba(255,255,255,.72); border-radius: 18px; background: rgba(255,255,255,.42); box-shadow: 0 10px 26px rgba(38, 131, 137, .10); transition: transform .25s ease, background .25s ease, box-shadow .25s ease; }
.player-card.active { transform: translateY(-4px); background: rgba(255,255,255,.82); box-shadow: 0 14px 30px rgba(38, 131, 137, .18); }
.player-avatar { display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; color: #fff; font: 700 16px "DM Mono", monospace; box-shadow: inset 0 2px 0 rgba(255,255,255,.32); }
.red-avatar { background: var(--red); } .blue-avatar { background: var(--blue); }
.player-copy { display: grid; gap: 1px; min-width: 38px; }
.player-copy span { color: var(--muted); font-size: 11px; font-weight: 700; }
.player-copy strong { font-size: 24px; line-height: 1; }
.collection { position: relative; flex: 1; height: 32px; min-width: 65px; }
.right-collection { direction: rtl; }
.collected-disc { position: absolute; top: 7px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255,255,255,.66); box-shadow: 0 3px 0 rgba(24,59,66,.17); animation: stack-in .35s cubic-bezier(.2, .75, .2, 1) both; }
@keyframes stack-in { from { transform: translateY(-16px) rotate(-18deg) scale(.5); opacity: 0; } to { transform: translateY(0) rotate(0) scale(1); opacity: 1; } }
.round-status { display: grid; justify-items: center; gap: 6px; color: var(--ink); font-size: 12px; font-weight: 800; white-space: nowrap; }
.round-status small { color: var(--muted); font-weight: 700; font-size: 10px; }
.turn-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 6px rgba(237,91,81,.12); transition: background .2s ease, box-shadow .2s ease; }
.turn-dot.blue { background: var(--blue); box-shadow: 0 0 0 6px rgba(52,137,189,.12); }

.bonus-strip { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 22px; color: var(--ink); }
.bonus-strip > div:first-child { display: grid; text-align: right; gap: 2px; }
.bonus-label { color: var(--muted); font-size: 10px; font-weight: 700; }
.bonus-strip strong { font-size: 13px; }
.bonus-disc { width: 36px; height: 36px; border-radius: 50%; border: 4px solid rgba(255,255,255,.84); box-shadow: 0 5px 0 rgba(24,59,66,.14), inset 0 2px 2px rgba(255,255,255,.5); transition: background .3s ease; }
.bonus-points { padding: 5px 8px; border-radius: 7px; color: var(--ink); background: rgba(255,255,255,.45); font: 500 10px "DM Mono", monospace; }

.table-wrap { width: min(100%, 780px); margin-top: 18px; padding: 20px; border-radius: 36px; background: rgba(50, 165, 172, .38); box-shadow: 0 22px 40px var(--shadow), inset 0 2px 0 rgba(255,255,255,.43); }
.table-shadow { position: absolute; inset: 22px; border-radius: 24px; background: rgba(21,88,93,.21); filter: blur(10px); transform: translateY(9px); }
.board { position: relative; display: grid; grid-template-columns: repeat(6, 1fr); gap: clamp(10px, 2.2vw, 18px); padding: clamp(18px, 4vw, 34px); border-radius: 26px; background: #53c8c6; box-shadow: inset 0 3px 0 rgba(255,255,255,.5), inset 0 -3px 0 rgba(26,120,127,.15); }
.tile { position: relative; aspect-ratio: 1; min-width: 0; border: 0; border-radius: 50%; padding: 0; background: transparent; cursor: pointer; perspective: 700px; }
.tile:focus-visible { outline: 4px solid rgba(255,255,255,.9); outline-offset: 4px; }
.tile-inner { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.tile.flipped .tile-inner { transform: rotateY(180deg); }
.tile-face { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; border-radius: 50%; backface-visibility: hidden; }
.tile-front { background: radial-gradient(circle at 32% 24%, rgba(255,255,255,.52) 0 4%, transparent 5%), repeating-linear-gradient(75deg, rgba(157,91,35,.11) 0 1px, transparent 1px 8px), linear-gradient(145deg, var(--wood-light), var(--wood)); border: 2px solid rgba(173,111,49,.38); box-shadow: 0 5px 0 var(--wood-dark), 0 9px 12px rgba(24,59,66,.18), inset 0 2px 2px rgba(255,255,255,.5); transition: filter .18s ease, transform .18s ease; }
.tile:not(.flipped):hover .tile-front { filter: brightness(1.08); transform: translateY(-3px); }
.tile-back { transform: rotateY(180deg); border: 3px solid rgba(255,255,255,.72); box-shadow: 0 5px 0 rgba(24,59,66,.2), 0 9px 13px rgba(24,59,66,.18), inset 0 2px 2px rgba(255,255,255,.45); }
.color-ring { width: 43%; height: 43%; border-radius: 50%; border: 2px solid rgba(255,255,255,.28); }
.tile.flipped .tile-back { animation: reveal-pop .34s ease .25s both; }
@keyframes reveal-pop { from { transform: rotateY(180deg) scale(.82); } to { transform: rotateY(180deg) scale(1); } }
.tile.claimed { animation: claimed .4s ease both; }
@keyframes claimed { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.tile.matched .tile-back { border-color: rgba(255,255,255,.96); box-shadow: 0 5px 0 rgba(24,59,66,.2), 0 0 0 4px rgba(255,255,255,.28), 0 10px 16px rgba(24,59,66,.18), inset 0 2px 2px rgba(255,255,255,.45); }
.tile.mismatch .tile-back { animation: mismatch-shake .32s ease both; }
@keyframes mismatch-shake { 0%,100% { transform: rotateY(180deg) translateX(0); } 25% { transform: rotateY(180deg) translateX(-4px); } 75% { transform: rotateY(180deg) translateX(4px); } }

.game-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 18px; }
.footer-hint { display: flex; align-items: center; gap: 8px; min-height: 32px; color: var(--ink); font-size: 12px; font-weight: 800; }
.hand-icon { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; color: var(--cream); background: var(--ink); font-size: 13px; }
.restart-button { border: 0; border-bottom: 2px solid rgba(24,59,66,.28); padding: 5px 0; color: var(--ink); background: transparent; font-size: 11px; font-weight: 800; cursor: pointer; }
.restart-button:hover { color: var(--red-deep); }

.start-overlay, .result-overlay { position: fixed; z-index: 4; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(27,91,94,.35); backdrop-filter: blur(9px); animation: fade-in .3s ease both; }
.hidden { display: none !important; }
.start-card, .result-card { width: min(100%, 380px); padding: 38px 32px 32px; border: 1px solid rgba(255,255,255,.86); border-radius: 30px; text-align: center; background: var(--paper); box-shadow: 0 24px 70px rgba(20,91,98,.26); }
.start-card h2, .result-card h2 { margin: 7px 0 12px; color: var(--ink); font-size: 34px; letter-spacing: -.08em; }
.start-card > p:not(.eyebrow), .result-card > p:not(.eyebrow) { color: var(--muted); font-size: 13px; line-height: 1.8; }
.start-token { width: 56px; height: 56px; margin: 0 auto 22px; border-radius: 50%; box-shadow: 0 7px 0 rgba(190,132,66,.45), inset 0 3px 3px rgba(255,255,255,.65); }
.token-yellow { background: var(--yellow); }
.mode-picker { display: grid; gap: 9px; margin-top: 24px; }
.mode-button { display: grid; gap: 2px; width: 100%; border: 1px solid rgba(24,59,66,.14); border-radius: 14px; padding: 12px 14px; color: var(--ink); background: #f5f7e9; text-align: left; cursor: pointer; transition: transform .16s ease, background .16s ease, border-color .16s ease; }
.mode-button:hover { transform: translateY(-2px); border-color: rgba(38,157,164,.45); background: #e9f7ef; }
.mode-button strong { font-size: 13px; }
.mode-button span { color: var(--muted); font-size: 10px; font-weight: 700; }
.primary-button { width: 100%; margin-top: 26px; border: 0; border-radius: 13px; padding: 14px 20px; color: #fffdf6; background: var(--ink); box-shadow: 0 5px 0 #0e292e; font-size: 14px; font-weight: 800; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.primary-button:hover { transform: translateY(-2px); background: #245760; box-shadow: 0 7px 0 #0e292e; }
.primary-button:active { transform: translateY(3px); box-shadow: 0 2px 0 #0e292e; }
.result-medal { display: grid; place-items: center; width: 62px; height: 62px; margin: 0 auto 14px; border-radius: 50%; color: #fff; background: var(--red); box-shadow: 0 7px 0 var(--red-deep); font-size: 25px; }
.final-score { display: flex; justify-content: center; gap: 14px; margin-top: 21px; font: 700 30px "DM Mono", monospace; }
.final-score b { color: var(--muted); }
.invite-overlay { position: fixed; z-index: 5; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(27,91,94,.35); backdrop-filter: blur(9px); animation: fade-in .3s ease both; }
.invite-card { position: relative; width: min(100%, 390px); padding: 34px 30px 28px; border: 1px solid rgba(255,255,255,.86); border-radius: 28px; text-align: center; background: var(--paper); box-shadow: 0 24px 70px rgba(20,91,98,.26); }
.invite-card h2 { margin: 7px 0 10px; color: var(--ink); font-size: 28px; letter-spacing: -.08em; }
.invite-card > p:not(.eyebrow):not(.invite-status) { color: var(--muted); font-size: 12px; line-height: 1.8; }
.close-button { position: absolute; top: 13px; right: 16px; width: 32px; height: 32px; border: 0; border-radius: 50%; color: var(--muted); background: transparent; font-size: 25px; line-height: 1; cursor: pointer; }
.close-button:hover { color: var(--ink); background: #eff5ed; }
.room-code-box { display: flex; align-items: center; gap: 10px; margin-top: 23px; padding: 13px 14px; border: 1px dashed rgba(24,59,66,.25); border-radius: 14px; background: #f5f7e9; text-align: left; }
.room-code-label { color: var(--muted); font-size: 11px; font-weight: 700; }
.room-code-box strong { flex: 1; color: var(--ink); font: 700 18px "DM Mono", monospace; letter-spacing: .05em; }
.copy-button { border: 0; border-bottom: 2px solid rgba(24,59,66,.25); padding: 3px 0; color: var(--ink); background: transparent; font-size: 11px; font-weight: 800; cursor: pointer; }
.link-button { margin-top: 15px; border: 0; border-bottom: 1px solid rgba(24,59,66,.3); padding: 3px 0; color: var(--muted); background: transparent; font-size: 11px; font-weight: 800; cursor: pointer; }
.invite-status { min-height: 20px; margin-top: 12px; color: var(--aqua-deep); font-size: 11px; font-weight: 800; }
.online-overlay { position: fixed; z-index: 6; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(27,91,94,.35); backdrop-filter: blur(9px); animation: fade-in .3s ease both; }
.online-card { padding-top: 38px; }
.online-loader { display: flex; justify-content: center; gap: 6px; margin-top: 24px; }
.online-loader span { width: 8px; height: 8px; border-radius: 50%; background: var(--aqua-deep); animation: online-bounce 1s ease-in-out infinite; }
.online-loader span:nth-child(2) { animation-delay: .14s; }
.online-loader span:nth-child(3) { animation-delay: .28s; }
@keyframes online-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-7px); opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 640px) {
  .game-shell { padding: 16px 13px 22px; }
  .score-row { gap: 7px; margin-top: 24px; }
  .player-card { padding: 8px; gap: 7px; border-radius: 14px; }
  .player-avatar { width: 29px; height: 29px; font-size: 13px; }
  .player-copy strong { font-size: 20px; }
  .collection { min-width: 38px; }
  .collected-disc { width: 18px; height: 18px; top: 7px; }
  .round-status { font-size: 10px; gap: 4px; }
  .round-status small { font-size: 9px; }
  .bonus-strip { margin-top: 17px; }
  .table-wrap { margin-top: 15px; padding: 10px; border-radius: 24px; }
  .table-shadow { inset: 13px; }
  .board { grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 14px; border-radius: 18px; }
  .tile-front { box-shadow: 0 3px 0 var(--wood-dark), 0 6px 8px rgba(24,59,66,.15), inset 0 2px 2px rgba(255,255,255,.5); }
  .tile-back { box-shadow: 0 3px 0 rgba(24,59,66,.2), 0 6px 8px rgba(24,59,66,.15), inset 0 2px 2px rgba(255,255,255,.45); }
  .game-footer { margin-top: 13px; }
  .footer-hint { font-size: 10px; }
  .restart-button { font-size: 10px; }
  .invite-button { padding: 8px 10px; font-size: 10px; }
  .start-card, .result-card { padding: 30px 20px 24px; }
  .mode-button { padding: 11px 12px; }
}

/* Color Memory Duel visual refresh */
:root {
  --ink: #123d45;
  --muted: #5a7d81;
  --paper: #fffdf7;
  --aqua: #48c3c2;
  --aqua-deep: #198e98;
  --shadow: rgba(15, 74, 82, .24);
}

body { background: #d5f0eb; }

.game-shell {
  padding-top: 26px;
  background:
    radial-gradient(circle at 8% -2%, rgba(255,255,255,.92) 0 14%, transparent 36%),
    radial-gradient(circle at 98% 96%, rgba(255,255,255,.45) 0 15%, transparent 36%),
    linear-gradient(145deg, #f2fbf5 0%, #c7eeee 50%, #8dd4d6 100%);
}

.game-shell::before { width: 560px; height: 560px; top: -310px; right: 7%; border-color: rgba(38,157,164,.2); }
.game-shell::after { width: 620px; height: 620px; bottom: -420px; left: -250px; border-color: rgba(38,157,164,.2); }

.topbar { max-width: 1120px; }
.brand-lockup { gap: 13px; }
.brand-mark.brand-icon {
  display: block;
  width: 48px;
  height: 48px;
  border: 3px solid rgba(255,255,255,.8);
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 5px 0 rgba(24,59,66,.2), 0 9px 20px rgba(24,59,66,.14);
}
.top-actions { gap: 12px; }
.invite-button, .icon-button { background: rgba(255,255,255,.62); }

.score-row { max-width: 1120px; margin-top: clamp(30px, 6vh, 66px); }
.player-card {
  padding: 13px 16px;
  border-color: rgba(255,255,255,.88);
  background: rgba(255,255,255,.52);
  box-shadow: 0 12px 28px rgba(38,131,137,.14);
}
.player-card.active { background: rgba(255,255,255,.9); }
.round-status { padding: 9px 14px; border: 1px solid rgba(255,255,255,.7); border-radius: 18px; background: rgba(255,255,255,.34); }

.table-wrap {
  width: min(100%, 900px);
  margin-top: 26px;
  padding: 24px;
  border-radius: 40px;
  background: linear-gradient(145deg, rgba(48,177,181,.65), rgba(28,134,143,.42));
  box-shadow: 0 28px 52px rgba(20,91,98,.22), inset 0 3px 0 rgba(255,255,255,.48), inset 0 -4px 0 rgba(15,99,107,.14);
}
.table-shadow { inset: 25px; border-radius: 28px; filter: blur(12px); opacity: .85; }
.board {
  gap: clamp(12px, 2vw, 19px);
  padding: clamp(24px, 4vw, 40px);
  border-radius: 30px;
  background:
    radial-gradient(circle at 25% 20%, rgba(255,255,255,.14), transparent 25%),
    radial-gradient(circle at 82% 78%, rgba(255,255,255,.11), transparent 28%),
    #4ec3c3;
  box-shadow: inset 0 4px 0 rgba(255,255,255,.48), inset 0 -5px 0 rgba(26,120,127,.18);
}

.game-footer { max-width: 1120px; margin-top: 23px; }
.footer-hint { font-size: 13px; }

.start-overlay, .result-overlay, .invite-overlay, .online-overlay {
  background: rgba(12,62,68,.52);
  backdrop-filter: blur(5px) saturate(1.05);
}
.start-card, .result-card {
  width: min(100%, 540px);
  padding: 34px 34px 32px;
  border-radius: 32px;
  box-shadow: 0 28px 90px rgba(8,54,61,.34), 0 2px 0 rgba(255,255,255,.95) inset;
}
.start-card h2, .result-card h2 { font-size: clamp(32px, 5vw, 42px); }
.start-card > p:not(.eyebrow) { max-width: 410px; margin-inline: auto; }
.start-token.game-icon-badge {
  display: block;
  width: 82px;
  height: 82px;
  margin: 0 auto 17px;
  border: 4px solid rgba(255,255,255,.9);
  border-radius: 24px;
  object-fit: cover;
  box-shadow: 0 8px 0 rgba(24,59,66,.18), 0 14px 24px rgba(24,59,66,.16);
}
.mode-picker {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
  margin-top: 28px;
}
.mode-button {
  appearance: none;
  -webkit-appearance: none;
  align-content: center;
  min-height: 92px;
  border: 1px solid rgba(18,61,69,.15);
  border-radius: 17px;
  padding: 14px;
  background: linear-gradient(160deg, #ffffff 0%, #eef8eb 100%);
  color: var(--ink);
  font: inherit;
  line-height: 1.25;
  text-align: left;
  box-shadow: 0 4px 0 rgba(18,61,69,.1);
}
.mode-button:hover, .mode-button:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(25,142,152,.58);
  background: linear-gradient(160deg, #ffffff 0%, #dff6ee 100%);
  box-shadow: 0 7px 0 rgba(18,61,69,.12);
}
.mode-button:active { transform: translateY(1px); box-shadow: 0 2px 0 rgba(18,61,69,.12); }
.mode-button strong { display: block; font-size: 13px; letter-spacing: -.02em; }
.mode-button span { display: block; margin-top: 7px; color: var(--muted); font-size: 10px; font-weight: 700; line-height: 1.45; }

.invite-card { width: min(100%, 460px); border-radius: 30px; box-shadow: 0 28px 90px rgba(8,54,61,.34), 0 2px 0 rgba(255,255,255,.95) inset; }
.online-card { width: min(100%, 480px); }

@media (max-width: 720px) {
  .mode-picker { grid-template-columns: 1fr; }
  .mode-button { min-height: 68px; }
  .mode-button span { margin-top: 3px; }
}

@media (max-width: 640px) {
  .game-shell { padding-top: 16px; }
  .table-wrap { margin-top: 17px; padding: 12px; border-radius: 27px; }
  .board { padding: 16px; border-radius: 20px; }
  .start-card, .result-card { padding: 28px 18px 24px; }
  .start-token.game-icon-badge { width: 72px; height: 72px; border-radius: 21px; }
}

/* Match the dark arcade stage used across Bitesize Arcade's playable games. */
:root {
  --ink: #f8f0df;
  --muted: #b3b3aa;
  --paper: #1d262d;
  --aqua: #2a9caf;
  --aqua-deep: #167f95;
  --shadow: rgba(0, 0, 0, .48);
}

html { background: #080d15; }
body {
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 36%, rgba(23, 139, 157, .3), transparent 31%),
    radial-gradient(circle at 89% 30%, rgba(218, 137, 55, .16), transparent 29%),
    linear-gradient(140deg, #0b3440 0%, #101a26 47%, #241d1b 100%);
}

.game-shell {
  min-height: 100vh;
  padding: clamp(20px, 4vw, 52px) clamp(14px, 4vw, 44px) 34px;
  background:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px),
    radial-gradient(circle at 12% 36%, rgba(23, 139, 157, .28), transparent 32%),
    radial-gradient(circle at 89% 30%, rgba(218, 137, 55, .16), transparent 30%),
    linear-gradient(140deg, #0b3440 0%, #101a26 47%, #241d1b 100%);
  background-size: 34px 34px, 34px 34px, auto, auto, auto;
}
.game-shell::before, .game-shell::after { opacity: .16; border-color: rgba(75, 192, 211, .28); }

.topbar, .score-row, .table-wrap, .game-footer { max-width: 1000px; }
.brand-lockup { gap: 13px; }
.brand-mark.brand-icon {
  border-color: rgba(255, 190, 98, .7);
  border-radius: 14px;
  box-shadow: 0 5px 0 rgba(0,0,0,.32), 0 0 22px rgba(255,169,74,.16);
}
.eyebrow { color: #efbd69; }
h1 { color: #fff7e7; letter-spacing: -.055em; }
.invite-button, .icon-button {
  border-color: rgba(82, 181, 199, .35);
  color: #f8f0df;
  background: rgba(28, 44, 51, .88);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.invite-button:hover, .icon-button:hover { color: #fff; background: #284650; }

.score-row { margin-top: clamp(26px, 4vh, 42px); }
.player-card {
  border-color: rgba(92, 177, 191, .34);
  background: rgba(28, 39, 47, .94);
  box-shadow: 0 12px 28px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.05);
}
.player-card.active { background: rgba(35, 53, 61, .98); box-shadow: 0 0 0 1px rgba(255,182,83,.28), 0 14px 32px rgba(0,0,0,.34); }
.player-copy span, .round-status small { color: #a9b4b3; }
.player-copy strong, .round-status { color: #fff6e5; }
.round-status { border-color: rgba(91, 180, 194, .34); background: rgba(20,31,39,.72); }
.bonus-strip { color: #f8f0df; }
.bonus-label { color: #a9b4b3; }
.bonus-points { color: #f8f0df; background: rgba(34,51,59,.88); }

.table-wrap {
  margin-top: 24px;
  padding: 18px;
  border: 1px solid rgba(76, 174, 190, .5);
  border-radius: 25px;
  background: linear-gradient(145deg, rgba(32, 77, 87, .98), rgba(20, 38, 48, .98));
  box-shadow: 0 24px 56px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.1);
}
.table-shadow { inset: 18px; border-radius: 17px; background: rgba(0,0,0,.4); filter: blur(14px); }
.board {
  gap: clamp(11px, 2vw, 18px);
  padding: clamp(18px, 3vw, 30px);
  border: 1px solid rgba(95, 203, 211, .52);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 42%, rgba(41, 159, 165, .25), transparent 55%),
    #164c56;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.1), 0 12px 26px rgba(0,0,0,.25);
}
.tile-front { box-shadow: 0 5px 0 #8d5d2c, 0 10px 13px rgba(0,0,0,.35), inset 0 2px 2px rgba(255,255,255,.5); }
.tile-back { box-shadow: 0 5px 0 rgba(0,0,0,.42), 0 10px 13px rgba(0,0,0,.35), inset 0 2px 2px rgba(255,255,255,.45); }
.game-footer { color: #f8f0df; }
.footer-hint { color: #f8f0df; }
.hand-icon { color: #17232a; background: #ffb45d; }
.restart-button { border-color: rgba(255,180,93,.5); color: #ffc274; }
.restart-button:hover { color: #fff; }

.start-overlay, .result-overlay, .invite-overlay, .online-overlay {
  background: rgba(4, 10, 17, .78);
  backdrop-filter: blur(3px);
}
.start-card, .result-card, .invite-card {
  width: min(100%, 560px);
  border-color: rgba(120, 139, 145, .65);
  border-radius: 23px;
  background: linear-gradient(160deg, rgba(31, 40, 47, .98), rgba(20, 29, 36, .98));
  box-shadow: 0 30px 80px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.08);
}
.start-card h2, .result-card h2, .invite-card h2 { color: #fff5df; }
.start-card > p:not(.eyebrow), .result-card > p:not(.eyebrow), .invite-card > p:not(.eyebrow):not(.invite-status) { color: #b8bfbd; }
.start-token.game-icon-badge { border-color: rgba(255, 190, 98, .72); box-shadow: 0 7px 0 rgba(0,0,0,.36), 0 0 26px rgba(255,164,71,.16); }
.mode-button {
  min-height: 92px;
  border-color: rgba(75, 165, 180, .42);
  background: linear-gradient(160deg, #263740 0%, #1c2a32 100%);
  color: #fff4df;
  box-shadow: 0 4px 0 rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.06);
}
.mode-button:hover, .mode-button:focus-visible {
  border-color: #ffad57;
  background: linear-gradient(160deg, #39484d 0%, #24343b 100%);
  box-shadow: 0 7px 0 rgba(0,0,0,.35), 0 0 22px rgba(255,166,73,.12);
}
.mode-button span { color: #aeb9b7; }
.primary-button {
  color: #241a12;
  background: linear-gradient(180deg, #ffc15f 0%, #ff8a40 100%);
  box-shadow: 0 5px 0 #8f4d29, 0 0 22px rgba(255,153,68,.18);
}
.primary-button:hover { color: #241a12; background: linear-gradient(180deg, #ffd277 0%, #ff9d52 100%); box-shadow: 0 7px 0 #8f4d29, 0 0 26px rgba(255,153,68,.28); }
.result-medal { color: #27190d; background: linear-gradient(180deg, #ffc25d, #ff8840); box-shadow: 0 7px 0 #904b28; }
.room-code-box { border-color: rgba(83, 172, 185, .5); background: #1a2b33; }
.room-code-label, .copy-button, .link-button { color: #b7c0bd; }
.room-code-box strong { color: #fff2d7; }
.copy-button:hover, .link-button:hover { color: #ffc16c; }
.invite-status { color: #63d3c6; }
.online-loader span { background: #ffad57; }

@media (max-width: 640px) {
  .game-shell { padding: 16px 12px 24px; }
  .table-wrap { padding: 11px; border-radius: 19px; }
  .board { padding: 14px; border-radius: 14px; }
  .start-card, .result-card, .invite-card { border-radius: 21px; }
}

/* Responsive board sizing: level 1 is 24 tiles, level 2 is a 60-tile memory wall. */
.board { grid-template-columns: repeat(var(--board-columns, 6), minmax(0, 1fr)); }
.board.level-2 { grid-template-columns: repeat(10, minmax(0, 1fr)); }
.table-wrap { width: min(100%, 800px); }
.game-shell.level-2-active .table-wrap { width: min(100%, 940px); }
.level-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid rgba(255, 180, 93, .4);
  border-radius: 999px;
  color: #ffc274;
  background: rgba(28, 44, 51, .88);
  font: 700 10px "DM Mono", monospace;
  letter-spacing: .08em;
  white-space: nowrap;
}
.result-card .primary-button + .primary-button { margin-top: 12px; }

@media (max-width: 720px) {
  .table-wrap, .game-shell.level-2-active .table-wrap { width: 100%; }
  .board.level-2 {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 7px;
    padding: 13px;
  }
  .board.level-2 .tile-front,
  .board.level-2 .tile-back { box-shadow: 0 3px 0 #8d5d2c, 0 5px 8px rgba(0,0,0,.35), inset 0 1px 1px rgba(255,255,255,.5); }
}

@media (max-width: 640px) {
  .game-shell { padding: 13px 10px 22px; }
  .topbar { align-items: flex-start; gap: 10px; }
  .brand-lockup { gap: 9px; min-width: 0; }
  .brand-mark.brand-icon { width: 40px; height: 40px; border-radius: 12px; }
  h1 { font-size: 18px; white-space: nowrap; }
  .eyebrow { font-size: 8px; }
  .top-actions { flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
  .level-pill { min-height: 28px; padding: 0 8px; font-size: 8px; }
  .invite-button { max-width: 116px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .icon-button { width: 34px; height: 34px; }
  .score-row { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 5px; margin-top: 19px; }
  .player-card { min-height: 58px; padding: 7px; gap: 6px; border-radius: 12px; }
  .player-avatar { width: 27px; height: 27px; font-size: 12px; }
  .player-copy strong { font-size: 19px; }
  .player-copy span { font-size: 9px; }
  .collection { min-width: 26px; }
  .round-status { min-width: 66px; padding: 7px 6px; font-size: 9px; }
  .round-status small { font-size: 8px; }
  .table-wrap { margin-top: 13px; padding: 8px; border-radius: 17px; }
  .board { gap: 7px; padding: 12px; border-radius: 13px; }
  .board.level-2 { gap: 5px; padding: 9px; }
  .game-footer { margin-top: 10px; }
  .footer-hint { font-size: 9px; }
}

/* Desktop game fit: keep the first 24-tile board and its controls inside a normal laptop viewport. */
@media (min-width: 900px) {
  .game-shell {
    padding-top: clamp(16px, 2.5vh, 28px);
    padding-bottom: 20px;
  }
  .score-row { margin-top: clamp(20px, 3vh, 34px); }
  .table-wrap { margin-top: clamp(14px, 2.4vh, 24px); padding: 14px; }
  .game-shell.level-2-active .table-wrap { padding: 16px; }
  .board { gap: clamp(10px, 1.25vw, 16px); padding: clamp(18px, 2.2vw, 28px); }
  .game-footer { margin-top: 12px; }
}

@media (min-width: 900px) and (max-height: 900px) {
  .game-shell { padding-top: 15px; padding-bottom: 4px; }
  .brand-mark.brand-icon { width: 42px; height: 42px; border-radius: 13px; }
  h1 { font-size: 22px; }
  .score-row { margin-top: 18px; }
  .table-wrap { margin-top: 14px; padding: 12px; }
  .board { gap: 11px; padding: 18px; }
  .game-footer { margin-top: 9px; }
}
