/* Snap! Two big pads at the ends of the screen (one per player, their text turned to face them) and the pile in the
   middle: the card underneath sits up-left, the newest card down-right, so both are always in view. */
.sn-main {
  --left: #2b6a93; --left-dark: #1f5274; --right: #d07a2a; --right-dark: #a85d18;
  --card-h: min(calc(100vh - 330px), 30vw, 420px); --card-w: calc(var(--card-h) * 0.72);
  flex-direction: row; align-items: stretch; justify-content: space-between; gap: clamp(12px, 2vw, 32px);
}

/* ---------- pads ---------- */
.sn-pad {
  flex: none; width: clamp(140px, 17vw, 260px); min-height: var(--tap); padding: 0; border: 0; border-radius: 28px;
  color: #fff; cursor: pointer; touch-action: none; display: grid; place-items: center; overflow: hidden;
  box-shadow: inset 0 -10px 0 rgba(0,0,0,0.18); transition: transform 0.08s, filter 0.2s;
}
.sn-pad[data-pad="0"] { background: radial-gradient(circle at 50% 40%, #3a82b0, var(--left) 60%, var(--left-dark)); }
.sn-pad[data-pad="1"] { background: radial-gradient(circle at 50% 40%, #e8913f, var(--right) 60%, var(--right-dark)); }
.sn-pad:active, .sn-pad.is-down { transform: scale(0.97); }
.sn-pad[aria-disabled="true"] { cursor: default; filter: saturate(0.55) brightness(0.95); }
.sn-pad.is-computer { cursor: default; }
.sn-pad-in { display: flex; flex-direction: column; align-items: center; gap: 0.25em; white-space: nowrap; }
/* Text faces the player sitting at that end. */
.sn-pad[data-pad="0"] .sn-pad-in { transform: rotate(90deg); }
.sn-pad[data-pad="1"] .sn-pad-in { transform: rotate(-90deg); }
.sn-pad strong { font-family: var(--sans); font-weight: 600; font-size: clamp(2.6rem, 4.6vw, 4.6rem); letter-spacing: 0.03em; line-height: 1; }
.sn-pad-name { font-family: var(--serif); font-size: 1.6rem; }
.sn-pad-count { font-size: 1.15rem; opacity: 0.92; }
.sn-pad kbd { font: inherit; font-size: 0.85rem; padding: 0 0.5em; border-radius: 6px; border: 1px solid rgba(255,255,255,0.5); opacity: 0.75; }
.sn-pad.is-computer kbd { display: none; }
.sn-pad.is-win { animation: sn-win 0.6s ease-out; }
.sn-pad.is-wrong { animation: sn-wrong 0.4s ease; }
@keyframes sn-win { 0% { box-shadow: inset 0 0 0 0 #fff; } 40% { box-shadow: inset 0 0 0 14px #fff; } 100% { box-shadow: inset 0 -10px 0 rgba(0,0,0,0.18); } }
@keyframes sn-wrong { 20% { transform: translateY(-14px); filter: brightness(0.7); } 60% { transform: translateY(14px); } 100% { transform: none; } }

/* ---------- centre ---------- */
.sn-centre { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.sn-options { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.sn-options .is-hidden, .sn-options[hidden] { display: none; }
.sn-options .choice button { white-space: nowrap; }
.sn-pile { position: relative; width: calc(var(--card-w) * 2.1); height: calc(var(--card-h) * 1.12); display: grid; place-items: center; }
.sn-start { min-height: 96px; min-width: 220px; font-size: 1.8rem; border-radius: 24px; position: relative; z-index: 5; }
.sn-start[hidden] { display: none; }
.sn-count-down { font-family: var(--serif); font-size: calc(var(--card-h) * 0.5); color: var(--sea-deep); z-index: 5; }
.sn-card {
  position: absolute; left: 50%; top: 50%; width: var(--card-w); height: var(--card-h);
  border-radius: 22px; background: var(--cream); box-shadow: 0 0 0 2px var(--rule), 0 10px 26px rgba(22,44,51,0.22);
  display: grid; place-items: center;
}
.sn-card svg { width: 80%; height: 80%; }
.sn-card.is-under { transform: translate(-98%, -53%) rotate(-5deg); }
.sn-card.is-top { transform: translate(-2%, -47%) rotate(var(--tilt, 4deg)); }
.sn-card.is-new { animation: sn-flip 0.22s ease-out; }
@keyframes sn-flip { from { transform: translate(-2%, -47%) rotate(var(--tilt, 4deg)) rotateY(90deg) scale(1.08); } }
.sn-card.is-under.is-match, .sn-card.is-top.is-match { box-shadow: 0 0 0 7px var(--good), 0 10px 26px rgba(22,44,51,0.22); }
.sn-card.is-gone { transition: transform 0.45s ease-in, opacity 0.45s ease-in; opacity: 0; }
.sn-card.is-gone.to-0 { transform: translate(-260%, -50%) rotate(-30deg); }
.sn-card.is-gone.to-1 { transform: translate(160%, -50%) rotate(30deg); }
.sn-message { min-height: 2.6em; font-size: 1.7rem; max-width: 100%; }
.sn-pile-count { font-size: 1.05rem; color: #5d646a; min-height: 1.4em; }

@media (prefers-reduced-motion: reduce) {
  .sn-pad.is-win, .sn-pad.is-wrong, .sn-card.is-new { animation: none; }
  .sn-card.is-gone { transition: none; }
}
