/* ==========================================================================
   Design Tokens (Variables)
   ========================================================================== */
:root {
    --bg-dark: #0B132B;
    --bg-darker: #050914;
    --bg-panel: rgba(28, 37, 65, 0.6);
    --primary: #5DFDDD;
    --primary-glow-subtle: color-mix(in srgb, var(--primary) 20%, transparent);
    --primary-glow-strong: color-mix(in srgb, var(--primary) 40%, transparent);
    --primary-hover: #3EE0C0;
    --success: #5EFDAB;
    --success-glow-subtle: color-mix(in srgb, var(--success) 20%, transparent);
    --success-glow-strong: color-mix(in srgb, var(--success) 40%, transparent);
    --secondary: #5DCDFD; 
    --text-main: #FFFFFF;
    --text-muted: #A1A1AA;
    --danger: #FD5DCD;
    --warning: #FD8D5D;
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --blur-intensity: 12px;
    --backdrop-blur: 4px;
    --backdrop-bg: rgba(5, 9, 20, 0.65);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --minimum-touch-target: 48px;
    --minimum-label-size: 0.75rem;
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-left: env(safe-area-inset-left, 0px);
    --safe-area-right: env(safe-area-inset-right, 0px);
}

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

body, html {
    width: 100%; height: 100%;
    font-family: var(--font-body);
    background-color: var(--bg-darker);
    color: var(--text-main);
    background-image: url('../assets/hero_mansion.webp');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(5, 9, 20, 0.85); /* 85% opacity of --bg-darker */
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    z-index: -1;
}

a { text-decoration: none; }

.app-container {
    position: relative;
    width: 100%; height: 100%;
    max-width: 600px; 
    margin: 0 auto;
    background-color: var(--bg-dark);
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
    overflow-y: auto;
    overflow-x: hidden;
}

.screen {
    width: 100%; min-height: 100%;
    display: flex; flex-direction: column;
    animation: fadeIn 0.4s ease forwards;
}

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

.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(var(--blur-intensity));
    -webkit-backdrop-filter: blur(var(--blur-intensity));
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
}

.btn {
    font-family: var(--font-heading);
    padding: 12px 24px;
    cursor: pointer; border: none; outline: none;
    border-radius: 12px; font-weight: 700;
    transition: all 0.3s ease;
    display: inline-flex; align-items: center; justify-content: center;
    min-height: var(--minimum-touch-target);
}

.btn-primary { background: var(--primary); color: #000; text-transform: uppercase; letter-spacing: 0.5px; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 10px 20px rgba(93, 253, 221, 0.3); }
.btn-secondary { background: transparent; color: var(--text-main); border: 2px solid var(--text-muted); }
.btn-secondary:hover {
    border-color: var(--secondary);
    background: rgba(93, 205, 253, 0.12);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3), 0 0 15px rgba(93, 205, 253, 0.2);
}
.btn-large { padding: 16px 32px; font-size: 1.1rem; width: 100%; }

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(93, 253, 221, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(93, 253, 221, 0); }
    100% { box-shadow: 0 0 0 0 rgba(93, 253, 221, 0); }
}
.pulse-glow { animation: pulseGlow 2s infinite; }

.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.w-100 { width: 100%; }
.text-center { text-align: center; }
.text-bold { font-weight: 700; }

/* Home */
.hero-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-size: cover; background-position: center; z-index: 1; }
.hero-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(to bottom, rgba(11, 19, 43, 0.2) 0%, rgba(11, 19, 43, 0.9) 80%, rgba(11, 19, 43, 1) 100%); z-index: 2; }
.content-wrapper {
    position: relative;
    z-index: 3;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: calc(0.75rem + var(--safe-area-top)) calc(1.25rem + var(--safe-area-right)) calc(0.85rem + var(--safe-area-bottom)) calc(1.25rem + var(--safe-area-left));
}
.content-wrapper.centered { justify-content: center; align-items: center; text-align: center; }
.logo-text { font-family: var(--font-heading); font-size: 2.5rem; font-weight: 800; margin-top: 0.25rem; text-align: center; }
.accent { color: var(--primary); }
.home-main { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; margin-bottom: 1.5rem; text-align: center; }
.tagline { font-family: var(--font-heading); font-size: 2rem; line-height: 1.2; margin-bottom: 0.75rem; }
.subtitle { color: var(--text-muted); font-size: 1rem; }
.home-actions { display: flex; flex-direction: column; gap: 1rem; align-items: center; margin-bottom: 1.5rem; }

/* Game Header Overlay */
.game-header {
    position: absolute;
    top: max(0.85rem, calc(0.35rem + var(--safe-area-top)));
    left: calc(0.9rem + var(--safe-area-left));
    right: calc(0.9rem + var(--safe-area-right));
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 20;
}
.nav-back,
.home-stats-btn {
    color: var(--text-main);
    text-decoration: none;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(0.85rem, 2.5vw, 1rem);
    letter-spacing: 0.3px;
    background: rgba(20, 32, 68, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    padding: clamp(0.35rem, 1vw, 0.5rem) clamp(0.8rem, 2vw, 1.15rem);
    border-radius: 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
    display: inline-flex;
    align-items: center;
    gap: clamp(0.3rem, 1vw, 0.45rem);
    min-height: clamp(38px, 2.5vw + 22px, var(--minimum-touch-target));
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-back:hover {
    background: rgba(28, 44, 90, 0.95);
    border-color: rgba(93, 253, 221, 0.6);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45), 0 0 15px rgba(93, 253, 221, 0.25);
}

.nav-back:active {
    transform: scale(0.96);
    background: rgba(15, 25, 55, 0.95);
}

.nav-back:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.progress-badge { padding: 0.5rem 1rem; font-size: 0.85rem; font-weight: 600; color: var(--primary); border-radius: 20px; background: rgba(11, 19, 43, 0.7); }

/* Game */
.property-view { position: relative; flex: 1; width: 100%; min-height: clamp(200px, 35vh, 360px); overflow: hidden; margin-top: var(--safe-area-top); }
.property-img { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; }
.property-view::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(5, 9, 20, 0.86) 0%, rgba(5, 9, 20, 0.52) 28%, transparent 58%);
}
/* Feedback */
.feedback-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem 1.5rem calc(2rem + var(--safe-area-bottom));
    border-radius: 20px 20px 0 0;
    background: rgba(11, 19, 43, 0.98);
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.5);
    border-top: 1px solid var(--glass-border);
    animation: slideUpFeedback 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}



@keyframes slideUpFeedback {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Underlying screen blur when feedback panel is active */
.app-container:has(.feedback-panel:not([style*="display: none"]):not([style*="display:none"]):not([hidden])) .screen > *:not(.feedback-panel),
.screen:has(.feedback-panel:not([style*="display: none"]):not([style*="display:none"]):not([hidden])) > *:not(.feedback-panel) {
    pointer-events: none;
    user-select: none;
    transition: filter 0.3s ease;
}

.feedback-icon { width: 50px; height: 50px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; font-weight: bold; margin-top: -45px; margin-bottom: 0.8rem; box-shadow: 0 4px 15px rgba(0,0,0,0.3); }
.feedback-icon.correct { background: var(--success); color: #000; }
.feedback-icon.wrong { background: rgba(255, 50, 50, 0.8); color: #FFF; }
.feedback-title { font-family: var(--font-heading); color: var(--primary); margin-bottom: 0.5rem; font-size: 1.6rem; }
.feedback-price { font-size: clamp(0.9rem, 3.5vw, 1.1rem); margin-bottom: 1rem; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feedback-explanation { background: rgba(255,255,255,0.05); padding: 1rem; border-radius: 10px; font-size: 0.9rem; color: var(--text-muted); text-align: left; border-left: 3px solid var(--primary); width: 100%; margin-bottom: 1rem; }
.feedback-explanation h4 { color: var(--text-main); margin-bottom: 0.3rem; font-family: var(--font-heading); font-size: 0.95rem; }

.error-badge {
    display: inline-block;
    max-width: 150px;
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.95rem;
}
.error-badge--great {
    background: var(--primary-glow-subtle);
    color: var(--primary);
    border: 1px solid var(--primary-glow-strong);
}
.error-badge--good  { background: rgba(255, 214, 0, 0.2); color: #ffd600; border: 1px solid rgba(255, 214, 0, 0.4); }
.error-badge--warn  { background: rgba(255, 146, 43, 0.2); color: #ff922b; border: 1px solid rgba(255, 146, 43, 0.4); }
.error-badge--bad   { background: rgba(255, 107, 107, 0.2); color: #ff6b6b; border: 1px solid rgba(255, 107, 107, 0.4); }

/* Multi-tier status thresholds (shared by play-survival and play-time-attack) */
.status-warning  { color: #ffd600 !important; border-color: #ffd600 !important; }
.status-danger   { color: #ff922b !important; border-color: #ff922b !important; }
.status-critical { color: #ff6b6b !important; border-color: #ff6b6b !important; }

/* End */
.end-icon { font-size: clamp(3rem, 10vh, 5rem); margin-bottom: 0.75rem; }
.end-title { font-family: var(--font-heading); font-size: clamp(1.8rem, 6vw, 2.5rem); margin-bottom: 0.35rem; }
.end-subtitle { color: var(--text-muted); margin-bottom: 1rem; font-size: 0.95rem; }
.end-score {
    width: 100%;
    max-width: 320px;
    margin: 0 auto 0.75rem auto;
    padding: 0.8rem 1.2rem;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
    box-sizing: border-box;
}
.end-actions { width: 100%; max-width: 320px; }

@media (max-height: 700px) {
    .content-wrapper.centered {
        padding: 1rem 1.25rem;
    }
    .end-icon {
        font-size: 2.8rem;
        margin-bottom: 0.35rem;
    }
    .end-title {
        font-size: 1.6rem;
        margin-bottom: 0.2rem;
    }
    .end-subtitle {
        margin-bottom: 0.75rem;
        font-size: 0.85rem;
    }
    .end-actions {
        margin-top: 0.5rem !important;
    }
    .end-actions .btn-large {
        padding: 12px 20px;
        font-size: 0.95rem;
        min-height: 44px;
    }
    .end-actions .mb-3 {
        margin-bottom: 0.5rem !important;
    }
}

/* About & Auxiliary Screens */
.about-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}
.about-header h2 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}
.lang-switcher { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; flex-wrap: nowrap; }
.lang-btn { background: transparent; border: none; font-size: 1.5rem; cursor: pointer; padding: 0; outline: none; min-width: var(--minimum-touch-target); min-height: var(--minimum-touch-target); }
.about-content { padding: 2rem; line-height: 1.6; }
.company-name { color: var(--secondary); font-family: var(--font-heading); font-size: 1.5rem; margin-bottom: 1rem; }
.about-content p { margin-bottom: 1rem; }

/* Question & Choices (shared by play-qcm, play-survival and play-time-attack) */
.qcm-container {
    flex: 1;
    padding: clamp(0.75rem, 2vh, 1.5rem);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: clamp(0.5rem, 1.5vh, 1rem);
    background: var(--bg-dark);
    position: relative;
    z-index: 5;
}
.question-container {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    flex: 1;
    gap: clamp(0.5rem, 1.5vh, 1rem);
}
.question-text {
    font-family: var(--font-heading);
    font-size: clamp(1.1rem, 3.2vh, 1.4rem);
    text-align: center;
    margin-bottom: clamp(0.4rem, 1.5vh, 1.25rem);
    line-height: 1.25;
}
.choices-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(0.5rem, 1.5vh, 1rem);
    position: relative;
    z-index: 10;
    width: 100%;
}
.glass-btn {
    background: var(--bg-panel);
    backdrop-filter: blur(var(--blur-intensity));
    -webkit-backdrop-filter: blur(var(--blur-intensity));
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: clamp(0.6rem, 1.8vh, 1.1rem) 0.5rem;
    min-height: clamp(var(--minimum-touch-target), 6.5vh, 68px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    font-family: var(--font-heading);
    font-size: clamp(0.95rem, 2vh, 1.15rem);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}
.glass-btn:hover { background: rgba(255,255,255,0.1); transform: translateY(-2px); }
.glass-btn.correct-choice { background: var(--success); color: #000; border-color: var(--success); box-shadow: 0 0 20px rgba(94, 253, 171, 0.4); }
.glass-btn.wrong-choice { background: rgba(255, 50, 50, 0.2); border-color: rgba(255, 50, 50, 0.5); color: #ffcccc; }

/* Modals & Dialogs (Abandon modal, Sponsor modal, Confirmation dialogs) */
.mode-selection-modal,
.sponsor-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.mode-selection-modal.hidden,
.sponsor-modal.hidden {
    display: none;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(11, 19, 43, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
}

.modal-content {
    position: relative;
    z-index: 1001;
    background: rgba(20, 32, 68, 0.95);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 3rem 2.2rem 2.2rem;
    width: 90%;
    max-width: 420px;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(93, 253, 221, 0.1);
    animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-close-btn {
    position: absolute;
    top: 12px;
    right: 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    min-width: var(--minimum-touch-target);
    min-height: var(--minimum-touch-target);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.18);
    transform: scale(1.08);
}

.modal-title {
    font-family: var(--font-heading);
    margin-bottom: 1.2rem;
    font-size: 1.5rem;
    color: var(--text-main);
    font-weight: 700;
}


/* Price Estimation Input (shared by play-photo and play-survival) */
.price-input-group { display: flex; flex-direction: column; align-items: center; width: 100%; }
.input-wrapper { position: relative; width: 100%; }
.price-input { width: 100%; padding: 1.2rem 3rem 1.2rem 1.5rem; border-radius: 12px; border: 2px solid var(--glass-border); background: var(--bg-panel); color: var(--text-main); font-size: clamp(1rem, 5vw, 1.5rem); font-weight: 700; text-align: center; transition: all 0.3s ease; outline: none; }
.price-input:focus { border-color: var(--primary); box-shadow: 0 0 15px rgba(93, 253, 221, 0.2); }
.currency-symbol { position: absolute; right: 1.5rem; top: 50%; transform: translateY(-50%); font-size: clamp(1rem, 5vw, 1.5rem); color: var(--text-muted); font-weight: 600; }

/* Animation missing */
@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-5px); }
  100% { transform: translateX(0); }
}

.wrong-shake {
  animation: shake 0.3s ease-in-out;
}

/* Image Carousel Component */
.property-view, .property-img-container {
    position: relative;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 700;
    width: var(--minimum-touch-target);
    height: var(--minimum-touch-target);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    transition: background 0.2s ease, transform 0.2s ease;
    user-select: none;
}

.carousel-btn:hover {
    background: rgba(0, 0, 0, 0.75);
    transform: translateY(-50%) scale(1.05);
}

.carousel-prev {
    left: 12px;
}

.carousel-next {
    right: 12px;
}

.carousel-indicators {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 5;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    padding: 4px 8px;
    border-radius: 12px;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.carousel-dot.active {
    background: #ffffff;
    transform: scale(1.25);
}

.carousel-btn.hidden,
.carousel-indicators.hidden {
    display: none !important;
}

/* Fullscreen Image Toggle */
.property-view .property-img {
    cursor: zoom-in;
}

.property-view.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.95);
}

.property-view.fullscreen .property-img {
    object-fit: contain;
    cursor: zoom-out;
}

.screen:has(.property-view.fullscreen) .property-details-card {
    display: none;
}




/* Compact Property Details Card Layout & Toggle Button */
.property-details-card {
    position: relative;
    width: 100%;
    margin-bottom: 0.75rem;
    padding: 0.35rem 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    z-index: 15;
    background: rgba(11, 19, 43, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    transition: all 0.25s ease;
}

.primary-details-row,
.secondary-details-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.35rem;
    width: 100%;
}

.secondary-details-row.hidden {
    display: none !important;
}

.detail-item {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    flex: 1 1 auto;
    min-width: 0;
}

.detail-item .icon {
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    line-height: 1.2;
    flex-shrink: 0;
    margin-top: 1px;
}

.detail-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
}

.detail-text .label {
    font-size: max(var(--minimum-label-size), clamp(0.55rem, 1.6vw, 0.62rem));
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.1;
}

.detail-text .value {
    font-size: clamp(0.72rem, 2vw, 0.82rem);
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.location-value {
    display: inline-flex;
    align-items: baseline;
    max-width: 100%;
    gap: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
}

.location-zip {
    flex-shrink: 0;
}

.location-city {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1 1 auto;
    min-width: 0;
}

.location-country {
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .location-zip {
        display: none;
    }
}

.expand-details-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid var(--glass-border);
    color: var(--primary);
    font-weight: 700;
    font-size: max(var(--minimum-label-size), clamp(0.65rem, 1.8vw, 0.72rem));
    padding: 0.2rem 0.55rem;
    border-radius: 16px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease, transform 0.2s ease;
    margin-left: auto;
    flex-shrink: 0;
    align-self: center;
    min-width: var(--minimum-touch-target);
    min-height: var(--minimum-touch-target);
}

.expand-details-btn:hover {
    background: rgba(93, 253, 221, 0.2);
    transform: scale(1.05);
}

/* Larger screens (Desktop / Tablet) adjustments for property details card */
@media (min-width: 768px) {
    .carousel-indicators {
        bottom: 1.5rem;
    }

    .property-details-card {
        padding: 0.6rem 1rem;
        gap: 0.5rem;
    }

    .detail-item .icon {
        font-size: 1.1rem;
    }

    .detail-text .label {
        font-size: 0.65rem;
    }

    .detail-text .value {
        font-size: 0.85rem;
    }
}

.secondary-details-row {
    flex-wrap: wrap;
}

.secondary-details-row .detail-item:has(.atouts-value) {
    flex: 1 1 100%;
    width: 100%;
    margin-top: 0.2rem;
}

.detail-text .value.atouts-value {
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.35;
}

/* Responsive Desktop & PC Improvements */
@media (min-width: 900px) {
    .app-container {
        max-width: 100%;
        display: flex;
        justify-content: center;
        background-color: transparent;
        box-shadow: none;
    }

    .screen {
        width: 100%;
        max-width: 1400px;
        background-color: var(--bg-dark);
        box-shadow: 0 0 50px rgba(0,0,0,0.5);
        position: relative;
    }

    /* Start screen */
    .content-wrapper { padding: 4rem; }
    .logo-text { font-size: 4rem; }
    .tagline { font-size: 3rem; }

}

@media (min-width: 900px) and (orientation: landscape) {
    .screen:has(.property-view) {
        flex-direction: row;
    }

    .screen:has(.property-view) .property-view {
        flex: 1.5;
        height: 100%;
        min-height: 100vh;
    }

    .screen:has(.property-view) .qcm-container {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 3rem;
        z-index: 10;
        background: var(--bg-dark);
    }

    /* Used in photo-mode and survival-mode */
    .screen:has(.property-view) .price-input-group,
    .screen:has(.property-view) .play-screen > div:not(.property-view) {
        justify-content: center;
        padding: 2rem;
        z-index: 10;
        background: var(--bg-dark);
        flex: 1;
    }

    .game-header {
        max-width: 1400px;
        margin: 0 auto;
    }

    /* Make feedback panel only cover the right side (the qcm side) */
    .screen:has(.property-view) .feedback-panel,
    .app-container:has(.property-view) .feedback-panel {
        width: 40%;
        right: 0;
        left: auto;
        height: 100%;
        border-radius: 0;
        justify-content: center;
    }
}

/* For tall portrait desktop/tablet */
@media (min-width: 768px) and (orientation: portrait) {
    .app-container { max-width: 100%; }
    .screen { max-width: 900px; margin: 0 auto; }
    .property-view { min-height: 50vh; }
    .qcm-container, .price-input-group { padding: 3rem; }
}

/* Mobile optimizations */
* {
    -webkit-tap-highlight-color: transparent;
}

button, a {
    touch-action: manipulation;
}

/* Active state feedback for mobile touch */
.btn:active, a:active {
    transform: scale(0.96);
    opacity: 0.8;
}

/* Privacy & About Screen Overrides for Typography and Spacing */
.about-content {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 2rem;
    text-align: left;
    font-size: 1rem;
}

.about-content h3 {
    color: var(--secondary);
    font-family: var(--font-heading);
    font-size: 1.25rem;
    margin-top: 1rem;
    margin-bottom: 0.25rem;
}

.about-content h3:first-child {
    margin-top: 0;
}

.about-content p {
    margin: 0;
    line-height: 1.6;
    color: var(--text-main);
}

.about-content ul {
    margin: 0;
    padding-left: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.about-content li {
    line-height: 1.5;
    color: var(--text-main);
}

.about-content a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.about-content a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Remove spin buttons from number inputs for all browsers */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type=number] {
  -moz-appearance: textfield; /* Firefox */
  appearance: textfield;
}

.feedback-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: var(--backdrop-bg);
    backdrop-filter: blur(var(--backdrop-blur));
    -webkit-backdrop-filter: blur(var(--backdrop-blur));
    z-index: 25;
    pointer-events: auto;
    animation: fadeIn 0.3s ease forwards;
}

.feedback-backdrop.active {
    display: block;
}
.glass-btn.selected-choice { background: var(--secondary); color: #000; border-color: var(--secondary); box-shadow: 0 0 20px rgba(93, 205, 253, 0.4); }
