/* Guess My Neighbour (26120504). Built on the Fun Puzzles tokens; the tray and cards keep their own colours in every palette. */
#guess-my-neighbour { --tray:#11706b; --tray-dark:#0b4f4b; --card:#fff8e6; --card-ink:#1d1526; --yes:#17703d; --no:#b3261e; --brand:var(--vl-royal,var(--accent)); font-size:15px; line-height:1.5; max-width:1360px; margin:auto; padding:0 24px 40px }
#guess-my-neighbour * { box-sizing:border-box; min-width:0 }
#guess-my-neighbour [hidden] { display:none !important }
#guess-my-neighbour button { font:inherit; color:inherit; cursor:pointer }
#guess-my-neighbour button:disabled, #guess-my-neighbour [aria-disabled=true] { cursor:default; opacity:.5 }
/* AC-019: a focused card is never hidden under the sticky bar at the top or the Ask bar at the bottom. */
:root:has(#guess-my-neighbour) { scroll-padding-top:110px; scroll-padding-bottom:16px }
#gmn-message:focus { outline:none }
#guess-my-neighbour button:focus-visible, #guess-my-neighbour input:focus-visible, #guess-my-neighbour a:focus-visible { outline:3px solid var(--brand); outline-offset:3px }
#guess-my-neighbour h1, #guess-my-neighbour h2, #guess-my-neighbour h3 { letter-spacing:-.02em; line-height:1.15; margin:0 }
#guess-my-neighbour p { margin:0 0 8px }
.gmn-sr { position:absolute !important; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap }

.gmn-head { display:flex; flex-wrap:wrap; align-items:center; gap:8px 20px; padding:18px 0 16px }
.gmn-back { display:inline-flex; align-items:center; min-height:44px; min-width:44px; font-size:13px; color:var(--muted) }
.gmn-head > .gmn-back { flex:0 0 100% }
.gmn-brand { display:flex; align-items:center; gap:12px }
.gmn-brand h1 { font-size:clamp(28px,4.2vw,42px) }
.gmn-tagline { flex:1 1 280px; color:var(--muted); font-weight:700; margin:0 !important }

.gmn-panel { background:#fff; border:1px solid var(--line); border-radius:18px; padding:18px; box-shadow:0 6px 24px #4230650a }
.gmn-panel h2 { font-size:22px; margin-bottom:10px }
.gmn-panel h3 { font-size:17px; margin-bottom:8px }
.gmn-help { font-size:13px; color:var(--muted) }
#guess-my-neighbour label { display:block; font-weight:700; font-size:14px; margin:6px 0 4px }
#guess-my-neighbour input[type=text] { width:100%; min-height:48px; padding:0 14px; border:2px solid var(--line); border-radius:12px; background:var(--card); color:var(--card-ink); font:700 17px/1 inherit }
#guess-my-neighbour input[type=text]:disabled { opacity:.55 }
.gmn-code-input { text-transform:uppercase; letter-spacing:.18em; font-size:22px !important }

.gmn-start { display:grid; gap:16px }
.gmn-name-panel { max-width:520px }
.gmn-start-grid { display:grid; gap:16px; grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr)); align-items:start }
.gmn-error { background:#fdecea; border:1px solid #f2c4bf; color:#7a1a12; border-radius:14px; padding:14px 16px; font-weight:700 }
.gmn-field-error { color:#a3241b; font-size:13px; font-weight:700; min-height:0; margin:4px 0 0 !important }
.gmn-field-error:empty { display:none }

.gmn-seg { border:0; padding:0; margin:6px 0 8px; display:flex; flex-wrap:wrap; gap:6px }
.gmn-seg legend { font-weight:700; font-size:14px; padding:0; margin-bottom:6px; width:100% }
#guess-my-neighbour .gmn-seg label { margin:0; flex:1 1 auto; position:relative }
.gmn-seg input { position:absolute; opacity:0; inset:0; width:100%; height:100%; margin:0; cursor:pointer }
.gmn-seg span { display:flex; align-items:center; justify-content:center; min-height:44px; padding:0 14px; border:2px solid var(--line); border-radius:999px; background:var(--soft); font-weight:700; font-size:14px }
.gmn-seg input:checked + span { background:var(--brand); border-color:var(--brand); color:#fff }
.gmn-seg input:focus-visible + span { outline:3px solid var(--brand); outline-offset:3px }

.gmn-b { display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height:44px; padding:0 18px; border-radius:999px; border:2px solid var(--line); background:var(--soft); font-weight:700; font-size:14px; text-align:center }
.gmn-b:hover:not(:disabled) { filter:brightness(.97) }
.gmn-primary { background:var(--brand); border-color:var(--brand); color:#fff !important }
.gmn-yes { background:var(--yes); border-color:var(--yes); color:#fff !important; min-width:96px; font-size:17px }
.gmn-no { background:var(--no); border-color:var(--no); color:#fff !important; min-width:96px; font-size:17px }
.gmn-row { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-top:10px }
.gmn-center { justify-content:center }

.gmn-roombar { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:6px }
.gmn-chip { display:inline-flex; align-items:center; gap:6px; min-height:32px; padding:0 12px; border-radius:999px; background:#fff; border:1px solid var(--line); font-size:13px; font-weight:700 }
.gmn-chip b { letter-spacing:.12em }
.gmn-dot { width:10px; height:10px; border-radius:50%; background:#9a9a9a; flex:none }
.gmn-dot.on { background:#1f8a4c }

.gmn-bar { position:sticky; top:0; z-index:5; background:var(--bg); padding:10px 0; display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; border-bottom:1px solid var(--line); margin-bottom:12px }
.gmn-message { flex:1 1 280px; font-size:17px; font-weight:700; line-height:1.35; margin:0 !important }
.gmn-actions { display:flex; flex-wrap:wrap; gap:8px }
.gmn-notice { background:#fff7dc; border:2px solid #e5c766; border-radius:16px; padding:14px 16px; margin-bottom:12px }
.gmn-answer { background:#eef7f6; border-color:var(--tray) }
.gmn-answer-q { font-size:20px; font-weight:800; overflow-wrap:anywhere }

.gmn-layout { display:grid; gap:16px }
@media (min-width:1000px) { .gmn-layout { grid-template-columns:minmax(0,1fr) 360px; align-items:start } .gmn-desk { position:sticky; top:84px } }
.gmn-desk { display:grid; gap:12px }
@media (min-width:640px) and (max-width:999px) { .gmn-desk { grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start } }

.gmn-tray { background:var(--tray); border-radius:24px; padding:clamp(8px,1.4vw,16px); box-shadow:inset 0 -6px 0 var(--tray-dark),0 6px 0 #0000002e }
.gmn-board { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:clamp(6px,1vw,12px); perspective:900px }
.gmn-card { appearance:none; border:0; padding:0; background:none; border-radius:12px; color:var(--card-ink); transition:transform .15s }
.gmn-card:disabled { opacity:1 !important; cursor:default }
.gmn-card-inner { display:grid; transition:transform .5s cubic-bezier(.3,1.35,.5,1); transform-style:preserve-3d }
.gmn-card-front, .gmn-card-back { grid-area:1/1; backface-visibility:hidden; -webkit-backface-visibility:hidden; border-radius:12px; border:2px solid var(--card-ink); overflow:hidden; display:flex; flex-direction:column }
.gmn-card-front { background:var(--card) }
.gmn-card-front svg { display:block; width:100%; aspect-ratio:1 }
.gmn-card-back { transform:rotateY(180deg); background:repeating-linear-gradient(135deg,#e8432e 0 10px,#d3361f 10px 20px) }
.gmn-card-back::before { content:"?"; flex:1; display:grid; place-items:center; font:800 clamp(28px,4vw,48px)/1 inherit; color:#fff8e6 }
.gmn-card-name { display:flex; flex-direction:column; padding:3px 4px 5px; text-align:center; font-size:12px; line-height:1.15; font-weight:800; background:var(--card-ink); color:#fff8e6 }
.gmn-card-name i { font-style:normal; font-weight:700; opacity:.85 }
.gmn-card-name i, .gmn-card-name span { white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
.gmn-card-back .gmn-card-name { background:#1d1526cc }
.gmn-card.down .gmn-card-inner { transform:rotateY(180deg) }
.gmn-card.hint .gmn-card-front { box-shadow:inset 0 0 0 4px #e8432e }
.gmn-card.hint svg { opacity:.55 }
.gmn-card.picked { transform:translateY(-4px) }
.gmn-card.picked .gmn-card-front { box-shadow:0 0 0 4px #fff8e6,0 0 0 8px #e8432e }
.gmn-card.mine .gmn-card-front { box-shadow:inset 0 0 0 4px #f2b705 }
.gmn-card:focus-visible { outline:3px solid #fff8e6 !important; outline-offset:2px }

.gmn-big-code { font:800 clamp(38px,7vw,52px)/1 inherit; letter-spacing:.14em; color:var(--brand); margin:4px 0 !important }
.gmn-secret { display:flex; gap:12px; align-items:center }
.gmn-mini { width:76px; flex:none; border:2px solid var(--card-ink); border-radius:10px; overflow:hidden; background:var(--card); color:var(--card-ink) }
.gmn-mini svg { display:block; width:100% }
.gmn-mini-name { display:block; background:var(--card-ink); color:#fff8e6; font-size:11px; font-weight:800; text-align:center; padding:2px 3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
.gmn-mini-unknown { display:grid; place-items:center; aspect-ratio:3/4; font-size:36px; font-weight:800 }
.gmn-meter { height:12px; border-radius:999px; background:#e8432e33; overflow:hidden; margin:6px 0 }
.gmn-meter span { display:block; height:100%; background:var(--tray); border-radius:999px; transition:width .3s }

.gmn-ask-toggle { display:none }
.gmn-tabs { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:8px }
.gmn-tab { min-height:44px; padding:0 12px; font-size:13px }
#guess-my-neighbour .gmn-tab[aria-pressed=true] { background:var(--ink); border-color:var(--ink); color:var(--bg) }
.gmn-qs { display:flex; flex-wrap:wrap; gap:6px; margin:8px 0 10px }
#guess-my-neighbour .gmn-q { border-radius:12px; background:var(--card); color:var(--card-ink); font-size:14px; padding:0 12px }
#guess-my-neighbour .gmn-q[aria-pressed=true] { background:var(--brand); border-color:var(--brand); color:#fff }
.gmn-q.used { text-decoration:line-through }
#gmn-ask-send { width:100%; margin-top:6px }
#gmn-copy-fallback { margin-top:10px }

.gmn-log { list-style:none; margin:0; padding:0; max-height:260px; overflow:auto }
.gmn-log li { padding:7px 0; border-top:1px solid var(--line); font-size:14px; overflow-wrap:anywhere }
.gmn-log li:first-child { border-top:0 }
#guess-my-neighbour .gmn-pill { display:inline-block; padding:0 9px; border-radius:999px; color:#fff; font-weight:800; font-size:13px }
.gmn-pill-yes { background:var(--yes) }
.gmn-pill-no { background:var(--no) }

#gmn-over { text-align:center; width:min(520px,calc(100% - 28px)) }
#gmn-over h2 { font-size:clamp(30px,6vw,42px); margin-bottom:6px }
.gmn-duo { display:flex; justify-content:center; gap:18px; margin:14px 0 }
.gmn-duo figure { margin:0 }
.gmn-duo .gmn-mini { width:110px }
.gmn-duo figcaption { font-weight:700; font-size:13px; margin-top:6px }

/* AC-014, Q-006: below the width where board and ask panel sit side by side, the board has 4 columns and the questions live in a
   sheet behind an Ask bar at the bottom of the screen; the answer buttons take that bar's place for the answering player. */
@media (max-width:999px) {
    #guess-my-neighbour { padding:0 12px 96px }
    :root:has(#guess-my-neighbour) { scroll-padding-top:130px; scroll-padding-bottom:96px }
    #guess-my-neighbour.gmn-answering { padding-bottom:280px }
    :root:has(#guess-my-neighbour.gmn-answering) { scroll-padding-bottom:280px }
    .gmn-board { grid-template-columns:repeat(4,minmax(0,1fr)) }
    .gmn-tray { max-width:640px; width:100%; margin-inline:auto }
    .gmn-answering .gmn-ask { display:none }
    .gmn-answer { position:fixed; left:0; right:0; bottom:0; z-index:31; margin:0; border-width:2px 0 0; border-radius:18px 18px 0 0; padding:12px 12px calc(12px + env(safe-area-inset-bottom)); max-height:75vh; overflow:auto; box-shadow:0 -8px 30px #21123730 }
    .gmn-answer .gmn-row > .gmn-b { flex:1 1 auto }
    .gmn-message { font-size:16px }
    .gmn-ask { position:fixed; left:0; right:0; bottom:0; z-index:30; border-radius:18px 18px 0 0; padding:10px 12px calc(10px + env(safe-area-inset-bottom)); max-height:75vh; overflow:auto; box-shadow:0 -8px 30px #21123730 }
    #guess-my-neighbour .gmn-ask-toggle { display:flex; width:100%; justify-content:center; min-height:48px; border-radius:14px; border:0; background:var(--brand); color:#fff; font-weight:800; font-size:16px }
    #guess-my-neighbour .gmn-ask-toggle:disabled { background:var(--soft); color:var(--ink) }
    .gmn-ask-title { display:none }
    .gmn-ask-body { display:none; padding-top:10px }
    .gmn-ask.open .gmn-ask-body { display:block }
    .gmn-bar { padding:8px 0 }
}
@media (prefers-reduced-motion:reduce) { .gmn-card, .gmn-card-inner, .gmn-meter span { transition:none } }
