/* Phone-first finish. All surfaces inherit the Sponsor Studio palette. */
html { height: auto; min-height: 100%; }
body { height: auto; min-height: 100dvh; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.btn { border-color: color-mix(in srgb, var(--ink) 14%, transparent); }
.btn:focus-visible, [role="button"]:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--hl-ring); outline-offset: 3px;
}
.btn.small, .actions .btn, .bgHead .btn, .sol-header .btn, .bj-header .btn,
.vpHead .btn, .pkHead .btn, .esHead .btn { min-height: 44px; }
/* One return button across every game, independent of its local theme. */
body .btn.gameRoomBtn {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  min-height: 44px; padding: 8px 10px; border: 1px solid #3b9960;
  border-radius: 12px; background: #287a46; color: #fff;
  font: 600 12px/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  white-space: nowrap; text-decoration: none; box-shadow: none;
}
body .btn.gameRoomBtn:active { background: #205f37; }
#oppBar { flex-wrap: wrap; }
input[type="text"], input[type="number"], select { font-size: 16px; }
input[type="range"] { min-height: 44px; touch-action: pan-y; }
.sheet { max-height: calc(100dvh - 16px); overflow-y: auto; overscroll-behavior: contain; }
.sheet h2 { letter-spacing: -.025em; }

/* A small illustrated game library, sized for thumbs. */
#home { align-items: flex-start; padding: 66px 12px 24px; max-width: 560px; }
#home .home-card { max-width: 520px; padding: 0; }
#home .home-logo { width: 48px; height: 48px; margin-bottom: 8px; }
#home h1 { font-size: 1.9rem; letter-spacing: -.045em; line-height: 1.15; }
#home .tagline { max-width: 33ch; margin: 10px auto 22px; font-size: .9rem; }
#home .gamePick { gap: 10px; }
#home .gameBtn {
  position: relative; flex-direction: column; gap: 7px; min-height: 112px;
  padding: 12px 5px; border-radius: 18px; font-size: .9rem; line-height: 1.2;
  font-weight: 700; letter-spacing: -.015em; justify-content: center;
  background: var(--panel); color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
  box-shadow: 0 3px 8px color-mix(in srgb, var(--sq-border) 9%, transparent), inset 0 1px 0 #ffffff35;
}
#home .gameBtn .gIcon {
  width: 54px; height: 54px; padding: 5px; border-radius: 15px;
  background: color-mix(in srgb, var(--accent) 25%, transparent);
}
#home .gameBtn[data-game-id="checkers"] .gIcon,
#home .gameBtn[data-game-id="hangman"] .gIcon,
#home .gameBtn[data-game-id="video-poker"] .gIcon { background: color-mix(in srgb, var(--pr1) 22%, transparent); }
#home .gameBtn[data-game-id="c4"] .gIcon,
#home .gameBtn[data-game-id="twentyone"] .gIcon { background: color-mix(in srgb, var(--py1) 26%, transparent); }
#home .gameBtn:last-child:nth-child(odd) { grid-column: 1 / -1; flex-direction: row; min-height: 76px; gap: 14px; }
#home .shareApp { margin-top: 18px; border-radius: 13px; min-height: 48px; box-shadow: 0 3px 10px #00000016; }
.sponsor { overflow-wrap: anywhere; margin-top: 18px; border: 1px solid color-mix(in srgb, var(--ink) 10%, transparent); }
.sponsor img { max-width: 100%; height: auto; border-radius: 10px; }

/* Strength controls use native, keyboard-accessible range inputs. */
.difficultyControl {
  width: 100%; min-width: 0; padding: 12px 14px; border-radius: 14px;
  background: var(--panel); border: 1px solid color-mix(in srgb, var(--ink) 15%, transparent);
  text-align: left;
}
.difficultyHeader { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .85rem; font-weight: 700; }
.difficultyHeader output { border-radius: 8px; padding: 4px 8px; background: var(--accent); color: var(--accent-ink); white-space: nowrap; font-size: .78rem; }
.difficultyControl input[type="range"] { display: block; width: 100%; margin: 1px 0; accent-color: var(--hl-ring); cursor: pointer; }
.difficultyEnds { display: flex; justify-content: space-between; color: var(--ink-dim); font-size: .7rem; }
.difficultyControl .difficultyHint { margin-top: 7px; font-size: .76rem; line-height: 1.4; color: var(--ink-dim); }

/* Retain the vector art; softer shadows keep small details crisp. */
#boardWrap { border-width: 4px; border-radius: 12px; box-shadow: 0 8px 22px #00000024; }
.square .piece { filter: drop-shadow(0 1px 1px #0000004d); }
.square.c4cell::before { box-shadow: inset 0 2px 4px #00000030; }
.square .coordF, .square .coordR { opacity: 1; }
.bar { border: 1px solid color-mix(in srgb, var(--ink) 10%, transparent); }
#statusLine { line-height: 1.45; }
.bgSetup, .sol-setup, .bj-setup, .vpPanel, .pkSetup {
  border: 1px solid color-mix(in srgb, var(--ink) 13%, transparent);
  box-shadow: 0 8px 24px #0000000d; border-radius: 20px;
}
.bgPage { margin: 0 auto; }
.bgSetup, .sol-setup, .vpPanel, .pkSetup { margin-top: clamp(18px, 4vh, 36px); margin-bottom: 18px; }
.pkHeadActions, .vpHeaderActions { flex-direction: row; flex-wrap: wrap; }
.bgHead { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.bgHead > h1 { grid-column: 1 / -1; grid-row: 2; }
.bgHead .bgHeaderActions { flex-wrap: wrap; flex-direction: row; }
.bgHead > .gameRoomBtn { justify-self: end; }
.bgBoard { border-width: 4px; box-shadow: 0 6px 18px #00000024; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.bgPoint { padding: 2px 0; min-width: 0; }
.bgPoint .checker { width: min(90%, 36px); flex-shrink: 0; }
.checker.w { background: radial-gradient(circle at 35% 25%, #fff, #e7e6e0 65%, #a8acac); }
.checker.b { background: radial-gradient(circle at 35% 25%, #58616c, #252b34 65%, #090e17); }
.bgInfo { flex-wrap: wrap; gap: 6px; font-size: .8rem; }
.sol-setup > p, .drawToggle small, #solStatus, .sol-help { color: var(--ink-dim); }
.drawToggle span { background: var(--panel); border-color: color-mix(in srgb, var(--ink) 15%, transparent); }
.drawToggle input:checked + span { border-color: var(--hl-ring); background: color-mix(in srgb, var(--accent) 20%, var(--panel)); box-shadow: none; }
.drawToggle input:focus-visible + span { outline: 3px solid var(--hl-ring); outline-offset: 3px; }
.sol-board { background: color-mix(in srgb, var(--accent) 14%, transparent); box-shadow: inset 0 0 18px #0000000a; }
.sol-top, .sol-tableau { min-width: 0; }
.playing-card {
  background: linear-gradient(145deg, #fffefa, #fff 55%, #eeeae1);
  border-color: #ccc7bd; box-shadow: 0 2px 4px #00000025;
}
.playing-card.back {
  border-width: 2px; background-color: #28435d;
  background-image: repeating-linear-gradient(45deg, #ffffff15 0, #ffffff15 1px, transparent 1px, transparent 6px), repeating-linear-gradient(-45deg, #ffffff15 0, #ffffff15 1px, transparent 1px, transparent 6px);
  background-size: auto; background-position: center;
  box-shadow: inset 0 0 0 3px #28435d, inset 0 0 0 4px #ffffff6b, 0 2px 4px #00000025;
}
.playing-card.placeholder { border-color: color-mix(in srgb, var(--ink) 24%, transparent); background: color-mix(in srgb, var(--ink) 4%, transparent); }
.sol-slot.foundation .placeholder::after { color: var(--ink-dim); opacity: .55; }
.vpCard { box-shadow: 0 2px 7px #00000020; }
.vpPaytable th, .vpPaytable td.max, .vpMessage { color: var(--ink); }
.pkStatus { color: var(--ink); }
.pkSeat.me { grid-column: 1 / -1; }
.pkSeat.me .pkCard { width: clamp(44px, 13vw, 60px); }
.pkSeats[data-variant="stud"] .pkCard { width: clamp(34px, 10vw, 48px); }
.pkBoard .pkCard { width: clamp(40px, 12vw, 58px); }
.pkSeat.me .pkCard .corner, .pkBoard .pkCard .corner { font-size: clamp(.7rem, 3vw, 1rem); }
.pkCard { box-shadow: 0 2px 4px #00000025; }
@media (max-width: 620px) {
  .pkHead { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .pkTitle { grid-row: 1; grid-column: 1; text-align: left; }
  .pkHead .gameRoomBtn { grid-row: 1; grid-column: 2; }
  .pkHeadActions { grid-row: 2; grid-column: 1 / -1; flex-direction: row; }
}
@media (max-width: 380px) {
  #home { padding-inline: 10px; }
  #home .gameBtn { font-size: .82rem; }
  .sol-header { grid-template-columns: minmax(0, 1fr) auto; }
  .sol-header > div:nth-child(2) { grid-row: 2; grid-column: 1 / -1; }
  .sol-header .headerActions { flex-direction: row; flex-wrap: wrap; }
  .sol-top { grid-template-columns: repeat(2, minmax(0, 1fr)) 8px repeat(4, minmax(0, 1fr)); }
  .sol-tableau { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .difficultyControl { padding: 10px; }
}
@media (prefers-reduced-motion: reduce) { .btn:active { transform: none; } }
