/* =========================================================================
   Wording: Letter Hunt — web design system.

   Same palette as the mobile app: near-white surfaces, one coral accent, heavy
   rounding. Values are duplicated here rather than shared because the two
   clients have no common styling layer; if the palette changes, both Theme.kt
   and this file need updating.

   Motion here is meant to carry information, not decorate: a tile flips because
   a letter opened, the ring tightens because time is running out, the podium
   rises because someone won. Everything is CSS — no animation library — and all
   of it collapses under prefers-reduced-motion at the end of this file.
   ========================================================================= */

:root {
    --coral: #ff5436;
    --coral-pressed: #e84424;
    --coral-wash: #ffede9;
    --coral-glow: rgba(255, 84, 54, 0.32);

    --ink: #1f2933;
    --ink-muted: #8a9199;

    --canvas: #ffffff;
    --card: #ffffff;
    --divider: #ecedef;

    --gold: #f5c244;
    --silver: #c9cdd2;
    --bronze: #d9a06b;

    --success: #2fa84f;
    --danger: #e5484d;

    --radius-card: 20px;
    --radius-card-lg: 26px;
    --radius-button: 16px;
    --radius-tile: 14px;

    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 24px;
    --space-xxl: 32px;

    /* Two shadows per surface: a tight one for the edge, a wide soft one for
       the lift. A single shadow reads as a sticker; two read as depth. */
    --lift-1: 0 1px 2px rgba(31, 41, 51, 0.05), 0 6px 16px rgba(31, 41, 51, 0.05);
    --lift-2: 0 2px 4px rgba(31, 41, 51, 0.06), 0 14px 32px rgba(31, 41, 51, 0.09);
    --lift-3: 0 4px 8px rgba(31, 41, 51, 0.08), 0 24px 60px rgba(31, 41, 51, 0.14);

    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    min-height: 100%;
}

/* The canvas colour goes on html and body stays transparent: body::before sits
   at a negative z-index, so if body painted its own background the drifting
   gradients would be hidden behind it and never seen. */
html { background: var(--canvas); }
body { background: transparent; }

/* ---------------------------------------------------------------- backdrop */

/*
   Three slow-drifting colour fields behind everything. They are what stops the
   page reading as a form: the surface is never quite still, but nothing moves
   fast enough to pull the eye away from the board.
*/
body::before {
    content: "";
    position: fixed;
    /* Only a little larger than the viewport. Oversizing it pushes the gradient
       centres off-screen and all that is left on screen is their faded tails. */
    inset: -12%;
    z-index: -2;
    background:
        radial-gradient(52% 46% at 14% 8%, rgba(255, 84, 54, 0.34), transparent 68%),
        radial-gradient(46% 42% at 88% 16%, rgba(86, 142, 255, 0.30), transparent 68%),
        radial-gradient(50% 46% at 60% 96%, rgba(255, 182, 66, 0.30), transparent 70%),
        radial-gradient(40% 38% at 96% 80%, rgba(186, 112, 255, 0.24), transparent 68%);
    animation: drift 26s ease-in-out infinite alternate;
}

/* A whisper of grain over the gradients so they don't band on wide screens. */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.22;
    background-image: radial-gradient(rgba(31, 41, 51, 0.045) 1px, transparent 1px);
    background-size: 3px 3px;
}

@keyframes drift {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    50%  { transform: translate3d(3%, -2%, 0) scale(1.12); }
    100% { transform: translate3d(-2%, 3%, 0) scale(1.05); }
}

h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -0.025em; }
h1 { font-size: 38px; line-height: 1.1; }
h2 { font-size: 23px; }
h3 { font-size: 19px; }

a { color: var(--coral); text-decoration: none; }

.muted { color: var(--ink-muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.coral { color: var(--coral); }

/* ---------------------------------------------------------------- layout */

.shell {
    max-width: 960px;
    margin: 0 auto;
    padding: var(--space-xl) var(--space-lg) 64px;
}

.shell-narrow { max-width: 460px; }

.topbar {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.topbar .title { flex: 1; text-align: center; }
.topbar .slot { width: 40px; display: flex; align-items: center; }

.back {
    font-size: 28px;
    line-height: 1;
    color: var(--ink);
    cursor: pointer;
    background: none;
    border: 0;
    padding: 0;
    transition: transform 0.18s var(--ease-out), opacity 0.18s;
}

.back:hover { transform: translateX(-3px); opacity: 0.7; }
.back:active { transform: translateX(-1px) scale(0.94); }

.row { display: flex; align-items: center; gap: var(--space-md); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); }
.col { display: flex; flex-direction: column; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: var(--space-md); }
.stack-lg > * + * { margin-top: var(--space-xl); }

/* ---------------------------------------------------------------- entrances */

/*
   Content arrives instead of appearing. The stagger is set per element with
   --i, which is what makes a list read as one gesture rather than ten.
*/
@keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

.rise, .card, .action-tile, .room-code, .board, .countdown, .podium {
    animation: rise 0.5s var(--ease-out) backwards;
    animation-delay: calc(var(--i, 0) * 60ms);
}

@keyframes pop {
    from { opacity: 0; transform: scale(0.9); }
    to   { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- surfaces */

.card {
    background: color-mix(in srgb, var(--card) 88%, transparent);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-card);
    padding: var(--space-lg);
    box-shadow: var(--lift-1);
    transition: box-shadow 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}

.card-lg { border-radius: var(--radius-card-lg); padding: var(--space-xl); }

.chip {
    display: inline-block;
    background: var(--coral-wash);
    color: var(--coral);
    border-radius: 999px;
    padding: 5px 11px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.chip-muted { background: var(--divider); color: var(--ink-muted); }
.chip-success { background: rgba(47, 168, 79, 0.15); color: var(--success); }

/* ---------------------------------------------------------------- buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    width: 100%;
    min-height: 56px;
    padding: 10px 20px;
    border-radius: var(--radius-button);
    border: 0;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.16s var(--ease-spring), box-shadow 0.22s var(--ease-out),
                background 0.18s, opacity 0.18s;
}

.btn:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
.btn:not(:disabled):hover { transform: translateY(-2px); }
.btn:not(:disabled):active { transform: translateY(0) scale(0.985); }
.btn .sub { font-size: 12px; font-weight: 500; opacity: 0.85; }

.btn-primary {
    background: linear-gradient(135deg, #ff6a4d, var(--coral) 55%, #ef4526);
    color: #fff;
    box-shadow: 0 6px 18px var(--coral-glow), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.btn-primary:not(:disabled):hover { box-shadow: 0 12px 28px var(--coral-glow); }

/* A light sweep on hover — the one purely decorative flourish, kept slow and
   low-contrast so it reads as sheen rather than a loading bar. */
.btn-primary::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.35) 50%, transparent 65%);
    transform: translateX(-120%);
    transition: transform 0.7s var(--ease-out);
}

.btn-primary:not(:disabled):hover::after { transform: translateX(120%); }

.btn-secondary {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--coral);
    border: 1.5px solid var(--coral);
}

.btn-secondary:not(:disabled):hover { background: var(--coral-wash); }

.btn-inline { width: auto; min-height: 40px; font-size: 13px; padding: 8px 18px; }

/* ---------------------------------------------------------------- forms */

.field {
    width: 100%;
    padding: 15px var(--space-lg);
    border: 1.5px solid var(--divider);
    border-radius: var(--radius-tile);
    background: rgba(255, 255, 255, 0.85);
    font-size: 16px;
    font-family: inherit;
    color: var(--ink);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.field:focus {
    outline: none;
    border-color: var(--coral);
    background: #fff;
    box-shadow: 0 0 0 4px var(--coral-wash);
}

.field::placeholder { color: var(--ink-muted); }

.field-code {
    text-align: center;
    font-size: 32px;
    font-weight: 800;
    letter-spacing: 12px;
    padding: 18px;
    font-variant-numeric: tabular-nums;
}

.error-text { color: var(--danger); font-size: 13px; animation: shake 0.4s; }

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

input[type="range"] {
    accent-color: var(--coral);
    height: 28px;
}

/* ---------------------------------------------------------------- brand */

.logo {
    width: 76px;
    height: 76px;
    position: relative;
    margin: 0 auto;
    animation: float 4.5s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(-1deg); }
    50%      { transform: translateY(-8px) rotate(1.5deg); }
}

.logo .bubble {
    position: absolute;
    inset: 0 14px 14px 0;
    border: 4px solid var(--coral);
    border-radius: 20px;
}

.logo .tile {
    position: absolute;
    inset: 10px 0 0 16px;
    background: var(--card);
    border-radius: 18px;
    box-shadow: var(--lift-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-weight: 800;
    color: var(--coral);
}

.wordmark { font-size: 27px; font-weight: 800; letter-spacing: -0.03em; }

/* ---------------------------------------------------------------- avatars */

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    flex: none;
    user-select: none;
    box-shadow: inset 0 -2px 6px rgba(0, 0, 0, 0.12), var(--lift-1);
}

img.avatar { object-fit: cover; background: var(--divider); }

.avatar-sm { width: 30px; height: 30px; font-size: 13px; }
.avatar-lg { width: 64px; height: 64px; font-size: 22px; }
.avatar-host { box-shadow: 0 0 0 2.5px var(--coral), var(--lift-1); }

/* ---------------------------------------------------------------- game board */

.board {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
    flex-wrap: wrap;
    perspective: 900px;
}

.tile {
    width: 56px;
    height: 68px;
    border-radius: var(--radius-tile);
    background: linear-gradient(180deg, #fff, #f4f5f7);
    border: 1px solid var(--divider);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 27px;
    font-weight: 800;
    box-shadow: var(--lift-1);
    transform-style: preserve-3d;
}

.tile-hidden::after {
    content: "";
    width: 18px;
    height: 3px;
    border-radius: 2px;
    background: var(--ink-muted);
    opacity: 0.45;
    margin-top: 22px;
}

/*
   The signature moment: a letter does not fade in, the tile turns over to show
   it. Flipping communicates "this just opened" far better than a colour change,
   which is why it is worth the 3D context on .board.
*/
@keyframes tile-flip {
    0%   { transform: rotateY(0deg) scale(1); }
    45%  { transform: rotateY(90deg) scale(1.08); }
    55%  { transform: rotateY(90deg) scale(1.08); }
    100% { transform: rotateY(0deg) scale(1); }
}

.tile-filled {
    animation: tile-flip 0.55s var(--ease-out);
    box-shadow: var(--lift-2);
    border-color: rgba(255, 84, 54, 0.35);
}

.tile-solved {
    background: linear-gradient(160deg, #ff7a5e, var(--coral));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 18px var(--coral-glow);
    animation: tile-flip 0.55s var(--ease-out);
}

/* Long words shrink rather than overflow. */
.board-tight .tile { width: 42px; height: 52px; font-size: 20px; }
.board-tight .tile-hidden::after { margin-top: 16px; }

/* ---------------------------------------------------------------- countdown */

.countdown {
    width: 124px;
    height: 124px;
    margin: 0 auto;
    position: relative;
}

.countdown svg { transform: rotate(-90deg); overflow: visible; }
.countdown .track { stroke: rgba(31, 41, 51, 0.08); }

.countdown .value {
    stroke: var(--coral);
    transition: stroke-dashoffset 1s linear, stroke 0.4s;
    filter: drop-shadow(0 2px 8px var(--coral-glow));
}

/* Under five seconds the whole dial takes on the alarm: colour, a pulse, and a
   slight grow. One channel would be easy to miss on a busy screen. */
.countdown .value.urgent { stroke: var(--danger); }

.countdown .label {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.countdown .seconds {
    font-size: 34px;
    font-weight: 800;
    color: var(--coral);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.countdown .seconds.urgent {
    color: var(--danger);
    animation: tick-pulse 1s ease-in-out infinite;
}

@keyframes tick-pulse {
    0%, 100% { transform: scale(1); }
    18%      { transform: scale(1.22); }
    40%      { transform: scale(1); }
}

/* ---------------------------------------------------------------- scoreboard + feed */

.panel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    align-items: start;
}

@media (max-width: 720px) {
    .panel-grid { grid-template-columns: 1fr; }
}

.score-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    border-radius: var(--radius-tile);
    transition: background 0.3s var(--ease-out);
}

.score-row.self { background: var(--coral-wash); }
.score-row .rank { width: 18px; text-align: center; font-size: 12px; color: var(--ink-muted); }
.score-row .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.score-row .score { font-weight: 800; font-variant-numeric: tabular-nums; }

.feed { max-height: 340px; overflow-y: auto; scroll-behavior: smooth; }

.feed-entry {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
    animation: slide-in 0.35s var(--ease-out);
}

@keyframes slide-in {
    from { opacity: 0; transform: translateX(-14px); }
    to   { opacity: 1; transform: none; }
}

.feed-entry .who { font-size: 11px; color: var(--ink-muted); }

.bubble {
    display: inline-block;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--divider);
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 13px;
}

.bubble-correct {
    background: linear-gradient(135deg, #ff7a5e, var(--coral));
    border-color: transparent;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 4px 12px var(--coral-glow);
}

/* ---------------------------------------------------------------- overlays */

.scrim {
    position: fixed;
    inset: 0;
    background: rgba(20, 24, 30, 0.42);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    z-index: 50;
    animation: fade 0.25s var(--ease-out);
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal {
    background: var(--card);
    border-radius: var(--radius-card-lg);
    padding: var(--space-xl);
    width: 100%;
    max-width: 460px;
    box-shadow: var(--lift-3);
    max-height: 88vh;
    overflow-y: auto;
    animation: modal-in 0.4s var(--ease-spring);
}

@keyframes modal-in {
    from { opacity: 0; transform: translateY(24px) scale(0.94); }
    to   { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- celebration */

/*
   The reward for solving. A ring of pieces thrown outward from the middle, each
   with its own angle and delay set inline — CSS alone cannot randomise, so the
   markup supplies the variation.
*/
.confetti {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    border-radius: inherit;
}

.confetti i {
    position: absolute;
    top: 42%;
    left: 50%;
    width: 9px;
    height: 14px;
    border-radius: 2px;
    opacity: 0;
    animation: burst 1.1s var(--ease-out) forwards;
    animation-delay: var(--d, 0s);
}

@keyframes burst {
    0%   { opacity: 1; transform: translate(-50%, -50%) rotate(0deg) scale(0.4); }
    100% { opacity: 0; transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) rotate(var(--r)) scale(1); }
}

.medal {
    width: 78px;
    height: 78px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: #fff;
    margin: 0 auto;
    background: linear-gradient(150deg, #ff7a5e, var(--coral));
    box-shadow: 0 10px 30px var(--coral-glow);
    animation: stamp 0.55s var(--ease-spring);
}

@keyframes stamp {
    0%   { transform: scale(0.3) rotate(-25deg); opacity: 0; }
    60%  { transform: scale(1.12) rotate(4deg); opacity: 1; }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}

.points-won {
    font-size: 52px;
    font-weight: 800;
    color: var(--coral);
    line-height: 1;
    font-variant-numeric: tabular-nums;
    animation: count-in 0.5s 0.15s var(--ease-spring) backwards;
}

@keyframes count-in {
    from { opacity: 0; transform: translateY(16px) scale(0.7); }
    to   { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- podium */

.podium { display: flex; align-items: flex-end; gap: var(--space-sm); }
.podium .place { flex: 1; text-align: center; }

.podium .block {
    border-radius: var(--radius-tile) var(--radius-tile) 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    font-weight: 800;
    margin-top: var(--space-sm);
    transform-origin: bottom;
    animation: raise 0.6s var(--ease-out) backwards;
}

/* Second and third settle first, then the winner — the order is the drama. */
@keyframes raise {
    from { transform: scaleY(0.05); opacity: 0; }
    to   { transform: scaleY(1); opacity: 1; }
}

.podium .p1 .block { height: 112px; background: linear-gradient(180deg, rgba(245, 194, 68, 0.5), rgba(245, 194, 68, 0.25)); color: #c99a12; animation-delay: 0.45s; }
.podium .p2 .block { height: 82px;  background: linear-gradient(180deg, rgba(201, 205, 210, 0.55), rgba(201, 205, 210, 0.3)); color: #7d8288; animation-delay: 0.15s; }
.podium .p3 .block { height: 64px;  background: linear-gradient(180deg, rgba(217, 160, 107, 0.5), rgba(217, 160, 107, 0.25)); color: #b07b44; animation-delay: 0.3s; }

.podium .crown {
    font-size: 26px;
    animation: crown-drop 0.5s 0.8s var(--ease-spring) backwards;
}

@keyframes crown-drop {
    from { opacity: 0; transform: translateY(-22px) rotate(-18deg); }
    to   { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- misc */

.centered-state {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: var(--space-md);
}

.tiles-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); }

.action-tile {
    border-radius: var(--radius-card-lg);
    padding: var(--space-xl);
    text-align: center;
    cursor: pointer;
    border: 1.5px solid transparent;
    box-shadow: var(--lift-1);
    transition: transform 0.28s var(--ease-spring), box-shadow 0.28s var(--ease-out);
}

.action-tile:hover { transform: translateY(-6px) scale(1.015); box-shadow: var(--lift-2); }
.action-tile:active { transform: translateY(-1px) scale(0.99); }

.action-tile.filled {
    background: linear-gradient(140deg, #ff6a4d, var(--coral) 60%, #ef4526);
    color: #fff;
    box-shadow: 0 10px 26px var(--coral-glow);
}

.action-tile.filled:hover { box-shadow: 0 18px 40px var(--coral-glow); }

.action-tile.outlined {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-color: rgba(255, 84, 54, 0.55);
}

.action-tile .glyph {
    width: 58px; height: 58px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto var(--space-md); font-size: 26px; color: var(--coral);
    transition: transform 0.35s var(--ease-spring);
}

.action-tile:hover .glyph { transform: scale(1.12) rotate(8deg); }
.action-tile.filled .glyph { background: #fff; box-shadow: var(--lift-1); }
.action-tile.outlined .glyph { background: var(--coral-wash); }

.room-code {
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 999px;
    padding: var(--space-lg);
    text-align: center;
    box-shadow: var(--lift-2);
}

.room-code .value {
    font-size: 42px;
    font-weight: 800;
    color: var(--coral);
    letter-spacing: 8px;
    font-variant-numeric: tabular-nums;
}

.rank-up { color: var(--success); font-size: 12px; font-weight: 700; }
.rank-down { color: var(--danger); font-size: 12px; font-weight: 700; }
.rank-same { color: var(--ink-muted); font-size: 12px; }

.player-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    gap: var(--space-lg);
}

.player-grid .player {
    text-align: center;
    animation: pop 0.4s var(--ease-spring) backwards;
    animation-delay: calc(var(--i, 0) * 70ms);
}

.player-grid .player .name {
    font-size: 12px;
    margin-top: var(--space-xs);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.option-grid { display: flex; gap: var(--space-sm); flex-wrap: wrap; }

.option {
    flex: 1 1 auto;
    min-width: 84px;
    padding: 12px;
    border-radius: var(--radius-tile);
    border: 1.5px solid var(--divider);
    background: rgba(255, 255, 255, 0.8);
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    color: var(--ink);
    transition: transform 0.18s var(--ease-spring), border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.option:hover { transform: translateY(-2px); border-color: rgba(255, 84, 54, 0.4); }
.option:active { transform: scale(0.96); }

.option.selected {
    border-color: var(--coral);
    background: var(--coral-wash);
    color: var(--coral);
    box-shadow: 0 4px 12px rgba(255, 84, 54, 0.18);
}

/* ---------------------------------------------------------------- reduced motion */

/*
   Everything above degrades to a still page. Motion sickness and vestibular
   disorders are not edge cases, and none of the animation carries information
   that the layout does not already show.
*/
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }

    body::before { animation: none; }
    .btn:not(:disabled):hover,
    .action-tile:hover { transform: none; }
}

/* ---------------------------------------------------------------- hint */

/*
   The clue sits directly under the board, where the eye already is. It is a
   sentence to read rather than a label, so it gets its own surface instead of
   being squeezed into the category line.
*/
.hint-card {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 560px;
    margin: 0 auto var(--space-md);
    padding: 12px 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--divider);
    box-shadow: var(--lift-1);
    font-size: 14px;
    animation: rise 0.5s var(--ease-out) backwards;
}

.hint-label {
    flex: none;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--coral);
    background: var(--coral-wash);
    border-radius: 999px;
    padding: 4px 10px;
}

/* ---------------------------------------------------------------- avatar picker */

/*
   Auto-fill rather than a fixed column count: the same grid sits in a narrow sign-in
   card and in the wider profile pane, and twenty faces reflowing beats two layouts.
*/
.avatar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
    gap: var(--space-sm);
    margin: var(--space-md) 0;
}

.avatar-choice {
    padding: 0;
    border: 2px solid transparent;
    border-radius: 50%;
    background: var(--coral-wash);
    aspect-ratio: 1;
    cursor: pointer;
    overflow: hidden;
    transition: transform 140ms var(--ease-spring), border-color 140ms var(--ease-out);
}

.avatar-choice img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-choice:hover { transform: translateY(-2px); }

/* The ring is the only thing marking the choice, so it carries a shadow too: on a
   busy grid of faces a thin outline alone reads as an artefact of the picture. */
.avatar-choice.selected {
    border-color: var(--coral);
    box-shadow: 0 0 0 3px var(--coral-glow);
    transform: translateY(-2px);
}
