:root {
    color-scheme: dark;
    font-family: system-ui, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: #111827;
    color: #f9fafb;
}

button {
    font: inherit;
}

.game-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.game-card {
    width: min(100%, 430px);
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 24px;
    padding: 24px;
}

.game-header {
    text-align: center;
}

.game-header h1 {
    margin: 0;
}

.game-header p {
    margin: 8px 0 0;
    color: #9ca3af;
}

.answer-area {
    display: grid;
    gap: 12px;
    margin: 32px 0 24px;
}

.answer-row {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.slot {
    width: 34px;
    height: 42px;
    border-bottom: 3px solid #9ca3af;
}

.current-word {
    min-height: 32px;
    text-align: center;
    font-size: 1.3rem;
    letter-spacing: 0.2em;
    margin-bottom: 20px;
}

.wheel {
    position: relative;
    width: 280px;
    height: 280px;
    margin: 0 auto;
    border: 1px solid #374151;
    border-radius: 50%;
}

.letter {
    position: absolute;
    width: 64px;
    height: 64px;
    border: 0;
    border-radius: 50%;
    background: #e5e7eb;
    color: #111827;
    font-weight: 700;
    cursor: pointer;
}

.letter-a {
    top: 12px;
    left: 108px;
}

.letter-d {
    top: 58px;
    right: 20px;
}

.letter-l {
    bottom: 58px;
    right: 20px;
}

.letter-o {
    bottom: 12px;
    left: 108px;
}

.letter-r {
    bottom: 58px;
    left: 20px;
}

.letter-s {
    top: 58px;
    left: 20px;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
}

.controls button {
    border: 1px solid #4b5563;
    border-radius: 12px;
    padding: 10px 18px;
    background: #111827;
    color: #f9fafb;
}

.trail-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}

#trail-line {
    fill: none;
    stroke: #60a5fa;
    stroke-width: 10;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.75;
}

.letter {
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    z-index: 2;
}

.letter.is-selected {
    background: #60a5fa;
    color: #ffffff;
}

.slot {
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.slot.is-filled {
    border-bottom-color: #60a5fa;
    color: #f9fafb;
}

html,
body {
    overscroll-behavior: none;
}

body {
    padding-top: env(safe-area-inset-top);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
}

@media (max-width: 520px) {
    .game-shell {
        min-height: 100dvh;
        padding: 12px;
    }

    .game-card {
        width: 100%;
        border-radius: 20px;
        padding: 18px 14px;
    }
}

/* =========================================================
   QueenK MVP fantasy/mobile presentation
   ========================================================= */

:root {
    --queenk-bg-deep: #060b12;
    --queenk-bg-mid: #0b1620;
    --queenk-panel: rgba(8, 16, 24, 0.78);
    --queenk-panel-border: rgba(120, 176, 220, 0.22);
    --queenk-magic: #60a5fa;
    --queenk-magic-soft: rgba(96, 165, 250, 0.28);
    --queenk-gold: #d7b56d;
    --queenk-text: #f3f4f6;
    --queenk-muted: #a6b0bc;
}

html,
body {
    width: 100%;
    min-height: 100%;
    background: var(--queenk-bg-deep);
}

body {
    position: relative;
    overflow-x: hidden;
    color: var(--queenk-text);
}

/* Layered enchanted-ruins atmosphere */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -3;

    background:
        radial-gradient(
            circle at 50% 26%,
            rgba(63, 132, 181, 0.24) 0,
            rgba(31, 66, 91, 0.10) 24%,
            transparent 48%
        ),
        radial-gradient(
            circle at 15% 70%,
            rgba(28, 86, 68, 0.24),
            transparent 38%
        ),
        radial-gradient(
            circle at 88% 67%,
            rgba(52, 46, 103, 0.20),
            transparent 36%
        ),
        linear-gradient(
            180deg,
            #07111a 0%,
            #08121a 42%,
            #05090e 100%
        );
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -2;

    background:
        linear-gradient(
            90deg,
            rgba(0, 0, 0, 0.55),
            transparent 22%,
            transparent 78%,
            rgba(0, 0, 0, 0.55)
        ),
        radial-gradient(
            ellipse at center bottom,
            rgba(96, 165, 250, 0.12),
            transparent 48%
        );
}

.game-shell {
    position: relative;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding:
        max(12px, env(safe-area-inset-top))
        max(12px, env(safe-area-inset-right))
        max(16px, env(safe-area-inset-bottom))
        max(12px, env(safe-area-inset-left));
}

.game-shell::before {
    content: "";
    position: absolute;
    inset: 4% 5%;
    pointer-events: none;
    opacity: 0.45;

    background:
        radial-gradient(
            circle at 12% 18%,
            rgba(120, 170, 130, 0.15) 0 2px,
            transparent 3px
        ),
        radial-gradient(
            circle at 75% 32%,
            rgba(96, 165, 250, 0.14) 0 2px,
            transparent 3px
        ),
        radial-gradient(
            circle at 30% 75%,
            rgba(215, 181, 109, 0.11) 0 2px,
            transparent 3px
        );
    background-size: 72px 72px, 95px 95px, 120px 120px;
    animation: queenk-drift 18s linear infinite;
}

@keyframes queenk-drift {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-32px);
    }
}

.game-card {
    position: relative;
    width: min(100%, 430px);
    overflow: hidden;

    background:
        linear-gradient(
            180deg,
            rgba(15, 27, 39, 0.92),
            rgba(6, 13, 21, 0.90)
        );

    border: 1px solid var(--queenk-panel-border);
    border-radius: 26px;

    box-shadow:
        0 22px 70px rgba(0, 0, 0, 0.58),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.game-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;

    background:
        radial-gradient(
            circle at 50% 58%,
            rgba(96, 165, 250, 0.08),
            transparent 38%
        );
}

.game-header {
    position: relative;
    z-index: 1;
}

.game-header h1 {
    color: var(--queenk-gold);
    letter-spacing: 0.05em;
}

.game-header p {
    color: var(--queenk-muted);
}

.answer-area,
.current-word,
.wheel,
.controls {
    position: relative;
    z-index: 1;
}

.answer-area {
    min-height: 124px;
}

.answer-row {
    min-height: 34px;
}

.slot {
    width: 30px;
    height: 34px;

    border: 1px solid rgba(215, 181, 109, 0.32);
    border-bottom: 2px solid rgba(215, 181, 109, 0.78);
    border-radius: 7px 7px 3px 3px;

    background: rgba(0, 0, 0, 0.20);
}

.slot.is-filled {
    border-color: rgba(96, 165, 250, 0.72);
    border-bottom-color: var(--queenk-magic);

    background: rgba(96, 165, 250, 0.12);

    box-shadow:
        0 0 12px rgba(96, 165, 250, 0.20),
        inset 0 0 8px rgba(96, 165, 250, 0.08);
}

.current-word {
    color: #dbeafe;
    min-height: 36px;
    font-weight: 600;
    text-shadow: 0 0 12px rgba(96, 165, 250, 0.38);
}

.wheel {
    width: min(72vw, 300px);
    height: min(72vw, 300px);
    max-width: 300px;
    max-height: 300px;

    border: 1px solid rgba(96, 165, 250, 0.25);

    background:
        radial-gradient(
            circle,
            rgba(14, 32, 47, 0.90) 0%,
            rgba(7, 18, 27, 0.92) 53%,
            rgba(3, 9, 14, 0.94) 100%
        );

    box-shadow:
        0 0 28px rgba(96, 165, 250, 0.12),
        inset 0 0 35px rgba(0, 0, 0, 0.55);

    touch-action: none;
}

.wheel::before {
    content: "✦";
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);

    color: rgba(96, 165, 250, 0.22);
    font-size: 3rem;
}

.letter {
    background:
        radial-gradient(
            circle at 36% 30%,
            #f5f7fa,
            #d5dde7 65%,
            #adb9c6
        );

    border: 2px solid rgba(215, 181, 109, 0.70);

    box-shadow:
        0 5px 12px rgba(0, 0, 0, 0.45),
        0 0 0 3px rgba(0, 0, 0, 0.24);

    touch-action: none;
}

.letter.is-selected {
    background: var(--queenk-magic);
    border-color: #dbeafe;

    box-shadow:
        0 0 16px rgba(96, 165, 250, 0.80),
        0 0 32px rgba(96, 165, 250, 0.36);

    transform: scale(1.06);
}

#trail-line {
    stroke: #65b7ff;
    stroke-width: 11;
    opacity: 0.88;

    filter:
        drop-shadow(0 0 4px rgba(96, 165, 250, 0.95))
        drop-shadow(0 0 10px rgba(96, 165, 250, 0.48));
}

.controls button {
    min-height: 46px;
    min-width: 100px;

    border: 1px solid rgba(215, 181, 109, 0.36);

    background:
        linear-gradient(
            180deg,
            rgba(24, 38, 52, 0.96),
            rgba(9, 18, 28, 0.96)
        );

    color: var(--queenk-text);
}

.controls button:active {
    transform: scale(0.97);
}

/* iPhone / narrow portrait */
@media (max-width: 520px) {
    .game-shell {
        align-items: stretch;
        padding-top: max(8px, env(safe-area-inset-top));
    }

    .game-card {
        width: 100%;
        min-height: calc(
            100dvh -
            env(safe-area-inset-top) -
            env(safe-area-inset-bottom) -
            16px
        );

        display: flex;
        flex-direction: column;

        padding: 16px 12px;
        border-radius: 20px;
    }

    .game-header h1 {
        font-size: 1.35rem;
    }

    .game-header p {
        margin-top: 3px;
        font-size: 0.8rem;
    }

    .answer-area {
        margin: 18px 0 12px;
        gap: 8px;
        min-height: 112px;
    }

    .answer-row {
        gap: 6px;
    }

    .slot {
        width: 28px;
        height: 31px;
        font-size: 0.95rem;
    }

    .current-word {
        margin-bottom: 10px;
        font-size: 1.05rem;
    }

    .wheel {
        width: min(74vw, 290px);
        height: min(74vw, 290px);
        margin-top: auto;
        margin-bottom: auto;
    }

    .letter {
        width: 58px;
        height: 58px;
    }

    .controls {
        margin-top: 12px;
        padding-bottom: 4px;
    }
}

/* Very small phones */
@media (max-height: 680px) and (max-width: 520px) {
    .answer-area {
        min-height: 90px;
        margin-top: 10px;
    }

    .wheel {
        width: min(62vw, 245px);
        height: min(62vw, 245px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .game-shell::before {
        animation: none;
    }
}

/* =========================================================
   QueenK dragon ruins environment
   ========================================================= */

html {
    background: #050811;
}

body {
    min-height: 100dvh;
    background:
        linear-gradient(
            180deg,
            rgba(3, 8, 16, 0.16) 0%,
            rgba(3, 8, 16, 0.30) 45%,
            rgba(3, 8, 16, 0.58) 100%
        ),
        url("/assets/images/queenk-dragon-ruins.png")
        center center / cover no-repeat fixed;
}

/* Replace the old synthetic background with the real artwork. */
body::before {
    background:
        radial-gradient(
            circle at 50% 45%,
            rgba(74, 163, 255, 0.08),
            transparent 36%
        );
}

body::after {
    background:
        linear-gradient(
            90deg,
            rgba(0, 0, 0, 0.42),
            transparent 20%,
            transparent 80%,
            rgba(0, 0, 0, 0.42)
        ),
        linear-gradient(
            180deg,
            rgba(0, 0, 0, 0.04),
            rgba(0, 0, 0, 0.30)
        );
}

.game-shell {
    background: transparent;
}

/*
 * The artwork is now the environment.
 * The game surface becomes a glass-like overlay rather than an opaque card.
 */
.game-card {
    background:
        linear-gradient(
            180deg,
            rgba(5, 12, 22, 0.62),
            rgba(4, 10, 18, 0.78)
        );

    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);

    border: 1px solid rgba(138, 191, 255, 0.22);

    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.46),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Keep the puzzle area visually separated from the detailed artwork. */
.answer-area {
    padding: 10px 8px;

    border-radius: 14px;

    background:
        linear-gradient(
            180deg,
            rgba(2, 8, 15, 0.26),
            rgba(2, 8, 15, 0.10)
        );
}

.wheel {
    background:
        radial-gradient(
            circle at center,
            rgba(10, 26, 42, 0.76) 0%,
            rgba(4, 14, 25, 0.86) 58%,
            rgba(1, 7, 13, 0.90) 100%
        );

    border-color: rgba(97, 184, 255, 0.42);

    box-shadow:
        0 0 22px rgba(80, 170, 255, 0.18),
        0 0 54px rgba(39, 109, 181, 0.12),
        inset 0 0 32px rgba(0, 0, 0, 0.58);
}

#trail-line {
    stroke: #67c2ff;
    stroke-width: 11;
    opacity: 0.94;

    filter:
        drop-shadow(0 0 4px rgba(100, 200, 255, 1))
        drop-shadow(0 0 10px rgba(70, 165, 255, 0.76))
        drop-shadow(0 0 20px rgba(45, 120, 230, 0.46));
}

/* Mobile is QueenK's primary presentation. */
@media (max-width: 520px) {
    body {
        background-attachment: scroll;
        background-position: center 42%;
    }

    .game-shell {
        padding:
            max(6px, env(safe-area-inset-top))
            max(6px, env(safe-area-inset-right))
            max(8px, env(safe-area-inset-bottom))
            max(6px, env(safe-area-inset-left));
    }

    .game-card {
        min-height: calc(
            100dvh -
            env(safe-area-inset-top) -
            env(safe-area-inset-bottom) -
            12px
        );

        border-radius: 18px;

        background:
            linear-gradient(
                180deg,
                rgba(5, 12, 22, 0.50),
                rgba(3, 9, 16, 0.68)
            );

        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
    }

    .answer-area {
        background: rgba(1, 7, 14, 0.30);
    }

    .current-word {
        text-shadow:
            0 0 5px rgba(0, 0, 0, 1),
            0 0 12px rgba(96, 184, 255, 0.65);
    }
}

/* Landscape phone safety fallback. */
@media (orientation: landscape) and (max-height: 520px) {
    body {
        background-position: center 38%;
    }

    .game-card {
        min-height: auto;
    }
}

/* =========================================================
   Level progression
   ========================================================= */

#level-label {
    color: rgba(215, 181, 109, 0.88);
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

body.level-complete .game-card {
    animation: queenk-level-complete 1s ease;
}

body.level-complete .wheel {
    box-shadow:
        0 0 28px rgba(96, 190, 255, 0.70),
        0 0 80px rgba(70, 120, 255, 0.42),
        inset 0 0 34px rgba(70, 160, 255, 0.20);
}

@keyframes queenk-level-complete {
    0% {
        transform: scale(1);
    }

    45% {
        transform: scale(1.015);
        filter: brightness(1.22);
    }

    100% {
        transform: scale(1);
        filter: brightness(1);
    }
}

/* =========================================================
   QueenK sanctuary HUD
   ========================================================= */

.game-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.rune-counter {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    padding: 8px 11px;

    border: 1px solid rgba(96, 165, 250, 0.30);
    border-radius: 999px;

    background: rgba(4, 12, 22, 0.54);

    font-weight: 700;

    box-shadow:
        0 0 14px rgba(96, 165, 250, 0.10);
}

.rune-icon {
    color: #71c5ff;

    text-shadow:
        0 0 8px rgba(96, 190, 255, 0.90);
}

.sanctuary-hud {
    margin-top: 12px;
}

.sanctuary-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;

    margin-bottom: 6px;

    color: rgba(235, 241, 248, 0.88);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.sanctuary-track {
    height: 8px;

    overflow: hidden;

    border: 1px solid rgba(126, 178, 220, 0.20);
    border-radius: 999px;

    background: rgba(0, 0, 0, 0.34);
}

.sanctuary-fill {
    display: block;

    width: 0%;
    height: 100%;

    border-radius: inherit;

    background:
        linear-gradient(
            90deg,
            #4fa9ef,
            #84d8ff
        );

    box-shadow:
        0 0 12px rgba(87, 182, 255, 0.64);

    transition:
        width 450ms ease;
}

@media (max-width: 520px) {
    .game-title-row {
        align-items: center;
    }

    .rune-counter {
        padding: 6px 9px;
        font-size: 0.85rem;
    }

    .sanctuary-hud {
        margin-top: 8px;
    }
}

/* =========================================================
   Word pack / age band selector
   ========================================================= */

.mode-selector {
    display: grid;
    gap: 3px;

    color: rgba(235, 241, 248, 0.72);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.mode-selector select {
    max-width: 130px;
    min-height: 36px;

    border: 1px solid rgba(96, 165, 250, 0.30);
    border-radius: 9px;

    padding: 5px 8px;

    background: rgba(4, 12, 22, 0.86);
    color: #f3f4f6;

    font-size: 0.85rem;
    text-transform: none;
}

@media (max-width: 520px) {
    .game-title-row {
        flex-wrap: wrap;
    }

    .mode-selector {
        order: 3;
        width: 100%;
    }

    .mode-selector select {
        width: 100%;
        max-width: none;
    }
}

/* =========================================================
   QueenK Word Level toolbar
   ========================================================= */

.game-toolbar {
    position: relative;
    z-index: 30;

    display: flex;
    justify-content: flex-end;

    margin: 0 0 12px;
}

.game-toolbar .mode-selector {
    display: flex;
    align-items: center;
    gap: 9px;

    color: rgba(240, 244, 250, 0.86);

    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.game-toolbar .mode-selector span {
    white-space: nowrap;
}

.game-toolbar .mode-selector select {
    min-width: 138px;
    min-height: 38px;

    padding: 6px 9px;

    border: 1px solid rgba(113, 197, 255, 0.45);
    border-radius: 10px;

    background: rgba(3, 11, 20, 0.94);
    color: #f4f7fb;

    font-size: 0.86rem;
    font-weight: 600;
    text-transform: none;
}

@media (max-width: 520px) {
    .game-toolbar {
        justify-content: stretch;
    }

    .game-toolbar .mode-selector {
        width: 100%;
        justify-content: space-between;
    }

    .game-toolbar .mode-selector select {
        flex: 1;
        max-width: 190px;
    }
}

/* =========================================================
   My Dragons navigation
   ========================================================= */

.my-dragons-button {
    min-height: 38px;
    padding: 6px 11px;

    border:
        1px solid rgba(113, 197, 255, 0.40);
    border-radius: 10px;

    background: rgba(3, 11, 20, 0.90);
    color: #edf7ff;

    font-weight: 700;
    cursor: pointer;
}

.my-dragons-button span {
    display: inline-grid;
    place-items: center;

    min-width: 22px;
    height: 22px;

    margin-left: 5px;

    border-radius: 999px;

    background: rgba(88, 182, 245, 0.20);
    color: #8bd8ff;
}

@media (max-width: 520px) {
    .game-toolbar {
        flex-wrap: wrap;
        gap: 8px;
    }

    .my-dragons-button {
        flex: 1 1 100%;
    }
}

/* =========================================================
   QueenK full dragon gallery
   ========================================================= */

.dragon-gallery-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;

    padding: 24px;

    overflow-y: auto;

    background:
        rgba(1, 5, 11, 0.88);

    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.dragon-gallery-overlay[hidden] {
    display: none;
}

.dragon-gallery-panel {
    width: min(100%, 920px);

    margin: 30px auto;

    padding: 20px;

    border:
        1px solid rgba(
            114,
            195,
            250,
            0.30
        );

    border-radius: 22px;

    background:
        rgba(4, 13, 23, 0.96);
}

.dragon-gallery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    margin-bottom: 16px;
}

.dragon-gallery-header h2 {
    margin: 2px 0 0;

    color: #f0ce80;
}

.dragon-gallery-kicker {
    color:
        rgba(232, 240, 248, 0.56);

    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.dragon-gallery-close {
    width: 42px;
    height: 42px;

    border:
        1px solid rgba(
            114,
            195,
            250,
            0.30
        );

    border-radius: 50%;

    background:
        rgba(3, 10, 18, 0.90);

    color: white;
    font-size: 1.6rem;

    cursor: pointer;
}

.dragon-gallery-track {
    display: flex;
    gap: 18px;

    overflow-x: auto;
    overflow-y: visible;

    padding: 4px 4px 18px;

    scroll-snap-type: x mandatory;
    scroll-padding-inline: 4px;

    overscroll-behavior-x: contain;

    -webkit-overflow-scrolling:
        touch;
}

.dragon-gallery-slide {
    flex:
        0
        0
        min(88%, 420px);

    scroll-snap-align: center;

    overflow: hidden;

    border:
        1px solid rgba(
            115,
            193,
            246,
            0.24
        );

    border-radius: 20px;

    background:
        rgba(3, 10, 18, 0.94);
}

.dragon-portrait-frame {
    position: relative;

    aspect-ratio: 4 / 5;

    overflow: hidden;

    background:
        radial-gradient(
            circle at center,
            rgba(
                65,
                152,
                217,
                0.28
            ),
            rgba(
                2,
                7,
                13,
                0.98
            )
        );
}

.dragon-portrait {
    width: 100%;
    height: 100%;

    object-fit: cover;
}

.dragon-portrait-fallback {
    position: absolute;
    inset: 0;

    display: grid;
    place-content: center;
    gap: 10px;

    text-align: center;

    color: #85d7ff;
}

.dragon-portrait-fallback span {
    font-size: 4rem;

    text-shadow:
        0 0 24px
        rgba(86, 188, 255, 0.80);
}

.dragon-portrait-fallback strong {
    color: #f1d289;
}

.dragon-gallery-copy {
    padding: 18px;
}

.dragon-gallery-type {
    color:
        rgba(232, 240, 248, 0.54);

    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
}

.dragon-gallery-copy h3 {
    margin: 4px 0;

    color: #f1d289;

    font-size: 1.35rem;
}

.dragon-gallery-copy p {
    color:
        rgba(238, 244, 250, 0.72);
}

.dragon-gallery-stats {
    display: grid;
    grid-template-columns:
        repeat(2, 1fr);

    gap: 10px;

    margin: 16px 0;
}

.dragon-gallery-stats div {
    padding: 10px;

    border:
        1px solid rgba(
            111,
            190,
            244,
            0.18
        );

    border-radius: 10px;

    background:
        rgba(0, 0, 0, 0.22);
}

.dragon-gallery-stats span,
.dragon-gallery-stats strong {
    display: block;
}

.dragon-gallery-stats span {
    color:
        rgba(237, 243, 249, 0.56);

    font-size: 0.68rem;
    text-transform: uppercase;
}

.dragon-gallery-stats strong {
    margin-top: 3px;

    color: #85d7ff;
}

.dragon-companion-button {
    width: 100%;
    min-height: 44px;

    border:
        1px solid rgba(
            215,
            181,
            109,
            0.50
        );

    border-radius: 11px;

    background:
        rgba(20, 44, 64, 0.95);

    color: white;

    font-weight: 700;
}

.dragon-companion-button:disabled {
    opacity: 0.55;
}

.dragon-gallery-empty {
    width: 100%;

    padding: 40px 20px;

    text-align: center;
}

.dragon-gallery-empty > span {
    color: #7cd1ff;
    font-size: 3rem;
}

@media (max-width: 520px) {
    .dragon-gallery-overlay {
        padding:
            max(
                8px,
                env(safe-area-inset-top)
            )
            8px
            max(
                8px,
                env(safe-area-inset-bottom)
            );
    }

    .dragon-gallery-panel {
        margin: 0 auto;

        padding: 14px;

        border-radius: 17px;
    }

    .dragon-gallery-slide {
        flex-basis: 94%;
    }

    .dragon-gallery-track {
        touch-action:
            pan-x pan-y;
    }
}

/* =========================================================
   QueenK active guardian + gallery
   ========================================================= */

.active-dragon-card {
    position: relative;
    z-index: 10;

    display: grid;
    grid-template-columns:
        64px
        minmax(0, 1fr)
        auto;

    align-items: center;
    gap: 12px;

    width: 100%;
    min-height: 78px;

    margin: 14px 0;
    padding: 7px 12px 7px 7px;

    border:
        1px solid rgba(
            116,
            198,
            252,
            0.32
        );

    border-radius: 16px;

    background:
        rgba(3, 12, 22, 0.78);

    color: #f3f6fa;

    text-align: left;
}

.active-dragon-card[hidden] {
    display: none;
}

.active-dragon-card img {
    width: 64px;
    height: 64px;

    object-fit: cover;

    border-radius: 13px;
}

.active-dragon-copy {
    display: grid;
    gap: 2px;

    min-width: 0;
}

.active-dragon-copy strong {
    color: #f1d28b;
}

.active-dragon-copy > span:last-child {
    color:
        rgba(235, 242, 249, 0.65);

    font-size: 0.72rem;
}

.active-dragon-label {
    color: #7ed4ff;

    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.active-dragon-arrow {
    color: #86d5ff;
    font-size: 1.8rem;
}


.dragon-gallery-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;

    overflow-y: auto;

    padding: 20px;

    background:
        rgba(1, 5, 11, 0.91);
}

.dragon-gallery-overlay[hidden] {
    display: none;
}

.dragon-gallery-panel {
    width: min(100%, 900px);

    margin: 20px auto;

    padding: 18px;

    border:
        1px solid rgba(
            111,
            192,
            249,
            0.30
        );

    border-radius: 22px;

    background:
        rgba(4, 13, 23, 0.98);
}

.dragon-gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 14px;
}

.dragon-gallery-header span {
    color:
        rgba(235, 242, 249, 0.54);

    font-size: 0.68rem;
    text-transform: uppercase;
}

.dragon-gallery-header h2 {
    margin: 2px 0 0;

    color: #f1d28b;
}

#dragon-gallery-close {
    width: 42px;
    height: 42px;

    border:
        1px solid rgba(
            117,
            198,
            252,
            0.30
        );

    border-radius: 50%;

    background:
        rgba(3, 11, 20, 0.90);

    color: white;
    font-size: 1.6rem;
}

.dragon-gallery-track {
    display: flex;
    gap: 16px;

    overflow-x: auto;
    overflow-y: visible;

    padding: 4px 2px 16px;

    scroll-snap-type:
        x mandatory;

    overscroll-behavior-x:
        contain;

    -webkit-overflow-scrolling:
        touch;
}

.dragon-gallery-slide {
    flex:
        0
        0
        min(88%, 400px);

    overflow: hidden;

    scroll-snap-align:
        center;

    border:
        1px solid rgba(
            117,
            198,
            252,
            0.22
        );

    border-radius: 20px;

    background:
        rgba(2, 9, 17, 0.96);
}

.dragon-gallery-image {
    display: block;

    width: 100%;
    aspect-ratio: 4 / 5;

    object-fit: cover;
}

.dragon-gallery-copy {
    padding: 16px;
}

.dragon-gallery-copy > span {
    color:
        rgba(235, 242, 249, 0.55);

    font-size: 0.67rem;
    text-transform: uppercase;
}

.dragon-gallery-copy h3 {
    margin: 4px 0;

    color: #f1d28b;
    font-size: 1.3rem;
}

.dragon-gallery-copy p {
    color:
        rgba(235, 242, 249, 0.70);
}

.dragon-gallery-stats {
    display: flex;
    gap: 14px;

    margin: 14px 0;

    color: #7ed4ff;
    font-size: 0.77rem;
}

.choose-dragon {
    width: 100%;
    min-height: 44px;

    border:
        1px solid rgba(
            215,
            181,
            109,
            0.45
        );

    border-radius: 11px;

    background:
        rgba(17, 41, 60, 0.95);

    color: white;
    font-weight: 700;
}

.choose-dragon:disabled {
    opacity: 0.55;
}

.dragon-gallery-empty {
    padding: 40px 20px;

    color: white;
    text-align: center;
}

@media (max-width: 520px) {
    .dragon-gallery-overlay {
        padding:
            max(
                8px,
                env(safe-area-inset-top)
            )
            8px
            max(
                8px,
                env(safe-area-inset-bottom)
            );
    }

    .dragon-gallery-panel {
        margin: 0;

        padding: 12px;

        border-radius: 17px;
    }

    .dragon-gallery-slide {
        flex-basis: 94%;
    }

    .dragon-gallery-track {
        touch-action:
            pan-x pan-y;
    }
}
