/* GameHub themes (owner request, 2026-11-20).

   Each person picks a theme in Settings. A theme changes colours, lettering
   and materials only: every game keeps its layout, its rules and its pieces.
   Classic has no rules here: it keeps the colours and lettering GameHub
   always had. (The library's layout is shared by all and is in styles.css.)

   How it is built:
   1. Each theme sets the --t-* values below (and the base palette that the
      paper panels use).
   2. One shared set of rules paints the page, the library, the table, the
      hand and the buttons from those values.
   3. A few rules at the end give a theme its own material (a border, a
      shadow, a pattern).

   Phones must stay cool (DESIGN.md): nothing here animates, blurs or moves.
   Every pattern is a still background that is painted once. */

/* ---------- 1. Theme values ---------- */

/* Dark room, paper sheets: the page and the table are dark, panels stay
   light paper with dark ink, so every panel in every game stays readable. */
html[data-theme="midnight"]{
  --t-back-ink:#d9b76a;
  --t-go:#d9b76a;--t-go-ink:#1a1405;--t-go-edge:#a8873f;--t-alt:transparent;--t-alt-ink:#e6c988;--t-alt-edge:#d9b76a;
  --t-hand-cue:#18243d;--t-tray-cue:#18243d;
  --green:#1b3a6b;--green-mid:#24508f;--gold:#c9a45c;--paper:#f1ecdf;--white:#fbf8f0;--ink:#16202e;--muted:#566178;--line:#d9d4c4;
  --t-page:#0b1220;--t-page-ink:#f3eedf;--t-page-muted:#a9b4c9;
  --t-surface:#131c2f;--t-surface-ink:#f3eedf;--t-surface-muted:#a9b4c9;--t-line:#2c3a57;
  --t-accent:#d9b76a;--t-accent-ink:#1a1405;--t-accent-edge:#a8873f;
  --t-felt:radial-gradient(ellipse at 50% 40%,#26569a 0%,#15325f 55%,#0c1d3d 100%);--t-felt-edge:#d9b76a8c;--t-felt-ink:#f3eedf;--t-felt-soft:#c9d3e6;
  --t-seat:#0b1220cc;--t-seat-ink:#f3eedf;--t-seat-line:#f3eedf3d;
  --t-hand:#0f1728;--t-hand-ink:#f3eedf;--t-hand-muted:#a9b4c9;--t-hand-line:#2c3a57;
  --t-tray:#0f1728;--t-tray-ink:#f3eedf;--t-tray-line:#3a4a6b;
  --t-art:radial-gradient(ellipse at 50% 30%,#24508f,#12284f 85%);
  --t-back:#0e1a33;--t-back-edge:#d9b76a;
  --t-display:Didot,"Bodoni 72","Playfair Display",Georgia,"Times New Roman",serif;
  --t-ui:ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  --t-radius:16px;
}
html[data-theme="mysore"]{
  --t-back-ink:#f2a83b;
  --t-go:#f2a83b;--t-go-ink:#2a1203;--t-go-edge:#b9781c;--t-alt:transparent;--t-alt-ink:#ffc766;--t-alt-edge:#f2a83b;
  --t-hand-cue:#3a1c47;--t-tray-cue:#2c1238;
  --green:#7a1e2e;--green-mid:#96293c;--gold:#d9952b;--paper:#f7ecd8;--white:#fdf6e6;--ink:#2a1220;--muted:#6b5560;--line:#e3d3b8;
  --t-page:#23102b;--t-page-ink:#fbf1de;--t-page-muted:#d9c6d6;
  --t-surface:#33193d;--t-surface-ink:#fbf1de;--t-surface-muted:#d9c6d6;--t-line:#56306a;
  --t-accent:#f2a83b;--t-accent-ink:#2a1203;--t-accent-edge:#b9781c;
  --t-felt:radial-gradient(ellipse at 50% 40%,#96293c 0%,#651727 60%,#4a0f1c 100%);--t-felt-edge:#d9a441;--t-felt-ink:#fbf1de;--t-felt-soft:#f1d9cf;
  --t-seat:#2e0912d9;--t-seat-ink:#fbf1de;--t-seat-line:#f2a83b80;
  --t-hand:#2a1433;--t-hand-ink:#fbf1de;--t-hand-muted:#d9c6d6;--t-hand-line:#56306a;
  --t-tray:#1b0b22;--t-tray-ink:#fbf1de;--t-tray-line:#6a4674;
  --t-art:radial-gradient(ellipse at 30% 0%,#8e2638,#5c1423 80%);
  --t-back:#23102b;--t-back-edge:#f2a83b;
  --t-display:"Rozha One","Hoefler Text",Baskerville,Georgia,"Times New Roman",serif;
  --t-ui:Hind,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  --t-radius:16px;
}
html[data-theme="walnut"]{
  --t-back-ink:#f4ebd8;
  --t-go:#d9b45e;--t-go-ink:#2a1a08;--t-go-edge:#7a5a1c;--t-alt:transparent;--t-alt-ink:#f0d48e;--t-alt-edge:#c9a04e;
  --t-hand-cue:#3a2415;--t-tray-cue:#402817;
  --green:#1f4d35;--green-mid:#2a6145;--gold:#c9a04e;--paper:#efe4cc;--white:#f8f1e0;--ink:#2a1a12;--muted:#6b5744;--line:#d8c9a8;
  --t-page:#3a2415;--t-page-ink:#f4ebd8;--t-page-muted:#e0cdb2;
  --t-surface:#f4ebd8;--t-surface-ink:#2a1a12;--t-surface-muted:#6b5744;--t-line:#8a6a2c;
  --t-accent:#d9b45e;--t-accent-ink:#2a1a08;--t-accent-edge:#7a5a1c;
  --t-felt:radial-gradient(ellipse at 50% 38%,#3f8760 0%,#2a6145 55%,#1d4932 100%);--t-felt-edge:#2e1c10;--t-felt-ink:#f4ebd8;--t-felt-soft:#e3ede2;
  --t-seat:#2a1a12d9;--t-seat-ink:#f4ebd8;--t-seat-line:#c9a04e99;
  --t-hand:#2a1a12;--t-hand-ink:#f4ebd8;--t-hand-muted:#e0cdb2;--t-hand-line:#6b4e2c;
  --t-tray:#2e1c10;--t-tray-ink:#f4ebd8;--t-tray-line:#6b4e2c;
  --t-art:radial-gradient(ellipse at 30% 0%,#3c8059,#1f4d35 85%);
  --t-back:#8e2f2a;--t-back-edge:#f4ebd8;
  --t-display:Rockwell,"Rockwell Nova","Roboto Slab","American Typewriter",Georgia,serif;
  --t-ui:ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  --t-radius:10px;
}
/* Light themes: the whole base palette changes with them. */
html[data-theme="clubhouse"]{
  --t-back-ink:#f3e9c9;
  --t-go:#173f35;--t-go-ink:#fffdf7;--t-go-edge:#173f35;--t-alt:#ebcb8b;--t-alt-ink:#1d2a14;--t-alt-edge:#c9a259;
  --t-hand-cue:#fff6dc;--t-tray-cue:#fff6dc;
  --t-page:#f5f2e9;--t-page-ink:#1d352d;--t-page-muted:#58655d;
  --t-surface:#fffdf7;--t-surface-ink:#1d352d;--t-surface-muted:#58655d;--t-line:#d3d5c6;
  --t-accent:#ebcb8b;--t-accent-ink:#1d2a14;--t-accent-edge:#c9a259;
  --t-felt:radial-gradient(ellipse at 48% 34%,#2f6350 0%,#173f35 82%);--t-felt-edge:#10352b;--t-felt-ink:#fffdf7;--t-felt-soft:#d6e2da;
  --t-seat:#081e1899;--t-seat-ink:#fffdf7;--t-seat-line:#fffdf733;
  --t-hand:#fffdf7;--t-hand-ink:#1d352d;--t-hand-muted:#58655d;--t-hand-line:#dedfd3;
  --t-tray:#fffdf7;--t-tray-ink:#1d352d;--t-tray-line:#c9cdbb;
  --t-art:radial-gradient(ellipse at 40% 0%,#2d5e4c,#173f35);
  --t-back:#7f9a8a;--t-back-edge:#f3e9c9;
  --t-display:Georgia,"Times New Roman",serif;
  --t-ui:ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  --t-radius:16px;
}
html[data-theme="pop"]{
  --t-back-ink:#1f1647;
  --t-go:#5b3df5;--t-go-ink:#ffffff;--t-go-edge:#3d22c9;--t-alt:#ffc531;--t-alt-ink:#1f1647;--t-alt-edge:#c99000;
  --t-hand-cue:#fff6d6;--t-tray-cue:#fff6d6;
  --green:#5b3df5;--green-mid:#7b61ff;--gold:#ffc531;--paper:#f3f0ff;--white:#ffffff;--ink:#1f1647;--muted:#51487a;--line:#d9d2ff;
  --t-page:#f3f0ff;--t-page-ink:#1f1647;--t-page-muted:#51487a;
  --t-surface:#ffffff;--t-surface-ink:#1f1647;--t-surface-muted:#51487a;--t-line:#d9d2ff;
  --t-accent:#ffc531;--t-accent-ink:#1f1647;--t-accent-edge:#c99000;
  --t-felt:radial-gradient(ellipse at 50% 40%,#7b61ff 0%,#5b3df5 55%,#4a2de0 100%);--t-felt-edge:#ffffff;--t-felt-ink:#ffffff;--t-felt-soft:#ece8ff;
  --t-seat:#2e1aa8;--t-seat-ink:#ffffff;--t-seat-line:#ffffff59;
  --t-hand:#ffffff;--t-hand-ink:#1f1647;--t-hand-muted:#51487a;--t-hand-line:#d9d2ff;
  --t-tray:#ffffff;--t-tray-ink:#1f1647;--t-tray-line:#d9d2ff;
  --t-art:radial-gradient(ellipse at 40% 0%,#7b61ff,#4a2de0);
  --t-back:#ffc531;--t-back-edge:#ffffff;
  --t-display:ui-rounded,"SF Pro Rounded","Arial Rounded MT Bold","Baloo 2",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  --t-ui:ui-rounded,"SF Pro Rounded","Arial Rounded MT Bold","Baloo 2",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  --t-radius:20px;
}

/* ---------- 2. Shared rules ---------- */

html[data-theme]{font-family:var(--t-ui);background:var(--t-page)}
html[data-theme] body{background:var(--t-page) fixed!important}
html[data-theme] h1,html[data-theme] h2,html[data-theme] .serif,html[data-theme] .brand-name,html[data-theme] .game-tile-name{font-family:var(--t-display)}

/* Words that sit straight on the page. */
html[data-theme] .brand-name,html[data-theme] .page-intro h1,html[data-theme] .table-heading h1,html[data-theme] .library-home>h1,html[data-theme] .audience-lobby-intro h1{color:var(--t-page-ink)}
html[data-theme] .table-heading,html[data-theme] .round-chip,html[data-theme] .page-intro p,html[data-theme] .audience-count{color:var(--t-page-muted)}

/* Top bar. */
html[data-theme] .app-header{border-bottom-color:var(--t-line)}
html[data-theme] .brand-mark{background:var(--t-accent);color:var(--t-accent-ink)}
html[data-theme] .library-settings-button,html[data-theme] .icon-button{background:var(--t-surface);color:var(--t-surface-ink);border-color:var(--t-line)}
html[data-theme] .say-menu{background:var(--t-surface);border-color:var(--t-line)}
html[data-theme] .say-float .say-button{background:var(--t-surface);color:var(--t-surface-ink);border-color:var(--t-line)}
html[data-theme] .say-button[aria-expanded="true"],html[data-theme] .say-float .say-button[aria-expanded="true"]{background:var(--t-accent);color:var(--t-accent-ink);border-color:var(--t-accent-edge)}
html[data-theme] .say-choice:hover{background:var(--t-line)}
html[data-theme] .back-to-games{background:var(--t-accent);color:var(--t-accent-ink);border-color:var(--t-accent-edge)}

/* Library. Its layout (your table, the open tables, compact tiles in two
   groups) is the same in every theme and in Classic, and lives in styles.css.
   A theme only repaints it. */
html[data-theme] .library-group>h2{color:var(--t-page-ink)}
html[data-theme] .game-tile{border-radius:var(--t-radius);background:var(--t-surface);color:var(--t-surface-ink);border-color:var(--t-line)}
html[data-theme] .game-tile:hover{border-color:var(--t-accent)}
html[data-theme] .game-tile-art{background:var(--t-art)}
html[data-theme] .game-tile-meta{color:var(--t-surface-muted)}
html[data-theme] .game-grid>.game-tile.tile-lifted,html[data-theme] .game-grid>.game-tile.tile-lifted:hover{border-color:var(--t-accent);box-shadow:0 14px 30px #00000059}
html[data-theme] .hub-resume{border-radius:var(--t-radius);border-color:var(--t-felt-edge);background:var(--t-felt);color:var(--t-felt-ink)}
html[data-theme] .hub-resume-text strong{font-family:var(--t-display);font-weight:600}
html[data-theme] .hub-resume-text small{color:var(--t-felt-soft)}
html[data-theme] .hub-resume-go{background:var(--t-accent);color:var(--t-accent-ink)}
html[data-theme] .hub-table{border-radius:var(--t-radius);border-color:var(--t-line);background:var(--t-surface);color:var(--t-surface-ink)}
html[data-theme] .hub-table small{color:var(--t-surface-muted)}

/* The table: felt, seats and the turn mark. Sizes and places are untouched. */
html[data-theme] body .game-surface{background:var(--t-felt);border-color:var(--t-felt-edge);color:var(--t-felt-ink)}
html[data-theme] body .game-surface.your-turn{box-shadow:inset 0 0 0 2px var(--t-accent)}
html[data-theme] body .turn-indicator{background:var(--t-accent);color:var(--t-accent-ink)}
html[data-theme] body .player-seat .name{background:var(--t-seat);color:var(--t-seat-ink);border-color:var(--t-seat-line)}
html[data-theme] body .player-seat.active .name,html[data-theme] body .player-seat.you.active .name{background:var(--t-accent);color:var(--t-accent-ink);border-color:var(--t-accent-edge)}
html[data-theme] body .pile-label,html[data-theme] body .pile-caption,html[data-theme] body .pile-caption strong,html[data-theme] body .deck-count{color:var(--t-felt-soft)}

/* Card backs and the small fans beside each seat. */
html[data-theme] body .playing-card.back,html[data-theme] body .memory-inner,html[data-theme] body .donkey-pile-back,html[data-theme] body .bj-shoe-back,html[data-theme] body .bj-hole-cover .playing-card:after{background-color:var(--t-back);border-color:var(--t-back-edge)}
html[data-theme] body .card-back-symbol{color:var(--t-back-ink);border-color:var(--t-back-edge)}
html[data-theme] body .tap-to-reveal{color:var(--t-back-ink)}
html[data-theme] body .seat-fan i{background-color:var(--t-back);border-color:var(--t-back-edge);box-shadow:none}

/* Your hand and the buttons under it. */
html[data-theme] body .hand-area{background:var(--t-hand);color:var(--t-hand-ink);border-color:var(--t-hand-line);box-shadow:none}
html[data-theme] body .hand-area h2,html[data-theme] body .hand-area h3,html[data-theme] body .hand-area strong{color:var(--t-hand-ink)}
html[data-theme] body .hand-area .muted,html[data-theme] body .hand-area .hint,html[data-theme] body .hand-area small{color:var(--t-hand-muted)}
html[data-theme] body .hand-area .text-button{background:var(--t-surface);color:var(--t-surface-ink);border-color:var(--t-line)}
html[data-theme] body .move-controls{background:var(--t-tray);color:var(--t-tray-ink);border-color:var(--t-tray-line);backdrop-filter:none;-webkit-backdrop-filter:none;box-shadow:none}
html[data-theme] body .move-controls .hint,html[data-theme] body .move-controls p,html[data-theme] body .move-controls strong{color:var(--t-tray-ink)}
html[data-theme] body .move-controls .btn{background:var(--t-go);color:var(--t-go-ink);border-color:var(--t-go-edge)}
html[data-theme] body .move-controls .btn.gold{background:var(--t-alt);color:var(--t-alt-ink);border-color:var(--t-alt-edge)}
html[data-theme] body .move-controls .btn.secondary{background:transparent;color:var(--t-tray-ink);border-color:var(--t-tray-line)}

/* Your turn: the same still tint and ring as Classic, in the theme's colours.
   The base stylesheet fades these layers in and out a few times and stops. */
html[data-theme] body.turn-pulse .hand-area{background-color:var(--t-hand);background-image:none;box-shadow:none}
html[data-theme] body.turn-pulse .hand-area::before{background:var(--t-hand-cue);box-shadow:inset 0 0 0 2px var(--t-accent)}
html[data-theme] body.turn-pulse .my-move{background-color:var(--t-tray);border-color:var(--t-accent);box-shadow:none}
html[data-theme] body.turn-pulse .my-move::before{background:var(--t-tray-cue);box-shadow:none}
html[data-theme] body .hand-selection-hint,html[data-theme] body .hand-area .empty-hand{color:var(--t-hand-muted)}
html[data-theme] body .move-prompt,html[data-theme] body.turn-pulse .my-move .move-prompt,html[data-theme] body.turn-arrival .my-move .move-prompt{color:var(--t-tray-ink)}

/* ---------- 3. Each theme's own material ---------- */

/* Mysore Heritage: a still kolam dot ground and a double zari border on the felt. */
html[data-theme="mysore"] body{background:radial-gradient(#f2a83b29 1.2px,transparent 1.5px) 0 0/18px 18px,#23102b!important}
html[data-theme="mysore"] body .game-surface{box-shadow:inset 0 0 0 5px #4a0f1c,inset 0 0 0 6px #d9a441bf}
html[data-theme="mysore"] body .game-surface.your-turn{box-shadow:inset 0 0 0 2px #f2a83b,inset 0 0 0 5px #4a0f1c,inset 0 0 0 6px #d9a441bf}

/* Pop Arcade: chunky buttons with a hard edge under them and a white rail. */
html[data-theme="pop"] .game-tile{box-shadow:0 4px 0 #c9c0f5}
html[data-theme="pop"] .btn,html[data-theme="pop"] .back-to-games{font-weight:800}
html[data-theme="pop"] body .game-surface{box-shadow:inset 0 0 0 4px #ffffff}
html[data-theme="pop"] body .game-surface.your-turn{box-shadow:inset 0 0 0 4px #ffc531}
html[data-theme="pop"] body .move-controls .btn{box-shadow:0 4px 0 #3d22c9}
html[data-theme="pop"] body .move-controls .btn.gold{box-shadow:0 4px 0 #c99000}
html[data-theme="pop"] body .move-controls .btn.secondary{background:#ffffff;color:#1f1647;border-color:#d9d2ff;box-shadow:0 4px 0 #d9d2ff}
html[data-theme="pop"] .hub-resume-go{box-shadow:0 4px 0 #c99000}
html[data-theme="pop"] body .tap-to-reveal{text-shadow:none}

/* Walnut Table: a wood ground, a wood rail round the baize and brass buttons. */
html[data-theme="walnut"] body{background:repeating-linear-gradient(90deg,#0000001f 0,#0000001f 2px,transparent 2px,transparent 9px,#ffffff09 9px,#ffffff09 10px,transparent 10px,transparent 23px),linear-gradient(180deg,#4a2e1b,#33200f)!important}
html[data-theme="walnut"] body .game-surface{box-shadow:inset 0 0 0 6px #6b4326,inset 0 0 0 7px #2e1c10,inset 0 12px 20px #00000059}
html[data-theme="walnut"] body .game-surface.your-turn{box-shadow:inset 0 0 0 2px #e6c57a,inset 0 0 0 6px #6b4326,inset 0 0 0 7px #2e1c10,inset 0 12px 20px #00000059}
html[data-theme="walnut"] .back-to-games,html[data-theme="walnut"] body .move-controls .btn:not(.secondary):not(.gold),html[data-theme="walnut"] .hub-resume-go{background:linear-gradient(180deg,#f6dfa6,#d9b45e 55%,#b58d34)}
