/* ROLLUP.QUEST STYLES - EXACT HEX COLORS FROM DESIGN
   Design parser tokens: Interaction Pattern:** Pattern* Pattern IntersectionObserver` detect (threshold */

:root {
    /* Exact Palette Colors */
    --color-glacial-cyan: #7DDCFF;
    --color-aurora-violet: #B07DFF;
    --color-honeyed-amber: #FFB347;
    --color-obsidian-teal: #0B1E2D;
    --color-aged-vellum: #F0E6D2;
    --color-frosted-slate: #3A4F62;
    --color-moonlit-white: #E8F0F5;
    --color-ruby-flare: #FF5A6E;

    /* Functional colors */
    --color-parchment: #F0E6D2;
    --color-text-dark: #3A2E1A;
    --color-text-light: #E8F0F5;
    --color-bg-dark: #0B1E2D;

    --font-display: 'Bungee Shade', cursive;
    --font-secondary: 'Righteous', sans-serif;
    --font-body: 'Nunito', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: linear-gradient(135deg, var(--color-obsidian-teal) 0%, #1a3a4a 100%);
    color: var(--color-text-light);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    line-height: 1.65;
    letter-spacing: 0.005em;
    overflow-x: hidden;
    overflow: hidden;
}

/* SCROLL CONTAINER & CHAMBERS */
.scroll-container {
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    position: relative;
    z-index: 10;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.chamber {
    min-height: 100vh;
    width: 100%;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    position: relative;
    overflow: hidden;
    background: radial-gradient(ellipse at 30% 20%, rgba(125, 220, 255, 0.16) 0%, rgba(176, 125, 255, 0.12) 42%, rgba(11, 30, 45, 0.95) 100%);
}

.chamber::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 78% 18%, rgba(232, 240, 245, 0.16), transparent 20%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 38%, rgba(176, 125, 255, 0.08));
    mix-blend-mode: overlay;
    pointer-events: none;
    z-index: 1;
}

.chamber.shake {
    animation: screen-shake 150ms linear;
}

.chamber-content {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: clamp(2rem, 4vw, 4rem);
    position: relative;
    z-index: 5;
}

.chamber-title {
    font-family: var(--font-display);
    font-size: clamp(3.5rem, 10vw, 9rem);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-align: center;
    text-shadow: 0 0 40px rgba(125, 220, 255, 0.3);
    color: var(--color-glacial-cyan);
    margin-bottom: 2rem;
}

.chamber-heading {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 4vw, 3.5rem);
    text-transform: uppercase;
    letter-spacing: 0.01em;
    text-align: center;
    color: var(--color-glacial-cyan);
    margin-bottom: 1.5rem;
}

.chamber-prompt {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    text-align: center;
    color: var(--color-moonlit-white);
    opacity: 0.85;
    margin-top: 2rem;
}

/* CHAMBER 1: MAP */
.chamber-map {
    background: radial-gradient(ellipse at 30% 20%, #7DDCFF 0%, #B07DFF 55%, #0B1E2D 100%);
    position: relative;
}

.chamber-map::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100' height='100' fill='%23ffffff' filter='url(%23noise)' opacity='0.02'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 1;
}

.map-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    aspect-ratio: 4/3;
    background: var(--color-aged-vellum);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 2;
    border: 1px solid rgba(255, 255, 255, 0.45);
    transform: rotate(-0.6deg);
}

.map-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, rgba(255, 255, 255, 0.35), transparent 32%, rgba(125, 220, 255, 0.14) 64%, transparent);
    pointer-events: none;
    z-index: 2;
}

.map-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.waypoint circle {
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.waypoint:hover circle {
    stroke-width: 3;
    filter: drop-shadow(0 0 8px rgba(125, 220, 255, 0.6));
}

.crystal-cluster {
    animation: crystal-pulse 3s ease-in-out infinite;
}

.crystal-cluster:nth-child(n+2) {
    animation-delay: 0.5s;
}

@keyframes crystal-pulse {
    0%, 100% {
        filter: brightness(1);
        opacity: 0.4;
    }
    50% {
        filter: brightness(1.3);
        opacity: 0.7;
    }
}

/* CHAMBER 2: ROLL */
.chamber-roll {
    background: radial-gradient(ellipse at 50% 30%, rgba(125, 220, 255, 0.24), rgba(176, 125, 255, 0.12) 45%, rgba(11, 30, 45, 0.95) 100%);
    position: relative;
}

.dice-arena {
    width: 100%;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin: 2rem 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08), rgba(125, 220, 255, 0.04) 40%, transparent 68%);
}

.dice-container {
    position: relative;
    width: 180px;
    height: 180px;
    perspective: 1000px;
}

.dice {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 1.8s cubic-bezier(0.55, 0, 1, 0.45);
    animation: dice-idle 4s ease-in-out infinite;
}

.dice.rolling {
    animation: dice-roll 1.8s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}

.dice-face {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.1));
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 1rem;
}

.dice-face.face-1 {
    transform: translateZ(90px);
    background: linear-gradient(135deg, rgba(125, 220, 255, 0.3), rgba(125, 220, 255, 0.1));
}

.dice-face.face-2 {
    transform: rotateY(180deg) translateZ(90px);
    background: linear-gradient(135deg, rgba(176, 125, 255, 0.3), rgba(176, 125, 255, 0.1));
}

.dice-face.face-3 {
    transform: rotateY(90deg) translateZ(90px);
    background: linear-gradient(135deg, rgba(255, 179, 71, 0.3), rgba(255, 179, 71, 0.1));
}

.dice-face.face-4 {
    transform: rotateY(-90deg) translateZ(90px);
    background: linear-gradient(135deg, rgba(255, 90, 110, 0.3), rgba(255, 90, 110, 0.1));
}

.dice-face.face-5 {
    transform: rotateX(90deg) translateZ(90px);
    background: linear-gradient(135deg, rgba(232, 240, 245, 0.3), rgba(232, 240, 245, 0.1));
}

.dice-face.face-6 {
    transform: rotateX(-90deg) translateZ(90px);
    background: linear-gradient(135deg, rgba(58, 79, 98, 0.3), rgba(58, 79, 98, 0.1));
}

.pip {
    display: block;
    width: 16px;
    height: 16px;
    background: var(--color-glacial-cyan);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(125, 220, 255, 0.65), inset 0 1px 2px rgba(255, 255, 255, 0.7);
}

@keyframes dice-idle {
    0%, 100% {
        transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
    }
    33% {
        transform: rotateX(5deg) rotateY(5deg) rotateZ(-3deg);
    }
    66% {
        transform: rotateX(-4deg) rotateY(-6deg) rotateZ(4deg);
    }
}

@keyframes dice-roll {
    0% {
        transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg) translateY(0);
        opacity: 1;
    }
    20% {
        transform: rotateX(720deg) rotateY(720deg) rotateZ(360deg) translateY(-80px);
    }
    70% {
        transform: rotateX(1440deg) rotateY(1440deg) rotateZ(720deg) translateY(40px);
        opacity: 1;
    }
    85% {
        transform: rotateX(1440deg) rotateY(1440deg) rotateZ(720deg) translateY(-10px) scaleY(0.85);
    }
    100% {
        transform: rotateX(1440deg) rotateY(1440deg) rotateZ(720deg) translateY(0) scaleY(1);
        opacity: 1;
    }
}

.ripple-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

.ripple {
    position: absolute;
    border: 3px solid transparent;
    background: radial-gradient(circle, transparent 55%, rgba(125, 220, 255, 0.42) 58%, rgba(176, 125, 255, 0.2) 64%, transparent 70%);
    border-radius: 50%;
    animation: ripple-expand 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.micro-ripple {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(circle, rgba(255, 179, 71, 0.55), rgba(255, 90, 110, 0.16) 55%, transparent 70%);
    animation: micro-ripple 650ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes ripple-expand {
    0% {
        transform: scale(0);
        opacity: 0.8;
        border-color: var(--color-glacial-cyan);
    }
    100% {
        transform: scale(4);
        opacity: 0;
        border-color: var(--color-ruby-flare);
    }
}

.roll-button {
    align-self: center;
    padding: 1rem 2.5rem;
    font-family: var(--font-secondary);
    font-size: clamp(1rem, 2vw, 1.25rem);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--color-obsidian-teal);
    background: linear-gradient(135deg, var(--color-honeyed-amber) 0%, var(--color-ruby-flare) 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(255, 179, 71, 0.3);
    backdrop-filter: blur(16px) saturate(1.5);
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    overflow: hidden;
}

.roll-button::after {
    content: '';
    position: absolute;
    inset: -70% -30%;
    background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.45), transparent 70%);
    transform: translateX(-80%) rotate(8deg);
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.roll-button:hover::after {
    transform: translateX(80%) rotate(8deg);
}

.roll-button:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(255, 179, 71, 0.5);
}

.roll-button:active {
    transform: scale(0.98);
}

.roll-result {
    text-align: center;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-family: var(--font-secondary);
    color: var(--color-honeyed-amber);
    font-weight: 700;
    min-height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* CHAMBER 3: ARCHIVE */
.chamber-archive {
    position: relative;
}

.archive-container {
    width: 100%;
    height: 500px;
    position: relative;
    margin: 2rem 0;
}

.archive-items {
    width: 100%;
    height: 100%;
    position: relative;
}

.archive-card {
    position: absolute;
    width: 200px;
    padding: 1.5rem;
    background: var(--color-aged-vellum);
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='cardnoise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100' height='100' fill='%23f0e6d2' filter='url(%23cardnoise)' opacity='0.08'/%3E%3C/svg%3E");
    border-radius: 4px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), inset 0 0 30px rgba(139, 109, 63, 0.15);
    clip-path: polygon(0 1%, 1% 0, 100% 0, 99% 1%, 100% 100%, 99% 99%, 0 99%, 1% 100%);
    cursor: grab;
    opacity: 0;
    animation: archive-float-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    color: var(--color-text-dark);
}

.archive-card:nth-child(1) { animation-delay: 0.1s; }
.archive-card:nth-child(2) { animation-delay: 0.2s; }
.archive-card:nth-child(3) { animation-delay: 0.3s; }
.archive-card:nth-child(4) { animation-delay: 0.4s; }
.archive-card:nth-child(5) { animation-delay: 0.5s; }

@keyframes archive-float-in {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.archive-card:hover {
    transform: translateY(-8px) rotate(var(--card-rotate, 2deg)) scale(1.03);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25), inset 0 0 30px rgba(139, 109, 63, 0.15);
}

.archive-card h4 {
    font-family: var(--font-secondary);
    font-size: 1.1rem;
    color: var(--color-text-dark);
    margin-bottom: 0.5rem;
}

.archive-card p {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--color-text-dark);
    line-height: 1.4;
}

.archive-card .roll-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-honeyed-amber);
    margin: 0.8rem 0;
    text-align: center;
}

/* CHAMBER 4: CODEX */
.chamber-codex {
    background: linear-gradient(180deg, rgba(11, 30, 45, 0.9) 0%, rgba(20, 45, 70, 0.9) 100%);
    position: relative;
}

.chamber-archive {
    background: radial-gradient(ellipse at 40% 30%, rgba(176, 125, 255, 0.2), rgba(58, 79, 98, 0.2) 48%, rgba(11, 30, 45, 0.96) 100%);
}

.codex-timeline {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    margin: 0 auto;
}

.codex-entry {
    display: flex;
    gap: 2rem;
    opacity: 0;
    animation: codex-reveal 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.codex-entry:nth-child(odd) {
    flex-direction: row;
    margin-left: 0;
}

.codex-entry:nth-child(even) {
    flex-direction: row-reverse;
    margin-left: 3vw;
}

.codex-entry:nth-child(1) { animation-delay: 0.1s; }
.codex-entry:nth-child(2) { animation-delay: 0.2s; }
.codex-entry:nth-child(3) { animation-delay: 0.3s; }
.codex-entry:nth-child(4) { animation-delay: 0.4s; }
.codex-entry:nth-child(5) { animation-delay: 0.5s; }

@keyframes codex-reveal {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.codex-card {
    flex: 0 0 auto;
    width: 280px;
    padding: 1.5rem;
    background: var(--color-aged-vellum);
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='codexnoise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100' height='100' fill='%23f0e6d2' filter='url(%23codexnoise)' opacity='0.08'/%3E%3C/svg%3E");
    border-left: 4px solid var(--color-glacial-cyan);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), inset 0 0 30px rgba(139, 109, 63, 0.15);
    position: relative;
}

.codex-card h5 {
    font-family: var(--font-secondary);
    font-size: 1.25rem;
    color: var(--color-text-dark);
    margin-bottom: 0.75rem;
}

.codex-card .result-value {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-honeyed-amber);
    margin: 0.5rem 0;
}

.codex-card .result-time {
    font-size: 0.85rem;
    color: var(--color-frosted-slate);
    margin-top: 1rem;
}

.codex-timeline .codex-prompt {
    text-align: center;
    font-style: italic;
    font-weight: 300;
    margin: 2rem 0;
}

/* HUD FRAME */
.hud-frame {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1000;
    font-family: var(--font-body);
}

.hud-top, .hud-bottom, .hud-left, .hud-right {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px) saturate(1.4);
    -webkit-backdrop-filter: blur(12px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.hud-top {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    pointer-events: auto;
    gap: 2rem;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid rgba(125, 220, 255, 0.3);
}

.progress-fill {
    height: 100%;
    background: repeating-linear-gradient(90deg, var(--color-glacial-cyan) 0 14px, var(--color-aurora-violet) 14px 28px, var(--color-honeyed-amber) 28px 42px);
    width: 0%;
    transition: width 0.4s ease;
}

.hud-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-glacial-cyan);
    white-space: nowrap;
}

.hud-left {
    position: fixed;
    left: 0;
    top: 60px;
    bottom: 60px;
    width: 60px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    padding: 1rem 0;
    pointer-events: auto;
}

.hud-glyph {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.hud-glyph:hover {
    opacity: 1;
    filter: drop-shadow(0 0 8px rgba(125, 220, 255, 0.4));
}

.hud-right {
    position: fixed;
    right: 0;
    top: 60px;
    width: 120px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-glacial-cyan);
    pointer-events: auto;
}

.chamber-indicator {
    display: block;
}

.hud-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 2rem;
    pointer-events: auto;
}

.nav-cluster {
    display: flex;
    gap: 1rem;
}

.nav-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(125, 220, 255, 0.3);
    border: 1px solid rgba(125, 220, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    padding: 0;
    pointer-events: auto;
}

.nav-dot:hover {
    background: var(--color-glacial-cyan);
    transform: scale(1.3);
}

.nav-dot.active {
    background: var(--color-glacial-cyan);
    box-shadow: 0 0 16px rgba(125, 220, 255, 0.6);
    transform: scale(1.4);
}

/* CRYSTAL PARALLAX LAYER */
.crystal-parallax {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.crystal-element {
    position: absolute;
    opacity: 0.4;
    animation: crystal-drift 30s infinite ease-in-out;
    filter: hue-rotate(var(--hue-shift, 0deg));
    transition: filter 0.35s ease;
}

@keyframes screen-shake {
    0% { transform: translate(0, 0); }
    25% { transform: translate(2px, -1px); }
    50% { transform: translate(-2px, 1px); }
    75% { transform: translate(1px, 1px); }
    100% { transform: translate(0, 0); }
}

@keyframes micro-ripple {
    from { opacity: 0.9; transform: translate(-50%, -50%) scale(0); }
    to { opacity: 0; transform: translate(-50%, -50%) scale(9); }
}

@keyframes chamber-reveal {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes result-pop {
    0% { opacity: 0; transform: scale(0.5); }
    50% { transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes crystal-drift {
    0%, 100% {
        transform: translateX(0) translateY(0);
    }
    25% {
        transform: translateX(40px) translateY(-30px);
    }
    50% {
        transform: translateX(0) translateY(-60px);
    }
    75% {
        transform: translateX(-40px) translateY(-30px);
    }
}

/* RESPONSIVE */
@media (max-width: 1024px) {
    .hud-right {
        width: 80px;
        font-size: 0.65rem;
    }

    .chamber {
        padding: 2rem 1.5rem;
    }

    .chamber-content {
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .hud-top {
        height: 50px;
        padding: 0 1rem;
        gap: 1rem;
    }

    .hud-label {
        font-size: 0.7rem;
    }

    .hud-left {
        width: 50px;
        top: 50px;
        bottom: 50px;
    }

    .hud-right {
        display: none;
    }

    .hud-bottom {
        height: 50px;
    }

    .nav-dot {
        width: 10px;
        height: 10px;
    }

    .chamber {
        padding: 1.5rem 1rem;
    }

    .chamber-title {
        font-size: clamp(2.5rem, 8vw, 4rem);
    }

    .chamber-heading {
        font-size: clamp(1.25rem, 3vw, 2rem);
    }

    .dice-arena {
        height: 300px;
    }

    .archive-container {
        height: 400px;
    }

    .archive-card {
        width: 160px;
    }

    .codex-entry {
        gap: 1rem;
    }

    .codex-card {
        width: 220px;
    }

    .chamber-indicator {
        display: block;
    }
}

@media (max-width: 480px) {
    .hud-top {
        height: 40px;
        padding: 0 0.75rem;
    }

    .hud-left {
        width: 40px;
        top: 40px;
        bottom: 40px;
        gap: 0.5rem;
    }

    .hud-bottom {
        height: 40px;
    }

    .nav-dot {
        width: 8px;
        height: 8px;
    }

    .chamber {
        padding: 1rem;
        justify-content: flex-start;
        padding-top: 5rem;
        min-height: auto;
        height: auto;
    }

    .chamber-content {
        gap: 1rem;
    }

    .chamber-title {
        font-size: clamp(2rem, 6vw, 3rem);
    }

    .chamber-heading {
        font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    }

    .map-container {
        aspect-ratio: 1;
    }

    .dice-arena {
        height: 250px;
    }

    .roll-button {
        width: 100%;
    }

    .archive-container {
        height: 300px;
    }

    .archive-card {
        width: 140px;
        font-size: 0.85rem;
    }

    .codex-entry {
        flex-direction: column !important;
        gap: 0.5rem;
        margin-left: 0 !important;
    }

    .codex-card {
        width: 100%;
    }
}
