    /* Silkscreen — self-hosted, eliminates ~51ms Google Fonts latency */
    /* latin-ext */
    @font-face {
        font-family: 'Silkscreen';
        font-style: normal;
        font-weight: 400;
        font-display: swap;
        src: url(fonts/silkscreen-400-latin-ext.woff2) format('woff2');
        unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
    }
    /* latin */
    @font-face {
        font-family: 'Silkscreen';
        font-style: normal;
        font-weight: 400;
        font-display: swap;
        src: url(fonts/silkscreen-400-latin.woff2) format('woff2');
        unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
    }
    /* latin-ext */
    @font-face {
        font-family: 'Silkscreen';
        font-style: normal;
        font-weight: 700;
        font-display: swap;
        src: url(fonts/silkscreen-700-latin-ext.woff2) format('woff2');
        unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
    }
    /* latin */
    @font-face {
        font-family: 'Silkscreen';
        font-style: normal;
        font-weight: 700;
        font-display: swap;
        src: url(fonts/silkscreen-700-latin.woff2) format('woff2');
        unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
    }

    :root {
        color-scheme: dark;
        --font-display: 'Silkscreen', ui-sans-serif, system-ui, sans-serif;
        --font-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
        font-family: var(--font-body);
        background: #0f172a;
        color: #f8fafc;
        /* UX_RECOMPOSE_v2 §8 tokens (Tier 2) */
        --btn-height-auto-desktop: 2.25rem;
        --btn-height-auto-touch:   2.75rem;
        --btn-height-cta:          2.75rem;
        --btn-width-cta:           min(100%, 16rem);
        --btn-padding-x-auto:      1.5rem;
        --appbar-height-desktop:   4.5rem;
        --appbar-height-tablet:    4rem;
        --appbar-height-mobile:    3rem;
        --container-max-wide:      60rem;
        --container-max-card:      36rem;
        --panel-padding-desktop:   2rem 2.5rem;
        --panel-padding-mobile:    1.25rem;
    }
    * {
        box-sizing: border-box;
    }
    html {
        background: #0f172a;
        scroll-padding-bottom: var(--appbar-height-desktop);
    }
    @media (max-width: 1023px) {
        html { scroll-padding-bottom: var(--appbar-height-tablet); }
    }
    @media (max-width: 767px) {
        html { scroll-padding-bottom: var(--appbar-height-mobile); }
    }
    body {
        margin: 0;
        min-height: 100vh;
        font-family: var(--font-body);
        color: #f8fafc;
        background-color: #0f172a;
        background-image:
            linear-gradient(180deg, rgba(92, 197, 244, 0.16) 0%, rgba(15, 23, 42, 0) 34%),
            linear-gradient(180deg, rgba(15, 23, 42, 0.92) 0%, rgba(12, 18, 32, 1) 100%);
        background-size: 100% 100%, 100% 100%;
        background-position: 0 0, 0 0;
        image-rendering: pixelated;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    @keyframes bgPan {
        from { transform: translate3d(0, 0, 0); }
        to { transform: translate3d(64px, 64px, 0); }
    }
    @keyframes crtFlicker {
        0% { opacity: 0.14; }
        25% { opacity: 0.17; }
        50% { opacity: 0.15; }
        75% { opacity: 0.18; }
        100% { opacity: 0.14; }
    }
    .shell {
        min-height: 100vh;
        padding: 40px 20px 56px;
        position: relative;
        overflow: hidden;
        background-color: #0f172a;
        transition: background-color 1s ease;
    }
    .shell--pre-session {
        min-height: calc(100vh - var(--appbar-height-desktop));
        padding-top: min(12vh, 6rem);
    }
    .shell--create-character {
        display: flex;
        align-items: stretch;
        padding-top: 24px;
        padding-bottom: 24px;
    }
    .shell.shell--day {
        background-color: #38bdf8;
    }
    .shell.shell--night {
        background-color: #0f172a;
    }
    .shell > * {
        position: relative;
        z-index: 1;
    }
    .shell__container::before {
        content: "";
        position: fixed;
        inset: -64px;
        pointer-events: none;
        z-index: -1;
        background-image:
            linear-gradient(45deg, rgba(165, 228, 255, 0.16) 25%, transparent 25%, transparent 75%, rgba(165, 228, 255, 0.16) 75%),
            linear-gradient(45deg, rgba(76, 99, 217, 0.12) 25%, transparent 25%, transparent 75%, rgba(76, 99, 217, 0.12) 75%);
        background-size: 64px 64px, 64px 64px;
        background-position: 0 0, 32px 32px;
        will-change: transform;
        transition: background-image 1s ease;
        animation: bgPan 24s linear infinite;
    }
    /* Night pattern (default): polka-dot starfield */
    .shell--night .shell__container::before {
        background-image:
            radial-gradient(rgba(79, 70, 229, 0.45) 15%, transparent 16%),
            radial-gradient(rgba(79, 70, 229, 0.45) 15%, transparent 16%);
        animation: bgPan 30s linear infinite;
    }
    /* Day pattern: diagonal checkerboard */
    .shell--day .shell__container::before {
        background-image:
            linear-gradient(45deg, rgba(125, 211, 252, 0.35) 25%, transparent 25%, transparent 75%, rgba(125, 211, 252, 0.35) 75%),
            linear-gradient(45deg, rgba(125, 211, 252, 0.35) 25%, transparent 25%, transparent 75%, rgba(125, 211, 252, 0.35) 75%);
        animation: bgPan 20s linear infinite;
    }
    .shell::before,
    .shell::after {
        content: "";
        position: fixed;
        inset: 0;
        pointer-events: none;
        z-index: 4;
    }
    .shell::before {
        background:
            linear-gradient(180deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.04) 100%),
            repeating-linear-gradient(180deg, rgba(255,255,255,0.28) 0 1px, rgba(203, 213, 225, 0.20) 1px 2px, rgba(15, 23, 42, 0.06) 2px 4px);
        background-size: 100% 100%, 100% 4px;
        opacity: 0.24;
        animation: crtFlicker 1.8s ease-in-out infinite;
    }
    .shell::after {
        background:
            radial-gradient(circle at center, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 40%, rgba(0,0,0,0.10) 72%, rgba(0,0,0,0.34) 100%);
    }
    .shell__container {
        max-width: var(--container-max-wide);
        margin: 0 auto;
        display: grid;
        gap: 24px;
        position: relative;
        z-index: 1;
    }
    .shell__container--card {
        width: min(var(--container-max-card), calc(100% - 2rem));
    }
    .shell__container--phase0 > .notice,
    .shell__container--handover > .notice {
        max-width: 640px;
    }
    .hero,
    .panel {
        background-color: rgba(248, 250, 252, 0.96);
        color: #111827;
        border: 4px solid #111827;
        border-radius: 0;
        box-shadow:
            inset -4px -4px 0 0 rgba(0, 0, 0, 0.18),
            inset 4px 4px 0 0 rgba(255, 255, 255, 0.48),
            8px 8px 0 0 rgba(0, 0, 0, 0.55);
        position: relative;
    }
    .hero::before,
    .panel::before {
        content: "";
        position: absolute;
        inset: 0;
        border: 3px solid rgba(255, 255, 255, 0.72);
        pointer-events: none;
    }
    .hero {
        padding: 32px 36px;
        display: grid;
        gap: 16px;
        background:
            linear-gradient(180deg, rgba(255, 247, 214, 0.98) 0%, rgba(248, 250, 252, 0.96) 100%);
        overflow: hidden;
    }
    .hero__title,
    .hero__body,
    .hero__meta {
        padding-inline-start: 6px;
    }
    .hero__title {
        margin: 0;
        font-family: var(--font-display);
        font-size: clamp(30px, 5vw, 50px);
        line-height: 1.05;
        text-transform: uppercase;
        text-shadow: 3px 3px 0 rgba(15, 23, 42, 0.18);
    }
    .hero__body,
    .panel__body,
    .meta {
        margin: 0;
        font-family: var(--font-body);
        color: #334155;
        line-height: 1.7;
        font-size: 13px;
    }
    .hero__body {
        max-width: 52rem;
    }
    .hero__meta {
        display: flex;
        gap: 12px;
        row-gap: 10px;
        align-items: center;
        flex-wrap: wrap;
    }
    .badge {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 10px 14px;
        font-family: var(--font-display);
        border: 3px solid #0f172a;
        background: #e2e8f0;
        color: #0f172a;
        box-shadow:
            inset 3px 3px 0 0 rgba(255,255,255,0.55),
            inset -3px -3px 0 0 rgba(0,0,0,0.12),
            3px 3px 0 0 rgba(0,0,0,0.35);
        font-size: 11px;
        text-transform: uppercase;
    }
    .status-offline { color: #b45309; }
    .status-connecting { color: #1d4ed8; }
    .status-connected { color: #166534; }
    .grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 24px;
    }
    .panel {
        padding: 30px 22px 22px;
        display: grid;
        gap: 12px;
        overflow: hidden;
        background:
            linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(241,245,249,0.96) 100%);
    }
    .panel--wide {
        width: 100%;
    }
    .panel--session {
        background:
            linear-gradient(180deg, rgba(255, 251, 235, 0.98) 0%, rgba(255,255,255,0.96) 100%);
    }
    .panel--controls {
        background:
            linear-gradient(180deg, rgba(236, 253, 245, 0.98) 0%, rgba(255,255,255,0.96) 100%);
    }
    .panel--judge {
        background:
            linear-gradient(180deg, rgba(239, 246, 255, 0.98) 0%, rgba(255,255,255,0.96) 100%);
    }
    .panel--runtime {
        background:
            linear-gradient(180deg, rgba(224, 231, 255, 0.98) 0%, rgba(255,255,255,0.96) 100%);
    }
    .panel--hero-tint {
        background:
            linear-gradient(180deg, rgba(255, 247, 214, 0.98) 0%, rgba(248, 250, 252, 0.96) 100%);
    }
    .panel--session::after,
    .panel--controls::after,
    .panel--judge::after,
    .panel--runtime::after {
        content: "";
        position: absolute;
        inset: 0 0 auto 0;
        height: 12px;
        pointer-events: none;
        border-bottom: 3px solid rgba(15, 23, 42, 0.18);
    }
    .panel--session::after { background: #ca8a04; }
    .panel--controls::after { background: #34d399; }
    .panel--judge::after { background: #38bdf8; }
    .panel--runtime::after { background: #4c63d9; }
    .panel__title {
        margin: 0;
        font-family: var(--font-display);
        font-size: 20px;
        text-transform: uppercase;
    }
    .panel__header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }
    .panel__header .panel__title {
        flex: 1 1 auto;
    }
    /* Subordinate label beneath `.panel__title`. PickCharacter uses
       this for its "Your Characters" h2 so the visual hierarchy
       remains h1 (title) > h2 (subtitle). */
    .panel__subtitle {
        margin: 0 0 8px;
        font-family: var(--font-body);
        font-size: 14px;
        font-weight: 600;
        color: #475569;
        text-transform: none;
        letter-spacing: normal;
    }
    .panel__list {
        margin: 0;
        padding-left: 18px;
        color: #334155;
        display: grid;
        gap: 8px;
        font-size: 12px;
    }
    .panel__stack {
        display: grid;
        gap: 12px;
    }
    .panel__stack--home-action {
        margin-top: auto;
    }
    .flow-cards {
        display: grid;
        gap: 12px;
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
    .flow-card {
        background: #1d2938;
        color: #f8fafc;
        border: 4px solid #06101f;
        padding: 14px 16px;
        box-shadow:
            inset -4px -4px 0 0 rgba(0,0,0,0.35),
            4px 4px 0 0 rgba(0,0,0,0.35);
    }
    .flow-card__title {
        margin: 0 0 8px;
        font-family: var(--font-display);
        font-size: 12px;
        color: #facc15;
        text-transform: uppercase;
        letter-spacing: 0.08em;
    }
    .flow-card__body {
        margin: 0;
        font-family: var(--font-body);
        color: #cbd5e1;
        font-size: 12px;
        line-height: 1.6;
    }
    .input {
        width: 100%;
        font-family: var(--font-body);
        border-radius: 0;
        border: 4px solid #0f172a;
        background: #ffffff;
        color: #0f172a;
        padding: 10px 12px;
        font: inherit;
        box-shadow: inset 4px 4px 0 0 rgba(0,0,0,0.08);
        outline: none;
    }
    .input::placeholder {
        color: #64748b;
    }
    .input:focus-visible,
    .button:focus-visible {
        outline: 4px solid #fde047;
        outline-offset: 4px;
    }
    .button-row {
        display: flex;
        gap: 12px;
        flex-wrap: wrap;
    }
    .button-row--home-action .button {
        flex: 1 1 0;
        min-width: 0;
    }
    .button {
        border: 4px solid #0f172a;
        border-radius: 0;
        padding: 10px 14px;
        font-family: var(--font-display);
        font-size: 12px;
        font-weight: 700;
        text-transform: uppercase;
        cursor: pointer;
        color: #0f172a;
        background: #e2e8f0;
        box-shadow:
            inset 4px 4px 0 0 rgba(255,255,255,0.72),
            inset -4px -4px 0 0 rgba(0,0,0,0.12),
            4px 4px 0 0 rgba(0,0,0,0.45);
        transition: transform 0.08s ease-out;
    }
    .button--cta {
        width: var(--btn-width-cta);
        height: var(--btn-height-cta);
    }
    @media (max-width: 767px) {
        .button {
            height: var(--btn-height-auto-touch);
        }
    }
    .button:hover {
        filter: brightness(1.03);
    }
    .button:active {
        transform: translate(4px, 4px);
        box-shadow:
            inset 4px 4px 0 0 rgba(0,0,0,0.12),
            inset -4px -4px 0 0 rgba(255,255,255,0.72),
            0 0 0 0 transparent;
    }
    .button:disabled {
        opacity: 0.65;
        cursor: wait;
        transform: none;
    }
    .button--primary {
        background: #34d399;
        color: #022c22;
    }
    .button--secondary {
        background: #38bdf8;
        color: #082f49;
    }
    .button--danger {
        background: #f43f5e;
        color: #fff;
    }
    .notice {
        width: 100%;
        border-radius: 0;
        padding: 14px 16px;
        border: 4px solid #0f172a;
        font-size: 12px;
        box-shadow: 4px 4px 0 0 rgba(0,0,0,0.35);
        position: relative;
        z-index: 1;
    }
    .notice-info {
        background: #dbeafe;
        color: #1e3a8a;
    }
    .notice-success {
        background: #dcfce7;
        color: #166534;
    }
    .notice-warning {
        background: #fef3c7;
        color: #92400e;
    }
    .notice-error {
        background: #fecdd3;
        color: #9f1239;
    }
    ::-webkit-scrollbar {
        width: 16px;
    }
    ::-webkit-scrollbar-track {
        background: #cbd5e1;
        border-left: 4px solid #0f172a;
    }
    ::-webkit-scrollbar-thumb {
        background: #64748b;
        border: 4px solid #0f172a;
        box-shadow: inset 2px 2px 0 0 rgba(255,255,255,0.3);
    }
    ::-webkit-scrollbar-thumb:hover {
        background: #475569;
    }
    .session-summary {
        display: grid;
        gap: 10px;
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
    .summary-chip {
        margin: 0;
        padding: 12px;
        font-family: var(--font-body);
        border: 3px solid #0f172a;
        background: #fffdf6;
        color: #0f172a;
        box-shadow:
            inset 3px 3px 0 0 rgba(255,255,255,0.68),
            inset -3px -3px 0 0 rgba(0,0,0,0.08),
            3px 3px 0 0 rgba(0,0,0,0.18);
    }
    .roster {
        display: grid;
        gap: 10px;
    }
    .roster__item {
        border: 4px solid #0f172a;
        border-radius: 0;
        background: #ffffff;
        padding: 14px 16px;
        display: flex;
        justify-content: space-between;
        gap: 12px;
        align-items: center;
        box-shadow:
            inset 3px 3px 0 0 rgba(255,255,255,0.72),
            inset -3px -3px 0 0 rgba(0,0,0,0.08),
            4px 4px 0 0 rgba(0,0,0,0.24);
    }
    .button-row--workshop-pager {
        align-self: flex-start;
        display: flex;
        justify-content: flex-end;
        flex: 0 0 auto;
        margin-left: auto;
        width: auto;
    }
    .button-row--workshop-actions {
        justify-content: flex-end;
        align-items: center;
        flex: 0 0 auto;
        flex-wrap: nowrap;
        gap: 8px;
    }
    .button-row--workshop-actions .button {
        flex: 0 0 auto;
        white-space: nowrap;
    }
    .modal-backdrop {
        position: fixed;
        inset: 0;
        z-index: 120;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 24px;
        background: rgba(2, 6, 23, 0.72);
        backdrop-filter: blur(4px);
    }
    .modal-card {
        width: min(560px, 100%);
        border: 4px solid #0f172a;
        background:
            linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(241,245,249,0.98) 100%);
        box-shadow:
            inset 3px 3px 0 0 rgba(255,255,255,0.72),
            inset -3px -3px 0 0 rgba(0,0,0,0.08),
            10px 10px 0 0 rgba(15,23,42,0.45);
        display: grid;
        gap: 14px;
        padding: 24px;
    }
    .modal-card__title {
        color: #0f172a;
    }
    .modal-card__body {
        max-width: 42ch;
    }
    .modal-card__actions {
        justify-content: flex-end;
    }
    .modal-card__actions .button {
        min-width: 136px;
    }
    .roster__item--phase {
        background: #fff7d6;
    }
    .roster__item--phase .roster__name {
        color: #0f172a;
    }
    .roster__item--feedback {
        align-items: flex-start;
        background: #f8fbff;
    }
    .roster__name {
        margin: 0;
        font-family: var(--font-display);
        font-size: 13px;
        font-weight: 700;
        text-transform: uppercase;
    }
    .roster__meta {
        margin: 6px 0 0;
        font-family: var(--font-body);
        color: #475569;
        font-size: 11px;
        text-transform: none;
        letter-spacing: 0.01em;
        line-height: 1.5;
    }
    .roster__meta--feedback {
        margin-top: 8px;
        color: #0f172a;
        font-size: 12px;
        line-height: 1.7;
        max-width: 54ch;
    }
    .roster__status {
        font-family: var(--font-display);
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.08em;
    }
    .roster__status--phase {
        padding: 6px 8px;
        border: 3px solid currentColor;
        background: rgba(255,255,255,0.65);
    }
    .judge-feedback-grid {
        display: grid;
        gap: 12px;
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }
    .judge-feedback-card {
        border: 4px solid #0f172a;
        background: #eff6ff;
        padding: 16px;
        display: grid;
        gap: 8px;
        box-shadow:
            inset 3px 3px 0 0 rgba(255,255,255,0.72),
            inset -3px -3px 0 0 rgba(0,0,0,0.08),
            4px 4px 0 0 rgba(0,0,0,0.24);
    }
    .judge-feedback-card__body {
        margin: 0;
        font-family: var(--font-body);
        color: #1e293b;
        font-size: 12px;
        line-height: 1.7;
    }
    /* ---- Voting grid + pixel dragon sprites ---- */
    .voting-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .voting-card {
        border: 4px solid #0f172a;
        background: #ffffff;
        padding: 16px;
        display: flex;
        align-items: center;
        gap: 16px;
        box-shadow:
            inset 3px 3px 0 0 rgba(255,255,255,0.72),
            inset -3px -3px 0 0 rgba(0,0,0,0.08),
            4px 4px 0 0 rgba(0,0,0,0.24);
        transition: transform 0.08s ease-out;
    }
    .voting-card--selected {
        border-color: #166534;
        background: #dcfce7;
    }
    .voting-card--blocked {
        opacity: 0.55;
    }
    .voting-card__sprite {
        width: 64px;
        height: 64px;
        position: relative;
        image-rendering: pixelated;
    }
    .voting-card__sprite--fallback {
        margin: 0 auto;
    }
    .voting-card__sprite-stack {
        display: grid;
        gap: 8px;
        flex: 0 0 auto;
        min-width: 184px;
        justify-items: start;
    }
    .voting-card__emotion-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
    }
    /* Pixel blocks forming a simplified dragon silhouette */
    .sprite-pixel {
        position: absolute;
        image-rendering: pixelated;
    }
    .sprite-body {
        width: 28px;
        height: 20px;
        top: 24px;
        left: 16px;
        border: 2px solid rgba(0,0,0,0.18);
    }
    .sprite-head {
        width: 16px;
        height: 14px;
        top: 14px;
        left: 36px;
        border: 2px solid rgba(0,0,0,0.18);
    }
    .sprite-eye {
        width: 4px;
        height: 4px;
        top: 18px;
        left: 44px;
    }
    .sprite-wing {
        width: 18px;
        height: 10px;
        top: 16px;
        left: 14px;
        border: 2px solid rgba(0,0,0,0.12);
        clip-path: polygon(0% 100%, 50% 0%, 100% 100%);
    }
    .sprite-tail {
        width: 14px;
        height: 8px;
        top: 32px;
        left: 4px;
        border: 2px solid rgba(0,0,0,0.18);
        clip-path: polygon(0% 50%, 60% 0%, 100% 50%, 60% 100%);
    }
    .sprite-horn {
        width: 6px;
        height: 8px;
        top: 8px;
        left: 42px;
        clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    }
    .sprite-legs {
        width: 6px;
        height: 8px;
        top: 44px;
        left: 22px;
        border: 2px solid rgba(0,0,0,0.12);
        box-shadow: 12px 0 0 0 currentColor;
    }
    .voting-card__name {
        margin: 0;
        font-family: var(--font-display);
        font-size: 12px;
        text-transform: uppercase;
        text-align: left;
    }
    .voting-card__badge {
        font-family: var(--font-display);
        font-size: 10px;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        padding: 4px 8px;
        border: 2px solid currentColor;
    }
    .voting-card__summary {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 10px;
        flex: 1 1 auto;
        align-content: center;
        align-items: center;
    }
    .voting-card__button {
        font-size: 11px;
        padding: 6px 12px;
        justify-self: end;
        grid-column: 2;
        grid-row: 1 / span 2;
    }
    /* ---- Voting card: base64 sprite image ---- */
    .voting-card__sprite-img {
        width: 100%;
        max-width: 84px;
        aspect-ratio: 1 / 1;
        image-rendering: pixelated;
        display: block;
        border: 3px solid #0f172a;
        background: #e2e8f0;
        box-shadow:
            inset 2px 2px 0 0 rgba(255,255,255,0.55),
            inset -2px -2px 0 0 rgba(0,0,0,0.08),
            3px 3px 0 0 rgba(0,0,0,0.18);
    }
    /* ---- Phase 0: dragon description textarea ---- */
    .sprite-description-input {
        resize: vertical;
        min-height: 64px;
        font-family: var(--font-body);
        font-size: 13px;
        line-height: 1.6;
    }
    /* ---- Phase 0: sprite preview ---- */
    .sprite-preview-section {
        border: 3px solid #0f172a;
        background: #fffdf6;
        padding: 16px;
        box-shadow:
            inset 2px 2px 0 0 rgba(255,255,255,0.5),
            inset -2px -2px 0 0 rgba(0,0,0,0.06),
            3px 3px 0 0 rgba(0,0,0,0.18);
    }
    .sprite-preview {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        padding: 12px 0;
    }
    .sprite-preview__image {
        width: 128px;
        height: 128px;
        image-rendering: pixelated;
        border: 4px solid #0f172a;
        background: #e2e8f0;
        box-shadow:
            inset 3px 3px 0 0 rgba(0,0,0,0.08),
            4px 4px 0 0 rgba(0,0,0,0.24);
    }
    .sprite-preview__label {
        margin: 0;
        font-family: var(--font-display);
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: #0f172a;
    }
    .sprite-emotion-nav {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        justify-content: center;
    }
    .sprite-emotion-btn {
        font-size: 10px;
        padding: 4px 8px;
    }
    .sprite-emotion-btn--active {
        box-shadow:
            inset 4px 4px 0 0 rgba(0,0,0,0.12),
            inset -4px -4px 0 0 rgba(255,255,255,0.72),
            0 0 0 0 transparent;
        transform: translate(2px, 2px);
    }
    /* ---- Leaderboard table ---- */
    .leaderboard {
        border: 4px solid #0f172a;
        background: #ffffff;
        box-shadow:
            inset 3px 3px 0 0 rgba(255,255,255,0.72),
            inset -3px -3px 0 0 rgba(0,0,0,0.08),
            4px 4px 0 0 rgba(0,0,0,0.24);
    }
    .leaderboard__header {
        display: grid;
        grid-template-columns: 40px 1fr 60px 60px 72px 64px;
        gap: 0;
        padding: 10px 14px;
        background: #0f172a;
        color: #f8fafc;
        font-family: var(--font-display);
        font-size: 10px;
        text-transform: uppercase;
        letter-spacing: 0.08em;
    }
    .leaderboard__row {
        display: grid;
        grid-template-columns: 40px 1fr 60px 60px 72px 64px;
        gap: 0;
        padding: 10px 14px;
        align-items: center;
        border-top: 2px solid #e2e8f0;
    }
    .leaderboard__row:first-of-type {
        border-top: none;
    }
    .leaderboard__row--winner {
        background: #fffbeb;
    }
    .leaderboard__col {
        font-family: var(--font-body);
        font-size: 12px;
        color: #0f172a;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .leaderboard__col--rank {
        font-family: var(--font-display);
        font-size: 12px;
        font-weight: 700;
        text-transform: uppercase;
    }
    .leaderboard__col--name {
        font-family: var(--font-display);
        font-size: 12px;
        font-weight: 700;
        text-transform: uppercase;
    }
    .leaderboard__col--score {
        text-align: center;
        font-variant-numeric: tabular-nums;
    }
    .leaderboard__col--total {
        text-align: center;
        font-family: var(--font-display);
        font-weight: 700;
        font-variant-numeric: tabular-nums;
    }
    .leaderboard__col--status {
        text-align: center;
        font-family: var(--font-display);
        font-size: 10px;
        text-transform: uppercase;
        letter-spacing: 0.06em;
    }
    .leaderboard__status--good {
        color: #166534;
    }
    .leaderboard__status--bad {
        color: #991b1b;
        cursor: default;
    }
    .leaderboard__tooltip-anchor {
        position: relative;
    }
    .leaderboard__tooltip {
        display: none;
        position: absolute;
        right: 0;
        top: 100%;
        margin-top: 6px;
        z-index: 10;
        min-width: 220px;
        max-width: 320px;
        padding: 10px 12px;
        font-family: var(--font-body);
        font-size: 11px;
        text-transform: none;
        letter-spacing: normal;
        line-height: 1.6;
        color: #1e293b;
        white-space: normal;
        background: #fff1f2;
        border: 3px solid #991b1b;
        box-shadow: 3px 3px 0 0 rgba(0,0,0,0.18);
    }
    .leaderboard__tooltip-anchor:hover .leaderboard__tooltip {
        display: block;
    }
    /* Creativity leaderboard uses a 4-column grid */
    .leaderboard--creativity .leaderboard__header,
    .leaderboard--creativity .leaderboard__row {
        grid-template-columns: 40px 1fr 1fr 72px;
    }
    /* ---- Scoring methodology (end view) ---- */
    .scoring-method {
        border: 3px solid #0f172a;
        background: #f8fafc;
        padding: 14px 16px;
        margin-top: 4px;
        box-shadow:
            inset 2px 2px 0 0 rgba(255,255,255,0.5),
            inset -2px -2px 0 0 rgba(0,0,0,0.06),
            3px 3px 0 0 rgba(0,0,0,0.18);
    }
    .scoring-method__title {
        margin: 0 0 8px;
        font-family: var(--font-display);
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: #0f172a;
    }
    .scoring-method__body {
        font-family: var(--font-body);
        font-size: 12px;
        color: #334155;
        line-height: 1.6;
    }
    .scoring-method__section {
        margin: 6px 0;
    }
    /* ---- Stat bars (dragon stats display) ---- */
    .stat-bars {
        display: grid;
        gap: 8px;
    }
    .stat-bar {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .stat-bar__label {
        font-family: var(--font-display);
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: #0f172a;
        min-width: 56px;
    }
    .stat-bar__track {
        flex: 1;
        height: 16px;
        border: 3px solid #0f172a;
        background: #e2e8f0;
        position: relative;
        box-shadow:
            inset 2px 2px 0 0 rgba(0,0,0,0.12),
            2px 2px 0 0 rgba(0,0,0,0.18);
    }
    .stat-bar__fill {
        height: 100%;
        background: #38bdf8;
        transition: width 0.3s ease;
        box-shadow: inset 2px 2px 0 0 rgba(255,255,255,0.4);
    }
    .stat-bar__value {
        font-family: var(--font-display);
        font-size: 11px;
        color: #0f172a;
        min-width: 28px;
        text-align: right;
    }
    @media (max-width: 720px) {
        .shell {
            padding: 24px 14px 40px;
        }
        .shell--pre-session {
            padding-top: 1rem;
        }
        .hero,
        .panel {
            box-shadow:
                inset -4px -4px 0 0 rgba(0, 0, 0, 0.18),
                inset 4px 4px 0 0 rgba(255, 255, 255, 0.48),
                5px 5px 0 0 rgba(0, 0, 0, 0.45);
        }
        .hero {
            padding: 20px;
        }
        .panel {
            padding: 18px;
        }
        .button-row {
            flex-direction: column;
        }
        .button:not(.button--cta) {
            width: 100%;
        }
        .roster__item {
            flex-direction: column;
            align-items: flex-start;
        }
        .panel__header {
            align-items: flex-start;
            flex-direction: column;
        }
        .button-row--workshop-pager {
            margin-left: 0;
        }
        .button-row--workshop-pager,
        .button-row--workshop-actions {
            width: 100%;
        }
        .modal-card__actions {
            width: 100%;
        }
        .modal-card__actions .button {
            min-width: 0;
        }
        .button-row--workshop-actions {
            justify-content: stretch;
            flex-wrap: wrap;
        }
        .button-row--workshop-actions .button {
            flex: 1 1 0;
            min-width: 0;
        }
        .voting-card {
            flex-direction: column;
            align-items: stretch;
        }
        .voting-card__sprite-stack {
            min-width: 0;
            width: 100%;
            justify-items: center;
        }
        .voting-card__name {
            text-align: center;
        }
        .voting-card__button {
            grid-column: 1;
            grid-row: auto;
            justify-self: stretch;
        }
    }
    /* ---- Phase 0: sprite grid (all 4 emotions) ---- */
    .sprite-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }
    .sprite-grid__cell {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
    }
    .sprite-grid__image-wrap {
        width: 96px;
        height: 96px;
        border: 4px solid #0f172a;
        background: #e2e8f0;
        box-shadow:
            inset 3px 3px 0 0 rgba(0,0,0,0.08),
            4px 4px 0 0 rgba(0,0,0,0.24);
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .sprite-grid__image {
        width: 100%;
        height: 100%;
        image-rendering: pixelated;
        object-fit: contain;
    }
    .sprite-grid__label {
        margin: 0;
        font-family: var(--font-display);
        font-size: 10px;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: #475569;
    }
    @media (max-width: 720px) {
        .sprite-grid {
            grid-template-columns: repeat(2, 1fr);
        }
    }

    /* ---- Phase 1: 3-column layout (dragon left 2/3, actions right 1/3) ---- */
    .shell__container--phase1 {
        max-width: 1280px;
    }

    /* ---- Clock HUD (Phase 1 + Phase 2) ---- */
    .clock-hud {
        position: fixed;
        top: 24px;
        right: 24px;
        z-index: 3;
        display: flex;
        align-items: center;
        gap: 12px;
        background: rgba(15, 23, 42, 0.92);
        border: 4px solid #0f172a;
        padding: 10px 18px;
        box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.4);
    }
    .clock-hud__time {
        font-family: var(--font-display);
        font-weight: 900;
        font-size: 26px;
        letter-spacing: 0.12em;
        color: #f8fafc;
        text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
    }
    @media (max-width: 720px) {
        .clock-hud {
            top: 8px;
            right: 8px;
            padding: 6px 12px;
            gap: 8px;
        }
        .clock-hud__time {
            font-size: 18px;
        }
    }

    /* ---- Lobby: centered waiting room ---- */
    .shell__container--lobby {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: calc(100vh - 96px);
    }
    .phase1-grid {
        display: grid;
        grid-template-columns: 2fr 1fr;
        gap: 24px;
        align-items: start;
    }
    .phase1-dragon-col {
        display: grid;
        gap: 24px;
    }
    .phase1-actions-col {
        display: grid;
        gap: 24px;
    }
    @media (max-width: 900px) {
        .phase1-grid {
            grid-template-columns: 1fr;
        }
    }

    /* ---- Handover: shift change screen ---- */
    .handover-card {
        max-width: 640px;
        width: 100%;
        text-align: center;
        padding: 36px 32px 28px;
        gap: 8px;
    }
    .handover-card__title {
        margin: 0;
        font-family: var(--font-display);
        font-size: clamp(28px, 4vw, 44px);
        line-height: 1.05;
        text-transform: uppercase;
        text-shadow: 3px 3px 0 rgba(15, 23, 42, 0.18);
    }
    .handover-card__subtitle {
        margin: 0 0 20px;
        font-family: var(--font-display);
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.12em;
        color: #475569;
    }
    .handover-input-group {
        display: grid;
        gap: 10px;
        text-align: left;
    }
    .handover-input-label {
        margin: 0;
        font-family: var(--font-display);
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: #334155;
    }
    .handover-rule-number {
        width: 48px;
        height: 48px;
        min-width: 48px;
        background: rgba(100, 116, 139, 0.15);
        border: 4px solid #0f172a;
        display: flex;
        align-items: center;
        justify-content: center;
        font-family: var(--font-display);
        font-weight: 900;
        font-size: 20px;
        color: #334155;
    }
    .shell__container--handover {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: calc(100vh - 96px);
    }
    .shell__container--voting {
        max-width: 900px;
    }
    .shell__container--end {
        max-width: 900px;
    }
    @media (max-width: 720px) {
        .handover-card {
            padding: 24px 18px 20px;
        }
    }

    /* ---- Dragon display area (phase 1/2) ---- */
    .dragon-stage {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 280px;
        margin: 16px 0;
    }
    .dragon-stage__sprite {
        width: 220px;
        height: 220px;
        image-rendering: pixelated;
        object-fit: contain;
        filter: drop-shadow(0 10px 10px rgba(0,0,0,0.5));
    }
    @keyframes dragonFloat {
        0%, 100% { transform: translateY(0); }
        50% { transform: translateY(-8px); }
    }
    @keyframes dragonBounce {
        0%, 100% { transform: translateY(0); }
        50% { transform: translateY(-12px); }
    }
    @keyframes dragonShake {
        0%, 100% { transform: translateX(0); }
        25% { transform: translateX(-4px); }
        75% { transform: translateX(4px); }
    }
    @keyframes dragonSink {
        0%, 100% { transform: translateY(0); opacity: 1; }
        50% { transform: translateY(4px); opacity: 0.8; }
    }
    .dragon-stage__mover {
        animation: dragonFloat 2.5s ease-in-out infinite;
    }
    .dragon-stage__mover--happy {
        animation: dragonBounce 0.4s ease-in-out infinite;
    }
    .dragon-stage__mover--angry {
        animation: dragonShake 0.1s linear infinite;
    }
    .dragon-stage__mover--sleepy {
        animation: dragonSink 4s ease-in-out infinite;
    }

    /* ---- Speech bubble ---- */
    .speech-bubble {
        position: absolute;
        top: -12px;
        left: 50%;
        transform: translateX(-50%);
        background: #ffffff;
        border: 4px solid #0f172a;
        padding: 6px 14px;
        z-index: 20;
        box-shadow: 4px 4px 0 #0f172a;
        white-space: nowrap;
        animation: speechFadeIn 0.3s ease-out;
    }
    .speech-bubble__text {
        margin: 0;
        font-family: var(--font-body);
        font-weight: 700;
        font-size: 14px;
        color: #0f172a;
        text-align: center;
    }
    .speech-bubble__tail {
        position: absolute;
        bottom: -10px;
        left: 50%;
        transform: translateX(-50%) rotate(45deg);
        width: 14px;
        height: 14px;
        background: #ffffff;
        border-bottom: 4px solid #0f172a;
        border-right: 4px solid #0f172a;
    }
    @keyframes speechFadeIn {
        from { opacity: 0; transform: translateX(-50%) translateY(10px); }
        to   { opacity: 1; transform: translateX(-50%) translateY(0); }
    }

    /* ---- Pixel progress bars (20-step) ---- */
    .pixel-progress-container {
        background-color: #1e293b;
        border: 4px solid #0f172a;
        box-shadow: inset 4px 4px 0 0 rgba(0,0,0,0.5);
        padding: 4px;
        display: flex;
        gap: 2px;
        height: 28px;
        width: 100%;
    }
    .pixel-progress-bar {
        flex: 1;
        height: 100%;
        border: 2px solid rgba(255,255,255,0.2);
        border-top-color: rgba(255,255,255,0.5);
        border-left-color: rgba(255,255,255,0.5);
        border-bottom-color: rgba(0,0,0,0.2);
        border-right-color: rgba(0,0,0,0.2);
    }
    .pixel-progress-bar--empty {
        background: transparent;
        border-color: transparent;
    }
    .pixel-progress-bar--pink   { background: #f472b6; }
    .pixel-progress-bar--orange { background: #fb923c; }
    .pixel-progress-bar--blue   { background: #60a5fa; }
    .pixel-stat-row {
        display: flex;
        flex-direction: column;
        gap: 4px;
        margin-bottom: 10px;
    }
    .pixel-stat-row__header {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .pixel-stat-row__label {
        display: flex;
        align-items: center;
        gap: 6px;
        font-family: var(--font-display);
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: #334155;
    }
    .pixel-stat-row__value {
        font-family: var(--font-display);
        font-size: 11px;
        color: #334155;
    }

    /* ---- Pixel icon (PokeAPI sprite) ---- */
    .pixel-icon {
        image-rendering: pixelated;
        display: inline-block;
        vertical-align: middle;
    }

    /* ---- pixel-header / pixel-header-amber (initial-version style) ---- */
    .pixel-header {
        background-color: #0f172a;
        color: #f8fafc;
        padding: 12px 20px;
        border-bottom: 4px solid #0f172a;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .pixel-header-amber {
        background-color: #b45309;
        color: #fffbeb;
        padding: 12px 20px;
        border-bottom: 4px solid #0f172a;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .pixel-header__title {
        margin: 0;
        font-family: var(--font-display);
        font-size: 16px;
        font-weight: 900;
        text-transform: uppercase;
        text-shadow: 3px 3px 0 rgba(0,0,0,0.8);
        letter-spacing: 0.06em;
    }

    /* ---- Action buttons with icons (phase 1/2) ---- */
    .action-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    .action-btn {
        border: 4px solid #0f172a;
        border-radius: 0;
        padding: 14px 8px;
        font-family: var(--font-display);
        font-size: 11px;
        font-weight: 900;
        text-transform: uppercase;
        cursor: pointer;
        color: #0f172a;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        transition: transform 0.08s ease-out;
        box-shadow:
            inset 3px 3px 0 0 rgba(255,255,255,0.55),
            inset -3px -3px 0 0 rgba(0,0,0,0.12),
            4px 4px 0 0 rgba(0,0,0,0.35);
    }
    .action-btn:hover { filter: brightness(1.05); }
    .action-btn:active {
        transform: translate(4px, 4px);
        box-shadow:
            inset 3px 3px 0 0 rgba(0,0,0,0.12),
            inset -3px -3px 0 0 rgba(255,255,255,0.55),
            0 0 0 0 transparent;
    }
    .action-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        transform: none;
    }
    .action-btn--meat    { background: #ffedd5; }
    .action-btn--fruit   { background: #dcfce7; }
    .action-btn--fish    { background: #cffafe; }
    .action-btn--fetch   { background: #ffe4e6; }
    .action-btn--puzzle  { background: #f3e8ff; }
    .action-btn--music   { background: #fef9c3; }
    .action-btn--sleep {
        background: #6366f1;
        color: #ffffff;
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: center;
        font-size: 14px;
        padding: 14px;
        box-shadow:
            inset 3px 3px 0 0 rgba(255,255,255,0.25),
            inset -3px -3px 0 0 rgba(0,0,0,0.25),
            4px 4px 0 0 rgba(0,0,0,0.35);
    }
    .action-section-label {
        margin: 0 0 8px;
        font-family: var(--font-display);
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: #334155;
        grid-column: 1 / -1;
    }

    /* ---- Handover sticky notes (phase 2) ---- */
    .handover-notes {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        padding: 16px;
    }
    .handover-note {
        background: #fde68a;
        padding: 12px 18px;
        border: 4px solid #0f172a;
        font-family: var(--font-display);
        font-size: 14px;
        font-weight: 900;
        color: #78350f;
        box-shadow: 4px 4px 0 rgba(0,0,0,0.2);
        transform: rotate(-2deg);
        transition: transform 0.15s ease;
        cursor: default;
    }
    .handover-note:nth-child(2n) {
        transform: rotate(1.5deg);
    }
    .handover-note:nth-child(3n) {
        transform: rotate(-1deg);
    }
    .handover-note:hover {
        transform: rotate(0deg);
    }

    /* ---- Decay badge (phase 2) ---- */
    .phase2-creator-label {
        margin: 4px 0 0;
        font-size: 10px;
        color: #94a3b8;
        text-transform: uppercase;
        letter-spacing: 0.08em;
    }
    .decay-badge {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        background: #f43f5e;
        color: #ffffff;
        padding: 4px 10px;
        border: 2px solid #ffffff;
        font-family: var(--font-display);
        font-size: 11px;
        font-weight: 900;
        text-transform: uppercase;
        letter-spacing: 0.06em;
    }
    @keyframes decayPulse {
        0%, 100% { opacity: 1; }
        50% { opacity: 0.7; }
    }
    .decay-badge--pulse {
        animation: decayPulse 1.5s ease-in-out infinite;
    }

    /* ---- Achievements panel (phase 1/2) ---- */
    .achievements {
        display: grid;
        gap: 10px;
        max-height: 256px;
        overflow-y: auto;
        padding-right: 4px;
    }
    .achievement-card {
        display: flex;
        align-items: flex-start;
        gap: 12px;
        padding: 12px;
        background: #f8fafc;
        border: 4px solid #0f172a;
    }
    .achievement-card__name {
        margin: 0;
        font-family: var(--font-display);
        font-size: 12px;
        font-weight: 900;
        text-transform: uppercase;
        color: #334155;
    }
    .achievement-card__desc {
        margin: 4px 0 0;
        font-family: var(--font-body);
        font-size: 11px;
        color: #475569;
        line-height: 1.5;
    }

    /* ---- Cooldown indicator ---- */
    .cooldown-label {
        font-family: var(--font-display);
        font-size: 12px;
        color: #f43f5e;
        font-weight: 700;
    }
    @keyframes cooldownPulse {
        0%, 100% { opacity: 1; }
        50% { opacity: 0.5; }
    }
    .cooldown-label--pulse {
        animation: cooldownPulse 0.8s ease-in-out infinite;
    }

    @media (max-width: 720px) {
        .action-grid {
            grid-template-columns: repeat(2, 1fr);
        }
    }
    @media (prefers-reduced-motion: reduce) {
        body {
            animation: none;
        }
        .shell__container::before {
            animation: none;
            transform: none;
        }
        .shell::before {
            animation: none;
        }
        .button {
            transition: none;
        }
        .button:active {
            transform: none;
        }
        .dragon-stage__mover,
        .dragon-stage__mover--happy,
        .dragon-stage__mover--angry,
        .dragon-stage__mover--sleepy {
            animation: none;
        }
        .speech-bubble {
            animation: none;
        }
        .decay-badge--pulse {
            animation: none;
        }
        .cooldown-label--pulse {
            animation: none;
        }
        .phase0-generation-bar--loading .phase0-generation-bar__segment,
        .phase0-generation-bar--error .phase0-generation-bar__segment {
            animation: none;
            transform: none;
        }
    }

    /* ---- Phase 0: fullscreen character creation ---- */
    .shell__container--phase0 {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: 0;
    }
    .phase0-card {
        max-width: 640px;
        width: 100%;
        text-align: center;
        padding: 36px 32px 28px;
        gap: 8px;
    }
    .phase0-card__title {
        margin: 0;
        font-family: var(--font-display);
        font-size: clamp(32px, 5vw, 52px);
        line-height: 1.05;
        text-transform: uppercase;
        text-shadow: 3px 3px 0 rgba(15, 23, 42, 0.18);
    }
    .phase0-card__subtitle {
        margin: 0 0 20px;
        font-family: var(--font-display);
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.12em;
        color: #475569;
    }
    .phase0-card__section-title {
        margin-top: 12px;
    }
    .phase0-card__section-desc {
        margin-bottom: 8px;
    }
    .phase0-card__meta {
        text-align: center;
        margin-top: 12px;
    }

    /* Dark textarea for character description */
    .phase0-textarea {
        width: 100%;
        resize: vertical;
        min-height: 80px;
        font-family: var(--font-display);
        font-size: 13px;
        line-height: 1.6;
        text-transform: uppercase;
        background: #0f172a;
        color: #34d399;
        border: 3px solid #166534;
        padding: 14px 16px;
        border-radius: 0;
        outline: none;
        box-shadow:
            inset 3px 3px 0 0 rgba(0, 0, 0, 0.4),
            3px 3px 0 0 rgba(0, 0, 0, 0.18);
    }
    .phase0-textarea::placeholder {
        color: rgba(52, 211, 153, 0.4);
        text-transform: uppercase;
    }
    .phase0-textarea:focus-visible {
        outline: 4px solid #fde047;
        outline-offset: 4px;
    }

    .phase0-card__actions {
        width: 100%;
        margin-top: 8px;
        align-items: stretch;
    }
    .phase0-card__back-row {
        width: 100%;
        justify-content: flex-start;
    }

    /* Phase 0 action buttons share the primary action row evenly. */
    .phase0-action-button {
        flex: 1 1 0;
        min-width: 0;
    }

    .sr-only {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .phase0-generation-bar {
        margin-top: 12px;
        background: #0f172a;
        border: 3px solid #0f172a;
        box-shadow:
            inset 3px 3px 0 0 rgba(255,255,255,0.08),
            inset -3px -3px 0 0 rgba(0,0,0,0.35),
            3px 3px 0 0 rgba(0,0,0,0.16);
        padding: 4px;
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 3px;
        min-height: 22px;
    }
    .phase0-generation-bar--idle {
        display: none;
    }
    .phase0-generation-bar__label {
        width: 100%;
        margin: 0 0 4px;
        font-family: var(--font-display);
        font-size: 10px;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: #cbd5e1;
    }
    .phase0-generation-bar--loading .phase0-generation-bar__label {
        color: #86efac;
    }
    .phase0-generation-bar--error .phase0-generation-bar__label {
        color: #fda4af;
    }
    .phase0-generation-bar--error .phase0-generation-bar__label::before {
        content: "Error: ";
    }
    .phase0-generation-bar__segment {
        flex: 1;
        min-width: 0;
        height: 14px;
        background: rgba(255,255,255,0.06);
        opacity: 0.22;
    }
    .phase0-generation-bar--loading .phase0-generation-bar__segment {
        background: linear-gradient(180deg, #4ade80 0%, #16a34a 100%);
        animation: phase0-generation-pulse 1.1s steps(2, end) infinite;
    }
    .phase0-generation-bar--error .phase0-generation-bar__segment {
        background: linear-gradient(180deg, #fb7185 0%, #dc2626 100%);
        opacity: 1;
        animation: phase0-generation-error-flash 0.45s steps(2, end) 2;
    }
    @keyframes phase0-generation-pulse {
        0%, 100% { opacity: 0.2; transform: translateY(0); }
        50% { opacity: 1; transform: translateY(-1px); }
    }
    @keyframes phase0-generation-error-flash {
        0%, 100% { opacity: 0.28; }
        50% { opacity: 1; }
    }

    /* Sprite frames with dark background */
    .phase0-sprite-frame {
        background: #1e293b;
    }

    /* Host controls separator */
    .phase0-host-controls {
        margin-top: 16px;
        padding-top: 16px;
        border-top: 3px solid rgba(15, 23, 42, 0.12);
    }

    @media (max-width: 720px) {
        .phase0-card {
            padding: 24px 18px 20px;
        }
        .phase0-card__title {
            font-size: clamp(24px, 6vw, 36px);
        }
        .phase0-card__actions {
            flex-direction: row;
            flex-wrap: nowrap;
        }
        .phase0-card__actions .button,
        .phase0-card__back-row .button {
            width: auto;
        }
    }

    /* ---------------------------------------------------------------
       Game Over overlay
       --------------------------------------------------------------- */
    .game-over {
        text-align: center;
        padding: 32px 16px;
        font-family: var(--font-display);
    }
    .game-over__title {
        font-family: var(--font-display);
        font-size: clamp(32px, 8vw, 48px);
        font-weight: 900;
        letter-spacing: 0.15em;
        text-transform: uppercase;
        color: #f43f5e;
        text-shadow: 3px 3px 0 rgba(0,0,0,0.4);
        margin: 0 0 8px;
    }
    .game-over__subtitle {
        font-family: var(--font-display);
        font-size: clamp(18px, 4vw, 24px);
        font-weight: 900;
        letter-spacing: 0.15em;
        text-transform: uppercase;
        color: #fbbf24;
        text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
        margin: 0 0 24px;
    }
    .game-over__list {
        text-align: left;
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin-bottom: 24px;
    }
    .game-over__player {
        padding: 16px 20px;
        border: 4px solid #334155;
        background: #0f172a;
    }
    .game-over__player--winner {
        background: rgba(120,53,15,0.4);
        border-color: #fbbf24;
    }
    .game-over__player-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 4px;
    }
    .game-over__name {
        font-family: var(--font-display);
        font-weight: 900;
        font-size: 18px;
        text-transform: uppercase;
        letter-spacing: 0.1em;
        color: #cbd5e1;
    }
    .game-over__name--winner {
        color: #fbbf24;
    }
    .game-over__crown {
        margin-right: 6px;
        display: inline-block;
        animation: bounce-crown 1s infinite;
        vertical-align: middle;
    }
    .game-over__crown-icon {
        width: 22px;
        height: 22px;
        image-rendering: pixelated;
    }
    @keyframes bounce-crown {
        0%, 100% { transform: translateY(0); }
        50% { transform: translateY(-4px); }
    }
    .game-over__score {
        font-family: var(--font-display);
        font-weight: 900;
        font-size: 22px;
        color: #34d399;
    }
    .game-over__score--winner {
        color: #fbbf24;
    }
    .game-over__achievements {
        display: flex;
        gap: 6px;
        flex-wrap: wrap;
        margin-top: 8px;
    }
    .game-over__badge {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        background: #1e293b;
        border: 2px solid #475569;
        padding: 3px 10px;
        font-family: var(--font-display);
        font-weight: 700;
        font-size: 12px;
        color: #cbd5e1;
    }
    .game-over__badge-icon {
        width: 16px;
        height: 16px;
        image-rendering: pixelated;
    }

    /* -----------------------------------------------------------------
       App bar (UX_RECOMPOSE_v2 §4.A / Tier 3a-1 step 15).
       Consumes the --appbar-height-* tokens declared in :root. Sticky
       landmark at the top of the shell that hosts the wordmark, a
       reserved center slot for Tier 3a-2's stepper/phase clock, and the
       account disclosure menu on signed-in surfaces.
       ----------------------------------------------------------------- */
    .app-bar {
        position: sticky;
        top: 0;
        z-index: 50;
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        gap: 1.5rem;
        height: var(--appbar-height-desktop);
        padding: 0 1.5rem;
        background: #0f172a;
        border-bottom: 4px solid #1e293b;
    }
    .app-bar__wordmark {
        font-family: var(--font-display);
        font-size: 1.375rem;
        font-weight: 700;
        letter-spacing: 0.05em;
        color: #fde047;
        background: transparent;
        border: 0;
        padding: 0;
        cursor: pointer;
    }
    .app-bar__wordmark[disabled] {
        cursor: default;
        opacity: 0.85;
    }
    .app-bar__wordmark:focus-visible {
        outline: 4px solid #fde047;
        outline-offset: 4px;
    }
    .app-bar__center {
        /* Tier 3a-2 will fill this: stepper (pre-session) / phase+clock (in-session) */
    }
    .app-bar__menu-wrap {
        position: relative;
        justify-self: end;
    }
    .app-bar__menu-trigger {
        font-family: var(--font-display);
        font-size: 0.875rem;
        background: transparent;
        border: 2px solid #334155;
        padding: 0.25rem 0.75rem;
        color: #f8fafc;
        cursor: pointer;
    }
    .app-bar__menu-trigger:focus-visible {
        outline: 4px solid #fde047;
        outline-offset: 4px;
    }
    .app-bar__menu {
        position: absolute;
        top: calc(var(--appbar-height-desktop) + 0.25rem);
        right: 1.5rem;
        min-width: 12rem;
        margin: 0;
        padding: 0.25rem 0;
        list-style: none;
        background: #0f172a;
        border: 4px solid #1e293b;
        z-index: 60;
    }
    .app-bar__menu[hidden] {
        display: none;
    }
    .app-bar__menu-item {
        display: block;
        width: 100%;
        padding: 0.5rem 1rem;
        background: transparent;
        border: 0;
        font-family: var(--font-display);
        font-size: 0.8125rem;
        color: #f8fafc;
        text-align: left;
        cursor: pointer;
    }
    .app-bar__menu-item:focus-visible {
        outline: 3px solid #fde047;
        outline-offset: -3px;
    }
    .app-bar__menu-item:hover {
        background: #1e293b;
    }
    @media (max-width: 1023px) {
        .app-bar { height: var(--appbar-height-tablet); }
        .app-bar__menu { top: calc(var(--appbar-height-tablet) + 0.25rem); }
        .shell--pre-session { min-height: calc(100vh - var(--appbar-height-tablet)); }
        .shell--create-character {
            padding-top: 20px;
            padding-bottom: 20px;
        }
    }
    @media (max-width: 767px) {
        .app-bar { height: var(--appbar-height-mobile); padding: 0 0.75rem; gap: 0.75rem; }
        .app-bar__menu { top: calc(var(--appbar-height-mobile) + 0.25rem); right: 0.75rem; }
        .app-bar__wordmark { font-size: 1.125rem; }
        .shell--pre-session {
            min-height: calc(100vh - var(--appbar-height-mobile));
            padding-top: 1.5rem;
        }
        .shell--create-character {
            padding-top: 12px;
            padding-bottom: 12px;
        }
    }
