html{
    margin: 0;
    padding: 0;
}
body {
    text-align: center;
    background: #221942;
    font-family: 'Inter', sans-serif;
    color:#fff;
}
.floor {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: auto;
    z-index: 2; /* keep the floor near the back */
}
.gallery-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 70px;
    height: auto;
    cursor: pointer;
    background: none;
    border: none;
}
.gallery-btn-photo {
    width: 100%; 
    height: auto;
}
.gallery-btn:hover {
    transform: scale(1.1);
    transition: transform 0.2s;
}

.bear-box {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: none; /*hide till pres */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    bottom: 120px;
    width: auto;
    max-width: 760px;
    z-index: 20;
}

.bear-guide-normal {
    width: 120%;
    height: auto;
}
.text-box {
    background: #fff; 
    color: #111;
    padding: 18px 26px;
    border-radius: 18px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
    width: 60%;
    max-width: 760px;
    box-sizing: border-box;
    text-align: left;
    font-size: 26px;
    line-height: 1.1;
    display: flex;
    flex-direction: column;
    min-height: 120px;
}

#display-text {
    color:#000;
    font-size: 1.5rem;
    flex: 1 1 auto;
    min-height: 1.25em;
    white-space: pre-line;
}
.next-link {
    display: inline-block;
    margin-top: auto;
    align-self: flex-end;
    color: #111;
    text-decoration: underline;
    font-size: 18px;
    padding-top: 10px;
}

.bear-guide-normal {
    width: 220px; 
    height: auto;
}

/* Left-aligned layout bear on 3rd dialogue*/
.bear-box.bear-left {
    left: 5%;
    transform: none;
    bottom: 120px;
    flex-direction: column;
    align-items: center;
    width: auto;
}

.bear-box.bear-left .bear-guide-normal {
    width: 200px;
    margin: 12px 0 0 0;
}

.bear-box.bear-left .text-box {
    width: 360px;
    max-width: 50vw;
    text-align: left;
    margin-bottom: 12px;
}

/* Bear travels horizontally across the viewport, then settles (next exhibit beat) */
.bear-box.bear-exhibit-shift {
    animation: bearTraverseCentered 1.45s cubic-bezier(0.37, 0, 0.25, 1) both;
}
.bear-box.bear-left.bear-exhibit-shift {
    animation: bearTraverseFromLeft 1.45s cubic-bezier(0.37, 0, 0.25, 1) both;
}
@keyframes bearTraverseCentered {
    0% {
        left: 50%;
        transform: translateX(calc(-50% - min(42vw, 520px)));
    }
    55% {
        left: 50%;
        transform: translateX(calc(-50% + min(42vw, 520px)));
    }
    100% {
        left: 50%;
        transform: translateX(-50%);
    }
}
@keyframes bearTraverseFromLeft {
    0% {
        left: 5%;
        transform: none;
    }
    55% {
        left: calc(100% - min(18vw, 160px));
        transform: none;
    }
    100% {
        left: 5%;
        transform: none;
    }
}
@media (prefers-reduced-motion: reduce) {
    .bear-box.bear-exhibit-shift,
    .bear-box.bear-left.bear-exhibit-shift {
        animation: none !important;
    }
}

/* Bear + speech above spotlight so the cone reads on the room, not on Félix */
body.museum-spotlit .bear-box {
    z-index: 35;
}
body.museum-spotlit .bear-box .text-box {
    position: relative;
    z-index: 36;
}

.bear-box h1, .bear-box p {
    margin: 20px 0 10px 0;
    font-size: 36px;
    color: #fff;
    z-index: 35;
}

.welcome-circle {
    position: absolute;
    bottom:0%;
    right: 0%;
    width: 50%;
    height: auto;
    z-index: 30;
}

.start-btn {
    display: inline-block;
    color: #111;
    background: transparent;
    text-decoration: underline;
    position: absolute;
    top: calc(45% + 220px);
    left: 60%;
    transform: translateX(0);
    z-index: 40;
    font-size: 18px;
}

.welcome-title{
    position: absolute;
    top: 400px;
    left: 930px;
    transform: translateX(-50%);
    font-size: 48px;
    z-index: 40;
    color: #000;
}
.frame {
    position: absolute; 
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex; 
    justify-content: center;
    align-items: center;
    width: 320px; 
    max-width: 90%;
    height: auto;
    display: none; 
    pointer-events: auto;
    cursor: none;
    z-index: 10;
}

.quiz-box{
    position: absolute;
    top:50%;
    left: 50%;
    transform: translate(-50%, -50%);
    justify-content: center;
    background: #fff; 
    color: #111;
    padding: 18px 26px;
    border-radius: 18px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
    width: 100%;
    max-width: 400px;
    box-sizing: border-box;
    text-align: center;
    font-size: 24px;
    z-index: 110;
    display: none;
    flex-direction: column;
    pointer-events: auto;

}
.quiz-intro-circle{    
    position: absolute;
    left: 0%;
    width: 50%;
    bottom:0%;
    z-index: 70;
}

.quiz-intro-wrap h1 {
    font-size: 36px;
    color: #000;
    z-index: 71;

}
.welcome-quiz-title
{
    position: absolute;
    top: 60%;
    left: 34%;
    transform: translate(-50%, -50%);
    font-size: 36px;
    color: #000;
    z-index: 71;
}
.quiz-box{
    width: 700px;
    max-width: 90%;
    height: 500px;
}

/* Score request: loading state inside .quiz-box */
.quiz-score-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 36px;
    min-height: 220px;
    padding: 24px 16px;
    box-sizing: border-box;
}
.quiz-score-loading-title {
    margin: 0;
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    font-weight: 800;
    color: #111;
}
.quiz-score-loading-row {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: clamp(14px, 4vw, 24px);
    min-height: 72px;
}
.quiz-score-loading-bubble {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
    animation: quizScoreLoadingBounce 0.55s ease-in-out infinite;
    animation-delay: calc(var(--ql-i, 0) * -0.1s);
}
@keyframes quizScoreLoadingBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-16px); }
}
.quiz-score-loading-bubble .qs-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
    pointer-events: none;
    transition: opacity 0.14s ease;
}
.quiz-score-loading-bubble .qs-img-bear {
    opacity: 0;
}
.quiz-score-loading-bubble .qs-img-dot {
    opacity: 1;
}
.quiz-score-loading-bubble--bear .qs-img-bear {
    opacity: 1;
}
.quiz-score-loading-bubble--bear .qs-img-dot {
    opacity: 0;
}

#quiz-start-btn {
    position: absolute;
    font-size: 18px;
    color: #000;
    text-decoration: underline;
    cursor: pointer;
    z-index: 71;
    left: 28%;
    top: 80%;
}
.quiz-intro-wrap{
    display:none;
    position: fixed;
    inset: 0;
    z-index: 130;
    pointer-events: auto;
}

.quiz-btn-box{
    display: flex;
    flex-direction: row;
    color: #000;
    justify-content: space-around;
}

.quiz-sub-text{
    font-size: 18px;
    color: #000;
    display:flex;
    flex-direction: row;
}

.quiz-btn{
    border-radius: 8px;
    border-color: #000;
    border-width: 4px;
    border-style: solid;
    min-width: 120px;
    max-width: 220px;
    height: auto;
    padding: 10px 12px;
    box-sizing: border-box;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: normal;
    line-height: 1.1;
    word-break: break-word;
}
.quiz-btn1{
    background-color: #FF876F;
}
.quiz-btn2{
    background-color: #FFB06F;
}
.quiz-btn3{
    background-color: #FFDF52;
}
.quiz-btn4{
    background-color: #92FF88;
}


.quiz-btn{
    transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
    will-change: transform, box-shadow;
}
.quiz-btn:hover{
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 5px 5px rgba(0,0,0,0.18);
    filter: brightness(0.98);
}

.quiz-btn:focus{
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 5px 5px rgba(0,0,0,0.18);
    filter: brightness(0.98);
}



/* Improve accessibility when user prefers reduced motion */
@media (prefers-reduced-motion: reduce){
    .quiz-btn{ transition: none; transform: none; }
}

.quiz-nav{
    padding-top: 24px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: nowrap;
    width: 100%;
    background: transparent;
    text-decoration: underline;
}

.quiz-nav button,
.quiz-nav a{
    background: transparent !important;
    border: none;
    box-shadow: none;
    color: inherit;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.2rem;
    white-space: nowrap;
}

/* floating glowys*/
.glow-dots{
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 15;
}
.glow-dot{
    position: absolute;
    left: var(--left, 10%);
    top: var(--top, 10%);
    width: var(--size, 10px);
    height: var(--size, 10px);
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #fff 0%, #fff9c4 18%, #ffea00 40%, rgba(255,210,77,0.12) 65%);
    filter: blur(6px);
    opacity: 0.95;
    transform: translate3d(0,0,0);
    animation: float var(--dur, 7s) ease-in-out var(--delay, 0s) infinite, pulse 3.5s ease-in-out calc(var(--delay,0s) + 0.2s) infinite;
}
.glow-dot::after{
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%,-50%);
    width: 240%;
    height: 240%;
    background: radial-gradient(circle, rgba(255,235,59,0.22), rgba(255,235,59,0) 40%);
    filter: blur(12px);
    border-radius: 50%;
    pointer-events: none;
}

@keyframes float{
    0%{ transform: translate3d(0,0,0) scale(1); }
    50%{ transform: translate3d(10px, -28px, 0) scale(1.08); }
    100%{ transform: translate3d(0,0,0) scale(1); }
}

@keyframes pulse{
    0%{ opacity: 0.9; transform: scale(1); }
    50%{ opacity: 0.7; transform: scale(1.12); }
    100%{ opacity: 0.9; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce){
    .glow-dot{ animation: none !important; }
}

.score-container{
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:18px;
    width:100%;
    padding:18px;
}

.score-circle{
    width:220px;
    height:220px;
    border-radius:50%;
    border:10px solid rgba(255,138,101,0.95);
    display:flex;
    align-items:center;
    justify-content:center;
    background: #fff;
    box-shadow: 0 8px 30px rgba(255,138,101,0.08);
}
.score-value{
    font-size:56px;
    font-weight:800;
    color: #ff7043;
    line-height:1;
}
.score-unit{
    font-size:20px;
    color:#111;
    margin-left:6px;
    font-weight:700;
}
.score-sub{
    font-size:18px;
    color:#222;
    max-width:720px;
    text-align:center;
}

/* .score-circle.score-red { 
    border-color: #FF876F; 
} */
.score-container h1 {
    order: -1;
    margin: 0 0 18px 0;
    font-size: 36px;
    color: #111;
    width: 100%;
    text-align: center;
}

.score-next-btn{
    position: absolute;
    right: 18px;
    bottom: 18px;
    background: transparent;
    border: none;
    color: #111;
    font-weight: 800;
    font-size: 18px;
    cursor: pointer;
    text-decoration: underline;
    z-index: 80;
}
.score-circle { z-index: 1; }
.score-next-btn:active{ transform: translateY(1px); }

.scorecard-box {
    position: absolute;
    top: 35%;
    left:45%;
    width: 100%;
    max-width: 720px;

    display: flex;
    justify-content: center;
    align-items: center;

    position: absolute; 
    display: none;
    z-index: 18;
    transition: left 0.35s ease, top 0.35s ease, transform 0.35s ease;
}

/* Sit beside the portrait frame when a risk painting is shown */
.scorecard-box.scorecard-near-frame {
    left: calc(50% + 140px);
    top: 28%;
    transform: translateY(-50%);
    max-width: 200px;
    width: auto;
    justify-content: flex-start;
}
@media (max-width: 900px) {
    .scorecard-box.scorecard-near-frame {
        left: 50%;
        top: calc(30% + 140px);
        transform: translateX(-50%);
        max-width: 180px;
    }
}

.scorecard-num {
    position: absolute; 
    left: 50%;
    transform: translate(-50%, -50%); 

    z-index: 2; 
    color: black; 
    font-size: 32px;
}

.scorecard
{
    width: 20%;
    height: auto;
}

/* Final exhibit: dramatic spotlight */
.museum-spotlight-layer {
    position: fixed;
    inset: 0;
    z-index: 25;
    pointer-events: none;
}
.museum-spotlight-layer[hidden] {
    display: none !important;
}
.museum-spotlight-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 52% 48% at 22% 42%, transparent 0%, transparent 14%, rgba(10, 5, 30, 0.78) 38%, rgba(5, 2, 20, 0.94) 100%);
}
.museum-spotlight-cone {
    position: absolute;
    top: 8%;
    left: 8%;
    width: 34%;
    height: 72%;
    background: radial-gradient(ellipse 42% 58% at 48% 46%, rgba(255, 255, 255, 0.42) 0%, rgba(220, 230, 255, 0.1) 28%, transparent 62%);
    filter: blur(1px);
    mix-blend-mode: screen;
}

/* Overall risk assessment (end of tour) */
.overall-assessment-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
    background: rgba(15, 8, 40, 0.55);
    pointer-events: auto;
}
.overall-assessment-card {
    background: #fff;
    color: #111;
    border-radius: 20px;
    max-width: 920px;
    width: 100%;
    padding: 28px 32px 24px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    text-align: left;
    position: relative;
    animation: museumModalIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
    /* cap height and allow internal scrolling when content is large */
    max-height: 84vh;
    overflow: hidden;
}
@keyframes museumModalIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
.overall-assessment-card h2 {
    margin: 0 0 20px;
    font-size: 1.75rem;
    text-align: center;
    color: #111;
}
.overall-assessment-body {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    align-items: flex-start;
    justify-content: center;
    /* allow the body to scroll when modal is tall */
    max-height: calc(84vh - 140px);
    overflow: auto;
    padding-right: 8px; /* space for scrollbar */
}
.overall-score-ring-wrap {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.overall-score-ring {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 12px solid #ff8a65;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    font-size: 3rem;
    font-weight: 800;
    color: #ff7043;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.overall-score-ring:hover {
    transform: scale(1.04);
    box-shadow: 0 0 0 6px rgba(255, 223, 82, 0.25);
}
.overall-score-ring.tier-green { border-color: #92FF88; color: #1b5e20; }
.overall-score-ring.tier-yellow { border-color: #FFDF52; color: #5d4a00; }
.overall-score-ring.tier-red { border-color: #FF876F; color: #b71c1c; }
.overall-portraits {
    flex: 1 1 280px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}
/* Compact option boxes for overall modal (drivers & tips) */
.overall-dropdown-row{
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: stretch;
    margin: 8px 0 12px 0;
    flex-wrap: wrap; /* wrap boxes on small viewports */
}
.overall-option-box{
    min-width: 160px;
    max-width: 220px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 4px solid #000;
    background: #FFDF52;
    color: #111;
    font-weight: 700;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 0 rgba(0,0,0,0.12);
    text-align: left;
}
.overall-option-box:hover{ transform: translateY(-3px); box-shadow: 0 8px 18px rgba(0,0,0,0.18); }
.overall-option-box.selected{ outline: 3px solid rgba(0,0,0,0.08); box-shadow: 0 12px 30px rgba(0,0,0,0.22); }
.overall-option-title{ font-size: 16px; margin-bottom: 6px; }
.overall-option-meta{ font-size: 14px; color: rgba(0,0,0,0.7); font-weight: 600; }
.overall-more-box{ background: #fff; border-style: dashed; color: #111; }
.overall-driver-detail, .overall-tip-detail{ margin-top: 8px; color: #222; font-size: 18px; line-height: 1.4; max-width: 560px; }
/* if details are long, allow them to scroll within the modal body */
.overall-driver-detail, .overall-tip-detail { max-height: 40vh; overflow: auto; padding-right: 8px; }
.overall-label{ font-size: 18px; font-weight: 800; color: #111; }
.overall-label-row{ display:flex; justify-content:center; align-items:center; margin-bottom:6px; }
.overall-portraits-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
}
.overall-portrait-mini {
    width: 88px;
    height: 88px;
    object-fit: cover;
    border-radius: 8px;
    border: 4px solid #c9a227;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    background: #eee;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.overall-portrait-mini:hover {
    transform: scale(1.08) rotate(-1deg);
    box-shadow: 0 8px 22px rgba(201, 162, 39, 0.45);
}
.overall-backend-placeholder {
    font-size: 0.95rem;
    line-height: 1.45;
    color: #444;
    max-width: 520px;
    margin: 0 auto;
}
.overall-assessment-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 22px;
    padding-top: 8px;
    flex-wrap: wrap;
    gap: 12px;
}
.overall-bear-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}
.overall-retake-btn,
.quiz-btn-like {
    border-radius: 8px;
    border: 4px solid #000;
    border-style: solid;
    padding: 10px 18px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    box-sizing: border-box;
    font-family: inherit;
}
.overall-retake-btn.quiz-btn-like {
    background-color: #ffdf52;
    color: #111;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.overall-retake-btn.quiz-btn-like:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
    filter: brightness(1.04);
}
.overall-retake-btn.quiz-btn-like:active {
    transform: translateY(1px);
}

.frame {
    transition: transform 0.35s ease, filter 0.35s ease, box-shadow 0.35s ease;
}
.frame:hover {
    transform: translate(-50%, -50%) scale(1.03);
    filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.35));
}

.next-link {
    transition: color 0.2s ease, letter-spacing 0.2s ease, transform 0.2s ease;
}
.next-link:hover {
    color: #ffdf52;
    letter-spacing: 0.02em;
}

.gallery-btn {
    transition: transform 0.25s ease, filter 0.25s ease;
}
.gallery-btn:hover {
    transform: scale(1.08) rotate(-3deg);
    filter: drop-shadow(0 4px 12px rgba(255, 223, 82, 0.35));
}

.vase{
    position: absolute;
    z-index: 3;
    width: 13%;
    left: 13%;
    bottom: 10%;

}
.candle{
    position: absolute;
    z-index: 3;
    bottom: 0; 
    width: 10%; 
}
.column{
    position: absolute;
    z-index: 3;
    bottom: 10%;
    width: 20%;
    left: -10px;
}

.exportrait,
.exportrait2,
.exportrait3 {
    position: absolute;
    z-index: 30; 
    width: 140px;
    max-width: 18vw;
    height: auto;
    object-fit: contain;
}
.exportrait { left: 17%; top: 20%; transform: none; }
.exportrait2 { left:30%; top: 33%; transform: none; }
.exportrait3 { left: 42%; top: 12%; transform: translateX(-50%); }


@media (prefers-reduced-motion: reduce) {
    .quiz-score-loading-bubble {
        animation: none !important;
    }
    .overall-assessment-card,
    .overall-portrait-mini,
    .overall-score-ring,
    .frame,
    .gallery-btn {
        animation: none !important;
        transition: none !important;
    }
    .overall-assessment-card {
        opacity: 1;
        transform: none;
    }
    .overall-portrait-mini:hover,
    .overall-score-ring:hover,
    .frame:hover,
    .gallery-btn:hover {
        transform: none;
    }
}
