/* ------------------------------------------------------------------ Shell
 *
 * A three-column console: an icon rail, the content, and a summary panel.
 * It collapses to one column on a phone, where the rail becomes a bottom bar.
 */

body.shellpage {
    --ink: #f6eef3;
    --ink-dim: #b9a3b2;
    --surface: #241528;
    --surface-2: #2e1a33;
    --panel: rgba(255, 255, 255, .055);
    --panel-line: rgba(255, 255, 255, .09);
    --rail-w: 4.5rem;
    --side-w: 17rem;

    min-height: 100vh; margin: 0; color: var(--ink);
    background:
        radial-gradient(60rem 40rem at 8% -8%, rgba(236, 72, 153, .16), transparent 60%),
        radial-gradient(50rem 36rem at 100% 0%, rgba(99, 102, 241, .18), transparent 58%),
        #150c19;
}
body.shellpage .sr {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.app {
    display: grid; gap: .9rem;
    grid-template-columns: 1fr;
    max-width: 84rem; margin: 0 auto; padding: .9rem .9rem 5.5rem;
}
@media (min-width: 62rem) {
    .app {
        grid-template-columns: var(--rail-w) minmax(0, 1fr) var(--side-w);
        padding: 1.1rem 1.1rem 1.5rem; gap: 1.1rem;
        align-items: start;
    }
}

/* Rail */
.rail {
    display: flex; align-items: center; gap: .5rem;
    position: fixed; inset: auto 0 0 0; z-index: 5;
    padding: .5rem .9rem calc(.5rem + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    border-top: 1px solid var(--panel-line);
    backdrop-filter: blur(8px);
}
.rail ul { display: flex; gap: .4rem; list-style: none; margin: 0; padding: 0; flex: 1; }
.rail a {
    display: grid; place-items: center; width: 2.85rem; height: 2.85rem;
    border-radius: .85rem; text-decoration: none; font-size: 1.15rem;
    color: var(--ink-dim); background: transparent;
}
.rail a:hover, .rail a.on { background: var(--panel); color: var(--ink); }
.rail-logo { background: transparent !important; padding: 0; }
.rail-logo img { width: 2.5rem; height: 2.5rem; display: block; }
.rail-logo:hover img { filter: brightness(1.08); }
.rail-new {
    background: linear-gradient(140deg, #f59e0b, #ec4899) !important;
    color: #fff !important; font-size: 1.4rem !important; font-weight: 700;
}

/* The account tile is a person, not a destination: it reads as an avatar. */
.rail .rail-me {
    display: grid; place-items: center; flex: none;
    width: 2.85rem; height: 2.85rem; border-radius: 50%;
    background: var(--panel); border: 1px solid var(--panel-line);
    color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.05rem;
    margin-left: .35rem;
}
.rail .rail-me:hover { border-color: color-mix(in srgb, var(--ink) 35%, var(--panel-line)); }
.rail .rail-me.on { box-shadow: 0 0 0 2px color-mix(in srgb, #ec4899 55%, transparent); }
@media (min-width: 62rem) {
    .rail {
        position: sticky; top: 1.1rem; inset: auto;
        flex-direction: column; gap: .75rem;
        padding: .75rem .6rem; border: 1px solid var(--panel-line); border-top: 1px solid var(--panel-line);
        border-radius: 1.15rem; background: var(--surface);
    }
    .rail ul { flex-direction: column; flex: 0; }
    .rail .rail-me { margin: .4rem 0 0; }
}

/* Canvas */
.canvas {
    min-width: 0; border-radius: 1.25rem;
    background: linear-gradient(170deg, var(--surface-2), var(--surface) 60%);
    border: 1px solid var(--panel-line);
    padding: 1.1rem;
}
@media (min-width: 48rem) { .canvas { padding: 1.5rem 1.75rem 2rem; } }

.topbar {
    display: grid; gap: .75rem; align-items: center; margin-bottom: 1.5rem;
    grid-template-columns: 1fr;
}
@media (min-width: 52rem) {
    .topbar { grid-template-columns: auto minmax(10rem, 22rem) auto; gap: 1rem; }
}
.greet { margin: 0; font-size: 1.05rem; color: var(--ink-dim); }
.greet strong { color: var(--ink); }
.searchbox {
    display: flex; align-items: center; gap: .5rem;
    padding: .5rem .8rem; border-radius: 999px;
    background: var(--panel); border: 1px solid var(--panel-line);
}
.searchbox input {
    flex: 1; border: 0; background: transparent; color: var(--ink);
    font: inherit; font-size: .9rem; padding: 0; width: 100%;
}
.searchbox input::placeholder { color: var(--ink-dim); }
.searchbox input:focus { outline: none; }
.searchbox:focus-within { border-color: color-mix(in srgb, #ec4899 60%, transparent); }
.topbar-actions { display: flex; align-items: center; gap: .5rem; justify-self: start; }
@media (min-width: 52rem) { .topbar-actions { justify-self: end; } }
.button.small { margin: 0; padding: .5rem .9rem; font-size: .85rem; border-radius: .6rem; }
.iconbtn, .avatar {
    display: grid; place-items: center; width: 2.3rem; height: 2.3rem; border-radius: 50%;
    background: var(--panel); border: 1px solid var(--panel-line);
    color: var(--ink); text-decoration: none; font-weight: 700;
}

/* Hero row */
.hero-row {
    display: grid; gap: 1rem; grid-template-columns: 1fr;
    align-items: start; margin-bottom: 1.75rem;
}
@media (min-width: 60rem) { .hero-row { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); } }
.hero-row .featured { margin: 0; }
body.shellpage .featured-art { max-width: 11rem; min-height: 10rem; }
body.shellpage .featured h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin-top: .4rem; }
body.shellpage .featured p { font-size: .92rem; }

.quicklist { display: flex; flex-direction: column; }
.quicklist .seeall {
    margin-top: .55rem; text-align: center; font-size: .85rem; text-decoration: none;
    padding: .55rem; border-radius: .9rem; color: var(--ink-dim);
    background: var(--panel); border: 1px dashed var(--panel-line);
}
.quicklist .seeall:hover { color: var(--ink); border-style: solid; }
.quick { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.quick li, .quick a {
    display: grid; grid-template-columns: 2.4rem 1fr auto; gap: .7rem; align-items: center;
    padding: .7rem .85rem; border-radius: .9rem; text-decoration: none; color: inherit;
    background: var(--panel); border: 1px solid var(--panel-line);
}
.quick a { padding: 0; border: 0; background: none; }
.quick li:has(a) { padding: 0; background: none; border: 0; display: block; }
.quick li:has(a) a { padding: .7rem .85rem; background: var(--panel); border: 1px solid var(--panel-line); }
.quick li:hover { border-color: color-mix(in srgb, #ec4899 45%, transparent); }
.quick-icon {
    display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: .7rem;
    background: rgba(255,255,255,.07); font-size: 1.1rem;
}
.quick-body { display: grid; gap: .1rem; min-width: 0; }
.quick-body strong { font-size: .92rem; }
.chev { color: var(--ink-dim); font-size: 1.2rem; }

/* Side panel */
.side { display: grid; gap: .9rem; align-content: start; }
.sidecard {
    padding: 1rem; border-radius: 1.15rem;
    background: var(--surface); border: 1px solid var(--panel-line);
}
.sidecard h2 { margin: 0 0 .8rem; font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-dim); }
.faces { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; padding: 0; }
.face {
    display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%;
    font-size: .82rem; font-weight: 700; color: #fff;
    background: linear-gradient(140deg, #6366f1, #ec4899);
}
.ringwrap { display: grid; place-items: center; margin: .25rem 0 1rem; }
.ring {
    width: 8.5rem; height: 8.5rem; border-radius: 50%; display: grid; place-items: center;
}
.ring-empty { background: rgba(255, 255, 255, .07) !important; }
.ring-hole {
    width: 5.9rem; height: 5.9rem; border-radius: 50%; display: grid; place-items: center;
    background: var(--surface); text-align: center;
}
.ring-hole strong { display: block; font-size: 1.5rem; line-height: 1.1; }
.ring-hole span { font-size: .72rem; color: var(--ink-dim); }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; font-size: .84rem; }
.legend li { display: grid; grid-template-columns: .6rem 1fr auto; gap: .5rem; align-items: center; color: var(--ink-dim); }
.legend b { color: var(--ink); font-variant-numeric: tabular-nums; }
.key { width: .6rem; height: .6rem; border-radius: 50%; }
.k-running { background: #6366f1; }
.k-finished { background: #ec4899; }
.k-gone { background: #f59e0b; }
.minitiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; text-align: center; }
.minitiles li { padding: .6rem .3rem; border-radius: .8rem; background: var(--panel); }
.minitiles strong { display: block; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.minitiles span { font-size: .68rem; color: var(--ink-dim); }

/* Content pieces inherit the dark surface */
body.shellpage .tile { background: var(--panel); border-color: var(--panel-line); color: var(--ink); }
body.shellpage .tile-tag { color: var(--ink-dim); }
body.shellpage .block-head h2 { color: var(--ink); font-size: 1rem; }
body.shellpage .muted { color: var(--ink-dim); }
body.shellpage .steps li { background: var(--panel); border-color: var(--panel-line); }
body.shellpage .steps p { color: var(--ink-dim); }
body.shellpage .closer {
    background: linear-gradient(135deg, rgba(99,102,241,.25), rgba(236,72,153,.25));
    border: 1px solid var(--panel-line);
}
body.shellpage .featured { background: linear-gradient(150deg, rgba(255,255,255,.09), rgba(255,255,255,.04)); }
body.shellpage .canvas-body > .block:first-child { margin-top: 0; }

/* Pages with no side panel close the gap rather than leaving a column of nothing. */
@media (min-width: 62rem) {
    body.shellpage.noside .app { grid-template-columns: var(--rail-w) minmax(0, 1fr); }
}
.topbar.nosearch { grid-template-columns: 1fr auto; }
@media (min-width: 52rem) { .topbar.nosearch { grid-template-columns: 1fr auto; } }
.backlink {
    display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem;
    margin-right: .4rem; border-radius: .55rem; text-decoration: none;
    background: var(--panel); color: var(--ink); vertical-align: -.45rem;
}
.backlink:hover { background: rgba(255,255,255,.12); }

/* Room: the clock and roster sit in the panel */
.clockcard .clock-value {
    margin: 0; font-variant-numeric: tabular-nums; font-size: 2rem; font-weight: 700;
    letter-spacing: -0.025em; line-height: 1.1;
}
.clockcard.urgent .clock-value { color: #ff7a7a; }
.clockcard.urgent h2::after { content: " ⚠"; }
body.shellpage .seats { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
body.shellpage .seat { display: flex; align-items: center; gap: .5rem; font-size: .9rem; }
body.shellpage .seat .dot { width: .5rem; height: .5rem; border-radius: 50%; background: rgba(255,255,255,.2); flex: 0 0 auto; }
body.shellpage .seat.status-submitted .dot { background: #34d399; }
body.shellpage .seat.status-joined .dot { background: #fbbf24; }
body.shellpage .seat.empty .name { font-style: italic; }
body.shellpage .badge {
    font-size: .62rem; text-transform: uppercase; letter-spacing: .06em;
    padding: .05rem .3rem; border-radius: .25rem; color: var(--ink-dim);
    border: 1px solid var(--panel-line);
}
body.shellpage .tally { margin: .7rem 0 0; font-size: .8rem; }
.invite-label { margin: 0 0 .25rem; }
body.shellpage code.invite {
    display: block; padding: .5rem .6rem; border-radius: .55rem; font-size: .72rem;
    background: rgba(0,0,0,.25); word-break: break-all; color: var(--ink-dim);
}
.ownerbtns { display: grid; gap: .4rem; margin-top: .75rem; }
.ownerbtns form { margin: 0; }
.ownerbtns button { width: 100%; margin: 0; padding: .5rem; font-size: .82rem; border-radius: .55rem; }
body.shellpage button.secondary { background: var(--panel); color: var(--ink); border: 1px solid var(--panel-line); }
body.shellpage button.danger { background: transparent; color: #ff7a7a; border: 1px solid rgba(255,122,122,.45); }
/* A button styled as a link keeps no chrome, whatever else it is also marked as.
   Without this a destructive link picks up the outlined danger button and reads as
   the loudest thing on the row. */
body.shellpage button.linky,
body.shellpage button.linky.danger { border: 0; background: none; padding: 0; }

/* Forms and content on the dark canvas */
body.shellpage .roombody, body.shellpage .panel { max-width: none; }
body.shellpage label { color: var(--ink); }
body.shellpage input[type=text], body.shellpage input[type=password], body.shellpage input[type=number],
body.shellpage input[type=search], body.shellpage select, body.shellpage textarea {
    background: rgba(0,0,0,.22); border-color: var(--panel-line); color: var(--ink);
}
body.shellpage .errors { background: rgba(214,69,69,.16); color: #ffb0b0; }
body.shellpage .warn { background: rgba(255,255,255,.06); border-left-color: #ec4899; }
body.shellpage blockquote { background: rgba(255,255,255,.05); border-left-color: var(--panel-line); }
body.shellpage .opt:hover { border-color: var(--panel-line); }
body.shellpage .cell { background: rgba(255,255,255,.06); border-color: var(--panel-line); }
body.shellpage .bar { background: rgba(255,255,255,.1); }
body.shellpage .prompt { color: var(--ink); }
body.shellpage details summary { color: var(--ink-dim); }
body.shellpage .secret, body.shellpage .codes { color: var(--ink); }

/* Auth pages */
body.authpage { display: grid; place-items: center; padding: 2rem 1rem; }
.authwrap { width: 100%; max-width: 26rem; text-align: center; }
.authlogo {
    display: inline-flex; align-items: center; gap: .5rem; margin-bottom: 1.25rem;
    font-weight: 800; text-decoration: none; color: var(--ink); letter-spacing: -0.01em;
}
.authlogo img { width: 11rem; height: auto; display: block; }
.authcard {
    text-align: left; padding: 1.6rem; border-radius: 1.15rem;
    background: var(--surface); border: 1px solid var(--panel-line);
}
.authcard h1 { font-size: 1.3rem; margin: 0 0 .5rem; letter-spacing: -0.02em; }
.authcard .panel { max-width: none; margin: 0; }
.authfoot { margin-top: 1.25rem; font-size: .78rem; color: var(--ink-dim); }
.authcard .qr { background: #fff; }

/* How to play */
.howto {
    display: grid; gap: 1rem; grid-template-columns: 1fr;
    padding: 1.25rem; border-radius: 1.15rem;
    background: var(--surface); border: 1px solid var(--panel-line);
}
@media (min-width: 56rem) {
    .howto { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.5rem; padding: 1.6rem; }
}
.howto ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.1rem; }
.howto li { display: grid; grid-template-columns: 2rem 1fr; gap: .85rem; align-items: start; }
.howto-num {
    display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%;
    font-size: .85rem; font-weight: 800; color: #fff;
    background: linear-gradient(140deg, #ec4899, #6366f1);
}
.howto h3 { margin: .15rem 0 .3rem; font-size: 1rem; }
.howto p { margin: 0 0 .4rem; color: var(--ink-dim); font-size: .9rem; line-height: 1.5; }
.howto p:last-child { margin-bottom: 0; }
.howto-warn {
    padding: .55rem .7rem; border-radius: .55rem; margin-top: .5rem !important;
    background: rgba(245, 158, 11, .12); border-left: 3px solid #f59e0b;
    color: #f5d9a8 !important; font-size: .85rem !important;
}
.howto-note {
    align-self: start; padding: 1.1rem; border-radius: .95rem;
    background: var(--panel); border: 1px solid var(--panel-line);
}
.howto-note h3 { margin: 0 0 .5rem; font-size: .95rem; }
.howto-note .button { margin-top: .9rem; }

/* ---------------------------------------------------------------- Motion
 *
 * Everything here animates transform and opacity only, so it stays on the
 * compositor and does not cost layout. All of it is switched off wholesale for
 * anyone who has asked their system for less movement.
 */

@keyframes aurora-a {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    33%      { transform: translate3d(6vw, 4vh, 0) scale(1.15); }
    66%      { transform: translate3d(-4vw, 7vh, 0) scale(.95); }
}
@keyframes aurora-b {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1.05); }
    40%      { transform: translate3d(-7vw, 5vh, 0) scale(.9); }
    75%      { transform: translate3d(5vw, -4vh, 0) scale(1.2); }
}
@keyframes floaty {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50%      { transform: translateY(-10px) rotate(2deg); }
}
@keyframes sheen {
    0%   { transform: translateX(-120%) skewX(-18deg); }
    55%  { transform: translateX(240%) skewX(-18deg); }
    100% { transform: translateX(240%) skewX(-18deg); }
}
@keyframes riseIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}
@keyframes pulseSoft {
    0%, 100% { opacity: 1; }
    50%      { opacity: .55; }
}
@keyframes popIn {
    0%   { transform: scale(.4); }
    70%  { transform: scale(1.25); }
    100% { transform: scale(1); }
}

/* The background itself: two slow clouds behind everything, fixed so they drift
   independently of the scroll. */
body.shellpage::before,
body.shellpage::after {
    content: ""; position: fixed; z-index: -1; pointer-events: none;
    border-radius: 50%; filter: blur(90px); opacity: .55;
}
body.shellpage::before {
    width: 55vw; height: 55vw; left: -12vw; top: -14vw;
    background: radial-gradient(circle, rgba(236, 72, 153, .55), transparent 68%);
    animation: aurora-a 34s ease-in-out infinite;
}
body.shellpage::after {
    width: 60vw; height: 60vw; right: -18vw; top: 8vh; left: auto;
    background: radial-gradient(circle, rgba(99, 102, 241, .5), transparent 68%);
    animation: aurora-b 44s ease-in-out infinite;
}

/* Reveal on scroll. The class is only added when scripting is on, so with it off
   everything is simply visible. */
html.js .reveal { opacity: 0; transform: translateY(14px); }
html.js .reveal.in {
    animation: riseIn .5s cubic-bezier(.22, .8, .3, 1) forwards;
}
html.js .tiles.reveal.in > .tile { animation: riseIn .45s cubic-bezier(.22,.8,.3,1) backwards; }
html.js .tiles.reveal.in > .tile:nth-of-type(1) { animation-delay: .04s; }
html.js .tiles.reveal.in > .tile:nth-of-type(2) { animation-delay: .08s; }
html.js .tiles.reveal.in > .tile:nth-of-type(3) { animation-delay: .12s; }
html.js .tiles.reveal.in > .tile:nth-of-type(4) { animation-delay: .16s; }
html.js .tiles.reveal.in > .tile:nth-of-type(5) { animation-delay: .20s; }
html.js .tiles.reveal.in > .tile:nth-of-type(6) { animation-delay: .24s; }
html.js .tiles.reveal.in > .tile:nth-of-type(n+7) { animation-delay: .28s; }

/* Featured card: the artwork drifts, and a highlight sweeps across it now and then. */
.featured-art { animation: floaty 7s ease-in-out infinite; }
.featured { position: relative; overflow: hidden; }
.featured::after {
    content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 35%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .07), transparent);
    animation: sheen 9s ease-in-out infinite; pointer-events: none;
}

/* Things that respond to being touched */
.button, .tile, .quick a, .rail a, .rail-me, .sessionlist a, .iconbtn, .avatar, .cell {
    transition: transform .16s cubic-bezier(.22,.8,.3,1), box-shadow .16s ease,
                border-color .16s ease, background-color .16s ease, filter .16s ease;
}
.button:active, .quick a:active, .sessionlist a:active { transform: scale(.97); }
.button:hover { transform: translateY(-1px); }
.rail a:hover, .rail-me:hover { transform: translateY(-2px); }
.quick li:hover a, .quick a:hover { transform: translateX(3px); }
.sessionlist a:hover { transform: translateX(3px); }
button.cell:not(:disabled):hover { transform: scale(1.06); }
.tile-art { transition: transform .2s cubic-bezier(.22,.8,.3,1); }
a.tile:hover .tile-art { transform: rotate(-4deg) scale(1.06); }
.howto li:hover .howto-num { transform: scale(1.1) rotate(-6deg); }
.howto-num { transition: transform .2s cubic-bezier(.22,.8,.3,1); }

/* The clock earns attention only when it is nearly out */
.clockcard.urgent .clock-value { animation: pulseSoft 1.6s ease-in-out infinite; }

/* A newly placed piece and a newly filled seat both land rather than appear */
.cell.p1 span, .cell.p2 span { animation: popIn .32s cubic-bezier(.3,1.4,.5,1); }
.seat.status-submitted .dot { animation: popIn .3s cubic-bezier(.3,1.4,.5,1); }

@media (prefers-reduced-motion: reduce) {
    body.shellpage::before, body.shellpage::after,
    .featured-art, .featured::after, .clockcard.urgent .clock-value,
    .cell.p1 span, .cell.p2 span, .seat.status-submitted .dot {
        animation: none !important;
    }
    html.js .reveal { opacity: 1; transform: none; }
    html.js .reveal.in { animation: none; }
    .button, .tile, .quick a, .rail a, .rail-me, .sessionlist a, .iconbtn, .avatar, .cell,
    .tile-art, .howto-num { transition: none; }
    .button:hover, .rail a:hover, .rail-me:hover, .quick a:hover, .sessionlist a:hover,
    button.cell:not(:disabled):hover, a.tile:hover .tile-art { transform: none; }
}

/* Account */
.acct-name { margin: 0 0 1rem; font-size: 1.3rem; letter-spacing: -0.02em; }
.acctfacts { display: grid; gap: .55rem; margin: 0 0 1.25rem; }
.acctfacts div { display: flex; justify-content: space-between; gap: 1rem; padding-bottom: .5rem; border-bottom: 1px solid var(--panel-line); }
.acctfacts dt { color: var(--ink-dim); font-size: .9rem; }
.acctfacts dd { margin: 0; font-weight: 600; font-size: .9rem; }
.acctbtns { display: flex; gap: .5rem; flex-wrap: wrap; }
.acctbtns form { margin: 0; }
.acctbtns button { margin: 0; }

/* Open sessions */
.openlist { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.openlist a {
    display: grid; grid-template-columns: 2.6rem 1fr auto; gap: .8rem; align-items: center;
    padding: .8rem .9rem; border-radius: .9rem; text-decoration: none; color: inherit;
    background: var(--panel); border: 1px solid var(--panel-line);
}
.openlist a:hover { border-color: color-mix(in srgb, #ec4899 45%, transparent); transform: translateX(3px); }
.open-icon {
    display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: .75rem;
    background: rgba(255,255,255,.07); font-size: 1.2rem;
}
.open-body { display: grid; gap: .12rem; min-width: 0; }
.open-join {
    font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    padding: .35rem .7rem; border-radius: 999px;
    background: linear-gradient(140deg, #ec4899, #6366f1); color: #fff;
}
.byid { margin-top: 1.1rem; padding: .9rem 1rem; border-radius: .9rem;
        background: var(--panel); border: 1px dashed var(--panel-line); }
.byid label { display: block; margin: 0 0 .45rem; font-size: .9rem; }
.byid-row { display: flex; gap: .5rem; }
.byid-row input { flex: 1; }
.byid-row button { margin: 0; white-space: nowrap; }
.byid p { margin: .5rem 0 0; }

/* Copyable link and id */
.copyrow { display: flex; gap: .4rem; align-items: stretch; margin-bottom: .6rem; }
.copyrow code.invite { flex: 1; margin: 0; }
.copybtn {
    margin: 0; padding: .35rem .6rem; font: inherit; font-size: .72rem; font-weight: 600;
    border-radius: .5rem; cursor: pointer; white-space: nowrap;
    background: var(--panel); color: var(--ink); border: 1px solid var(--panel-line);
}
.copybtn:hover { background: rgba(255, 255, 255, .13); }
.copybtn.copied { background: rgba(52, 211, 153, .2); border-color: rgba(52, 211, 153, .5); color: #a7f3d0; }

/* Invite card */
.qrbox {
    display: grid; place-items: center; padding: .6rem;
    background: #fff; border-radius: .75rem; margin-bottom: .5rem;
}
.qrbox svg { display: block; width: 100%; height: auto; max-width: 11rem; }
.qrhint { margin: 0 0 .8rem; text-align: center; }
.invitecard .howto-warn { margin: 0 0 .8rem !important; }

/* ----------------------------------------------------------------- round games
   Shared by every game that runs in rounds, because the round header, the running
   score and the final standings are drawn by templates in plugins/_shared/views/
   rather than by any one game. */

.roundhead {
    display: flex; flex-wrap: wrap; gap: .75rem 1rem;
    align-items: center; justify-content: space-between;
    margin: 0 0 1.25rem; padding-bottom: .85rem;
    border-bottom: 1px solid var(--panel-line);
}
.roundno { margin: 0; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-dim); }
.roundno strong { color: var(--ink); font-size: 1rem; }

.scorestrip { display: flex; flex-wrap: wrap; gap: .35rem; list-style: none; margin: 0; padding: 0; }
.scorestrip li {
    display: flex; align-items: baseline; gap: .4rem;
    padding: .3rem .6rem; border-radius: 999px;
    background: rgba(255, 255, 255, .08); font-size: .82rem;
}
.scorestrip .who { color: var(--ink-dim); max-width: 8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scorestrip .pts { font-weight: 700; font-variant-numeric: tabular-nums; }
.scorestrip li.me { background: linear-gradient(140deg, rgba(236,72,153,.35), rgba(99,102,241,.35)); }
.scorestrip li.me .who { color: var(--ink); }

.standings { list-style: none; margin: 1.25rem 0 0; padding: 0; display: grid; gap: .4rem; }
.standings li {
    display: grid; grid-template-columns: 1.75rem 1fr auto; gap: .75rem; align-items: center;
    padding: .6rem .8rem; border: 1px solid var(--panel-line); border-radius: .6rem;
}
.standings li:first-child { border-color: rgba(236, 72, 153, .55); }
.standings .rank { color: var(--ink-dim); font-variant-numeric: tabular-nums; text-align: center; }
.standings .who { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.standings .pts { font-weight: 700; font-variant-numeric: tabular-nums; }
.subhead { margin: 1.75rem 0 .6rem; font-size: .95rem; color: var(--ink-dim); }

/* ------------------------------------------------------------------- friends
   One list shape, used for friends, requests and the people you have played
   with. Wide enough to read a name, narrow enough that the buttons stay on the
   row until a phone forces them under it. */

.peoplelist { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .5rem; }
.peoplelist li {
    display: grid; grid-template-columns: 2.25rem 1fr auto; gap: .75rem; align-items: center;
    padding: .6rem .8rem; border: 1px solid var(--panel-line); border-radius: .75rem;
    background: var(--surface);
}
.peoplelist .who { display: grid; gap: .1rem; min-width: 0; }
.peoplelist .who a { color: var(--ink); text-decoration: none; font-weight: 600; }
.peoplelist .who a:hover { text-decoration: underline; }
.peoplelist .acts { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.peoplelist .acts form { margin: 0; }

.faces .face, .peoplelist .face {
    display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%;
    background: linear-gradient(140deg, #ec4899, #6366f1); color: #fff; font-weight: 700;
    font-size: .9rem;
}

/* A pending request is worth one dot, not a number nobody asked for. */
.rail a { position: relative; }
.rail a .railpip {
    position: absolute; top: .45rem; right: .45rem; width: .5rem; height: .5rem;
    border-radius: 50%; background: #ec4899; box-shadow: 0 0 0 2px var(--surface);
}

@media (max-width: 34rem) {
    .peoplelist li { grid-template-columns: 2.25rem 1fr; }
    .peoplelist .acts { grid-column: 1 / -1; justify-content: flex-start; }
}
.profile-act { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-top: 1.25rem; }
.profile-act form { margin: 0; }

/* ------------------------------------------------------------------ live board
   The board region swaps its own contents when a move lands, so the only things
   the shell draws here are the two that have to survive the swap: the line that
   says what happened, and the mark on the square that was just pressed.

   Nothing in here is a game's business — the board itself is drawn by the game's
   own stylesheet, and these rules deliberately sit on top of whatever that is. */

.boardsay {
    min-height: 1.15rem; margin: 0 0 .5rem;
    font-size: .82rem; color: var(--ink-dim);
}
.boardsay.refused { color: #ffb0b0; }

/* The pressed square answers the tap straight away. It is not the move — the
   server has not been asked yet — so it reads as "heard you", not as a piece. */
.roombody .pressing { position: relative; }
.roombody .pressing::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit;
    box-shadow: inset 0 0 0 2px rgba(236, 72, 153, .85);
    background: rgba(236, 72, 153, .14);
    pointer-events: none;
}
.roombody.busy { cursor: progress; }
.roombody:focus { outline: none; }
.roombody:focus-visible { outline: 2px solid rgba(236, 72, 153, .6); outline-offset: .35rem; border-radius: .5rem; }

/* A refused move has to be seen going away again, not just quietly not happen. */
.roombody.refused { animation: boardno .5s ease-out 1; }
@keyframes boardno {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-.28rem); }
    75%      { transform: translateX(.28rem); }
}
@media (prefers-reduced-motion: reduce) {
    .roombody.refused { animation: none; }
}
