/* HolyMoly theme: black, gold, emerald, charcoal, warm amber. */
:root {
    --black: #0b0b0b; --charcoal: #2b2b2b; --charcoal-2: #1a1a1a; --gold: #c9a227; --gold-2: #f0d060;
    --emerald: #0f6b4f; --emerald-2: #19a37a; --amber: #ffb347; --cream: #f4e9c8; --muted: #9a9a9a;
    --felt: #0d4a36; --felt-edge: #083424; --danger: #d94b4b;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 80px; }
html, body { margin: 0; background: var(--black); color: var(--cream); font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; }
a { color: var(--gold-2); }
h1, h2, h3 { margin: 0 0 8px; letter-spacing: .3px; }
h1 { font-size: 1.8rem; }
h1:focus { outline: none; }
/* Keyboard focus is always visible (H-29): a gold ring on anything you can tab to. Mouse and touch never show it. */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
summary:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--gold-2); outline-offset: 3px; border-radius: 8px; }
section[id] { scroll-margin-top: 80px; }
.muted { color: var(--muted); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.card { background: linear-gradient(180deg, #171717, #111); border: 1px solid var(--charcoal); border-radius: 14px; padding: 16px; }
/* Buttons in the style of the HolyMoly logo: a glossy black face inside a rounded gold-metal frame, gold lettering.
   Primary actions are solid gold metal like the wordmark; colored variants keep their face color inside the same frame. */
:root {
    --metal: linear-gradient(135deg, #fff2a8 0%, #f0d060 18%, #c9a227 42%, #7a5e12 62%, #e8c45a 82%, #fff2a8 100%);
    --gloss: linear-gradient(180deg, rgba(255,255,255,.16) 0%, rgba(255,255,255,.04) 45%, rgba(0,0,0,0) 50%, rgba(0,0,0,.25) 100%);
}
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; position: relative;
    border: 2px solid transparent; border-radius: 14px; padding: 10px 18px;
    background: var(--gloss) padding-box, linear-gradient(180deg, #1c1c1c, #070707) padding-box, var(--metal) border-box;
    color: var(--gold-2); font-weight: 800; letter-spacing: .4px; font-size: .95rem; text-decoration: none;
    text-shadow: 0 1px 0 #000, 0 0 10px rgba(240,208,96,.25);
    box-shadow: 0 2px 0 #000, 0 6px 14px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.12);
    transition: transform .08s, box-shadow .15s, filter .15s;
}
.btn:hover { box-shadow: 0 2px 0 #000, 0 6px 18px rgba(0,0,0,.6), 0 0 14px rgba(240,208,96,.35), inset 0 1px 0 rgba(255,255,255,.18); filter: brightness(1.08); }
.btn:active { transform: translateY(1px); box-shadow: 0 1px 0 #000, 0 3px 8px rgba(0,0,0,.5); }
.btn:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 3px; }
.btn:disabled, .btn.disabled { cursor: not-allowed; filter: grayscale(.85) brightness(.7); box-shadow: 0 2px 0 #000; }
.btn.gold {
    background: var(--gloss) padding-box, linear-gradient(180deg, #fff2a8 0%, #f0d060 22%, #c9a227 55%, #8a6d14 100%) padding-box,
        linear-gradient(135deg, #fffbe0, #c9a227 40%, #5c460c 70%, #fff2a8) border-box;
    color: #0b0b0b; text-shadow: 0 1px 0 rgba(255,242,168,.6);
}
.btn.emerald {
    background: var(--gloss) padding-box, linear-gradient(180deg, #23c08f, #0f6b4f 70%, #08402f) padding-box, var(--metal) border-box;
    color: #fff; text-shadow: 0 1px 0 #04291d;
}
.btn.amber {
    background: var(--gloss) padding-box, linear-gradient(180deg, #ffcf7a, #ffb347 40%, #c97a12) padding-box, var(--metal) border-box;
    color: #0b0b0b; text-shadow: 0 1px 0 rgba(255,230,180,.6);
}
.btn.danger {
    background: var(--gloss) padding-box, linear-gradient(180deg, #ee6b6b, #d94b4b 45%, #8e2323) padding-box, var(--metal) border-box;
    color: #fff; text-shadow: 0 1px 0 #4a0f0f;
}
.btn.big { padding: 16px 22px; font-size: 1.05rem; border-radius: 18px; }
.btn.small { padding: 4px 10px; font-size: .75rem; border-radius: 10px; }
.btn.block { width: 100%; }
.tag { display: inline-block; font-size: .7rem; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: #222; color: var(--muted); }
.tag.gold { background: var(--gold); color: var(--black); }
.tag.emerald { background: var(--emerald); color: #fff; }   /* the darker green: white text on it passes WCAG AA */
.tag.amber { background: var(--amber); color: var(--black); }
.tag.danger { background: var(--danger); color: #fff; }
.grid { display: grid; gap: 12px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.tiles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.sandbox { border: 1px dashed var(--amber); background: #1d1708; color: var(--amber); padding: 10px 12px; border-radius: 10px; font-size: .85rem; }
.notice { border-left: 3px solid var(--gold); background: #141414; padding: 10px 12px; border-radius: 8px; font-size: .9rem; }
table.list { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.list th, table.list td { text-align: left; padding: 8px 6px; border-bottom: 1px solid #222; }
table.list th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .5px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.progress { height: 8px; background: #222; border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-2)); }
input.text { background: #161616; color: var(--cream); border: 1px solid #3a3a3a; border-radius: 8px; padding: 10px 12px; font-size: 1rem; width: 100%; }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(201,162,39,.55); } 50% { box-shadow: 0 0 0 10px rgba(201,162,39,0); } }
.pop { animation: pop .35s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.slide-in { animation: slidein .4s ease-out both; }
@keyframes slidein { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.78); display: flex; overflow-y: auto; overscroll-behavior: contain; z-index: 50; padding: 16px; }
/* Centred when it fits; when a card is taller than the screen it starts at the top and the overlay scrolls. */
.overlay > * { margin: auto; }
/* A hand or game result waits for the domino slam (and the Capicu burst) to play first. */
.after-domino { animation: holdoff 1.7s steps(1, end) both; }
.after-capicu { animation: holdoff 3.9s steps(1, end) both; }
/* A locked hand: the LOCKED banner holds over the board first. */
.after-lock { animation: holdoff 2.2s steps(1, end) both; }
@keyframes holdoff { 0%, 99% { opacity: 0; pointer-events: none; } 100% { opacity: 1; } }
.overlay .card { max-width: 520px; width: 100%; border-color: var(--gold); box-shadow: 0 20px 60px rgba(0,0,0,.6); }
@media (prefers-reduced-motion: reduce) { .pulse, .pop, .slide-in { animation: none; } }
/* A crash: the page's card (PageErrorBoundary), or this bar when the whole connection is lost. Blazor shows the bar. */
.card.crash { max-width: 560px; margin: 24px auto; border-color: var(--gold); box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.card.crash h2 { color: var(--gold-2); margin-top: 0; }
/* The full error page (Error.razor), for a request that failed on the server. */
.card.server-error { max-width: 560px; margin: 32px auto; text-align: center; border-color: var(--gold); display: grid; justify-items: center; gap: 6px; }
.card.server-error h1 { color: var(--gold-2); margin: 4px 0 0; }
.card.server-error .mark { border-radius: 16px; }
.card.server-error .row { justify-content: center; margin-top: 6px; }
#blazor-error-ui {
    display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
    padding: 12px max(16px, env(safe-area-inset-left)) calc(12px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-right));
    background: #141414; border-top: 2px solid var(--gold); color: #eee; text-align: center; box-shadow: 0 -10px 30px rgba(0,0,0,.6);
}
#blazor-error-ui .btn { margin-left: 10px; }
.table-people { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.person { display: flex; gap: 8px; align-items: center; background: #141414; border: 1px solid #262626; border-radius: 10px; padding: 6px 10px; font-size: .9rem; }
.broke { border-color: var(--amber); }
.broke .btn { margin: 8px 8px 8px 0; }

/* Legal pages: readable line length, plain lists. */
.legal-page { max-width: 820px; margin: 0 auto; line-height: 1.6; }
.legal-page h1 { margin-bottom: 4px; }
.legal-page h2 { margin-top: 22px; font-size: 1.15rem; }
.legal-page ul { padding-left: 20px; }
.legal-page li { margin: 6px 0; }
footer.legal .legal-links { margin-top: 6px; }
footer.legal .legal-links a { color: inherit; text-decoration: underline; }


/* Admin pages */
.admin-nav { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; padding: 8px 12px; border: 1px solid #333; border-radius: 12px; }
.admin-nav a { color: inherit; }
.card.stat { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit; }
.card.stat strong { font-size: 2rem; }
.admin-account { user-select: all; font-size: 1rem; }
.report-player summary { cursor: pointer; }

/* Icon buttons (issue #106): the icon over its name, no box; a chip under it for a price or an on/off state. */
.icon-btn { position: relative; display: inline-grid; justify-items: center; align-content: start; gap: 4px; padding: 4px 6px; background: none; border: 0;
    color: var(--gold-2); font: inherit; font-weight: 800; font-size: .85rem; text-align: center; text-decoration: none; cursor: pointer; border-radius: 12px; }
.icon-btn img { width: 56px; height: 56px; filter: drop-shadow(0 5px 9px rgba(0,0,0,.6)); transition: transform .15s ease, filter .15s ease; }
.icon-btn:hover img, .icon-btn:focus-visible img { transform: translateY(-2px) scale(1.06); filter: drop-shadow(0 7px 14px rgba(240,208,96,.35)); }
.icon-btn:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; }
.icon-btn:disabled { cursor: default; opacity: .45; filter: grayscale(.7); }
.icon-btn:disabled:hover img { transform: none; }
.icon-btn.lg img { width: 76px; height: 76px; }
.icon-btn.sm img { width: 40px; height: 40px; }
.icon-btn .chip { font-size: .7rem; font-weight: 800; padding: 2px 9px; border-radius: 999px; background: var(--gold); color: var(--black); white-space: nowrap; }
.icon-btn .chip.on { background: var(--emerald); color: #fff; }
.icon-btn .chip.off { background: var(--charcoal); color: #bbb; }
.icon-row { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
@media (prefers-reduced-motion: reduce) { .icon-btn img { transition: none; } }

/* Rules & Help (Rules.razor): a tab per topic. Each is a link (/rules#odds); the chosen one shows, the first by default. */
.help-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 14px; }
.help-tabs a { font-size: .85rem; font-weight: 800; border: 1px solid #333; border-radius: 999px; padding: 6px 12px; color: #c9c3b3; text-decoration: none; }
.help-tabs a:hover { border-color: var(--gold); }
.help-tabs a.on { background: var(--gold); color: #111; border-color: var(--gold); }
.help-panel { display: none; scroll-margin-top: 80px; }
.help-panel:target, .help-panels:not(:has(.help-panel:target)) .help-panel:first-child { display: block; }
table.odds td.num, table.odds th.num { text-align: right; font-variant-numeric: tabular-nums; }
.odds-link { font-size: .8rem; color: var(--gold-2); text-decoration: underline; }
.btn.block + .odds-link { display: block; text-align: center; margin-top: 6px; }


/* The shuffle before the deal (shuffle.js, issue #179): face-down bones flying over the page; your real bones wait hidden. */
.hm-shuffle { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.hm-shuffle.skippable { pointer-events: auto; cursor: pointer; }
.hm-bone { position: absolute; left: 0; top: 0; border-radius: 4px; will-change: transform;
    background: radial-gradient(circle at 50% 50%, var(--gold-2) 0 9%, transparent 10%), linear-gradient(145deg, #3a1d4f, #26123a);
    border: 2px solid var(--gold); box-shadow: 0 3px 8px rgba(0,0,0,.5); }
.hm-skip { position: absolute; transform: translate(-50%, -50%); font-size: .8rem; padding: 4px 12px; border-radius: 999px; background: rgba(0,0,0,.65); color: var(--cream); }
body.hm-dealing .hand-area .hand > * { visibility: hidden; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; border: 0; padding: 0; margin: 0; }
.seg label { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid #3a3a3a; border-radius: 999px; cursor: pointer; font-weight: 700; font-size: .9rem; }
.seg input { accent-color: var(--gold); }
.seg label:has(input:checked) { border-color: var(--gold); background: rgba(201,162,39,.15); color: var(--gold-2); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--gold-2); outline-offset: 2px; }
