/* ==========================================
   CSS VARIABLES - Viewport Vertical Shift
   Controls how much viewport moves up to reclaim
   space from deprecated request_box
   ========================================== */
:root {
    --viewport-shift-up: 0px;  /* Default: no shift (desktop/windows) */
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */
.hidden {
    display: none !important;
}

/* Access Veil - First Layer Security */
.access-veil {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #0d2620 0%, #000000 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.access-veil.hidden {
    display: none;
}

.veil-title {
    font-size: 32px;
    font-weight: bold;
    color: #FFD700;
    text-align: center;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.veil-subtitle {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    margin-bottom: 30px;
}

.veil-input {
    width: 300px;
    padding: 15px;
    font-size: 18px;
    border: 3px solid #FFD700;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    color: #1a4d37;
    font-weight: bold;
    text-align: center;
    margin-bottom: 20px;
}

.veil-button {
    padding: 15px 50px;
    font-size: 20px;
    font-weight: bold;
    background: #FFD700;
    color: #1a4d37;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
}

.veil-button:hover {
    background: #FFA500;
}

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

.veil-error {
    color: #ff6b6b;
    font-size: 14px;
    margin-top: 15px;
    display: none;
}

.veil-error.show {
    display: block;
}


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

/* ==================================================================
   DESKTOP MODE - Portrait app centered on landscape screens
   Based on Galaxy S25+ dimensions (412×892 = ~1:2.16 aspect ratio)
   ================================================================== */

/* Desktop detection: landscape screen wider than typical mobile */
@media screen and (min-width: 1024px) and (orientation: landscape) {
    html, body {
        background: #0a0a0a !important; /* Dark side bars */
    }
    
    body.desktop-mode {
        display: flex;
        justify-content: center;
        align-items: center;
        background: #0a0a0a !important;
    }
    
    body.desktop-mode .app-container {
        /* Scale to viewport height, maintain portrait aspect ratio */
        width: calc(100vh * 0.462) !important; /* 412/892 = 0.462 */
        max-width: calc(100vh * 0.462) !important;
        height: 100vh !important;
        min-height: 100vh !important;
        border-left: 2px solid #2d6b4f;
        border-right: 2px solid #2d6b4f;
        box-shadow: 0 0 60px rgba(45, 107, 79, 0.3);
        background: linear-gradient(180deg, #2d6b4f 0%, #1a4d37 100%);
    }
    
    /* Desktop viewport fixes for mobile photos */
    body.desktop-mode .viewport-circle {
        aspect-ratio: 1 !important;
        max-width: 100%;
    }
    
    body.desktop-mode .viewport-content {
        aspect-ratio: 1 !important;
    }
    
    body.desktop-mode .viewport-content img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        object-position: center !important;
    }
    
    /* Desktop splash screen - match app container width */
    body.desktop-mode #brandedSplash {
        width: calc(100vh * 0.462) !important;
        max-width: calc(100vh * 0.462) !important;
        left: 50%;
        transform: translateX(-50%);
        border-left: 2px solid #2d6b4f;
        border-right: 2px solid #2d6b4f;
        box-shadow: 0 0 60px rgba(45, 107, 79, 0.3);
    }
}

body {
    font-family: 'Arial Black', Arial, sans-serif;
    background: linear-gradient(180deg, #2d6b4f 0%, #1a4d37 100%);
    background-size: 100% 100%;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: white;
    overflow: hidden;
    height: 100vh;
    min-height: -webkit-fill-available;
    margin: 0;
    width: 100%;
    /* Prevent text size adjustment on Android */
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.app-container {
    width: 100%;
    max-width: 100vw;
    height: 100vh;
    min-height: -webkit-fill-available;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    padding: 5px;
    padding-top: 20px;
    padding-bottom: 20px;
    padding-left: 5px;
    padding-right: 5px;
    position: relative;
    box-sizing: border-box;
}

/* iOS specific - keep safe area for notch */
@supports (-webkit-touch-callout: none) {
    .app-container {
        max-width: min(428px, 100vw);
        padding-top: max(20px, env(safe-area-inset-top));
        padding-bottom: max(20px, env(safe-area-inset-bottom));
        padding-left: max(5px, env(safe-area-inset-left));
        padding-right: max(5px, env(safe-area-inset-right));
    }
}

/* Row 0: Navigation & Counter */
.row-0 {
    min-height: 70px;
    display: grid;
    grid-template-columns: auto 1fr auto auto auto auto;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 3px;
    margin-bottom: 5px;
    margin-top: 10px;
}

.menu-button {
    grid-column: 1;
    grid-row: 1 / 3;
    cursor: pointer;
    align-self: start;
}

.menu-button img {
    height: 28px;
    width: auto;
}

/*fix_code:00002+hamburger_menu_condensed (2026-01-03)*/
/*Condensed menu spacing per beta tester feedback - reduced padding, margins, and item spacing*/
.menu-dropdown {
    position: absolute;
    top: 45px;
    left: 5px;
    background: linear-gradient(180deg, #1a4d37 0%, #0d2620 100%);
    border: 3px solid #FFD700;
    border-radius: 12px;
    padding: 8px;
    display: none;
    z-index: 100;
    min-width: 256px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.menu-dropdown.active {
    display: block;
}

.menu-item {
    padding: 7px 12px;
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 6px;
    margin-bottom: 3px;
    transition: background 0.2s;
}

.menu-item:hover {
    background: rgba(255, 215, 0, 0.2);
}

.menu-item:active {
    background: rgba(255, 215, 0, 0.4);
}

.menu-item .token-reward {
    color: #FFD700;
    font-size: 14px;
    float: right;
}

.menu-header {
    padding: 6px 12px;
    color: rgba(255, 215, 0, 0.9);
    font-size: 13px;
    font-weight: bold;
    text-align: center;
    margin-top: 4px;
    margin-bottom: 6px;
    letter-spacing: 1px;
}

/* Login Overlay */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #2d6b4f 0%, #1a4d37 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.login-overlay.hidden {
    display: none;
}

.nest-limit-overlay.hidden {
    display: none !important;
}

.poll-limit-overlay.hidden {
    display: none !important;
}

.login-box {
    background: linear-gradient(180deg, #1a4d37 0%, #0d2620 100%);
    border: 4px solid #FFD700;
    border-radius: 20px;
    padding: 30px;
    max-width: 380px;
    width: 90%;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.login-title {
    font-size: 28px;
    font-weight: bold;
    color: #FFD700;
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.login-mode-toggle {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    margin-bottom: 20px;
}

.login-mode-link {
    color: #FFD700;
    cursor: pointer;
    text-decoration: underline;
}

.login-mode-link:hover {
    color: #FFA500;
}

.login-label {
    font-size: 14px;
    font-weight: bold;
    color: white;
    margin-bottom: 8px;
    margin-top: 15px;
}

.login-select, .login-input {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 2px solid #FFD700;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    color: #1a4d37;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.login-button {
    width: 100%;
    padding: 14px;
    margin-top: 20px;
    font-size: 18px;
    font-weight: bold;
    background: #FFD700;
    color: #1a4d37;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
}

.login-button:hover {
    background: #FFA500;
}

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

.login-error {
    color: #ff6b6b;
    font-size: 14px;
    margin-top: 10px;
    text-align: center;
    display: none;
}

.login-error.show {
    display: block;
}

/* Password Field Toggle (iOS keyboard fix) */
.password-field-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.password-field-wrapper .login-input {
    flex: 1;
    padding-right: 50px; /* Space for toggle button */
}

.password-toggle-btn {
    position: absolute;
    right: 8px;
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.password-toggle-btn:hover {
    opacity: 1;
}

/* Hidden password state (CSS masking, not type="password") */
.password-toggle-input.password-hidden {
    -webkit-text-security: disc;
    text-security: disc;
}

/* Avatar Selection Overlay */
.avatar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.avatar-overlay.hidden {
    display: none;
}

.avatar-selection-box {
    background: linear-gradient(180deg, #1a4d37 0%, #0d2620 100%);
    border: 4px solid #FFD700;
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.avatar-title {
    font-size: 24px;
    font-weight: bold;
    color: #FFD700;
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.avatar-carousel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.avatar-nav-btn {
    background: #FFD700;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 24px;
    font-weight: bold;
    color: #1a4d37;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
}

.avatar-nav-btn:hover {
    background: #FFA500;
}

.avatar-nav-btn:active {
    transform: scale(0.95);
}

.avatar-display {
    width: 200px;
    height: 300px;
    border: 4px solid #FFD700;
    border-radius: 15px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
}

.avatar-display img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-counter {
    text-align: center;
    color: white;
    font-size: 16px;
    margin: 10px 0;
}

.avatar-select-btn {
    width: 100%;
    padding: 14px;
    margin-top: 15px;
    font-size: 18px;
    font-weight: bold;
    background: #FFD700;
    color: #1a4d37;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
}

.avatar-select-btn:hover {
    background: #FFA500;
}

.avatar-select-btn:active {
    transform: scale(0.98);
}

/* Squawk Dialog Overlay */
.squawk-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 998;
}

.squawk-overlay.hidden {
    display: none;
}

.squawk-dialog {
    background: linear-gradient(180deg, #1a4d37 0%, #0d2620 100%);
    border: 4px solid #4169E1;
    border-radius: 20px;
    padding: 25px;
    max-width: 350px;
    width: 90%;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.squawk-dialog-title {
    font-size: 22px;
    font-weight: bold;
    color: #4169E1;
    text-align: center;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.squawk-input {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 2px solid #4169E1;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    color: #1a4d37;
    font-weight: bold;
    resize: none;
    height: 80px;
}

.squawk-char-count {
    text-align: right;
    color: #4169E1;
    font-size: 12px;
    margin-top: 5px;
}

.squawk-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.squawk-btn {
    flex: 1;
    padding: 12px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
}

.squawk-btn-submit {
    background: #4169E1;
    color: white;
}

.squawk-btn-submit:hover {
    background: #1E90FF;
}

.squawk-btn-cancel {
    background: #808080;
    color: white;
}

.squawk-btn-cancel:hover {
    background: #696969;
}

.squawk-btn-delete {
    background: #dc3545;
    color: white;
}

.squawk-btn-delete:hover {
    background: #c82333;
}

.squawk-btn:active {
    transform: scale(0.98);
}

/* Create Nest Dialog */
.create-nest-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 998;
}

.create-nest-overlay.hidden {
    display: none;
}

.create-nest-dialog {
    background: linear-gradient(180deg, #1a4d37 0%, #0d2620 100%);
    border: 4px solid #FFD700;
    border-radius: 20px;
    padding: 30px;
    max-width: 350px;
    width: 90%;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
    position: relative;
}

.create-nest-title {
    font-size: 24px;
    font-weight: bold;
    color: #FFD700;
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.nest-code-display {
    background: rgba(255, 215, 0, 0.2);
    border: 3px solid #FFD700;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    margin: 20px 0;
}

.nest-code-label {
    color: white;
    font-size: 14px;
    margin-bottom: 10px;
}

.nest-code {
    font-size: 32px;
    font-weight: bold;
    color: #FFD700;
    letter-spacing: 4px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.create-nest-input {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 2px solid #FFD700;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    color: #1a4d37;
    font-weight: bold;
    margin-bottom: 15px;
}

.create-nest-btn {
    width: 100%;
    padding: 14px;
    font-size: 18px;
    font-weight: bold;
    background: #FFD700;
    color: #1a4d37;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
}

.create-nest-btn:hover {
    background: #FFA500;
}

.create-nest-btn:active {
    transform: scale(0.98);
}

/* Join Nest Dialog */
.join-nest-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 998;
}

.join-nest-overlay.hidden {
    display: none;
}

.join-nest-dialog {
    background: linear-gradient(180deg, #1a4d37 0%, #0d2620 100%);
    border: 4px solid #FFD700;
    border-radius: 20px;
    padding: 30px;
    max-width: 350px;
    width: 90%;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
    position: relative;
}

.dialog-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 0, 0, 0.8);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 20px;
    font-weight: bold;
    color: white;
    cursor: pointer;
    transition: background 0.2s;
    line-height: 1;
    padding: 0;
}

.dialog-close-btn:hover {
    background: rgba(255, 0, 0, 1);
}

.join-nest-title {
    font-size: 24px;
    font-weight: bold;
    color: #FFD700;
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.join-code-input {
    width: 100%;
    padding: 12px;
    font-size: 20px;
    border: 2px solid #FFD700;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    color: #1a4d37;
    font-weight: bold;
    text-align: center;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 15px;
}

.join-divider {
    text-align: center;
    color: #FFD700;
    font-size: 14px;
    margin: 20px 0;
    position: relative;
}

.join-divider::before,
.join-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: rgba(255, 215, 0, 0.5);
}

.join-divider::before {
    left: 0;
}

.join-divider::after {
    right: 0;
}

.scan-qr-btn {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    font-weight: bold;
    background: #4169E1;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    margin-bottom: 15px;
    transition: transform 0.1s, background 0.2s;
}

.scan-qr-btn:hover {
    background: #1E90FF;
}

.scan-qr-btn:active {
    transform: scale(0.98);
}

.join-nest-btn {
    width: 100%;
    padding: 14px;
    font-size: 18px;
    font-weight: bold;
    background: #FFD700;
    color: #1a4d37;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
}

.join-nest-btn:hover {
    background: #FFA500;
}

.join-nest-btn:active {
    transform: scale(0.98);
}

/* QR Scanner View */
#qrScannerView {
    width: 100%;
    max-width: 300px;
    height: 300px;
    margin: 15px auto;
    border: 2px solid #FFD700;
    border-radius: 10px;
    overflow: hidden;
    display: none;
}

/* CRITICAL: Ensure QR scanner video is NEVER mirrored */
/* Html5Qrcode library creates video elements inside this div */
#qrScannerView video {
    transform: scaleX(1) !important;
    -webkit-transform: scaleX(1) !important;
}

#qrScannerView.active {
    display: block;
}

/* Camera QR Scanner Mode */
#cameraQrScannerDiv {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
}

#cameraQrScannerDiv video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* QR scan mode indicator */
.camera-preview-circle.qr-mode {
    border-color: #FFD700 !important;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

/* Edit Squawk Alert Dialog */
.edit-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 998;
}

.edit-alert-overlay.hidden {
    display: none;
}

.edit-alert-dialog {
    background: linear-gradient(180deg, #1a4d37 0%, #0d2620 100%);
    border: 4px solid #FFD700;
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.edit-alert-title {
    font-size: 22px;
    font-weight: bold;
    color: #FFD700;
    text-align: center;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.edit-alert-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    margin-bottom: 20px;
}

.alert-input {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 2px solid #FFD700;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    color: #1a4d37;
    font-weight: bold;
    resize: none;
    height: 80px;
    margin-bottom: 10px;
}

.alert-char-count {
    text-align: right;
    color: #FFD700;
    font-size: 12px;
    margin-bottom: 15px;
}

.edit-alert-buttons {
    display: flex;
    gap: 10px;
}

.edit-alert-btn {
    flex: 1;
    padding: 12px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
}

.edit-alert-btn-cancel {
    background: #808080;
    color: white;
}

.edit-alert-btn-cancel:hover {
    background: #696969;
}

.edit-alert-btn-save {
    background: #FFD700;
    color: #1a4d37;
}

.edit-alert-btn-save:hover {
    background: #FFA500;
}

.edit-alert-btn:active {
    transform: scale(0.98);
}

/* Info Card Overlays (Credentials & About) */
.info-card-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.info-card-overlay.hidden {
    display: none;
}

.info-card {
    background: linear-gradient(180deg, #1a4d37 0%, #0d2620 100%);
    border: 4px solid #FFD700;
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.info-card-title {
    font-size: 24px;
    font-weight: bold;
    color: #FFD700;
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.info-card-content {
    color: white;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 25px;
    text-align: left;
}

.info-card-content p {
    margin-bottom: 15px;
}

.info-card-content strong {
    color: #FFD700;
}

.info-card-btn {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    font-weight: bold;
    background: #FFD700;
    color: #1a4d37;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
}

.info-card-btn:hover {
    background: #FFA500;
}

.info-card-btn:active {
    transform: scale(0.98);
}

/* ========================================
   THE ROOST - STORE OVERLAY
   ======================================== */

.roost-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    overflow-y: auto;
}

.roost-overlay.hidden {
    display: none;
}

/* New Avatar Announcement Overlay */
.new-avatar-announcement {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1100;
    animation: announcementFadeIn 0.5s ease-out;
}

.new-avatar-announcement.hidden {
    display: none;
}

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

.announcement-card {
    background: linear-gradient(135deg, #1a4d37 0%, #0d2620 100%);
    border: 4px solid #FFD700;
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 0 60px rgba(255, 215, 0, 0.4);
    animation: cardBounceIn 0.6s ease-out 0.2s both;
}

@keyframes cardBounceIn {
    0% { transform: scale(0.5); opacity: 0; }
    70% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

.announcement-header {
    color: #FFD700;
    font-size: 28px;
    font-weight: bold;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    margin-bottom: 20px;
}

.announcement-avatar-image {
    width: 200px;
    height: 300px;
    object-fit: contain;
    border: 3px solid #B8860B;
    border-radius: 15px;
    background: rgba(0, 0, 0, 0.4);
    margin: 15px auto;
    display: block;
    animation: avatarGlow 2s ease-in-out infinite alternate;
}

@keyframes avatarGlow {
    from { box-shadow: 0 0 20px rgba(255, 215, 0, 0.3); }
    to { box-shadow: 0 0 40px rgba(255, 215, 0, 0.6); }
}

.announcement-name {
    color: #4ade80;
    font-size: 24px;
    font-weight: bold;
    margin: 15px 0 5px 0;
}

.announcement-subtitle {
    color: #9ca3af;
    font-size: 14px;
    margin-bottom: 20px;
}

.announcement-cta {
    color: #e0e0e0;
    font-size: 16px;
    margin-bottom: 25px;
}

.announcement-continue-btn {
    background: linear-gradient(135deg, #FFD700 0%, #B8860B 100%);
    color: #0d2620;
    border: none;
    padding: 15px 40px;
    border-radius: 25px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.announcement-continue-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

.announcement-continue-btn:active {
    transform: scale(0.98);
}

.roost-container {
    background-image: url('../store/roost_background.WebP');
    background-size: cover;
    background-position: center;
    border: 6px solid #FFD700;
    border-radius: 20px;
    padding: 20px;
    max-width: 500px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    position: relative;
}

.roost-header {
    text-align: center;
    margin-bottom: 20px;
}

.roost-title-img {
    max-width: 80%;
    height: auto;
}

.roost-section {
    background: rgba(13, 38, 32, 0.85);
    border: 3px solid #FFD700;
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 20px;
}

.roost-section-title {
    font-size: 20px;
    font-weight: bold;
    color: #FFD700;
    text-align: center;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.avatar-shop-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.avatar-shop-item {
    background: rgba(26, 77, 55, 0.6);
    border: 2px solid #B8860B;
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
    position: relative;
}

.avatar-shop-item:hover {
    transform: scale(1.05);
    border-color: #FFD700;
}

.avatar-shop-item.owned {
    border-color: #00FF00;
    background: rgba(0, 100, 0, 0.3);
}

.avatar-shop-item.locked {
    opacity: 0.7;
}

.avatar-shop-img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 8px;
}

.avatar-shop-price {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 16px;
    font-weight: bold;
    color: #FFD700;
}

.avatar-shop-price img {
    width: 24px;
    height: 24px;
}

.avatar-given-name {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 14px;
    font-weight: bold;
    color: #E8D5B7;
    text-align: center;
    margin-top: 6px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    letter-spacing: 0.5px;
}

/* Avatar Preview Overlay (Backstory) */
.avatar-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    z-index: 1100;
    padding: 20px;
    overflow-y: auto;
}

.avatar-preview-overlay.hidden {
    display: none;
}

.avatar-preview-card {
    background: linear-gradient(135deg, #1a4d37 0%, #0d2620 100%);
    border: 4px solid #FFD700;
    border-radius: 20px;
    padding: 20px;
    max-width: 420px;
    width: 95%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(255, 215, 0, 0.3);
    animation: avatarPreviewFadeIn 0.3s ease-out;
    margin: 10px 0;
}

@keyframes avatarPreviewFadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.avatar-preview-image {
    width: 150px;
    height: 225px;
    object-fit: contain;
    border-radius: 12px;
    border: 3px solid #B8860B;
    margin-bottom: 12px;
}

.avatar-preview-given-name {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 24px;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    margin-bottom: 4px;
}

.avatar-preview-human-name {
    font-size: 14px;
    color: #B8860B;
    font-style: italic;
    margin-bottom: 5px;
}

.avatar-preview-species {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 15px;
}

.avatar-preview-backstory {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #2d6b4f;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 15px;
    max-height: 180px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scroll on iOS */
}

/* Custom scrollbar for backstory */
.avatar-preview-backstory::-webkit-scrollbar {
    width: 6px;
}

.avatar-preview-backstory::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.avatar-preview-backstory::-webkit-scrollbar-thumb {
    background: #FFD700;
    border-radius: 3px;
}

.avatar-preview-backstory::-webkit-scrollbar-thumb:hover {
    background: #FFA500;
}

.avatar-preview-backstory-label {
    font-size: 10px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.avatar-preview-backstory-text {
    font-size: 13px;
    color: #e0e0e0;
    line-height: 1.4;
    font-style: italic;
}

/* Collapsible Stats Section */
.avatar-stats-toggle {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #2d6b4f;
    border-radius: 10px;
    padding: 10px 15px;
    margin-bottom: 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s, border-radius 0.2s;
}

.avatar-stats-toggle:hover {
    background: rgba(0, 0, 0, 0.6);
}

.avatar-stats-toggle.open {
    border-radius: 10px 10px 0 0;
    margin-bottom: 0;
    border-bottom: none;
}

.avatar-stats-toggle-text {
    font-size: 12px;
    color: #FFD700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.avatar-stats-toggle-arrow {
    color: #4ade80;
    font-size: 12px;
    transition: transform 0.3s;
}

.avatar-stats-toggle.open .avatar-stats-toggle-arrow {
    transform: rotate(180deg);
}

.avatar-stats-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    margin-bottom: 15px;
}

.avatar-stats-content.open {
    max-height: 300px;
}

.avatar-preview-price {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

.avatar-preview-price img {
    width: 28px;
    height: 28px;
}

.avatar-preview-price span {
    font-size: 22px;
    font-weight: bold;
    color: #FFD700;
}

.avatar-paypal-container {
    margin: 15px 0;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.avatar-paypal-container.hidden {
    display: none;
}

.avatar-preview-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.avatar-preview-buy-btn {
    background: linear-gradient(135deg, #2d6b4f 0%, #1a4d37 100%);
    border: 2px solid #4ade80;
    color: #FFD700;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.avatar-preview-buy-btn:hover {
    background: linear-gradient(135deg, #3d7b5f 0%, #2a5d47 100%);
    transform: translateY(-2px);
}

.avatar-preview-buy-btn:disabled {
    background: #4a4a4a;
    border-color: #666;
    color: #999;
    cursor: not-allowed;
    transform: none;
}

.avatar-preview-cancel-btn {
    background: transparent;
    border: 1px solid #6b7280;
    color: #9ca3af;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.avatar-preview-cancel-btn:hover {
    border-color: #9ca3af;
    color: #e0e0e0;
}

.avatar-preview-owned-badge {
    background: linear-gradient(135deg, #065f46 0%, #047857 100%);
    border: 2px solid #10b981;
    color: #6ee7b7;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
}

/* Avatar Preview Stats Section */
.avatar-preview-stats {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #2d6b4f;
    border-top: none;
    border-radius: 0 0 10px 10px;
    padding: 12px;
    margin-top: -1px;
}

.avatar-preview-stats-label {
    font-size: 11px;
    color: #FFD700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    font-weight: bold;
    display: none; /* Now using toggle header */
}

.avatar-preview-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px 12px;
    margin-bottom: 10px;
}

.avatar-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    padding: 3px 6px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.avatar-stat-name {
    color: #9ca3af;
}

.avatar-stat-value {
    color: #4ade80;
    font-weight: bold;
    font-family: monospace;
}

.avatar-preview-weapons {
    border-top: 1px solid #2d6b4f;
    padding-top: 8px;
    margin-top: 8px;
}

.avatar-weapon-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    margin-bottom: 4px;
}

.avatar-weapon-icon {
    width: 16px;
    text-align: center;
}

.avatar-weapon-label {
    color: #6b7280;
    min-width: 65px;
}

.avatar-weapon-name {
    color: #e0e0e0;
    font-style: italic;
}

/* No Data Fallback */
.avatar-preview-no-data {
    background: rgba(0, 0, 0, 0.4);
    border: 1px dashed #6b7280;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    text-align: center;
}

.avatar-preview-no-data.hidden {
    display: none;
}

.avatar-preview-no-data-icon {
    font-size: 32px;
    margin-bottom: 10px;
    opacity: 0.7;
}

.avatar-preview-no-data-text {
    color: #e0e0e0;
    font-size: 14px;
    font-style: italic;
    margin-bottom: 6px;
}

.avatar-preview-no-data-sub {
    color: #6b7280;
    font-size: 12px;
}

.vault-option {
    background: rgba(26, 77, 55, 0.6);
    border: 2px solid #B8860B;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
}

.vault-option:hover {
    transform: scale(1.02);
    border-color: #FFD700;
}

.vault-option-title {
    font-size: 18px;
    font-weight: bold;
    color: #FFD700;
    text-align: center;
    margin-bottom: 10px;
}

.vault-option-details {
    color: white;
    text-align: center;
    font-size: 14px;
    line-height: 1.6;
}

/* Gifts Section Styles */
.gifts-category {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid #B8860B;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
}

.gifts-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
}

.gifts-category-title {
    font-size: 16px;
    font-weight: bold;
    color: #FFD700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gifts-category-count {
    background: rgba(255, 215, 0, 0.2);
    color: #FFD700;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.gifts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.gift-item {
    background: rgba(26, 77, 55, 0.6);
    border: 2px solid #2d6b4f;
    border-radius: 10px;
    padding: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.gift-item:hover {
    border-color: #FFD700;
    transform: scale(1.05);
}

.gift-item-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 6px;
    margin-bottom: 6px;
}

.gift-item-name {
    font-size: 11px;
    color: #E8D5B7;
    font-family: 'Georgia', serif;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gift-item-price {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 4px;
    font-size: 11px;
    color: #FFD700;
}

.gift-item-price img {
    width: 14px;
    height: 14px;
}

.gifts-empty {
    text-align: center;
    padding: 20px;
    color: #6b7280;
    font-style: italic;
    font-size: 13px;
}

.gifts-loading {
    text-align: center;
    padding: 15px;
    color: #9ca3af;
}

.gifts-recipient-section {
    background: rgba(255, 215, 0, 0.1);
    border: 2px dashed #FFD700;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    text-align: center;
}

.gifts-recipient-label {
    font-size: 14px;
    color: #FFD700;
    margin-bottom: 10px;
}

.gifts-recipient-select {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 2px solid #2d6b4f;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 14px;
}

.crypto-note {
    background: rgba(255, 215, 0, 0.1);
    border: 2px dashed #FFD700;
    border-radius: 10px;
    padding: 10px;
    margin-top: 10px;
    text-align: center;
    font-size: 13px;
    color: #FFD700;
    font-style: italic;
}

.roost-close-btn {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    font-weight: bold;
    background: #FFD700;
    color: #1a4d37;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
    margin-top: 20px;
}

.roost-close-btn:hover {
    background: #FFA500;
}

.roost-close-btn:active {
    transform: scale(0.98);
}

/* Top ticker clickable when admin */
.top-ticker.admin-clickable {
    cursor: pointer !important;
    transition: transform 0.1s ease;
}

.top-ticker.admin-clickable:hover {
    transform: scale(1.01);
}

.top-ticker.admin-clickable:active {
    transform: scale(0.99);
}

/* Nest Selection Screen */
.nest-selection-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #2d6b4f 0%, #1a4d37 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.nest-selection-overlay.hidden {
    display: none;
}

.nest-selection-box {
    background: linear-gradient(180deg, #1a4d37 0%, #0d2620 100%);
    border: 4px solid #FFD700;
    border-radius: 20px;
    padding: 30px;
    max-width: 380px;
    width: 90%;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.nest-selection-title {
    font-size: 24px;
    font-weight: bold;
    color: #FFD700;
    text-align: center;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.nest-selection-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    margin-bottom: 20px;
}

.nest-list {
    margin: 20px 0;
    max-height: 200px;
    overflow-y: auto;
}

.nest-option {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid #FFD700;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nest-option:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: scale(1.02);
}

.nest-option-name {
    font-size: 16px;
    font-weight: bold;
    color: white;
}

.nest-option-role {
    font-size: 12px;
    color: #FFD700;
    background: rgba(255, 215, 0, 0.2);
    padding: 4px 8px;
    border-radius: 4px;
}

.nest-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.nest-action-btn {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
}

.nest-action-btn-primary {
    background: #FFD700;
    color: #1a4d37;
}

.nest-action-btn-primary:hover {
    background: #FFA500;
}

.nest-action-btn-secondary {
    background: #4169E1;
    color: white;
}

.nest-action-btn-secondary:hover {
    background: #1E90FF;
}

.nest-action-btn:active {
    transform: scale(0.98);
}

.no-nests-message {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin: 20px 0;
    font-style: italic;
}

/* Beakin Confirmation Dialog */
.beakin-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
}

.beakin-confirm-overlay.hidden {
    display: none;
}

.beakin-confirm-dialog {
    background: linear-gradient(180deg, #8B0000 0%, #4B0000 100%);
    border: 4px solid #FF0000;
    border-radius: 20px;
    padding: 30px;
    max-width: 350px;
    width: 90%;
    box-shadow: 0 8px 20px rgba(255, 0, 0, 0.5);
    /* Pulse animation removed - only urgent dialogs should pulse */
}

/* URGENT DIALOG PULSE - Only for beakin/emergency dialogs */
.beakin-confirm-dialog.urgent-pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.beakin-confirm-title {
    font-size: 24px;
    font-weight: bold;
    color: #FF0000;
    text-align: center;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.beakin-confirm-message {
    font-size: 18px;
    color: white;
    text-align: center;
    margin-bottom: 25px;
}

.beakin-confirm-buttons {
    display: flex;
    gap: 15px;
}

.beakin-confirm-btn {
    flex: 1;
    padding: 15px;
    font-size: 18px;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
}

.beakin-btn-yes {
    background: #FF0000;
    color: white;
}

.beakin-btn-yes:hover {
    background: #CC0000;
}

.beakin-btn-no {
    background: #808080;
    color: white;
}

.beakin-btn-no:hover {
    background: #696969;
}

.beakin-confirm-btn:active {
    transform: scale(0.98);
}

/* Camera Preview Overlay */
.camera-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1003;
}

.camera-preview-overlay.hidden {
    display: none;
}

.camera-preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.camera-preview-title {
    font-size: 24px;
    font-weight: bold;
    color: #FFD700;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.camera-preview-circle {
    width: 400px;
    height: 400px;
    max-width: 85vw;
    max-height: 85vw;
    border-radius: 50%;
    overflow: hidden;
    border: 6px solid #FFD700;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
    position: relative;
    background: #000;
}

#cameraPreviewVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

#cameraPreviewVideo.camera-mirrored {
    transform: scaleX(-1);
}

.camera-preview-buttons {
    display: flex;
    gap: 20px;
}

.camera-btn {
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
}

.camera-btn-cancel {
    background: #808080;
    color: white;
}

.camera-btn-cancel:hover {
    background: #696969;
}

.camera-btn-capture {
    background: #28a745;
    color: white;
}

.camera-btn-capture:hover {
    background: #218838;
}

.camera-btn:active {
    transform: scale(0.98);
}

/* Photo Viewer Overlay (expanded view + reactions) */
.photo-viewer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.photo-viewer-overlay.hidden {
    display: none;
    opacity: 0;
}

.photo-viewer-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    cursor: pointer;
}

.photo-viewer-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 95vw;
    max-height: 90vh;
    z-index: 10001;
}

.photo-viewer-image-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 95vw;
    max-height: calc(90vh - 80px);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

#photoViewerImage {
    max-width: 95vw;
    max-height: calc(90vh - 80px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
}

.photo-viewer-reaction-bar {
    display: flex;
    align-items: center;
    gap: 1px;
    padding: 8px 6px;
    background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
    border-radius: 0 0 12px 12px;
    border: 2px solid #444;
    border-top: none;
    margin-top: -2px;
    max-width: 95vw;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}

.photo-viewer-reaction-bar::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.reaction-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    width: 38px;
    height: 54px;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 1px;
    flex-shrink: 0;
    scroll-snap-align: center;
}

.reaction-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #666;
    transform: scale(1.1);
}

.reaction-btn:active {
    transform: scale(0.95);
}

.reaction-btn.selected {
    background: rgba(76, 175, 80, 0.3);
    border-color: #4CAF50;
}

/* Owner-only delete button */
.reaction-btn.owner-only-btn {
    border-color: rgba(255, 107, 107, 0.5);
}

.reaction-btn.owner-only-btn:hover {
    background: rgba(255, 107, 107, 0.2);
    border-color: #ff6b6b;
}

.reaction-btn .reaction-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    font-size: 26px;
    line-height: 32px;
}

.reaction-btn .reaction-count {
    font-size: 11px;
    color: #aaa;
    font-weight: bold;
    margin-top: 2px;
    min-width: 16px;
    text-align: center;
}

.reaction-btn.selected .reaction-count {
    color: #4CAF50;
}

.photo-viewer-caption {
    max-width: 90vw;
    padding: 8px 16px;
    color: #fff;
    font-size: 14px;
    text-align: center;
    margin-top: 8px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 8px;
}

.photo-viewer-caption:empty {
    display: none;
}

/* Push Notification Permission Dialog */
.notification-permission-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1002;
}

.notification-permission-overlay.hidden {
    display: none;
}

.notification-permission-dialog {
    background: linear-gradient(180deg, #1a4d37 0%, #0d2620 100%);
    border: 4px solid #FFD700;
    border-radius: 20px;
    padding: 30px;
    max-width: 350px;
    width: 90%;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.notification-icon {
    font-size: 48px;
    text-align: center;
    margin-bottom: 15px;
}

.notification-permission-title {
    font-size: 22px;
    font-weight: bold;
    color: #FFD700;
    text-align: center;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.notification-permission-message {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    margin-bottom: 25px;
    line-height: 1.6;
}

.notification-permission-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification-permission-btn {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
}

.notification-btn-enable {
    background: #FFD700;
    color: #1a4d37;
}

.notification-btn-enable:hover {
    background: #FFA500;
}

.notification-btn-later {
    background: #808080;
    color: white;
}

.notification-btn-later:hover {
    background: #696969;
}

.notification-permission-btn:active {
    transform: scale(0.98);
}

.my-nest-egg {
    grid-column: 2 / 5;
    grid-row: 1 / 3;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.my-nest-egg img {
    height: 68px;
    width: auto;
    max-width: 180px;
}

.spinning-coin {
    grid-column: 5;
    grid-row: 2;
    width: 22px;
    height: 22px;
    cursor: pointer;
    justify-self: center;
}

.spinning-coin.pulse {
    animation: currency-pulse 0.6s ease-out;
}

.spinning-coin img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@keyframes spin {
    0%, 95% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

.token-counter {
    grid-column: 6;
    grid-row: 2;
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 8px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    color: #FFD700;
    border: 2px solid rgba(255, 215, 0, 0.3);
    min-width: 55px;
    text-align: center;
}

.token-counter.pulse {
    animation: currency-pulse 0.6s ease-out;
}

.gem-icon {
    grid-column: 5;
    grid-row: 1;
    width: 22px;
    height: 22px;
    cursor: pointer;
    justify-self: center;
}

.gem-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.gem-icon.pulse {
    animation: currency-pulse 0.6s ease-out;
}

.gem-counter {
    grid-column: 6;
    grid-row: 1;
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 8px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    color: #5C21A9;
    border: 2px solid rgba(177, 156, 217, 0.3);
    min-width: 55px;
    text-align: center;
}

.gem-counter.pulse {
    animation: currency-pulse 0.6s ease-out;
}

/* Nest Quest Promo Badge - covers currency area */
.nest-quest-promo {
    grid-column: 5 / 7;
    grid-row: 1 / 3;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    cursor: pointer;
}

.nest-quest-promo.hidden {
    display: none;
}

.nest-quest-promo img {
    height: 54px;
    width: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    animation: promo-pulse 2s ease-in-out infinite;
}

.nest-quest-promo .promo-dismiss {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    background: #ff4444;
    border: 2px solid #fff;
    border-radius: 50%;
    color: white;
    font-size: 14px;
    font-weight: bold;
    line-height: 16px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 51;
}

.nest-quest-promo .promo-dismiss:hover {
    background: #ff0000;
    transform: scale(1.1);
}

@keyframes promo-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 4px 16px rgba(255, 215, 0, 0.6);
    }
}

@keyframes currency-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7);
    }
    50% {
        transform: scale(1.15);
        box-shadow: 0 0 15px 5px rgba(255, 215, 0, 0.3);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
    }
}

.token-counter.wobble {
    animation: wobble 0.5s ease-in-out;
}

@keyframes wobble {
    0%, 100% {
        transform: translateX(0) scale(1);
    }
    15% {
        transform: translateX(-5px) rotate(-5deg) scale(1.1);
    }
    30% {
        transform: translateX(5px) rotate(5deg) scale(1.1);
    }
    45% {
        transform: translateX(-3px) rotate(-3deg) scale(1.05);
    }
    60% {
        transform: translateX(3px) rotate(3deg) scale(1.05);
    }
    75% {
        transform: translateX(-1px) rotate(-1deg) scale(1.02);
    }
}

/* Row 2: Top Ticker - doubled height */
.row-2 {
    height: 4vh;
    margin-top: 19px;
    margin-bottom: 1px;
    position: relative;
}

.top-ticker {
    width: 100%;
    height: 100%;
    background: #5C21A9;
    border: 4px solid #000000;
    border-radius: 25px;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.3),
        0 0 0 2px #B8860B,
        0 4px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    overflow: hidden;
    position: relative;
    z-index: 5;
    cursor: pointer;
}

.ticker-content {
    display: flex;
    align-items: center;
    white-space: nowrap;
    animation: scroll-left 20s linear infinite;
    padding-left: 100%;
    pointer-events: none;
}

.ticker-text {
    font-size: 15px;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    padding: 0 40px;
}

.bottom-ticker-text {
    font-size: 15px;
    font-weight: bold;
    color: black;
    text-shadow: 1px 1px 3px rgba(255, 255, 255, 0.8);
    padding: 0 40px;
}

@keyframes scroll-left {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* Ticker Tab Labels - File folder style */
/* ========================================
TAB-RESERVE: CSS-BASED TICKER TABS (BACKUP)
========================================
ORIGINAL CSS-BASED TAB STYLING - PRESERVED FOR FUTURE USE

.ticker-tab {
    position: absolute;
    top: -2vh;
    left: 50%;
    transform: translateX(-50%);
    height: 2vh;
    padding: 0 12px;
    background: rgba(143, 238, 188, 0.7);
    border: 3px solid black;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    font-weight: bold;
    white-space: nowrap;
    z-index: 6;
}

.top-ticker-tab,
.bottom-ticker-tab {
    color: black;
}
======================================== */

/* IMAGE-BASED TICKER TABS (ACTIVE) */
.ticker-tab {
    position: absolute;
    top: -2.75vh;
    left: 50%;
    transform: translateX(-50%);
    height: 2.75vh;
    width: 5.775vh;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 6;
}

.top-ticker-tab {
    background-image: url('../frames/leader_tab.png');
}

.bottom-ticker-tab {
    display: none; /* Hidden - was colliding with stream position indicator */
    background-image: url('../frames/nest_tab.png');
}

/* ========================================
   AD OVERLAY SYSTEM
   Slides down from top-ticker like a window shade
   ======================================== */
.ad-overlay-container {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    width: 360px;
    z-index: 10;
    visibility: hidden;
    opacity: 0;
    transition: transform 1.5s ease-out, opacity 0.3s ease-out, visibility 0s linear 1.5s;
}

.ad-overlay-container.visible {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    transition: transform 1.5s ease-out, opacity 0.3s ease-out, visibility 0s linear 0s;
}

.ad-overlay {
    width: 360px;
    height: 70px;
    background: transparent;
    border: 2px solid #000000;
    border-radius: 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    position: relative;
    cursor: pointer;
}

.ad-overlay img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ad-hide-button {
    position: absolute;
    top: 70px;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 3px 12px;
    border-radius: 0 0 8px 8px;
    cursor: pointer;
    min-width: 44px;
    min-height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 11;
    border: 1px solid rgba(0,0,0,0.3);
    border-top: none;
}

.ad-hide-button:hover {
    background: rgba(0, 0, 0, 0.9);
}

.ad-hide-button:active {
    background: rgba(0, 0, 0, 1);
}

/* Row 2.5: Nest Label and Camera Button */
.row-2-5 {
    height: 9vh;
    margin-top: 6px;
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 8px;
    z-index: 1;
    position: relative;
}

/* Badge slots removed - badges now transient (shown only at claim time) */
.badge-slot {
    display: none;
}

.badge-slot img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.nest-camera-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.nest-label {
    font-size: 14px;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    margin-bottom: 8px;
    margin-top: 5px;
}

.camera-button-container {
    width: 200px;
    height: calc(9vh - 25px);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    padding-top: 5px;
    gap: 8px;
}

.camera-button {
    width: 80px;
    height: 80px;
    cursor: pointer;
    transition: transform 0.2s, filter 0.2s;
}

.camera-button:hover {
    transform: scale(1.1);
    filter: brightness(1.2);
}

.camera-button:active {
    transform: scale(0.95);
}

/*fix_code:00005+quick_access_buttons (2026-01-03)*/
/*Quick-access buttons for Roost Store and Nest Quest Game Portal*/
.quick-access-btn {
    width: 52px;
    height: 52px;
    cursor: pointer;
    transition: transform 0.2s, filter 0.2s;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.quick-access-btn:hover {
    transform: scale(1.15);
    filter: brightness(1.2);
}

.quick-access-btn:active {
    transform: scale(0.9);
}

.quick-access-left {
    order: -1;
}

.quick-access-right {
    order: 1;
}

/* Row 3: Request Box - ABSOLUTE positioning to isolate */
.row-3 {
    height: 0;
    position: relative;
    margin: 0;
}

.request-box {
    position: absolute;
    top: 25px;
    left: 0;
    right: 0;
    background: transparent;
    border: none;
    padding: 4px 10px;
    border-radius: 0;
    font-size: 18px;
    font-weight: bold;
    color: #FF1493;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    text-align: center;
    width: calc(100% - 20px);
    margin: 0 10px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.5s ease-in;
    pointer-events: none;
    min-height: 35px;
    max-height: 70px;
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.3;
}

.request-box.show {
    opacity: 1;
}

/* Row 4: Viewport Circle - LOCKED */
.row-4 {
    min-height: 32vh;
    max-height: 45vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin-top: calc(3vh - 7px - var(--viewport-shift-up));
    margin-bottom: 0px;
    flex-shrink: 0;
    position: relative;
}

/* ==================================================================
   POLAROID CARD - Unified viewport + caption container
   Replaces separate viewport-circle and response-box elements
   ================================================================== */
.polaroid-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 81%;
    max-width: 432px;
    background: transparent;
    /* No border on container - caption-box has its own styling */
}

.viewport-circle {
    width: 100%;
    aspect-ratio: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.viewport-background {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 0;
    pointer-events: none;
    top: -5px;
    left: -2px;
}

.circle-frame {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 2;
    pointer-events: none;
}

.viewport-content {
    width: 95%;
    height: 95%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
    margin-top: 0%;
    border-radius: 50%;
    overflow: hidden;
}

.viewport-content img {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.viewport-content img.button-display {
    max-width: 72%;
    max-height: 72%;
    width: auto;
    height: auto;
    margin-top: -18px;
    object-fit: contain;
}

/* hero_trademark.webp - preloaded image display at 80% size */
.viewport-content img[src="hero_images/hero_trademark.webp"] {
    width: 80%;
    height: 80%;
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
}

/* Pulse animation for clickable viewport */
.viewport-content.pulse-click {
    animation: viewportPulse 1.5s ease-in-out infinite;
    cursor: pointer;
}

@keyframes viewportPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.08);
    }
}

/* Pulse animation for action buttons when they can respond */
.action-button.pulse-respond {
    animation: buttonPulse 1.2s ease-in-out infinite;
}

@keyframes buttonPulse {
    0%, 100% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.08);
        filter: brightness(1.3);
    }
}

/* Row 5: Response Box - ABSOLUTE positioning to isolate */
.row-5 {
    height: 0;
    position: relative;
    margin: 0;
}

/* ==================================================================
   CAPTION BOX - Bottom portion of polaroid card
   Replaces legacy response-box (now child of polaroid-card)
   Cream background only appears here, below the viewport circle
   ================================================================== */
.caption-box {
    width: 100%;
    background: #ffe7c2;
    border: 2px solid #fff256;
    border-radius: 0 0 8px 8px;
    padding: 6px 10px;
    font-size: 14px;
    font-weight: bold;
    color: #000000;
    text-align: center;
    min-height: 36px;
    max-height: 50px;
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.2;
    opacity: 0;
    transition: opacity 0.5s ease-in;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    margin-top: -10px; /* Slight overlap with circle frame */
}

.caption-box.show {
    opacity: 1;
}

/* Caption Reactions Preview - shows reactions below caption */
.caption-reactions {
    display: none; /* Hidden by default, shown via JS when reactions exist */
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    background: rgba(255, 231, 194, 0.9);
    border: 2px solid #fff256;
    border-top: none;
    border-radius: 0 0 8px 8px;
    margin-top: -2px;
    min-height: 28px;
}

.caption-reactions.show {
    display: flex;
}

.caption-reaction-item {
    display: flex;
    align-items: center;
    gap: 2px;
}

.caption-reaction-item img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.caption-reaction-item .count {
    font-size: 12px;
    font-weight: bold;
    color: #333;
    min-width: 14px;
    text-align: center;
}

.caption-box.caption-input {
    cursor: pointer;
    color: #666666;
    font-style: italic;
}

.caption-box.caption-input:hover {
    background: rgba(255, 242, 86, 0.2);
}

/* Active editing mode - ensure text is visible */
.caption-box[contenteditable="true"] {
    background: #ffe7c2 !important;
    color: #000000 !important;
    font-style: normal !important;
    opacity: 1 !important;
    border: 2px solid #fbbf24 !important;
    outline: none;
}

/* Pulse animation for caption input prompt */
@keyframes captionPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.caption-box.pulse-input {
    animation: captionPulse 1.5s ease-in-out infinite;
    opacity: 1;
}

/* Caption Control Buttons */
.caption-controls {
    display: none;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: rgba(255, 231, 194, 0.95);
    border: 1px solid #fff256;
    border-top: none;
    border-radius: 0 0 6px 6px;
    margin-top: -1px;
}

.caption-controls.show {
    display: flex;
}

.caption-btn {
    padding: 3px 8px;
    border: none;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.caption-btn-confirm {
    background: #4ade80;
    color: #000;
}

.caption-btn-confirm:hover {
    background: #22c55e;
}

.caption-btn-cancel {
    background: #fbbf24;
    color: #000;
}

.caption-btn-cancel:hover {
    background: #f59e0b;
}

.caption-btn-delete {
    background: #ef4444;
    color: #fff;
}

.caption-btn-delete:hover {
    background: #dc2626;
}

.caption-btn-edit {
    background: #60a5fa;
    color: #000;
}

.caption-btn-edit:hover {
    background: #3b82f6;
}

/* Stream Position Indicator */
.stream-position-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: rgba(255, 231, 194, 0.9);
    border: 1px solid #fff256;
    border-top: none;
    border-radius: 0 0 6px 6px;
    margin-top: -1px;
    min-height: 12px;
}

.stream-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.stream-dot.active {
    background: #1a4d37;
}

.stream-position-text {
    font-size: 10px;
    color: #1a4d37;
    font-weight: 600;
}

/* Row 6: Bottom Ticker - using transform instead */
.row-6 {
    height: 4vh;
    margin-top: auto;
    margin-bottom: 10px;
    position: relative;
}

.bottom-ticker {
    width: 100%;
    height: 100%;
    background: #FEE429;
    border: 4px solid #000000;
    border-radius: 25px;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.3),
        0 0 0 2px #B8860B,
        0 4px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: transform 0.1s ease;
    z-index: 5;
}

.bottom-ticker:hover {
    transform: scale(1.01);
}

.bottom-ticker:active {
    transform: scale(0.99);
}

/* Emergency Ticker Overlay - appears ON TOP of bottom_ticker during emergencies */
.emergency-ticker-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 15px;
    font-weight: bold;
    font-size: 13px;
    text-align: center;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.3),
        0 4px 8px rgba(0, 0, 0, 0.3);
}

.emergency-ticker-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.emergency-ticker-overlay.beakin {
    background: linear-gradient(180deg, #ff4444 0%, #cc0000 100%);
    color: #FFFFFF;
    border: 3px solid #ff6b6b;
}

.emergency-ticker-overlay.huddle {
    background: linear-gradient(180deg, #FFD700 0%, #FFA500 100%);
    color: #1a4d37;
    border: 3px solid #B8860B;
}

.emergency-ticker-overlay.request {
    background: linear-gradient(180deg, #FF1493 0%, #C71585 100%);
    color: #FFFFFF;
    border: 3px solid #FF69B4;
}

/* Row 7: Button Row - more compressed */
.row-7 {
    height: 9vh;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    align-items: center;
    margin-top: 12px;
    padding-bottom: 10px;
    margin-bottom: 5px;
}

.action-button {
    width: 100%;
    aspect-ratio: 0.9;
    cursor: pointer;
    transition: transform 0.1s;
    position: relative;
}

.action-button:active {
    transform: scale(0.95);
}

.action-button img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Responsive adjustments */
@media (max-width: 428px) {
    .beakin-logo {
        font-size: 60px;
    }
    .ticker-text {
        font-size: 18px;
    }
    .button-bottom {
        font-size: 10px;
    }
}

/* iPhone/iOS device specific adjustments - using class selector for reliability */
body.ios-device {
    --viewport-shift-up: 35px;  /* Reclaim request_box space */
}

body.ios-device .request-box {
    top: 3px;
}

body.ios-device .row-2-5 {
    margin-top: 6px;
}

body.ios-device .nest-label {
    margin-top: 5px;
}

body.ios-device .row-4 {
    margin-top: calc(3vh + 21px - var(--viewport-shift-up));
}

body.ios-device .caption-box {
    font-size: 16px;
}

/* Android-specific layout optimizations - Condensed and top-aligned */
body.android-device {
    --viewport-shift-up: 35px;  /* Reclaim request_box space */
}

body.android-device .app-container {
    padding-top: max(5px, env(safe-area-inset-top));
    padding-bottom: max(5px, env(safe-area-inset-bottom));
}

body.android-device .row-0 {
    height: 2vh;
    min-height: 20px;
    margin-bottom: 2px;
    margin-top: 3px;
}

body.android-device .menu-button img {
    height: 28px;
}

body.android-device .row-2 {
    height: 4vh;
    margin-top: 70px;
    margin-bottom: 0px;
}

body.android-device .ticker-text {
    font-size: 12px;
    padding: 8px 15px;
}

body.android-device .row-2-5 {
    height: 7vh;
    margin-top: 26px;
    margin-bottom: 10px;
}

body.android-device .nest-label {
    font-size: 11px;
    margin-bottom: 5px;
    margin-top: 3px;
}

body.android-device .row-3 .request-box {
    top: 60px;
    font-size: 15px;
    min-height: 25px;
    padding: 6px 12px;
}

body.android-device .row-4 {
    min-height: 24vh;
    max-height: 30vh;
    margin-top: calc(2vh + 113px - var(--viewport-shift-up));
    margin-bottom: 0px;
}

body.android-device .viewport-circle {
    width: 72%;
    max-width: 280px;
    position: relative;  /* Anchor for absolute child */
    aspect-ratio: 1;  /* Force perfect circle */
}

body.android-device .viewport-content {
    position: absolute;  /* CRITICAL: Prevents portrait photos from affecting parent layout */
    top: 2.5%;
    left: 2.5%;
    width: 95%;
    height: 95%;
    border-radius: 50%;
    overflow: hidden;
}

body.android-device .viewport-content img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

body.android-device .caption-box {
    font-size: 14px;
    min-height: 38px;
    padding: 6px 12px;
}

body.android-device .row-6 {
    height: 3vh;
    margin-top: auto;
    margin-bottom: 8px;
}

body.android-device .bottom-ticker-text {
    font-size: 12px;
    padding: 8px 15px;
}

body.android-device .row-7 {
    height: 7vh;
    margin-top: 8px;
    gap: 3px;
    padding-bottom: 8px;
    margin-bottom: 5px;
}

body.android-device .action-button {
    width: 18%;
    min-width: 55px;
}

body.android-device .action-button img {
    max-width: 100%;
    max-height: 100%;
}

/* Android: Additional condensing for token counter area */
body.android-device .token-counter {
    font-size: 20px;
    min-width: 50px;
}

body.android-device .spinning-coin img {
    height: 32px;
}

body.android-device .my-nest-egg img {
    height: 45px;
}

/* ========================================
   DEVICE-SPECIFIC LAYOUT OPTIMIZATIONS
   Based on tested iPhone 15 Plus and Galaxy S25+
   ======================================== */

/* ----------------------------------------
   IPHONE 15 PLUS (TESTED - NEAR PERFECT)
   2796 × 1290 (430 × 932 logical, DPR 3)
   ---------------------------------------- */
/* ========================================
   TODO (iOS 18.2 UPDATE - December 2025)
   ========================================
   iOS 18.2 update (released ~Dec 11, 2025) changed safe-area
   calculations, claiming more top space on iPhone 15 Plus.
   
   DEADLINE: Review and finalize by January 10, 2026
   
   AFFECTED MODELS TO TEST (reference: iPhone 15 Plus @ 430×932):
   - iPhone 15 Plus / 15 Pro Max (430×932)
   - iPhone 16 Plus / 16 Pro Max (same logical res)
   - iPhone 14 Pro / 15 Pro / 16 Pro (393×852)
   - iPhone 12/13/14/16 standard (390×844)
   
   CURRENT FIX: Added margin-top: -20px to row-6 (bottom_ticker)
   to pull bottom section up slightly, creating room at top for iOS safe area.
   (Reduced from -45px which was 25px too aggressive - 2025-12-11)
   
   FUTURE: May need device-specific adjustments once iOS stabilizes.
   ======================================== */
body.iphone-15-plus {
    --viewport-shift-up: 40px;  /* Slightly more shift for this device */
}

body.iphone-15-plus .request-box {
    top: 3px;
}

body.iphone-15-plus .row-2-5 {
    margin-top: 6px;
}

body.iphone-15-plus .nest-label {
    margin-top: 5px;
}

body.iphone-15-plus .row-4 {
    margin-top: calc(3vh + 21px - var(--viewport-shift-up));
}

body.iphone-15-plus .caption-box {
    font-size: 18px;
    min-height: 50px;
}

body.iphone-15-plus .ticker-tab {
    height: calc((2vh + 4px) * 1.5125) !important;
    width: calc((4.2vh + 8.4px) * 1.5125) !important;
    top: calc(-1 * calc((2vh + 4px) * 1.5125)) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
}

body.iphone-15-plus .row-6 {
    margin-bottom: 1px !important;
    margin-top: 35px; /* iOS 18.2 - moved down 60px from -25px (2025-12-11) */
}

body.iphone-15-plus .row-7 {
    /* row-7 follows row-6 naturally, no adjustment needed */
}

body.iphone-15-plus .my-nest-egg img {
    height: 82px !important;
}

/* ----------------------------------------
   IPHONE 15 PRO MAX (TESTED - NEAR PERFECT)
   2796 × 1290 (430 × 932 logical, DPR 3)
   Same resolution as 15 Plus - identical optimizations
   ---------------------------------------- */
body.iphone-15-pro-max {
    --viewport-shift-up: 40px;  /* Same as 15 Plus */
}

body.iphone-15-pro-max .request-box {
    top: 3px;
}

body.iphone-15-pro-max .row-2-5 {
    margin-top: 6px;
}

body.iphone-15-pro-max .nest-label {
    margin-top: 5px;
}

body.iphone-15-pro-max .row-4 {
    margin-top: calc(3vh + 21px - var(--viewport-shift-up));
}

body.iphone-15-pro-max .caption-box {
    font-size: 18px;
    min-height: 50px;
}

body.iphone-15-pro-max .ticker-tab {
    height: calc((2vh + 4px) * 1.5125) !important;
    width: calc((4.2vh + 8.4px) * 1.5125) !important;
    top: calc(-1 * calc((2vh + 4px) * 1.5125)) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
}

body.iphone-15-pro-max .row-6 {
    margin-bottom: 1px !important;
}

body.iphone-15-pro-max .my-nest-egg img {
    height: 82px !important;
}

/* ----------------------------------------
   IPHONE 14 PRO (BASELINE)
   2556 × 1179 (393 × 852 logical, DPR 3)
   Slightly smaller screen - adjusted from 15 Plus
   ---------------------------------------- */
body.iphone-14-pro {
    --viewport-shift-up: 35px;  /* Slightly less than 15 Plus */
}

body.iphone-14-pro .request-box {
    top: 2px;
}

body.iphone-14-pro .row-2-5 {
    margin-top: 4px;
}

body.iphone-14-pro .nest-label {
    margin-top: 4px;
    font-size: 10px;
}

body.iphone-14-pro .row-4 {
    margin-top: calc(3vh + 17px - var(--viewport-shift-up));
}

body.iphone-14-pro .viewport-circle {
    width: 70%;
    max-width: 270px;
}

body.iphone-14-pro .caption-box {
    font-size: 16px;
    min-height: 44px;
}

body.iphone-14-pro .ticker-tab {
    height: calc((2vh + 4px) * 1.71875) !important;
    width: calc((4.2vh + 8.4px) * 1.71875) !important;
    top: calc(-1 * calc((2vh + 4px) * 1.71875)) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
}

body.iphone-14-pro .cashout-card {
    max-width: 320px;
    padding: 30px 20px;
}

body.iphone-14-pro .cashout-title {
    font-size: 26px;
    letter-spacing: 0px;
}

body.iphone-14-pro .cashout-message {
    font-size: 16px;
}

body.iphone-14-pro .cashout-amount {
    font-size: 20px;
    padding: 15px;
}

/* ----------------------------------------
   iPHONE 14 (STANDARD) - "Nancy's Phone"
   2532 × 1170 physical (390 × 844 logical, DPR 3)
   6.1" screen - same as iPhone 12, 13, 16 standard
   Slightly shorter than 14 Pro (844 vs 852)
   ---------------------------------------- */
body.iphone-14 {
    --viewport-shift-up: 30px;
}

body.iphone-14 .request-box {
    top: 2px;
}

body.iphone-14 .row-2-5 {
    margin-top: 4px;
}

body.iphone-14 .nest-label {
    margin-top: 4px;
    font-size: 10px;
}

body.iphone-14 .row-4 {
    margin-top: calc(3vh + 12px - var(--viewport-shift-up));
}

body.iphone-14 .viewport-circle {
    width: 68%;
    max-width: 260px;
}

body.iphone-14 .caption-box {
    font-size: 15px;
    min-height: 42px;
}

body.iphone-14 .ticker-tab {
    height: calc((2vh + 4px) * 1.65) !important;
    width: calc((4.2vh + 8.4px) * 1.65) !important;
    top: calc(-1 * calc((2vh + 4px) * 1.65)) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
}

body.iphone-14 .row-6 {
    margin-top: 25px;
}

body.iphone-14 .cashout-card {
    max-width: 310px;
    padding: 28px 18px;
}

body.iphone-14 .cashout-title {
    font-size: 24px;
    letter-spacing: 0px;
}

body.iphone-14 .cashout-message {
    font-size: 15px;
}

body.iphone-14 .cashout-amount {
    font-size: 18px;
    padding: 14px;
}

/* ----------------------------------------
   iPHONE 13 / 13 Pro (390 × 844 logical)
   Same dimensions as iPhone 14 standard
   Separate class for personalized badge display
   ---------------------------------------- */
body.iphone-13 {
    --viewport-shift-up: 30px;
}

body.iphone-13 .request-box {
    top: 2px;
}

body.iphone-13 .row-2-5 {
    margin-top: 4px;
}

body.iphone-13 .nest-label {
    margin-top: 4px;
    font-size: 10px;
}

body.iphone-13 .row-4 {
    margin-top: calc(3vh + 12px - var(--viewport-shift-up));
}

body.iphone-13 .viewport-circle {
    width: 68%;
    max-width: 260px;
}

body.iphone-13 .caption-box {
    font-size: 15px;
    min-height: 42px;
}

body.iphone-13 .ticker-tab {
    height: calc((2vh + 4px) * 1.65) !important;
    width: calc((4.2vh + 8.4px) * 1.65) !important;
    top: calc(-1 * calc((2vh + 4px) * 1.65)) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
}

body.iphone-13 .row-6 {
    margin-top: 25px;
}

body.iphone-13 .cashout-card {
    max-width: 310px;
    padding: 28px 18px;
}

body.iphone-13 .cashout-title {
    font-size: 24px;
    letter-spacing: 0px;
}

body.iphone-13 .cashout-message {
    font-size: 15px;
}

body.iphone-13 .cashout-amount {
    font-size: 18px;
    padding: 14px;
}

/* ----------------------------------------
   iPHONE 12 (390 × 844 logical)
   Same dimensions as iPhone 14/13 standard
   ---------------------------------------- */
body.iphone-12 {
    --viewport-shift-up: 30px;
}

body.iphone-12 .request-box { top: 2px; }
body.iphone-12 .row-2-5 { margin-top: 4px; }
body.iphone-12 .nest-label { margin-top: 4px; font-size: 10px; }
body.iphone-12 .row-4 { margin-top: calc(3vh + 12px - var(--viewport-shift-up)); }
body.iphone-12 .viewport-circle { width: 68%; max-width: 260px; }
body.iphone-12 .caption-box { font-size: 15px; min-height: 42px; }
body.iphone-12 .ticker-tab {
    height: calc((2vh + 4px) * 1.65) !important;
    width: calc((4.2vh + 8.4px) * 1.65) !important;
    top: calc(-1 * calc((2vh + 4px) * 1.65)) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
}
body.iphone-12 .row-6 { margin-top: 25px; }
body.iphone-12 .cashout-card { max-width: 310px; padding: 28px 18px; }
body.iphone-12 .cashout-title { font-size: 24px; }
body.iphone-12 .cashout-message { font-size: 15px; }
body.iphone-12 .cashout-amount { font-size: 18px; padding: 14px; }

/* ----------------------------------------
   iPHONE 15 STANDARD (390 × 844 logical)
   Same dimensions as iPhone 14/13/12 standard
   ---------------------------------------- */
body.iphone-15-standard {
    --viewport-shift-up: 30px;
}

body.iphone-15-standard .request-box { top: 2px; }
body.iphone-15-standard .row-2-5 { margin-top: 4px; }
body.iphone-15-standard .nest-label { margin-top: 4px; font-size: 10px; }
body.iphone-15-standard .row-4 { margin-top: calc(3vh + 12px - var(--viewport-shift-up)); }
body.iphone-15-standard .viewport-circle { width: 68%; max-width: 260px; }
body.iphone-15-standard .caption-box { font-size: 15px; min-height: 42px; }
body.iphone-15-standard .ticker-tab {
    height: calc((2vh + 4px) * 1.65) !important;
    width: calc((4.2vh + 8.4px) * 1.65) !important;
    top: calc(-1 * calc((2vh + 4px) * 1.65)) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
}
body.iphone-15-standard .row-6 { margin-top: 25px; }
body.iphone-15-standard .cashout-card { max-width: 310px; padding: 28px 18px; }
body.iphone-15-standard .cashout-title { font-size: 24px; }
body.iphone-15-standard .cashout-message { font-size: 15px; }
body.iphone-15-standard .cashout-amount { font-size: 18px; padding: 14px; }

/* ----------------------------------------
   iPHONE 16 STANDARD (390 × 844 logical)
   Same dimensions as iPhone 14/13/12 standard
   ---------------------------------------- */
body.iphone-16-standard {
    --viewport-shift-up: 30px;
}

body.iphone-16-standard .request-box { top: 2px; }
body.iphone-16-standard .row-2-5 { margin-top: 4px; }
body.iphone-16-standard .nest-label { margin-top: 4px; font-size: 10px; }
body.iphone-16-standard .row-4 { margin-top: calc(3vh + 12px - var(--viewport-shift-up)); }
body.iphone-16-standard .viewport-circle { width: 68%; max-width: 260px; }
body.iphone-16-standard .caption-box { font-size: 15px; min-height: 42px; }
body.iphone-16-standard .ticker-tab {
    height: calc((2vh + 4px) * 1.65) !important;
    width: calc((4.2vh + 8.4px) * 1.65) !important;
    top: calc(-1 * calc((2vh + 4px) * 1.65)) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
}
body.iphone-16-standard .row-6 { margin-top: 25px; }
body.iphone-16-standard .cashout-card { max-width: 310px; padding: 28px 18px; }
body.iphone-16-standard .cashout-title { font-size: 24px; }
body.iphone-16-standard .cashout-message { font-size: 15px; }
body.iphone-16-standard .cashout-amount { font-size: 18px; padding: 14px; }

/* ----------------------------------------
   iPHONE 16 PRO MAX
   2868 × 1320 physical (440 × 956 logical, DPR 3)
   6.9" screen - largest iPhone, based on 15 Pro Max
   ---------------------------------------- */
body.iphone-16-pro-max {
    --viewport-shift-up: 30px;
}

body.iphone-16-pro-max .request-box {
    top: 60px;
}

body.iphone-16-pro-max .row-2-5 {
    margin-top: 15px;
}

body.iphone-16-pro-max .nest-label {
    margin-top: -12px;
}

body.iphone-16-pro-max .row-4 {
    margin-top: calc(2vh + 100px - var(--viewport-shift-up));
}

body.iphone-16-pro-max .viewport-circle {
    width: 90%;
    max-width: 396px;
    aspect-ratio: 1 !important;
}

body.iphone-16-pro-max .viewport-content img {
    max-width: 95%;
    max-height: 95%;
    width: 95%;
    height: 95%;
    object-fit: cover;
}

body.iphone-16-pro-max .caption-box {
    font-size: 17px;
    min-height: 48px;
}

body.iphone-16-pro-max .ticker-tab {
    height: calc((2vh + 4px) * 1.71875) !important;
    width: calc((4.2vh + 8.4px) * 1.71875) !important;
    top: calc(-1 * calc((2vh + 4px) * 1.71875)) !important;
}

body.iphone-16-pro-max .row-6 {
    margin-bottom: 25px;
}

body.iphone-16-pro-max .my-nest-egg img {
    height: 100px;
}

/* ----------------------------------------
   iPHONE 16
   2556 × 1179 physical (393 × 852 logical, DPR 3)
   6.1" screen - standard iPhone 16, based on iPhone 14 Pro
   ---------------------------------------- */
body.iphone-16 {
    --viewport-shift-up: 28px;
}

body.iphone-16 .request-box {
    top: 58px;
}

body.iphone-16 .row-2-5 {
    margin-top: 14px;
}

body.iphone-16 .nest-label {
    margin-top: -12px;
}

body.iphone-16 .row-4 {
    margin-top: calc(2vh + 95px - var(--viewport-shift-up));
}

body.iphone-16 .viewport-circle {
    width: 88%;
    max-width: 346px;
    aspect-ratio: 1 !important;
}

body.iphone-16 .viewport-content img {
    max-width: 95%;
    max-height: 95%;
    width: 95%;
    height: 95%;
    object-fit: cover;
}

body.iphone-16 .caption-box {
    font-size: 16px;
    min-height: 45px;
}

body.iphone-16 .ticker-tab {
    height: calc((2vh + 4px) * 1.65) !important;
    width: calc((4.2vh + 8.4px) * 1.65) !important;
    top: calc(-1 * calc((2vh + 4px) * 1.65)) !important;
}

body.iphone-16 .row-6 {
    margin-bottom: 22px;
}

body.iphone-16 .my-nest-egg img {
    height: 95px;
}

/* ----------------------------------------
   iPHONE SE (3RD GEN)
   1334 × 750 physical (375 × 667 logical, DPR 2)
   4.7" screen - compact, no notch, home button
   Requires tighter spacing for smaller display
   ---------------------------------------- */
body.iphone-se-3 {
    --viewport-shift-up: 20px;
}

body.iphone-se-3 .app-container {
    padding-top: 5px;
    padding-bottom: 5px;
}

body.iphone-se-3 .row-0 {
    height: 2vh;
    min-height: 16px;
    margin-bottom: 2px;
    margin-top: 2px;
}

body.iphone-se-3 .menu-button img {
    height: 24px;
}

body.iphone-se-3 .row-2 {
    height: 3vh;
    margin-top: 50px;
    margin-bottom: 0px;
}

body.iphone-se-3 .ticker-text {
    font-size: 10px;
    padding: 5px 10px;
}

body.iphone-se-3 .row-2-5 {
    height: 6vh;
    margin-top: 12px;
    margin-bottom: 8px;
}

body.iphone-se-3 .nest-label {
    font-size: 10px;
    margin-bottom: 4px;
    margin-top: -10px;
}

body.iphone-se-3 .row-3 .request-box {
    top: 45px;
    font-size: 13px;
    min-height: 22px;
    padding: 4px 10px;
}

body.iphone-se-3 .row-4 {
    min-height: 20vh;
    max-height: 26vh;
    margin-top: calc(2vh + 70px - var(--viewport-shift-up));
    margin-bottom: 0px;
}

body.iphone-se-3 .viewport-circle {
    width: 95%;
    max-width: 280px;
    aspect-ratio: 1 !important;
}

body.iphone-se-3 .viewport-content img {
    max-width: 95%;
    max-height: 95%;
    width: 95%;
    height: 95%;
    object-fit: cover;
}

body.iphone-se-3 .caption-box {
    font-size: 14px;
    min-height: 38px;
    padding: 4px 10px;
}

body.iphone-se-3 .row-6 {
    height: 3vh;
    margin-top: auto;
    margin-bottom: 15px;
}

body.iphone-se-3 .bottom-ticker-text {
    font-size: 10px;
    padding: 5px 10px;
}

body.iphone-se-3 .row-7 {
    height: 6vh;
    margin-top: 5px;
    gap: 2px;
    padding-bottom: 5px;
    margin-bottom: 3px;
}

body.iphone-se-3 .action-button {
    width: 19%;
    min-width: 58px;
}

body.iphone-se-3 .action-button img {
    max-width: 100%;
    max-height: 100%;
}

body.iphone-se-3 .token-counter {
    font-size: 18px;
    min-width: 80px;
    max-width: 80px;
}

body.iphone-se-3 .gem-counter {
    font-size: 18px;
    min-width: 80px;
    max-width: 80px;
}

body.iphone-se-3 .spinning-coin img {
    height: 26px;
}

body.iphone-se-3 .my-nest-egg img {
    height: 80px;
}

body.iphone-se-3 .ticker-tab {
    height: calc((2vh + 4px) * 1.4) !important;
    width: calc((4.2vh + 8.4px) * 1.4) !important;
    top: calc(-1 * calc((2vh + 4px) * 1.4)) !important;
}

/* ----------------------------------------
   iPHONE 15
   2556 × 1179 physical (393 × 852 logical, DPR 3)
   6.1" screen - standard iPhone 15, similar to iPhone 14 Pro
   ---------------------------------------- */
body.iphone-15 {
    --viewport-shift-up: 28px;
}

body.iphone-15 .request-box {
    top: 58px;
}

body.iphone-15 .row-2-5 {
    margin-top: 14px;
}

body.iphone-15 .nest-label {
    margin-top: -12px;
}

body.iphone-15 .row-4 {
    margin-top: calc(2vh + 95px - var(--viewport-shift-up));
}

body.iphone-15 .viewport-circle {
    width: 88%;
    max-width: 346px;
    aspect-ratio: 1 !important;
}

body.iphone-15 .viewport-content img {
    max-width: 95%;
    max-height: 95%;
    width: 95%;
    height: 95%;
    object-fit: cover;
}

body.iphone-15 .caption-box {
    font-size: 16px;
    min-height: 45px;
}

body.iphone-15 .ticker-tab {
    height: calc((2vh + 4px) * 1.65) !important;
    width: calc((4.2vh + 8.4px) * 1.65) !important;
    top: calc(-1 * calc((2vh + 4px) * 1.65)) !important;
}

body.iphone-15 .row-6 {
    margin-bottom: 22px;
}

body.iphone-15 .my-nest-egg img {
    height: 95px;
}


/* ----------------------------------------
   GOOGLE PIXEL 8 PRO (OPTIMIZED)
   2992 × 1344 (varies by zoom, DPR varies)
   Comprehensive optimizations applied
   ---------------------------------------- */
body.pixel-8-pro {
    --viewport-shift-up: 35px;  /* Reclaim request_box space */
}

body.pixel-8-pro .app-container {
    padding-top: max(5px, env(safe-area-inset-top));
    padding-bottom: max(5px, env(safe-area-inset-bottom));
}

body.pixel-8-pro .row-0 {
    height: 2vh;
    min-height: 20px;
    margin-bottom: 2px;
    margin-top: 4px;
}

body.pixel-8-pro .menu-button img {
    height: 30px;
}

body.pixel-8-pro .row-2 {
    height: 5vh !important;
    margin-top: 100px !important;
    margin-bottom: 0px;
}

body.pixel-8-pro .ticker-text {
    font-size: 17px;
    padding: 12px 15px !important;
    line-height: 1.2 !important;
}

body.pixel-8-pro .row-2-5 {
    height: 7vh;
    margin-top: 14px !important;
    margin-bottom: 10px;
}

body.pixel-8-pro .nest-label {
    font-size: 11px;
    margin-bottom: 5px;
    margin-top: -10px !important;
}

body.pixel-8-pro .row-3 .request-box {
    top: 2px !important;
    font-size: 15px;
    min-height: 26px;
    padding: 7px 13px;
}

body.pixel-8-pro .row-4 {
    min-height: 25vh;
    max-height: 31vh;
    margin-top: calc(2vh + 65px - var(--viewport-shift-up)) !important;
    margin-bottom: 0px;
}

body.pixel-8-pro .viewport-circle {
    width: 105% !important;
    max-width: 409px !important;
    position: relative;  /* Anchor for absolute child */
    aspect-ratio: 1;  /* Force perfect circle */
}

body.pixel-8-pro .viewport-content {
    position: absolute;  /* CRITICAL: Prevents portrait photos from affecting parent layout */
    top: 2.5%;
    left: 2.5%;
    width: 95%;
    height: 95%;
    border-radius: 50%;
    overflow: hidden;
}

body.pixel-8-pro .viewport-content img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Avatar collection - concentric circles */
body.pixel-8-pro .viewport-content img[src^="avatars_viewport/uav"] {
    width: 100%;
    height: 100%;
}

/* Button images - properly sized */
body.pixel-8-pro .viewport-content img.button-display {
    max-width: 52.5% !important;
    max-height: 52.5% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
}

body.pixel-8-pro .caption-box {
    font-size: 16px;
    min-height: 44px;
    padding: 7px 13px;
}

body.pixel-8-pro .row-6 {
    height: 3.75vh !important;
    margin-top: auto;
    margin-bottom: 11px !important;
}

body.pixel-8-pro .bottom-ticker-text {
    font-size: 17px;
    padding: 12px 15px !important;
    line-height: 1.2 !important;
}

body.pixel-8-pro .row-7 {
    height: 6.3vh !important;
    margin-top: -11px !important;
    gap: 4px;
    padding-bottom: 9px;
    padding-left: 6px !important;
    margin-bottom: 6px;
    justify-content: center !important;
}

body.pixel-8-pro .action-button {
    width: 24% !important;
    min-width: 74px !important;
}

body.pixel-8-pro .action-button img {
    max-width: 100%;
    max-height: 100%;
}

body.pixel-8-pro .token-counter {
    font-size: 21px;
    min-width: 52px;
    margin-top: -6px !important;
}

body.pixel-8-pro .gem-counter {
    font-size: 21px;
    min-width: 52px;
}

body.pixel-8-pro .spinning-coin {
    margin-top: -8px !important;
}

body.pixel-8-pro .spinning-coin img {
    height: 33px;
}

body.pixel-8-pro .my-nest-egg {
    padding: 0 !important;
}

body.pixel-8-pro .my-nest-egg img {
    height: 101px !important;
}

body.pixel-8-pro .ticker-tab {
    height: calc((2vh + 4px) * 1.5125) !important;
    width: calc((4.2vh + 8.4px) * 1.5125) !important;
    top: calc(-1 * calc((2vh + 4px) * 1.5125)) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
}

/* ----------------------------------------
   GOOGLE PIXEL 9 PRO
   2992 × 1344 physical (448 × 998 logical, DPR 3)
   6.3" screen - newest Pixel flagship, based on Pixel 8 Pro
   ---------------------------------------- */
body.pixel-9-pro {
    --viewport-shift-up: 35px;
}

body.pixel-9-pro .app-container {
    padding-top: max(5px, env(safe-area-inset-top));
    padding-bottom: max(5px, env(safe-area-inset-bottom));
}

body.pixel-9-pro .row-0 {
    height: 2vh;
    min-height: 20px;
    margin-bottom: 2px;
    margin-top: 3px;
}

body.pixel-9-pro .menu-button img {
    height: 28px;
}

body.pixel-9-pro .row-2 {
    height: 4vh;
    margin-top: 70px;
    margin-bottom: 0px;
}

body.pixel-9-pro .ticker-text {
    font-size: 12px;
    padding: 8px 15px;
}

body.pixel-9-pro .row-2-5 {
    height: 7vh;
    margin-top: 18px;
    margin-bottom: 10px;
}

body.pixel-9-pro .nest-label {
    font-size: 11px;
    margin-bottom: 5px;
    margin-top: -14px;
}

body.pixel-9-pro .row-3 .request-box {
    top: 60px;
    font-size: 15px;
    min-height: 25px;
    padding: 6px 12px;
}

body.pixel-9-pro .row-4 {
    min-height: 24vh;
    max-height: 30vh;
    margin-top: calc(2vh + 105px - var(--viewport-shift-up));
    margin-bottom: 0px;
}

body.pixel-9-pro .viewport-circle {
    width: 90%;
    max-width: 400px;
    aspect-ratio: 1 !important;
    position: relative;  /* Anchor for absolute child */
}

body.pixel-9-pro .viewport-content {
    position: absolute;  /* CRITICAL: Prevents portrait photos from affecting parent layout */
    top: 2.5%;
    left: 2.5%;
    width: 95%;
    height: 95%;
    border-radius: 50%;
    overflow: hidden;
}

body.pixel-9-pro .viewport-content img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

body.pixel-9-pro .viewport-content img[src^="avatars_viewport/uav"] {
    width: 100%;
    height: 100%;
}

body.pixel-9-pro .viewport-content img.button-display {
    max-width: 55% !important;
    max-height: 55% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    margin-top: -18px !important;
}

body.pixel-9-pro .caption-box {
    font-size: 17px;
    min-height: 48px;
    padding: 6px 12px;
}

body.pixel-9-pro .row-6 {
    height: 4vh;
    margin-top: auto;
    margin-bottom: 27px;
}

body.pixel-9-pro .bottom-ticker-text {
    font-size: 12px;
    padding: 8px 15px;
}

body.pixel-9-pro .row-7 {
    height: 7vh;
    margin-top: 8px;
    gap: 3px;
    padding-bottom: 8px;
    margin-bottom: 5px;
}

body.pixel-9-pro .action-button {
    width: 20%;
    min-width: 72px;
}

body.pixel-9-pro .action-button img {
    max-width: 100%;
    max-height: 100%;
}

body.pixel-9-pro .token-counter {
    font-size: 22px;
    min-width: 95px;
    max-width: 95px;
    text-align: center;
}

body.pixel-9-pro .gem-counter {
    font-size: 22px;
    min-width: 95px;
    max-width: 95px;
    text-align: center;
}

body.pixel-9-pro .spinning-coin img {
    height: 30px;
}

body.pixel-9-pro .my-nest-egg img {
    height: 100px;
}

body.pixel-9-pro .ticker-tab {
    height: calc((2vh + 4px) * 1.55) !important;
    width: calc((4.2vh + 8.4px) * 1.55) !important;
    top: calc(-1 * calc((2vh + 4px) * 1.55)) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
}

/* ----------------------------------------
   GOOGLE PIXEL 8
   2400 × 1080 physical (412 × 915 logical, DPR 2.625)
   6.2" screen - standard Pixel 8, slightly smaller than Pro
   ---------------------------------------- */
body.pixel-8 {
    --viewport-shift-up: 32px;
}

body.pixel-8 .app-container {
    padding-top: max(5px, env(safe-area-inset-top));
    padding-bottom: max(5px, env(safe-area-inset-bottom));
}

body.pixel-8 .row-0 {
    height: 2vh;
    min-height: 18px;
    margin-bottom: 2px;
    margin-top: 3px;
}

body.pixel-8 .menu-button img {
    height: 26px;
}

body.pixel-8 .row-2 {
    height: 3.5vh;
    margin-top: 65px;
    margin-bottom: 0px;
}

body.pixel-8 .ticker-text {
    font-size: 11px;
    padding: 7px 14px;
}

body.pixel-8 .row-2-5 {
    height: 6.5vh;
    margin-top: 16px;
    margin-bottom: 9px;
}

body.pixel-8 .nest-label {
    font-size: 11px;
    margin-bottom: 5px;
    margin-top: -13px;
}

body.pixel-8 .row-3 .request-box {
    top: 58px;
    font-size: 14px;
    min-height: 24px;
    padding: 5px 11px;
}

body.pixel-8 .row-4 {
    min-height: 23vh;
    max-height: 29vh;
    margin-top: calc(2vh + 98px - var(--viewport-shift-up));
    margin-bottom: 0px;
}

body.pixel-8 .viewport-circle {
    width: 92%;
    max-width: 380px;
    aspect-ratio: 1 !important;
    position: relative;  /* Anchor for absolute child */
}

body.pixel-8 .viewport-content {
    position: absolute;  /* CRITICAL: Prevents portrait photos from affecting parent layout */
    top: 2.5%;
    left: 2.5%;
    width: 95%;
    height: 95%;
    border-radius: 50%;
    overflow: hidden;
}

body.pixel-8 .viewport-content img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

body.pixel-8 .viewport-content img[src^="avatars_viewport/uav"] {
    width: 100%;
    height: 100%;
}

body.pixel-8 .viewport-content img.button-display {
    max-width: 55% !important;
    max-height: 55% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    margin-top: -18px !important;
}

body.pixel-8 .caption-box {
    font-size: 16px;
    min-height: 45px;
    padding: 5px 11px;
}

body.pixel-8 .row-6 {
    height: 3.5vh;
    margin-top: auto;
    margin-bottom: 24px;
}

body.pixel-8 .bottom-ticker-text {
    font-size: 11px;
    padding: 7px 14px;
}

body.pixel-8 .row-7 {
    height: 6.5vh;
    margin-top: 7px;
    gap: 3px;
    padding-bottom: 7px;
    margin-bottom: 5px;
}

body.pixel-8 .action-button {
    width: 20%;
    min-width: 68px;
}

body.pixel-8 .action-button img {
    max-width: 100%;
    max-height: 100%;
}

body.pixel-8 .token-counter {
    font-size: 21px;
    min-width: 92px;
    max-width: 92px;
    text-align: center;
}

body.pixel-8 .gem-counter {
    font-size: 21px;
    min-width: 92px;
    max-width: 92px;
    text-align: center;
}

body.pixel-8 .spinning-coin img {
    height: 28px;
}

body.pixel-8 .my-nest-egg img {
    height: 95px;
}

body.pixel-8 .ticker-tab {
    height: calc((2vh + 4px) * 1.5) !important;
    width: calc((4.2vh + 8.4px) * 1.5) !important;
    top: calc(-1 * calc((2vh + 4px) * 1.5)) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
}

/* ----------------------------------------
   GOOGLE PIXEL 8a
   2400 × 1080 physical (412 × 915 logical, DPR 2.625)
   6.1" screen - budget Pixel, same resolution as Pixel 8
   ---------------------------------------- */
body.pixel-8a {
    --viewport-shift-up: 32px;
}

body.pixel-8a .app-container {
    padding-top: max(5px, env(safe-area-inset-top));
    padding-bottom: max(5px, env(safe-area-inset-bottom));
}

body.pixel-8a .row-0 {
    height: 2vh;
    min-height: 18px;
    margin-bottom: 2px;
    margin-top: 3px;
}

body.pixel-8a .menu-button img {
    height: 26px;
}

body.pixel-8a .row-2 {
    height: 3.5vh;
    margin-top: 65px;
    margin-bottom: 0px;
}

body.pixel-8a .ticker-text {
    font-size: 11px;
    padding: 7px 14px;
}

body.pixel-8a .row-2-5 {
    height: 6.5vh;
    margin-top: 16px;
    margin-bottom: 9px;
}

body.pixel-8a .nest-label {
    font-size: 11px;
    margin-bottom: 5px;
    margin-top: -13px;
}

body.pixel-8a .row-3 .request-box {
    top: 58px;
    font-size: 14px;
    min-height: 24px;
    padding: 5px 11px;
}

body.pixel-8a .row-4 {
    min-height: 23vh;
    max-height: 29vh;
    margin-top: calc(2vh + 98px - var(--viewport-shift-up));
    margin-bottom: 0px;
}

body.pixel-8a .viewport-circle {
    width: 92%;
    max-width: 375px;
    aspect-ratio: 1 !important;
    position: relative;  /* Anchor for absolute child */
}

body.pixel-8a .viewport-content {
    position: absolute;  /* CRITICAL: Prevents portrait photos from affecting parent layout */
    top: 2.5%;
    left: 2.5%;
    width: 95%;
    height: 95%;
    border-radius: 50%;
    overflow: hidden;
}

body.pixel-8a .viewport-content img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

body.pixel-8a .viewport-content img[src^="avatars_viewport/uav"] {
    width: 100%;
    height: 100%;
}

body.pixel-8a .viewport-content img.button-display {
    max-width: 55% !important;
    max-height: 55% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    margin-top: -18px !important;
}

body.pixel-8a .caption-box {
    font-size: 16px;
    min-height: 45px;
    padding: 5px 11px;
}

body.pixel-8a .row-6 {
    height: 3.5vh;
    margin-top: auto;
    margin-bottom: 24px;
}

body.pixel-8a .bottom-ticker-text {
    font-size: 11px;
    padding: 7px 14px;
}

body.pixel-8a .row-7 {
    height: 6.5vh;
    margin-top: 7px;
    gap: 3px;
    padding-bottom: 7px;
    margin-bottom: 5px;
}

body.pixel-8a .action-button {
    width: 20%;
    min-width: 68px;
}

body.pixel-8a .action-button img {
    max-width: 100%;
    max-height: 100%;
}

body.pixel-8a .token-counter {
    font-size: 21px;
    min-width: 92px;
    max-width: 92px;
    text-align: center;
}

body.pixel-8a .gem-counter {
    font-size: 21px;
    min-width: 92px;
    max-width: 92px;
    text-align: center;
}

body.pixel-8a .spinning-coin img {
    height: 28px;
}

body.pixel-8a .my-nest-egg img {
    height: 95px;
}

body.pixel-8a .ticker-tab {
    height: calc((2vh + 4px) * 1.5) !important;
    width: calc((4.2vh + 8.4px) * 1.5) !important;
    top: calc(-1 * calc((2vh + 4px) * 1.5)) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
}


/* ========================================
   END DEVICE-SPECIFIC LAYOUTS
   ======================================== */

/* Beta Acknowledgment Overlay - Highest Priority */
.beta-acknowledgment-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    padding: 20px;
    overflow-y: auto;
}

.beta-acknowledgment-overlay.hidden {
    display: none;
}

.beta-ack-card {
    background: linear-gradient(180deg, #1a4d37 0%, #0d2620 100%);
    border: 4px solid #FFD700;
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.beta-ack-title {
    font-size: 28px;
    font-weight: bold;
    color: #FFD700;
    text-align: center;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.beta-ack-subtitle {
    font-size: 14px;
    color: #ff6b6b;
    text-align: center;
    margin-bottom: 25px;
    font-weight: bold;
}

.beta-ack-content {
    color: white;
    line-height: 1.6;
    margin-bottom: 25px;
    font-size: 15px;
}

.beta-ack-content h3 {
    color: #FFD700;
    font-size: 18px;
    margin: 20px 0 10px 0;
}

.beta-ack-content ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.beta-ack-content li {
    margin-bottom: 12px;
}

.beta-ack-content strong {
    color: #4CAF50;
}

.beta-ack-warning {
    background: rgba(255, 107, 107, 0.2);
    border-left: 4px solid #ff6b6b;
    padding: 15px;
    margin: 15px 0;
    border-radius: 8px;
}

.beta-ack-button {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    font-weight: bold;
    background: #FFD700;
    color: #1a4d37;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
}

.beta-ack-button:hover {
    background: #FFA500;
    transform: scale(1.02);
}

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

/* ==========================================
   APP UPDATE PROMPT OVERLAY
   Shown when installed PWA is outdated
   ========================================== */
.update-prompt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100002; /* Above beta acknowledgment */
    padding: 20px;
    overflow-y: auto;
}

.update-prompt-overlay.hidden {
    display: none;
}

.update-prompt-card {
    background: linear-gradient(180deg, #1a4d37 0%, #0d2620 100%);
    border: 4px solid #4CAF50;
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(76, 175, 80, 0.4);
    animation: slideIn 0.3s ease-out;
    text-align: center;
}

.update-prompt-icon {
    font-size: 64px;
    margin-bottom: 10px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.update-prompt-title {
    font-size: 26px;
    font-weight: bold;
    color: #4CAF50;
    margin-bottom: 8px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.update-prompt-version {
    font-size: 16px;
    color: #FFD700;
    margin-bottom: 20px;
    font-weight: bold;
}

.update-prompt-content {
    color: white;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.update-prompt-content ol {
    color: rgba(255, 255, 255, 0.9);
}

.update-prompt-content strong {
    color: #FFD700;
}

.update-prompt-button {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    font-weight: bold;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.update-prompt-button:hover {
    background: #45a049;
    transform: scale(1.02);
}

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

.update-dismiss-button {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.update-dismiss-button:hover {
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.6);
}

/* Achievement Claim Card Overlay */
.achievement-claim-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100001; /* Above everything */
    padding: 20px;
}

.achievement-claim-overlay.hidden {
    display: none;
}

.achievement-claim-card {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 3px solid #FFD700;
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.6);
    animation: achievementPopIn 0.5s ease-out;
}

@keyframes achievementPopIn {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.achievement-badge-display {
    margin: 0 auto 20px auto;
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: badgeGlow 1.5s ease-in-out infinite;
}

.achievement-badge-display img {
    width: 140px;
    height: 140px;
    object-fit: contain;
    animation: badgeSpin 0.6s ease-out;
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.8));
}

@keyframes badgeSpin {
    0% {
        transform: rotate(-180deg) scale(0);
    }
    100% {
        transform: rotate(0deg) scale(1);
    }
}

@keyframes badgeGlow {
    0%, 100% {
        filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.6));
    }
    50% {
        filter: drop-shadow(0 0 35px rgba(255, 215, 0, 1));
    }
}

.achievement-claim-title {
    font-size: 24px;
    font-weight: bold;
    color: #FFD700;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.achievement-claim-name {
    font-size: 20px;
    font-weight: bold;
    color: white;
    margin-bottom: 15px;
}

.achievement-claim-description {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin-bottom: 20px;
    padding: 0 10px;
}

.achievement-reward-box {
    background: rgba(255, 215, 0, 0.15);
    border: 2px solid rgba(255, 215, 0, 0.5);
    border-radius: 10px;
    padding: 15px;
    margin: 20px 0;
    font-size: 18px;
    font-weight: bold;
    color: #FFD700;
}

.achievement-claim-btn {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #0d2620;
    border: none;
    border-radius: 12px;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
    transition: all 0.2s ease;
    width: 100%;
    margin-top: 10px;
}

.achievement-claim-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.6);
}

.achievement-claim-btn:active {
    transform: translateY(0);
}

/* Roost Advertisement Overlay - Shows Every Time */
.roost-ad-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100000; /* Highest priority - above everything */
    padding: 20px;
}

.roost-ad-overlay.hidden {
    display: none;
}

.roost-ad-card {
    background: linear-gradient(180deg, #1a4d37 0%, #0d2620 100%);
    border: 6px solid #FFD700;
    border-radius: 20px;
    padding: 30px;
    max-width: 450px;
    width: 95%;
    box-shadow: 0 10px 40px rgba(255, 215, 0, 0.3);
    text-align: center;
    animation: adPulse 2s ease-in-out infinite;
}

@keyframes adPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.roost-ad-image {
    max-width: 100%;
    height: auto;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

.roost-ad-message {
    font-size: 20px;
    font-weight: bold;
    color: white;
    margin-bottom: 15px;
    line-height: 1.4;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.roost-ad-features {
    font-size: 16px;
    color: #FFD700;
    margin-bottom: 25px;
    line-height: 1.6;
}

.roost-ad-button {
    width: 100%;
    padding: 18px;
    font-size: 20px;
    font-weight: bold;
    background: #FFD700;
    color: #1a4d37;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    box-shadow: 0 4px 0 #B8860B;
}

.roost-ad-button:hover {
    background: #FFA500;
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #B8860B;
}

.roost-ad-button:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #B8860B;
}

/* iOS PWA Loading Bar Styles */
.roost-loading-container {
    width: 100%;
    margin: 15px 0;
    text-align: center;
}

.roost-loading-container.hidden {
    display: none;
}

.roost-loading-text {
    color: #FFD700;
    font-size: 16px;
    margin-bottom: 10px;
    font-weight: bold;
}

.roost-loading-bar {
    width: 100%;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #FFD700;
}

.roost-loading-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #FFD700 0%, #FFA500 50%, #FFD700 100%);
    background-size: 200% 100%;
    border-radius: 8px;
    transition: width 0.1s linear;
    animation: loadingShimmer 1.5s ease-in-out infinite;
}

@keyframes loadingShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Roost Video Ad Container */
.roost-video-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
}

.roost-video-container.hidden {
    display: none;
}

.roost-video-container video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-width: 100vw;
    max-height: 100vh;
}

.roost-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.roost-skip-container {
    position: absolute;
    bottom: 80px;
    right: 20px;
    pointer-events: auto;
}

.roost-skip-button {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.roost-skip-button.disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.roost-skip-button:not(.disabled) {
    background: rgba(255, 215, 0, 0.9);
    color: #1a4d37;
    border-color: #FFD700;
}

.roost-skip-button:not(.disabled):hover {
    background: #FFD700;
    transform: scale(1.05);
}

/* Sound Toggle Button - matches skip button style */
.roost-sound-button {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.roost-sound-button:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: #FFD700;
}

.roost-sound-button.sound-on {
    background: rgba(76, 175, 80, 0.8);
    border-color: #4CAF50;
    color: white;
}

.roost-sound-button.sound-on:hover {
    background: rgba(76, 175, 80, 1);
}

.roost-ad-label {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 4px 12px;
    background: rgba(0, 0, 0, 0.6);
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    font-weight: bold;
    border-radius: 4px;
    letter-spacing: 1px;
}

/* When video is showing, hide static card */
.roost-ad-overlay.video-mode .roost-ad-card {
    display: none;
}

/* Cash-Out Congratulations Overlay */
.cashout-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99998;
    padding: 20px;
}

.cashout-overlay.hidden {
    display: none;
}

.cashout-card {
    background: linear-gradient(180deg, #1a4d37 0%, #0d2620 100%);
    border: 4px solid #FFD700;
    border-radius: 20px;
    padding: 40px 30px;
    max-width: 450px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
    animation: bounceIn 0.5s ease-out;
    text-align: center;
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.cashout-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.cashout-title {
    font-size: 32px;
    font-weight: bold;
    color: #FFD700;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.cashout-message {
    color: white;
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 25px;
}

.cashout-amount {
    background: rgba(255, 215, 0, 0.2);
    border: 2px solid #FFD700;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    font-size: 24px;
    font-weight: bold;
    color: #FFD700;
    white-space: nowrap;
}

.cashout-close-btn {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    font-weight: bold;
    background: #FFD700;
    color: #1a4d37;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.cashout-close-btn:hover {
    background: #FFA500;
    transform: scale(1.02);
}

.cashout-close-btn:active {
    transform: scale(0.98);
}

/* ========================================
   WELCOME BACK CARD - Compact Version
   Reduces vertical spacing for better fit on all screens
   ======================================== */
#welcomeCongratsOverlay .cashout-card {
    padding: 20px 24px;
    max-width: 380px;
}

#welcomeCongratsOverlay .cashout-icon {
    margin-bottom: 8px;
}

#welcomeCongratsOverlay .cashout-icon img {
    width: 100px;
    height: 120px;
}

#welcomeCongratsOverlay .cashout-title {
    font-size: 24px;
    margin-bottom: 8px;
}

#welcomeCongratsOverlay .cashout-message {
    font-size: 16px;
    margin-bottom: 8px;
}

#welcomeCongratsOverlay .cashout-amount {
    padding: 10px 15px;
    margin: 6px 0;
    font-size: 20px;
}

#welcomeCongratsOverlay #battleStashSection {
    margin-top: 10px;
    padding: 10px;
}

#welcomeCongratsOverlay .cashout-close-btn {
    padding: 12px;
    font-size: 16px;
    margin-top: 12px;
}

/* ========================================
   NEST MEMBERS OVERLAY - v2.1.46
   ======================================== */
.nest-members-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99997;
    padding: 20px;
}

.nest-members-overlay.hidden {
    display: none;
}

.nest-members-card {
    background: linear-gradient(180deg, #1a4d37 0%, #0d2620 100%);
    border: 4px solid #FFD700;
    border-radius: 20px;
    padding: 0;
    max-width: 450px;
    width: 100%;
    max-height: 85vh;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
    animation: slideUp 0.4s ease-out;
    position: relative;
    display: flex;
    flex-direction: column;
}

@keyframes slideUp {
    0% {
        transform: translateY(100px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.nest-members-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 0, 0, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
    font-size: 24px;
    font-weight: bold;
    color: white;
    line-height: 1;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.nest-members-close:hover {
    background: rgba(220, 0, 0, 1);
    transform: scale(1.1);
}

.nest-members-close:active {
    transform: scale(0.95);
}

.nest-members-header {
    background: rgba(255, 215, 0, 0.1);
    border-bottom: 3px solid #FFD700;
    border-radius: 16px 16px 0 0;
    padding: 20px 20px 15px 20px;
    text-align: center;
}

.nest-members-logo {
    width: 250px;
    height: 184px;
    margin: 0 auto 15px auto;
    display: block;
}

.nest-members-title {
    font-size: 24px;
    font-weight: bold;
    color: #FFD700;
    margin-bottom: 8px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.nest-members-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
}

.nest-members-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    min-height: 200px;
    max-height: calc(85vh - 300px);
}

.nest-members-list-container::-webkit-scrollbar {
    width: 8px;
}

.nest-members-list-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.nest-members-list-container::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.5);
    border-radius: 4px;
}

.nest-members-list-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 215, 0, 0.7);
}

.nest-member-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 215, 0, 0.2);
    border-radius: 12px;
    transition: all 0.2s;
}

.nest-member-row:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.4);
}

.nest-member-row:active {
    background: rgba(255, 215, 0, 0.25);
    border-color: #FFD700;
    transform: scale(0.98);
}

.member-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid #FFD700;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.1);
}

.member-info {
    flex: 1;
    min-width: 0;
}

.member-display-name {
    font-size: 16px;
    font-weight: bold;
    color: white;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.member-username {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.member-creator-badge {
    display: inline-block;
    background: rgba(255, 215, 0, 0.2);
    border: 1px solid #FFD700;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 11px;
    color: #FFD700;
    margin-left: 8px;
    font-weight: bold;
}

.nest-members-footer {
    background: rgba(0, 0, 0, 0.3);
    border-top: 2px solid rgba(255, 215, 0, 0.3);
    padding: 15px 20px;
    border-radius: 0 0 16px 16px;
    display: flex;
    gap: 10px;
}

.nest-members-action-btn {
    flex: 1;
    padding: 12px;
    font-size: 15px;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.nest-members-send-btn {
    background: #FFD700;
    color: #1a4d37;
}

.nest-members-send-btn:hover {
    background: #FFA500;
    transform: scale(1.02);
}

.nest-members-send-btn:disabled {
    background: rgba(255, 215, 0, 0.3);
    color: rgba(255, 255, 255, 0.5);
    cursor: not-allowed;
}

.nest-members-cancel-btn {
    background: rgba(255, 69, 0, 0.3);
    color: #ff6b6b;
    border: 2px solid #ff6b6b;
}

.nest-members-cancel-btn:hover {
    background: rgba(255, 69, 0, 0.5);
}

.nest-members-empty {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
}

.nest-members-count {
    background: rgba(255, 215, 0, 0.2);
    border: 2px solid #FFD700;
    border-radius: 8px;
    padding: 8px 15px;
    margin-bottom: 15px;
    text-align: center;
    color: #FFD700;
    font-weight: bold;
    font-size: 14px;
}

/* ========================================
   MESSAGE COMPOSE DIALOG - Phase 2
   ======================================== */
.message-compose-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99998;
    padding: 20px;
}

.message-compose-overlay.hidden {
    display: none;
}

.message-compose-card {
    background: linear-gradient(180deg, #1a4d37 0%, #0d2620 100%);
    border: 4px solid #FFD700;
    border-radius: 20px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
    animation: slideUp 0.4s ease-out;
    position: relative;
    display: flex;
    flex-direction: column;
}

.message-compose-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 0, 0, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
    font-size: 24px;
    font-weight: bold;
    color: white;
    line-height: 1;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.message-compose-close:hover {
    background: rgba(220, 0, 0, 1);
    transform: scale(1.1);
}

.message-compose-close:active {
    transform: scale(0.95);
}

.message-compose-header {
    background: rgba(255, 215, 0, 0.1);
    border-bottom: 3px solid #FFD700;
    border-radius: 16px 16px 0 0;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.message-compose-nestor {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.message-compose-title {
    font-size: 22px;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.message-compose-recipients {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 4px;
}

.message-compose-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.message-compose-textarea {
    width: 100%;
    min-height: 200px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 12px;
    padding: 15px;
    color: white;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s;
}

.message-compose-textarea:focus {
    outline: none;
    border-color: #FFD700;
}

.message-compose-textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.message-compose-counter {
    margin-top: 10px;
    text-align: right;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
}

.message-compose-counter.warning {
    color: #FFA500;
    font-weight: bold;
}

.message-compose-counter.over-limit {
    color: #ff6b6b;
    font-weight: bold;
}

.message-compose-limits-info {
    background: rgba(255, 215, 0, 0.1);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    padding: 12px;
    margin-top: 15px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
}

.message-compose-limits-info strong {
    color: #FFD700;
}

.message-compose-footer {
    background: rgba(0, 0, 0, 0.3);
    border-top: 2px solid rgba(255, 215, 0, 0.3);
    padding: 15px 20px;
    border-radius: 0 0 16px 16px;
    display: flex;
    gap: 10px;
}

.message-compose-btn {
    flex: 1;
    padding: 14px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.message-compose-send-btn {
    background: #FFD700;
    color: #1a4d37;
}

.message-compose-send-btn:hover {
    background: #FFA500;
    transform: scale(1.02);
}

.message-compose-send-btn:disabled {
    background: rgba(255, 215, 0, 0.3);
    color: rgba(255, 255, 255, 0.5);
    cursor: not-allowed;
}

.message-compose-cancel-btn {
    background: rgba(255, 69, 0, 0.3);
    color: #ff6b6b;
    border: 2px solid #ff6b6b;
}

.message-compose-cancel-btn:hover {
    background: rgba(255, 69, 0, 0.5);
}

/* Helper Bubble Styles */
.helper-bubble {
    position: absolute;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(26, 77, 55, 0.98);
    border: 3px solid #FFD700;
    border-radius: 15px;
    padding: 15px;
    max-width: 90%;
    width: 400px;
    z-index: 10;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
    animation: bubbleAppear 0.4s ease-out;
}

@keyframes bubbleAppear {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.helper-bubble.hidden {
    display: none;
}

.helper-bubble-close {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #ff0000;
    border: 2px solid white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    color: white;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

.helper-bubble-close:hover {
    background: #cc0000;
    transform: scale(1.1);
}

.helper-bubble-close:active {
    transform: scale(0.95);
}

.helper-bubble-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
}

/* ========================================
   NESTOR MAIL NOTIFICATION BUBBLE
   ======================================== */
.nestor-mail-bubble {
    position: fixed;
    top: calc(17vh + 60px);
    right: max(10px, calc(50% - 310px));
    width: 120px;
    height: 120px;
    z-index: 99999;
    cursor: pointer;
    transition: transform 0.2s;
    animation: slideInFromRight 0.6s ease-out, mailPulse 2s infinite;
}

@keyframes slideInFromRight {
    0% {
        transform: translateX(150px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes mailPulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
    }
    50% {
        transform: scale(1.08);
        filter: drop-shadow(0 0 16px rgba(255, 215, 0, 0.9));
    }
}

.nestor-mail-bubble:hover {
    transform: scale(1.1);
}

.nestor-mail-bubble:active {
    transform: scale(0.95);
}

.nestor-mail-bubble.hidden {
    display: none;
}

.nestor-mail-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.nestor-mail-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff0000;
    color: white;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* ========================================
   POLLY POLL NOTIFICATION BUBBLE
   ======================================== */
.polly-poll-bubble {
    position: fixed;
    top: calc(17vh + 60px);
    left: max(10px, calc(50% - 310px));
    width: 120px;
    height: 120px;
    z-index: 99999;
    cursor: pointer;
    transition: transform 0.2s;
    animation: slideInFromLeft 0.6s ease-out, pollyPulse 2s infinite;
}

@keyframes slideInFromLeft {
    0% {
        transform: translateX(-150px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes pollyPulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 8px rgba(76, 175, 80, 0.6));
    }
    50% {
        transform: scale(1.08);
        filter: drop-shadow(0 0 16px rgba(76, 175, 80, 0.9));
    }
}

/* Purple pulse for unvoted poll cards */
@keyframes pollPulse {
    0%, 100% {
        box-shadow: 0 0 5px rgba(153, 50, 204, 0.4);
    }
    50% {
        box-shadow: 0 0 15px rgba(153, 50, 204, 0.8);
    }
}

.polly-poll-bubble:hover {
    transform: scale(1.1);
}

.polly-poll-bubble:active {
    transform: scale(0.95);
}

.polly-poll-bubble.hidden {
    display: none;
}

.polly-poll-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.polly-poll-badge {
    position: absolute;
    bottom: -5px;
    right: -5px;
    background: #ff0000;
    color: white;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* ========================================
   POLLING STATION HUB OVERLAY
   ======================================== */
.polling-station-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100000;
    padding: 20px;
}

.polling-station-overlay.hidden {
    display: none;
}

.polling-station-card {
    background: linear-gradient(180deg, #1a4d37 0%, #0d2620 100%);
    border: 4px solid #4CAF50;
    border-radius: 20px;
    padding: 25px;
    max-width: 400px;
    width: 95%;
    text-align: center;
    box-shadow: 0 0 30px rgba(76, 175, 80, 0.4);
    animation: pollingStationPopIn 0.4s ease-out;
}

@keyframes pollingStationPopIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.polling-station-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.polling-station-polly {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 10px rgba(76, 175, 80, 0.6));
}

.polling-station-title {
    font-size: 22px;
    font-weight: bold;
    color: #4CAF50;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.polling-station-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.polling-station-btn {
    position: relative;
    background: linear-gradient(180deg, rgba(76, 175, 80, 0.3) 0%, rgba(76, 175, 80, 0.1) 100%);
    border: 2px solid #4CAF50;
    border-radius: 15px;
    padding: 20px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.polling-station-btn:hover {
    background: linear-gradient(180deg, rgba(76, 175, 80, 0.5) 0%, rgba(76, 175, 80, 0.2) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.polling-station-btn:active {
    transform: translateY(0);
}

.polling-station-btn-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.polling-station-btn-label {
    font-size: 14px;
    font-weight: bold;
    color: white;
}

.polling-station-btn-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff0000;
    color: white;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    animation: badgePulse 1.5s infinite;
}

.polling-station-btn-badge.hidden {
    display: none;
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.polling-station-close {
    width: 100%;
    padding: 15px;
    background: rgba(76, 175, 80, 0.2);
    border: 2px solid #4CAF50;
    border-radius: 12px;
    color: #4CAF50;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.polling-station-close:hover {
    background: rgba(76, 175, 80, 0.4);
}

/* ========================================
   MESSAGE INBOX OVERLAY
   ======================================== */
.message-inbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99998;
    padding: 20px;
}

.message-inbox-overlay.hidden {
    display: none;
}

.message-inbox-card {
    background: linear-gradient(180deg, #1a4d37 0%, #0d2620 100%);
    border: 4px solid #FFD700;
    border-radius: 20px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
    animation: slideUp 0.4s ease-out;
    position: relative;
    display: flex;
    flex-direction: column;
}

.message-inbox-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 0, 0, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
    font-size: 24px;
    font-weight: bold;
    color: white;
    line-height: 1;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.message-inbox-close:hover {
    background: rgba(220, 0, 0, 1);
    transform: scale(1.1);
}

.message-inbox-close:active {
    transform: scale(0.95);
}

.message-inbox-header {
    background: rgba(255, 215, 0, 0.1);
    border-bottom: 3px solid #FFD700;
    border-radius: 16px 16px 0 0;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.message-inbox-nestor {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.message-inbox-title {
    font-size: 22px;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.message-inbox-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.message-inbox-list::-webkit-scrollbar {
    width: 8px;
}

.message-inbox-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.message-inbox-list::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.5);
    border-radius: 4px;
}

.message-inbox-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 215, 0, 0.7);
}

.message-item {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 15px;
    align-items: center;
}

.message-item:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: #FFD700;
    transform: translateX(5px);
}

.message-item-sender {
    font-size: 16px;
    font-weight: bold;
    color: #FFD700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.message-item-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #FFD700;
}

.message-item-timestamp {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    text-align: right;
}

.message-item-preview {
    grid-column: 1 / -1;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-reading-view {
    padding: 20px;
    display: none;
}

.message-reading-view.active {
    display: block;
}

.message-reading-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(255, 215, 0, 0.3);
}

.message-reading-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid #FFD700;
}

.message-reading-sender-info {
    flex: 1;
}

.message-reading-sender-name {
    font-size: 18px;
    font-weight: bold;
    color: #FFD700;
}

.message-reading-timestamp {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 4px;
}

.message-reading-nestor {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.message-reading-content {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 215, 0, 0.2);
    border-radius: 12px;
    padding: 20px;
    color: white;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 20px;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 300px;
    overflow-y: auto;
}

.message-reading-actions {
    display: flex;
    gap: 10px;
}

.message-reading-btn {
    flex: 1;
    padding: 14px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.message-trash-btn {
    background: #ff0000;
    color: white;
}

.message-trash-btn:hover {
    background: #cc0000;
    transform: scale(1.02);
}

.message-trash-btn:active {
    transform: scale(0.98);
}

.message-back-btn {
    background: rgba(255, 215, 0, 0.3);
    color: #FFD700;
    border: 2px solid #FFD700;
}

.message-back-btn:hover {
    background: rgba(255, 215, 0, 0.5);
}

.message-reply-btn {
    background: rgba(34, 197, 94, 0.3);
    color: #22c55e;
    border: 2px solid #22c55e;
}

.message-reply-btn:hover {
    background: rgba(34, 197, 94, 0.5);
}

/* Quoted Message in Compose */
.message-compose-quote {
    background: rgba(255, 215, 0, 0.1);
    border-left: 4px solid #FFD700;
    border-radius: 0 8px 8px 0;
    padding: 12px;
    margin-bottom: 12px;
    max-height: 120px;
    overflow-y: auto;
}

.message-quote-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.message-quote-label {
    font-size: 12px;
    color: #FFD700;
    font-weight: bold;
    text-transform: uppercase;
}

.message-quote-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
}

.message-quote-close:hover {
    color: white;
}

.message-quote-content {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
    line-height: 1.4;
}

.message-inbox-empty {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
}

.message-inbox-empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* ========================================
   ANDROID/SAMSUNG SPECIFIC FIXES
   ======================================== */

/* Android device adjustments */
body.android-device .app-container {
    max-width: 100vw !important;
    padding-left: 8px;
    padding-right: 8px;
}

/* Use CSS variable for vh on Android */
body.android-device {
    height: calc(var(--vh, 1vh) * 100);
}

body.android-device .app-container {
    height: calc(var(--vh, 1vh) * 100);
}

/* Ensure proper scaling on Samsung devices */
body.samsung-device {
    font-size: 16px;
}

/* Fix for tall aspect ratios (Samsung S25 is 20:9) */
@media (min-aspect-ratio: 19/9) {
    .app-container {
        max-width: 100vw;
    }
    
    /* Better vertical distribution for tall screens */
    .row-4 {
        max-height: 38vh;
        margin-top: calc(4vh + 130px);
    }
    
    .row-3 .request-box {
        top: 118px;
    }
    
    .caption-box {
        font-size: 14px;
    }
    
    .row-6 {
        margin-bottom: 15px;
    }
    
    .row-7 {
        margin-bottom: 10px;
        padding-bottom: 15px;
    }
}

/* Prevent zoom on inputs for Android */
body.android-device input,
body.android-device select,
body.android-device textarea {
    font-size: 16px !important;
}

/* ========================================
   DEVICE-SPECIFIC OVERRIDES (HIGHEST PRIORITY)
   These rules override all generic media queries
   ======================================== */

/* ----------------------------------------
   SAMSUNG GALAXY S25+ (TESTED - MUCH IMPROVED)
   3120 × 1440 (varies by zoom, DPR varies)
   ---------------------------------------- */
body.galaxy-s25-plus {
    --viewport-shift-up: 35px;  /* Reclaim request_box space */
}

body.galaxy-s25-plus .app-container {
    padding-top: max(5px, env(safe-area-inset-top));
    padding-bottom: max(5px, env(safe-area-inset-bottom));
}

body.galaxy-s25-plus .row-0 {
    height: 2vh;
    min-height: 20px;
    margin-bottom: 2px;
    margin-top: 11px;  /* DOWN 4px from 7px */
}

body.galaxy-s25-plus .menu-button img {
    height: 28px;
}

body.galaxy-s25-plus .row-2 {
    height: 4vh;
    margin-top: 99px !important;  /* DOWN 20px to reveal ticker-tab */
    margin-bottom: 0px;
}

body.galaxy-s25-plus .ticker-text {
    font-size: 18px !important;
    padding: 8px 15px;
}

body.galaxy-s25-plus .row-2-5 {
    height: 7vh;
    margin-top: 6px;  /* DOWN 6px from 0px */
    margin-bottom: 10px;
}

body.galaxy-s25-plus .nest-label {
    font-size: 11px !important;
    margin-bottom: 5px !important;
    margin-top: 3px !important;  /* DOWN 6px from -3px */
}

body.galaxy-s25-plus .camera-button-container {
    padding-top: 19px !important;
}

body.galaxy-s25-plus .row-3 .request-box {
    top: 40px !important;
    font-size: 15px;
    min-height: 25px;
    padding: 6px 12px;
}

body.galaxy-s25-plus .row-4 {
    min-height: 24vh !important;
    max-height: 35vh !important;
    margin-top: calc(2vh + 51px - var(--viewport-shift-up)) !important;  /* DOWN 6px from 45px */
    margin-bottom: 0px !important;
}

body.galaxy-s25-plus .viewport-circle {
    width: 106% !important;  /* Enlarged 20% from 88% */
    max-width: 413px !important;  /* Enlarged 20% from 344px */
    position: relative;  /* Anchor for absolute child */
    aspect-ratio: 1;  /* Force perfect circle */
}

body.galaxy-s25-plus .viewport-content {
    position: absolute;  /* CRITICAL: Prevents portrait photos from affecting parent layout */
    top: 2.5%;
    left: 2.5%;
    width: 95%;
    height: 95%;
    border-radius: 50%;
    overflow: hidden;
}

body.galaxy-s25-plus .viewport-content img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

body.galaxy-s25-plus .avatar-display {
    width: 100px !important;
    height: 150px !important;
}

body.galaxy-s25-plus .viewport-content img[src^="avatars_viewport/uav"] {
    width: 105% !important;
    height: 105% !important;
    max-width: 105% !important;
    max-height: 105% !important;
}

body.galaxy-s25-plus .viewport-content img.button-display {
    max-width: 52.5% !important;
    max-height: 52.5% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    margin-top: -18px !important;
}

body.galaxy-s25-plus .caption-box {
    font-size: 17px;
    min-height: 48px;
    padding: 6px 12px;
}

body.galaxy-s25-plus .row-6 {
    height: calc(4vh + 5px) !important;
    margin-top: auto !important;
    margin-bottom: 7px !important;
}

body.galaxy-s25-plus .bottom-ticker-text {
    font-size: 18px !important;
    padding: 8px 15px;
}

body.galaxy-s25-plus .row-7 {
    height: 7vh !important;
    margin-top: 8px !important;
    gap: 3px !important;
    padding-bottom: 8px !important;
    margin-bottom: 9px !important;
    justify-items: center !important;
    transform: translateY(-6px);  /* UP 6px */
}

body.galaxy-s25-plus .action-button {
    width: 24% !important;
    min-width: 72px !important;
}

body.galaxy-s25-plus .action-button img {
    max-width: 100%;
    max-height: 100%;
}

body.galaxy-s25-plus .token-counter {
    font-size: 13px !important;
    min-width: 80px !important;
    max-width: 80px !important;
    padding: 3px 6px !important;
    text-align: center !important;
    margin-top: -6px !important;
}

body.galaxy-s25-plus .gem-counter {
    font-size: 13px !important;
    min-width: 80px !important;
    max-width: 80px !important;
    padding: 3px 6px !important;
    text-align: center !important;
}

body.galaxy-s25-plus .spinning-coin img {
    height: 32px;
}

body.galaxy-s25-plus .spinning-coin {
    margin-top: -4px !important;
}

body.galaxy-s25-plus .my-nest-egg {
    justify-content: center !important;
    text-align: center !important;
    padding: 0 !important;
    transform: translateX(-50%) translateY(22px) !important;  /* DOWN 22px (19+3) */
}

body.galaxy-s25-plus .my-nest-egg img {
    height: 76px !important;  /* Reduced 10% from 84px */
    max-height: 76px !important;
}

body.galaxy-s25-plus .ticker-tab {
    height: calc((2vh + 4px) * 1.616484375) !important;
    width: calc((4.2vh + 8.4px) * 1.616484375) !important;
    top: calc(-1 * calc((2vh + 4px) * 1.616484375)) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
}

/* ----------------------------------------
   SAMSUNG GALAXY S24+ (BASELINE)
   3120 × 1440 (same as S25+)
   Uses S25+ baseline with minor adjustments
   ---------------------------------------- */
body.galaxy-s24-plus {
    --viewport-shift-up: 35px;  /* Reclaim request_box space */
}

body.galaxy-s24-plus .app-container {
    padding-top: max(5px, env(safe-area-inset-top));
    padding-bottom: max(5px, env(safe-area-inset-bottom));
}

body.galaxy-s24-plus .row-0 {
    height: 2vh;
    min-height: 20px;
    margin-bottom: 2px;
    margin-top: 3px;
}

body.galaxy-s24-plus .menu-button img {
    height: 28px;
}

body.galaxy-s24-plus .row-2 {
    height: 4vh;
    margin-top: 70px;
    margin-bottom: 0px;
}

body.galaxy-s24-plus .ticker-text {
    font-size: 12px;
    padding: 8px 15px;
}

body.galaxy-s24-plus .row-2-5 {
    height: 7vh;
    margin-top: 18px;
    margin-bottom: 10px;
}

body.galaxy-s24-plus .nest-label {
    font-size: 11px;
    margin-bottom: 5px;
    margin-top: -14px;
}

body.galaxy-s24-plus .row-3 .request-box {
    top: 60px;
    font-size: 15px;
    min-height: 25px;
    padding: 6px 12px;
}

body.galaxy-s24-plus .row-4 {
    min-height: 24vh;
    max-height: 30vh;
    margin-top: calc(2vh + 105px - var(--viewport-shift-up));
    margin-bottom: 0px;
}

body.galaxy-s24-plus .viewport-circle {
    width: 113%;
    max-width: 438px;
    aspect-ratio: 1 !important;
    position: relative;  /* Anchor for absolute child */
}

body.galaxy-s24-plus .viewport-content {
    position: absolute;  /* CRITICAL: Prevents portrait photos from affecting parent layout */
    top: 2.5%;
    left: 2.5%;
    width: 95%;
    height: 95%;
    border-radius: 50%;
    overflow: hidden;
}

body.galaxy-s24-plus .viewport-content img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

body.galaxy-s24-plus .caption-box {
    font-size: 17px;
    min-height: 48px;
    padding: 6px 12px;
}

body.galaxy-s24-plus .row-6 {
    height: 4vh;
    margin-top: auto;
    margin-bottom: 27px;
}

body.galaxy-s24-plus .bottom-ticker-text {
    font-size: 12px;
    padding: 8px 15px;
}

body.galaxy-s24-plus .row-7 {
    height: 7vh;
    margin-top: 8px;
    gap: 3px;
    padding-bottom: 8px;
    margin-bottom: 5px;
}

body.galaxy-s24-plus .action-button {
    width: 20%;
    min-width: 72px;
}

body.galaxy-s24-plus .action-button img {
    max-width: 100%;
    max-height: 100%;
}

body.galaxy-s24-plus .token-counter {
    font-size: 23px;
    min-width: 100px;
    max-width: 100px;
    text-align: center;
}

body.galaxy-s24-plus .gem-counter {
    font-size: 23px;
    min-width: 100px;
    max-width: 100px;
    text-align: center;
}

body.galaxy-s24-plus .spinning-coin img {
    height: 32px;
}

body.galaxy-s24-plus .my-nest-egg img {
    height: 106px;
}

body.galaxy-s24-plus .ticker-tab {
    height: calc((2vh + 4px) * 1.71875) !important;
    width: calc((4.2vh + 8.4px) * 1.71875) !important;
    top: calc(-1 * calc((2vh + 4px) * 1.71875)) !important;
}

/* ----------------------------------------
   SAMSUNG GALAXY S24 ULTRA
   3120 × 1440 physical (384 × 824 logical, DPR 3.75)
   6.8" screen - larger than S24+ with similar aspect ratio
   Based on S24+ baseline with adjustments for wider viewport
   ---------------------------------------- */
body.galaxy-s24-ultra {
    --viewport-shift-up: 65px;
}

body.galaxy-s24-ultra .app-container {
    padding-top: max(5px, env(safe-area-inset-top));
    padding-bottom: max(5px, env(safe-area-inset-bottom));
}

body.galaxy-s24-ultra .row-0 {
    height: 2vh;
    min-height: 20px;
    margin-bottom: 2px;
    margin-top: 3px;
}

body.galaxy-s24-ultra .my-nest-egg {
    transform: translateX(-50%) translateY(15px) !important;
}

body.galaxy-s24-ultra .menu-button img {
    height: 28px;
}

body.galaxy-s24-ultra .row-2 {
    height: 4vh;
    margin-top: 70px;
    margin-bottom: 0px;
}

body.galaxy-s24-ultra .ticker-text {
    font-size: 12px;
    padding: 8px 15px;
}

body.galaxy-s24-ultra .row-2-5 {
    height: 7vh;
    margin-top: 24px;  /* DOWN 6px from 18px */
    margin-bottom: 10px;
}

body.galaxy-s24-ultra .nest-label {
    font-size: 11px;
    margin-bottom: 5px;
    margin-top: -8px;  /* DOWN 6px from -14px */
}

body.galaxy-s24-ultra .row-3 .request-box {
    top: 60px;
    font-size: 15px;
    min-height: 25px;
    padding: 6px 12px;
}

body.galaxy-s24-ultra .row-4 {
    margin-top: calc(3vh + 27px - var(--viewport-shift-up)) !important;  /* DOWN 6px from 21px */
}

body.galaxy-s24-ultra .viewport-circle {
    width: 100%;
    max-width: 380px;
    aspect-ratio: 1;
    position: relative;  /* Anchor for absolute child */
}

body.galaxy-s24-ultra .viewport-content {
    position: absolute;  /* CRITICAL: Prevents portrait photos from affecting parent layout */
    top: 2.5%;
    left: 2.5%;
    width: 95%;
    height: 95%;
    border-radius: 50%;
    overflow: hidden;
}

body.galaxy-s24-ultra .viewport-content img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

body.galaxy-s24-ultra .avatar-display {
    width: 100px !important;
    height: 150px !important;
}

body.galaxy-s24-ultra .viewport-content img[src^="avatars_viewport/uav"] {
    width: 100%;
    height: 100%;
}

body.galaxy-s24-ultra .viewport-content img.button-display {
    /* Inherit base styles */
}

body.galaxy-s24-ultra .caption-box {
    font-size: 17px;
    min-height: 48px;
    padding: 6px 12px;
}

body.galaxy-s24-ultra .row-6 {
    height: 4vh;
    margin-top: auto;
    margin-bottom: 27px;
    transform: translateY(-15px);
}

body.galaxy-s24-ultra .bottom-ticker-text {
    font-size: 12px;
    padding: 8px 15px;
}

body.galaxy-s24-ultra .row-7 {
    height: 7vh;
    margin-top: 8px;
    gap: 3px;
    padding-bottom: 8px;
    margin-bottom: 5px;
    transform: translateY(-15px);
}

body.galaxy-s24-ultra .action-button {
    width: 20%;
    min-width: 72px;
}

body.galaxy-s24-ultra .action-button img {
    max-width: 100%;
    max-height: 100%;
}

body.galaxy-s24-ultra .token-counter {
    font-size: 23px;
    min-width: 100px;
    max-width: 100px;
    text-align: center;
}

body.galaxy-s24-ultra .gem-counter {
    font-size: 23px;
    min-width: 100px;
    max-width: 100px;
    text-align: center;
}

body.galaxy-s24-ultra .spinning-coin img {
    height: 32px;
}

body.galaxy-s24-ultra .my-nest-egg img {
    height: 90px;
}

body.galaxy-s24-ultra .ticker-tab {
    height: calc((2vh + 4px) * 1.71875) !important;
    width: calc((4.2vh + 8.4px) * 1.71875) !important;
    top: calc(-1 * calc((2vh + 4px) * 1.71875)) !important;
}

/* ----------------------------------------
   SAMSUNG GALAXY S25 ULTRA
   3120 × 1440 physical (384 × 824 logical, DPR 3.75)
   6.9" screen - newest Samsung flagship, based on S24 Ultra
   ---------------------------------------- */
body.galaxy-s25-ultra {
    --viewport-shift-up: 35px;
}

body.galaxy-s25-ultra .app-container {
    padding-top: max(5px, env(safe-area-inset-top));
    padding-bottom: max(5px, env(safe-area-inset-bottom));
}

body.galaxy-s25-ultra .row-0 {
    height: 2vh;
    min-height: 20px;
    margin-bottom: 2px;
    margin-top: 3px;
}

body.galaxy-s25-ultra .menu-button img {
    height: 28px;
}

body.galaxy-s25-ultra .row-2 {
    height: 4vh;
    margin-top: 70px;
    margin-bottom: 0px;
}

body.galaxy-s25-ultra .ticker-text {
    font-size: 12px;
    padding: 8px 15px;
}

body.galaxy-s25-ultra .row-2-5 {
    height: 7vh;
    margin-top: 18px;
    margin-bottom: 10px;
}

body.galaxy-s25-ultra .nest-label {
    font-size: 11px;
    margin-bottom: 5px;
    margin-top: -14px;
}

body.galaxy-s25-ultra .row-3 .request-box {
    top: 60px;
    font-size: 15px;
    min-height: 25px;
    padding: 6px 12px;
}

body.galaxy-s25-ultra .row-4 {
    min-height: 24vh;
    max-height: 30vh;
    margin-top: calc(2vh + 105px - var(--viewport-shift-up));
    margin-bottom: 0px;
}

body.galaxy-s25-ultra .viewport-circle {
    width: 110%;
    max-width: 420px;
    aspect-ratio: 1 !important;
    position: relative;  /* Anchor for absolute child */
}

body.galaxy-s25-ultra .viewport-content {
    position: absolute;  /* CRITICAL: Prevents portrait photos from affecting parent layout */
    top: 2.5%;
    left: 2.5%;
    width: 95%;
    height: 95%;
    border-radius: 50%;
    overflow: hidden;
}

body.galaxy-s25-ultra .viewport-content img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

body.galaxy-s25-ultra .avatar-display {
    width: 100px !important;
    height: 150px !important;
}

body.galaxy-s25-ultra .viewport-content img[src^="avatars_viewport/uav"] {
    width: 100%;
    height: 100%;
}

body.galaxy-s25-ultra .viewport-content img.button-display {
    max-width: 55% !important;
    max-height: 55% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    margin-top: -18px !important;
}

body.galaxy-s25-ultra .caption-box {
    font-size: 17px;
    min-height: 48px;
    padding: 6px 12px;
}

body.galaxy-s25-ultra .row-6 {
    height: 4vh;
    margin-top: auto;
    margin-bottom: 27px;
}

body.galaxy-s25-ultra .bottom-ticker-text {
    font-size: 12px;
    padding: 8px 15px;
}

body.galaxy-s25-ultra .row-7 {
    height: 7vh;
    margin-top: 8px;
    gap: 3px;
    padding-bottom: 8px;
    margin-bottom: 5px;
}

body.galaxy-s25-ultra .action-button {
    width: 20%;
    min-width: 72px;
}

body.galaxy-s25-ultra .action-button img {
    max-width: 100%;
    max-height: 100%;
}

body.galaxy-s25-ultra .token-counter {
    font-size: 23px;
    min-width: 100px;
    max-width: 100px;
    text-align: center;
}

body.galaxy-s25-ultra .gem-counter {
    font-size: 23px;
    min-width: 100px;
    max-width: 100px;
    text-align: center;
}

body.galaxy-s25-ultra .spinning-coin img {
    height: 32px;
}

body.galaxy-s25-ultra .my-nest-egg img {
    height: 106px;
}

body.galaxy-s25-ultra .ticker-tab {
    height: calc((2vh + 4px) * 1.71875) !important;
    width: calc((4.2vh + 8.4px) * 1.71875) !important;
    top: calc(-1 * calc((2vh + 4px) * 1.71875)) !important;
}

/* ----------------------------------------
   SAMSUNG GALAXY S25
   2340 × 1080 physical (360 × 780 logical, DPR 3)
   6.2" screen - standard S25, based on Galaxy S24
   ---------------------------------------- */
body.galaxy-s25 {
    --viewport-shift-up: 30px;
}

body.galaxy-s25 .app-container {
    padding-top: max(5px, env(safe-area-inset-top));
    padding-bottom: max(5px, env(safe-area-inset-bottom));
}

body.galaxy-s25 .row-0 {
    height: 2vh;
    min-height: 18px;
    margin-bottom: 2px;
    margin-top: 2px;
}

body.galaxy-s25 .menu-button img {
    height: 26px;
}

body.galaxy-s25 .row-2 {
    height: 3.5vh;
    margin-top: 60px;
    margin-bottom: 0px;
}

body.galaxy-s25 .ticker-text {
    font-size: 11px;
    padding: 6px 12px;
}

body.galaxy-s25 .row-2-5 {
    height: 6vh;
    margin-top: 15px;
    margin-bottom: 8px;
}

body.galaxy-s25 .nest-label {
    font-size: 10px;
    margin-bottom: 4px;
    margin-top: -12px;
}

body.galaxy-s25 .camera-button-container {
    transform: scale(0.95);
}

body.galaxy-s25 .row-3 .request-box {
    top: 55px;
    font-size: 14px;
    min-height: 23px;
    padding: 5px 10px;
}

body.galaxy-s25 .row-4 {
    min-height: 22vh;
    max-height: 28vh;
    margin-top: calc(2vh + 90px - var(--viewport-shift-up));
    margin-bottom: 0px;
}

body.galaxy-s25 .viewport-circle {
    width: 115%;
    max-width: 396px;
    aspect-ratio: 1 !important;
    position: relative;  /* Anchor for absolute child */
}

body.galaxy-s25 .viewport-content {
    position: absolute;  /* CRITICAL: Prevents portrait photos from affecting parent layout */
    top: 2.5%;
    left: 2.5%;
    width: 95%;
    height: 95%;
    border-radius: 50%;
    overflow: hidden;
}

body.galaxy-s25 .viewport-content img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

body.galaxy-s25 .avatar-display {
    transform: scale(0.97);
}

body.galaxy-s25 .viewport-content img[src^="avatars_viewport/uav"] {
    width: 100%;
    height: 100%;
}

body.galaxy-s25 .viewport-content img.button-display {
    max-width: 60%;
    max-height: 60%;
    width: auto;
    height: auto;
    object-fit: contain;
}

body.galaxy-s25 .caption-box {
    font-size: 15px;
    min-height: 42px;
    padding: 5px 10px;
}

body.galaxy-s25 .row-6 {
    height: 3.5vh;
    margin-top: auto;
    margin-bottom: 22px;
}

body.galaxy-s25 .bottom-ticker-text {
    font-size: 11px;
    padding: 6px 12px;
}

body.galaxy-s25 .row-7 {
    height: 6vh;
    margin-top: 6px;
    gap: 2px;
    padding-bottom: 6px;
    margin-bottom: 4px;
}

body.galaxy-s25 .action-button {
    width: 19%;
    min-width: 65px;
}

body.galaxy-s25 .action-button img {
    max-width: 100%;
    max-height: 100%;
}

body.galaxy-s25 .token-counter {
    font-size: 20px;
    min-width: 88px;
    max-width: 88px;
    text-align: center;
}

body.galaxy-s25 .gem-counter {
    font-size: 20px;
    min-width: 88px;
    max-width: 88px;
    text-align: center;
}

body.galaxy-s25 .spinning-coin img {
    height: 28px;
}

body.galaxy-s25 .spinning-coin {
    margin-right: 2px;
}

body.galaxy-s25 .gem-icon {
    margin-right: 2px;
}

body.galaxy-s25 .my-nest-egg {
    transform: scale(0.95);
}

body.galaxy-s25 .my-nest-egg img {
    height: 92px;
}

body.galaxy-s25 .ticker-tab {
    height: calc((2vh + 4px) * 1.6) !important;
    width: calc((4.2vh + 8.4px) * 1.6) !important;
    top: calc(-1 * calc((2vh + 4px) * 1.6)) !important;
}

/* ----------------------------------------
   SAMSUNG GALAXY A55
   2340 × 1080 physical (384 × 854 logical, DPR 2.625)
   6.6" screen - budget Samsung, high market share for families
   ---------------------------------------- */
body.galaxy-a55 {
    --viewport-shift-up: 32px;
}

body.galaxy-a55 .app-container {
    padding-top: max(5px, env(safe-area-inset-top));
    padding-bottom: max(5px, env(safe-area-inset-bottom));
}

body.galaxy-a55 .row-0 {
    height: 2vh;
    min-height: 18px;
    margin-bottom: 2px;
    margin-top: 2px;
}

body.galaxy-a55 .menu-button img {
    height: 26px;
}

body.galaxy-a55 .row-2 {
    height: 3.5vh;
    margin-top: 62px;
    margin-bottom: 0px;
}

body.galaxy-a55 .ticker-text {
    font-size: 11px;
    padding: 7px 13px;
}

body.galaxy-a55 .row-2-5 {
    height: 6.5vh;
    margin-top: 16px;
    margin-bottom: 9px;
}

body.galaxy-a55 .nest-label {
    font-size: 10px;
    margin-bottom: 4px;
    margin-top: -12px;
}

body.galaxy-a55 .camera-button-container {
    transform: scale(0.96);
}

body.galaxy-a55 .row-3 .request-box {
    top: 56px;
    font-size: 14px;
    min-height: 23px;
    padding: 5px 10px;
}

body.galaxy-a55 .row-4 {
    min-height: 23vh;
    max-height: 29vh;
    margin-top: calc(2vh + 95px - var(--viewport-shift-up));
    margin-bottom: 0px;
}

body.galaxy-a55 .viewport-circle {
    width: 108%;
    max-width: 400px;
    aspect-ratio: 1 !important;
    position: relative;  /* Anchor for absolute child */
}

body.galaxy-a55 .viewport-content {
    position: absolute;  /* CRITICAL: Prevents portrait photos from affecting parent layout */
    top: 2.5%;
    left: 2.5%;
    width: 95%;
    height: 95%;
    border-radius: 50%;
    overflow: hidden;
}

body.galaxy-a55 .viewport-content img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

body.galaxy-a55 .avatar-display {
    transform: scale(0.97);
}

body.galaxy-a55 .viewport-content img[src^="avatars_viewport/uav"] {
    width: 100%;
    height: 100%;
}

body.galaxy-a55 .viewport-content img.button-display {
    max-width: 58%;
    max-height: 58%;
    width: auto;
    height: auto;
    object-fit: contain;
}

body.galaxy-a55 .caption-box {
    font-size: 15px;
    min-height: 44px;
    padding: 5px 10px;
}

body.galaxy-a55 .row-6 {
    height: 3.5vh;
    margin-top: auto;
    margin-bottom: 24px;
}

body.galaxy-a55 .bottom-ticker-text {
    font-size: 11px;
    padding: 7px 13px;
}

body.galaxy-a55 .row-7 {
    height: 6.5vh;
    margin-top: 7px;
    gap: 2px;
    padding-bottom: 7px;
    margin-bottom: 4px;
}

body.galaxy-a55 .action-button {
    width: 19%;
    min-width: 68px;
}

body.galaxy-a55 .action-button img {
    max-width: 100%;
    max-height: 100%;
}

body.galaxy-a55 .token-counter {
    font-size: 21px;
    min-width: 90px;
    max-width: 90px;
    text-align: center;
}

body.galaxy-a55 .gem-counter {
    font-size: 21px;
    min-width: 90px;
    max-width: 90px;
    text-align: center;
}

body.galaxy-a55 .spinning-coin img {
    height: 29px;
}

body.galaxy-a55 .spinning-coin {
    margin-right: 2px;
}

body.galaxy-a55 .gem-icon {
    margin-right: 2px;
}

body.galaxy-a55 .my-nest-egg {
    transform: scale(0.96);
}

body.galaxy-a55 .my-nest-egg img {
    height: 94px;
}

body.galaxy-a55 .ticker-tab {
    height: calc((2vh + 4px) * 1.65) !important;
    width: calc((4.2vh + 8.4px) * 1.65) !important;
    top: calc(-1 * calc((2vh + 4px) * 1.65)) !important;
}

/* ----------------------------------------
   SAMSUNG GALAXY A35
   2340 × 1080 physical (384 × 832 logical, DPR ~2.625)
   Shorter than A55 (854) by 22px - needs more aggressive viewport shift
   ---------------------------------------- */
body.galaxy-a35 {
    --viewport-shift-up: 55px;  /* UP from 32px - shorter screen needs more shift */
}

body.galaxy-a35 .app-container {
    padding-top: max(5px, env(safe-area-inset-top));
    padding-bottom: max(20px, env(safe-area-inset-bottom));  /* Push content up from bottom edge */
}

body.galaxy-a35 .row-0 {
    height: 2vh;
    min-height: 18px;
    margin-bottom: 2px;
    margin-top: 2px;
    position: relative;  /* Anchor for absolute positioned logo */
}

body.galaxy-a35 .menu-button img {
    height: 26px;
}

body.galaxy-a35 #debug-badge {
    top: 71px !important;  /* DOWN 6px from default 65px */
}

body.galaxy-a35 .row-2 {
    height: 3.5vh;
    margin-top: 88px;  /* DOWN more so ticker-tab bottom rests on top border (was 70px) */
    margin-bottom: 0px;
}

body.galaxy-a35 .ticker-text {
    font-size: 11px;
    padding: 7px 13px;
}

body.galaxy-a35 .row-2-5 {
    height: 6.5vh;
    margin-top: 16px;  /* BACK to A55 baseline */
    margin-bottom: 9px;
}

body.galaxy-a35 .nest-label {
    font-size: 10px;
    margin-bottom: 4px;
    margin-top: 16px;  /* DOWN 6px more (was 10px) */
}

body.galaxy-a35 .camera-button-container {
    transform: scale(0.96) translateY(24px);  /* DOWN 8px more (was 16px) */
}

body.galaxy-a35 .row-3 .request-box {
    top: 56px;
    font-size: 14px;
    min-height: 23px;
    padding: 5px 10px;
}

body.galaxy-a35 .row-4 {
    min-height: 23vh;
    max-height: 29vh;
    margin-top: calc(2vh + 95px - var(--viewport-shift-up));  /* BACK to A55 formula - shift-up var does the work */
    margin-bottom: 0px;
}

body.galaxy-a35 .viewport-circle {
    width: 108%;
    max-width: 400px;
    aspect-ratio: 1 !important;
    position: relative;
}

body.galaxy-a35 .viewport-content {
    position: absolute;
    top: 2.5%;
    left: 2.5%;
    width: 95%;
    height: 95%;
    border-radius: 50%;
    overflow: hidden;
}

body.galaxy-a35 .viewport-content img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

body.galaxy-a35 .avatar-display {
    transform: scale(0.97);
}

body.galaxy-a35 .viewport-content img[src^="avatars_viewport/uav"] {
    width: 100%;
    height: 100%;
}

body.galaxy-a35 .viewport-content img.button-display {
    max-width: 58%;
    max-height: 58%;
    width: auto;
    height: auto;
    object-fit: contain;
}

body.galaxy-a35 .caption-box {
    font-size: 15px;
    min-height: 44px;
    padding: 5px 10px;
    /* No transform needed - viewport-shift-up handles positioning */
}

body.galaxy-a35 .row-6 {
    height: 3.5vh;
    margin-top: auto;
    margin-bottom: 34px;  /* UP 10px - INCREASE to push row-6 up from bottom (was 24px baseline) */
}

body.galaxy-a35 .bottom-ticker-text {
    font-size: 11px;
    padding: 7px 13px;
}

body.galaxy-a35 .row-7 {
    height: 6.5vh !important;
    margin-top: -1px !important;  /* UP 8px (was 7px) */
    gap: 2px !important;
    padding-bottom: 7px !important;
    margin-bottom: 4px !important;
}

body.galaxy-a35 .action-button {
    width: 19%;
    min-width: 68px;
}

body.galaxy-a35 .action-button img {
    max-width: 100%;
    max-height: 100%;
}

body.galaxy-a35 .token-counter {
    font-size: 14px;  /* Reduced 10% */
    min-width: 76px;  /* Reduced 10% from 85px */
    max-width: 85px;
    text-align: center;
    margin-right: 5px;  /* Reduced margin */
}

body.galaxy-a35 .gem-counter {
    font-size: 14px;  /* Reduced 10% */
    min-width: 76px;  /* Reduced 10% from 85px */
    max-width: 85px;
    text-align: center;
    margin-right: 6px;  /* Reduced margin */
}

body.galaxy-a35 .spinning-coin img {
    height: 19px;  /* Reduced 10% from 21px */
}

body.galaxy-a35 .spinning-coin {
    margin-right: 2px;
}

body.galaxy-a35 .gem-icon {
    margin-right: 2px;
}

body.galaxy-a35 .gem-icon img {
    height: 19px;  /* Reduced 10% from 21px */
}

body.galaxy-a35 .my-nest-egg {
    position: absolute;
    left: calc(50% + 15px);  /* RIGHT 3px more (was +12px) */
    transform: translateX(-50%) translateY(5px) scale(0.86);
}

body.galaxy-a35 .my-nest-egg img {
    height: 76px;  /* Reduced 10% from 85px */
}

body.galaxy-a35 .ticker-tab {
    height: calc((2vh + 4px) * 1.65) !important;
    width: calc((4.2vh + 8.4px) * 1.65) !important;
    top: calc(-1 * calc((2vh + 4px) * 1.65)) !important;  /* Bottom edge rests on ticker top */
}

/* ----------------------------------------
   SAMSUNG GALAXY A34
   2340 × 1080 physical (384 × 854 logical, DPR ~2.625)
   Same dimensions as A55/A35 - shared profile
   ---------------------------------------- */
body.galaxy-a34 {
    --viewport-shift-up: 32px;
}

body.galaxy-a34 .app-container {
    padding-top: max(5px, env(safe-area-inset-top));
    padding-bottom: max(5px, env(safe-area-inset-bottom));
}

body.galaxy-a34 .row-0 {
    height: 2vh;
    min-height: 18px;
    margin-bottom: 2px;
    margin-top: 2px;
}

body.galaxy-a34 .menu-button img {
    height: 26px;
}

body.galaxy-a34 .row-2 {
    height: 3.5vh;
    margin-top: 62px;
    margin-bottom: 0px;
}

body.galaxy-a34 .ticker-text {
    font-size: 11px;
    padding: 7px 13px;
}

body.galaxy-a34 .row-2-5 {
    height: 6.5vh;
    margin-top: 16px;
    margin-bottom: 9px;
}

body.galaxy-a34 .nest-label {
    font-size: 10px;
    margin-bottom: 4px;
    margin-top: -12px;
}

body.galaxy-a34 .camera-button-container {
    transform: scale(0.96);
}

body.galaxy-a34 .row-3 .request-box {
    top: 56px;
    font-size: 14px;
    min-height: 23px;
    padding: 5px 10px;
}

body.galaxy-a34 .row-4 {
    min-height: 23vh;
    max-height: 29vh;
    margin-top: calc(2vh + 95px - var(--viewport-shift-up));
    margin-bottom: 0px;
}

body.galaxy-a34 .viewport-circle {
    width: 108%;
    max-width: 400px;
    aspect-ratio: 1 !important;
    position: relative;
}

body.galaxy-a34 .viewport-content {
    position: absolute;
    top: 2.5%;
    left: 2.5%;
    width: 95%;
    height: 95%;
    border-radius: 50%;
    overflow: hidden;
}

body.galaxy-a34 .viewport-content img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

body.galaxy-a34 .avatar-display {
    transform: scale(0.97);
}

body.galaxy-a34 .viewport-content img[src^="avatars_viewport/uav"] {
    width: 100%;
    height: 100%;
}

body.galaxy-a34 .viewport-content img.button-display {
    max-width: 58%;
    max-height: 58%;
    width: auto;
    height: auto;
    object-fit: contain;
}

body.galaxy-a34 .caption-box {
    font-size: 15px;
    min-height: 44px;
    padding: 5px 10px;
}

body.galaxy-a34 .row-6 {
    height: 3.5vh;
    margin-top: auto;
    margin-bottom: 24px;
}

body.galaxy-a34 .bottom-ticker-text {
    font-size: 11px;
    padding: 7px 13px;
}

body.galaxy-a34 .row-7 {
    height: 6.5vh;
    margin-top: 7px;
    gap: 2px;
    padding-bottom: 7px;
    margin-bottom: 4px;
}

body.galaxy-a34 .action-button {
    width: 19%;
    min-width: 68px;
}

body.galaxy-a34 .action-button img {
    max-width: 100%;
    max-height: 100%;
}

body.galaxy-a34 .token-counter {
    font-size: 21px;
    min-width: 90px;
    max-width: 90px;
    text-align: center;
}

body.galaxy-a34 .gem-counter {
    font-size: 21px;
    min-width: 90px;
    max-width: 90px;
    text-align: center;
}

body.galaxy-a34 .spinning-coin img {
    height: 29px;
}

body.galaxy-a34 .spinning-coin {
    margin-right: 2px;
}

body.galaxy-a34 .gem-icon {
    margin-right: 2px;
}

body.galaxy-a34 .my-nest-egg {
    transform: scale(0.96);
}

body.galaxy-a34 .my-nest-egg img {
    height: 94px;
}

body.galaxy-a34 .ticker-tab {
    height: calc((2vh + 4px) * 1.65) !important;
    width: calc((4.2vh + 8.4px) * 1.65) !important;
    top: calc(-1 * calc((2vh + 4px) * 1.65)) !important;
}

/* ----------------------------------------
   SAMSUNG GALAXY S24 (STANDARD - NON-PLUS)
   2340 × 1080 physical (360 × 780 logical, DPR 3)
   Smaller 6.2" screen - based on S24+ with tighter spacing
   ---------------------------------------- */
body.galaxy-s24 {
    --viewport-shift-up: 30px;
}

body.galaxy-s24 .app-container {
    padding-top: max(5px, env(safe-area-inset-top));
    padding-bottom: max(5px, env(safe-area-inset-bottom));
}

body.galaxy-s24 .row-0 {
    height: 2vh;
    min-height: 18px;
    margin-bottom: 2px;
    margin-top: 2px;
}

body.galaxy-s24 .menu-button img {
    height: 26px;
}

body.galaxy-s24 .row-2 {
    height: 3.5vh;
    margin-top: 60px;
    margin-bottom: 0px;
}

body.galaxy-s24 .ticker-text {
    font-size: 11px;
    padding: 6px 12px;
}

body.galaxy-s24 .row-2-5 {
    height: 6vh;
    margin-top: 15px;
    margin-bottom: 8px;
}

body.galaxy-s24 .nest-label {
    font-size: 10px;
    margin-bottom: 4px;
    margin-top: -12px;
}

body.galaxy-s24 .camera-button-container {
    transform: scale(0.9);
}

body.galaxy-s24 .row-3 .request-box {
    top: 52px;
    font-size: 14px;
    min-height: 22px;
    padding: 5px 10px;
}

body.galaxy-s24 .row-4 {
    min-height: 22vh;
    max-height: 28vh;
    margin-top: calc(2vh + 90px - var(--viewport-shift-up));
    margin-bottom: 0px;
}

body.galaxy-s24 .viewport-circle {
    width: 115%;
    max-width: 396px;
    aspect-ratio: 1 !important;
    position: relative;  /* Anchor for absolute child */
}

body.galaxy-s24 .viewport-content {
    position: absolute;  /* CRITICAL: Prevents portrait photos from affecting parent layout */
    top: 2.5%;
    left: 2.5%;
    width: 95%;
    height: 95%;
    border-radius: 50%;
    overflow: hidden;
}

body.galaxy-s24 .viewport-content img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

body.galaxy-s24 .avatar-display {
    transform: scale(0.97);
}

body.galaxy-s24 .viewport-content img[src^="avatars_viewport/uav"] {
    width: 100%;
    height: 100%;
}

body.galaxy-s24 .viewport-content img.button-display {
    max-width: 60%;
    max-height: 60%;
    width: auto;
    height: auto;
    object-fit: contain;
}

body.galaxy-s24 .caption-box {
    font-size: 15px;
    min-height: 42px;
    padding: 5px 10px;
}

body.galaxy-s24 .row-6 {
    height: 3.5vh;
    margin-top: auto;
    margin-bottom: 8px;
}

body.galaxy-s24 .bottom-ticker-text {
    font-size: 11px;
    padding: 6px 12px;
}

body.galaxy-s24 .row-7 {
    height: 6.5vh;
    margin-top: 6px;
    gap: 2px;
    padding-bottom: 6px;
    margin-bottom: 4px;
}

body.galaxy-s24 .action-button {
    width: 19%;
    min-width: 62px;
}

body.galaxy-s24 .action-button img {
    max-width: 100%;
    max-height: 100%;
}

body.galaxy-s24 .token-counter {
    font-size: 16px;
    min-width: 68px;
    max-width: 68px;
    text-align: center;
}

body.galaxy-s24 .gem-counter {
    font-size: 16px;
    min-width: 68px;
    max-width: 68px;
    text-align: center;
}

body.galaxy-s24 .spinning-coin img {
    height: 22px;
}

body.galaxy-s24 .spinning-coin {
    margin-right: 2px;
}

body.galaxy-s24 .gem-icon {
    width: 20px;
    height: 20px;
}

body.galaxy-s24 .my-nest-egg {
    margin-left: 2px;
}

body.galaxy-s24 .my-nest-egg img {
    height: 70px;
}

body.galaxy-s24 .ticker-tab {
    height: calc((2vh + 4px) * 1.6) !important;
    width: calc((4.2vh + 8.4px) * 1.6) !important;
    top: calc(-1 * calc((2vh + 4px) * 1.6)) !important;
}

/* Settings Row Layout */
.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.settings-row:last-child {
    border-bottom: none;
}

.settings-label {
    flex: 1;
    cursor: pointer;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #666;
    transition: 0.3s;
    border-radius: 26px;
    pointer-events: auto;
}

.toggle-switch .slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .slider {
    background-color: #28a745;
}

.toggle-switch input:checked + .slider:before {
    transform: translateX(24px);
}

.toggle-switch.disabled {
    opacity: 0.6;
}

.toggle-switch.disabled .slider {
    cursor: not-allowed;
    background-color: #444;
}

.toggle-switch.disabled input:checked + .slider {
    background-color: #28a745;
}

/* ==========================================
   BRANDED SPLASH SCREEN
   Professional loading screen with cross-fade animation
   ========================================== */
#brandedSplash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../roost_background.WebP') center center / cover no-repeat;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease-out;
}

#brandedSplash.fade-out {
    opacity: 0;
    pointer-events: none;
}

.splash-slide {
    position: absolute;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
}

.splash-slide.active {
    opacity: 1;
}

.splash-logo {
    max-width: 60%;
    height: auto;
    margin-bottom: 20px;
    animation: fadeInScale 0.8s ease-out;
}

.splash-text {
    color: white;
    text-align: center;
    font-family: 'Arial', sans-serif;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    animation: fadeIn 1s ease-out 0.3s backwards;
}

.splash-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
}

.splash-tagline {
    font-size: 16px;
    font-style: italic;
    opacity: 0.9;
}

.splash-gem {
    width: 64px;
    height: 64px;
    margin-top: 30px;
    animation: gemPulse 1.5s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(138, 43, 226, 0.6));
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes gemPulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 10px rgba(138, 43, 226, 0.6));
    }
    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 20px rgba(138, 43, 226, 0.9));
    }
}

/* Hide splash on very small screens to ensure content visibility */
@media (max-height: 500px) {
    .splash-logo {
        max-width: 40%;
    }
    .splash-title {
        font-size: 18px;
    }
    .splash-tagline {
        font-size: 14px;
    }
    .splash-gem {
        width: 48px;
        height: 48px;
        margin-top: 20px;
    }
}

/* ========================================
   BEAKIN MAP AVATAR MARKERS
   ======================================== */

/* Remove default Leaflet marker styling */
.custom-beakin-marker {
    background: transparent !important;
    border: none !important;
}

/* Avatar marker container */
.beakin-avatar-marker {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
    position: relative;
}

/* Emergency (launcher) marker - red border with pulse */
.beakin-avatar-marker.emergency {
    border: 4px solid #ff4444;
    animation: beakinEmergencyPulse 1.5s ease-in-out infinite;
}

/* Responder marker - blue border */
.beakin-avatar-marker.responder {
    border: 4px solid #4444ff;
}

/* Avatar image inside marker */
.beakin-avatar-marker img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Pulsing animation for emergency markers */
@keyframes beakinEmergencyPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(255, 68, 68, 0);
    }
}

/* ========================================
   STROBE FLASH OVERLAY (Accessibility)
   ======================================== */

/* Full-screen strobe overlay */
.strobe-flash-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #ffffff;
    z-index: 99999;
    pointer-events: none;
    opacity: 0;
}

/* Active strobe animation */
.strobe-flash-overlay.active {
    animation: strobeFlash 150ms ease-in-out 6;
}

/* Strobe keyframes - rapid white flash */
@keyframes strobeFlash {
    0%, 100% {
        opacity: 0;
    }
    50% {
        opacity: 0.95;
    }
}

/* Slower fallback for reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .strobe-flash-overlay.active {
        animation: slowFlash 500ms ease-in-out 2;
    }
    
    @keyframes slowFlash {
        0%, 100% {
            opacity: 0;
        }
        50% {
            opacity: 0.7;
        }
    }
}

/* ========================================
   ARCADE COIN COUNTER ANIMATION
   ======================================== */

/* Wobble effect for counting numbers */
.coin-wobble {
    animation: coinWobble 80ms ease-in-out;
}

@keyframes coinWobble {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
        color: #fbbf24;
    }
}

/* Gentle pulse for "Claim Your Winnings" button */
.claim-pulse {
    animation: claimPulse 1.5s ease-in-out infinite;
}

@keyframes claimPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(251, 191, 36, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 25px rgba(251, 191, 36, 0.6);
    }
}

/* ========================================
   COPPA COMPLIANCE STYLES
   ======================================== */

/* DOB Select Styling */
.dob-select {
    padding: 12px 8px !important;
    font-size: 14px !important;
    background: rgba(255,255,255,0.95) !important;
    border: 2px solid #FFD700 !important;
    border-radius: 8px !important;
    color: #1a4d37 !important;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231a4d37' d='M6 8L1 3h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 8px center !important;
    background-color: rgba(255,255,255,0.95) !important;
    padding-right: 28px !important;
}

.dob-select:focus {
    outline: none;
    border-color: #FFA500 !important;
    box-shadow: 0 0 0 2px rgba(255,165,0,0.3);
}

/* Age Check Buttons in Join Nest */
.age-check-btn {
    transition: all 0.2s ease;
}

.age-check-btn:hover {
    transform: scale(1.02);
}

.age-check-btn.selected {
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(255,215,0,0.5);
}

#ageCheck13Plus.selected {
    background: rgba(40,167,69,0.6) !important;
    color: white !important;
}

#ageCheckUnder13.selected {
    background: rgba(255,165,0,0.6) !important;
    color: white !important;
}

/* Hide age gate section in login mode */
.login-mode-active #ageGateSection {
    display: none !important;
}


/* ========================================
   PROFILE PIC UPLOAD & CROPPER
   ======================================== */

.profile-pic-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.profile-pic-dialog {
    background: linear-gradient(135deg, #1a4d37 0%, #0d2818 100%);
    border: 3px solid #FFD700;
    border-radius: 20px;
    padding: 20px;
    width: 90%;
    max-width: 350px;
    text-align: center;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.profile-pic-title {
    color: #FFD700;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 5px;
}

.profile-pic-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin-bottom: 15px;
}

/* Cropper Container */
.cropper-container {
    width: 250px;
    height: 250px;
    margin: 0 auto 15px;
    position: relative;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #FFD700;
    touch-action: none;
}

.cropper-circle-mask {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 50%;
}

.cropper-circle-mask img {
    position: absolute;
    top: 0;
    left: 0;
    cursor: grab;
    user-select: none;
    -webkit-user-drag: none;
    /* Size controlled by JavaScript transform, no CSS constraints */
}

.cropper-circle-mask img:active {
    cursor: grabbing;
}

/* Zoom Control */
.zoom-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.zoom-label {
    font-size: 20px;
}

.zoom-slider {
    width: 150px;
    height: 8px;
    -webkit-appearance: none;
    background: rgba(255, 215, 0, 0.3);
    border-radius: 4px;
    outline: none;
}

.zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: #FFD700;
    border-radius: 50%;
    cursor: pointer;
}

.zoom-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: #FFD700;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Profile Pic Buttons */
.profile-pic-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.profile-pic-btn {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    border: 2px solid;
    transition: all 0.2s ease;
}

.profile-pic-btn-choose {
    background: rgba(76, 175, 80, 0.2);
    border-color: #4CAF50;
    color: #4CAF50;
}

.profile-pic-btn-camera {
    background: rgba(33, 150, 243, 0.2);
    border-color: #2196F3;
    color: #2196F3;
}

.profile-pic-btn-save {
    width: 100%;
    background: rgba(255, 215, 0, 0.3);
    border-color: #FFD700;
    color: #FFD700;
    margin-bottom: 10px;
}

.profile-pic-btn-cancel {
    width: 100%;
    background: rgba(255, 107, 107, 0.2);
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.profile-pic-btn:active {
    transform: scale(0.95);
}

.profile-pic-slot-info {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    margin-top: 10px;
}

/* Replace Avatar Overlay */
.replace-avatar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10001;
    display: flex;
    justify-content: center;
    align-items: center;
}

.replace-avatar-dialog {
    background: linear-gradient(135deg, #1a4d37 0%, #0d2818 100%);
    border: 3px solid #FFD700;
    border-radius: 20px;
    padding: 20px;
    width: 90%;
    max-width: 350px;
    text-align: center;
}

.replace-avatar-title {
    color: #FFD700;
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 10px;
}

.replace-avatar-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin-bottom: 20px;
}

.replace-avatar-options {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 20px;
}

.replace-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px;
    border: 2px solid transparent;
    border-radius: 15px;
    transition: all 0.2s ease;
}

.replace-option:hover,
.replace-option:active {
    border-color: #FFD700;
    background: rgba(255, 215, 0, 0.1);
}

.replace-option img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #FFD700;
}

.replace-option span {
    color: #FFD700;
    font-size: 14px;
    font-weight: bold;
}

.replace-cancel-btn {
    width: 100%;
    padding: 12px;
    background: rgba(255, 107, 107, 0.2);
    border: 2px solid #ff6b6b;
    border-radius: 10px;
    color: #ff6b6b;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
}


/* ========================================
   NEST QUEST GAME RESULTS - VIEWPORT STREAM
   ======================================== */

#gameResultOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 5;
    padding-bottom: 30px; /* Nudge content up */
}

.game-result-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px;
    text-align: center;
}

.game-result-card .game-logo {
    width: 97px;
    height: 97px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.game-result-card .game-player {
    display: flex;
    align-items: center;
    gap: 7px;
    background: rgba(0,0,0,0.5);
    padding: 5px 12px;
    border-radius: 18px;
    margin-top: 3px;
}

.game-result-card .player-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid gold;
}

.game-result-card .player-name {
    color: white;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.game-result-card .game-stats {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 6px;
}

.game-result-card .stat-row {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0,0,0,0.6);
    padding: 6px 14px;
    border-radius: 12px;
    min-width: 168px;
}

.game-result-card .stat-row.eggs {
    border: 2px solid gold;
}

.game-result-card .stat-row.gems {
    border: 2px solid #a855f7;
}

.game-result-card .stat-icon {
    font-size: 19px;
}

.game-result-card .stat-value {
    font-size: 18px;
    font-weight: bold;
    color: #4ade80;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.game-result-card .stat-label {
    font-size: 12px;
    color: rgba(255,255,255,0.8);
    margin-left: auto;
}

.game-result-card .game-level {
    margin-top: 4px;
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    background: rgba(0,0,0,0.4);
    padding: 4px 12px;
    border-radius: 10px;
}

/* Game result overlay - uses default styles from above */
/* Mobile styles are the correct baseline */

/* ========================================
   GAME RESULT OVERLAY - Device Fixes
   fix_code:00009+viewport_avatar_sizing (2026-01-04)
   Prevents viewport img rules from affecting player-avatar
   ======================================== */

/* Desktop fix */
body.desktop-mode #gameResultOverlay .player-avatar {
    width: 34px !important;
    height: 34px !important;
    object-fit: cover !important;
    border-radius: 50% !important;
}

/* Galaxy S25 Plus fix */
body.galaxy-s25-plus #gameResultOverlay .player-avatar {
    width: 34px !important;
    height: 34px !important;
    max-width: 34px !important;
    max-height: 34px !important;
    object-fit: cover !important;
    border-radius: 50% !important;
}

/* Galaxy S24 Ultra fix */
body.galaxy-s24-ultra #gameResultOverlay .player-avatar {
    width: 34px !important;
    height: 34px !important;
    max-width: 34px !important;
    max-height: 34px !important;
    object-fit: cover !important;
    border-radius: 50% !important;
}

/* ========================================
   SOUND TOGGLE BUTTON - Intro Ad
   ======================================== */

.roost-sound-button {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.5);
    padding: 8px 14px;
    font-size: 14px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.roost-sound-button:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: #FFD700;
}

.roost-sound-button.sound-on {
    background: rgba(34, 197, 94, 0.8);
    border-color: #22c55e;
}

.roost-sound-button.sound-on:hover {
    background: rgba(34, 197, 94, 1);
}

/* ==========================================
   DUCKIN SAYS - In-App Helper Overlay
   Formatting Reference v1.0
   ========================================== */

/* --- CONFIGURATION VARIABLES --- */
:root {
    /* Duckin Says Text Limits */
    --duckin-short-msg-limit: 40;
    --duckin-medium-msg-limit: 80;
    
    /* Duckin Says Spacing */
    --duckin-card-padding-top: 15%;
    --duckin-card-padding-right: 8%;
    --duckin-card-padding-bottom: 20%;
    --duckin-card-padding-left: 32%;
    
    /* Duckin Says Text Area */
    --duckin-text-area-top: 18%;
    --duckin-text-area-width: 58%;
    --duckin-line-height: 1.35;
    
    /* Duckin Says Font Sizes */
    --duckin-prefix-size: 1.1rem;
    --duckin-msg-size-short: 1.5rem;
    --duckin-msg-size-medium: 1.25rem;
    --duckin-msg-size-long: 1.1rem;
}

.duckin-says-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.duckin-says-overlay.active {
    opacity: 1;
    visibility: visible;
}

.duckin-says-card {
    position: relative;
    width: 90%;
    max-width: 400px;
    aspect-ratio: 1 / 1;
    background: url('helpers/duckin_helper.png') no-repeat center/contain;
}

/* Text Container - positioned within the golden frame */
.duckin-says-content {
    position: absolute;
    top: var(--duckin-text-area-top);
    left: var(--duckin-card-padding-left);
    right: var(--duckin-card-padding-right);
    bottom: var(--duckin-card-padding-bottom);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* --- GREETING/PREFIX STYLES --- */
.duckin-says-prefix {
    font-family: 'Fredoka One', cursive, sans-serif;
    font-size: var(--duckin-prefix-size);
    color: #555;
    margin-bottom: 6px;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.8);
    flex-shrink: 0;
}

/* --- MESSAGE STYLES --- */
.duckin-says-message {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    line-height: var(--duckin-line-height);
    text-shadow: 1px 1px 2px rgba(255,255,255,0.8);
    flex-grow: 1;
    display: flex;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* --- BUY MORE LINK --- */
.duckin-says-buymore {
    font-family: 'Fredoka One', cursive, sans-serif;
    font-size: 1.1rem;
    color: #9333ea;
    text-decoration: underline;
    margin-top: 10px;
    padding: 5px 15px;
    background: rgba(147, 51, 234, 0.1);
    border-radius: 15px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.duckin-says-buymore:hover {
    color: #7c22ce;
    background: rgba(147, 51, 234, 0.2);
    transform: scale(1.05);
}

.duckin-says-buymore.hidden {
    display: none;
}

/* SHORT messages (≤40 chars): Centered, large text */
.duckin-says-message.msg-short {
    font-size: var(--duckin-msg-size-short);
    text-align: center;
    justify-content: center;
    align-items: center;
}

/* MEDIUM messages (41-80 chars): Top-left, medium text */
.duckin-says-message.msg-medium {
    font-size: var(--duckin-msg-size-medium);
    text-align: left;
    justify-content: flex-start;
    align-items: flex-start;
}

/* LONG messages (80+ chars): Top-left, smaller text, with indent */
.duckin-says-message.msg-long {
    font-size: var(--duckin-msg-size-long);
    text-align: left;
    text-indent: 1em;
    justify-content: flex-start;
    align-items: flex-start;
}

/* --- TEXT COLOR CLASSES --- */
.duckin-text-red { color: #dc2626; }
.duckin-text-blue { color: #2563eb; }
.duckin-text-green { color: #16a34a; }
.duckin-text-purple { color: #9333ea; }
.duckin-text-pink { color: #ec4899; }
.duckin-text-black { color: #1a1a1a; }

/* --- DISMISS BUTTON --- */
.duckin-says-dismiss {
    position: absolute;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 30px;
    font-family: 'Fredoka One', cursive, sans-serif;
    font-size: 1rem;
    background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
    border: 3px solid #b45309;
    border-radius: 25px;
    color: #1a1a1a;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    transition: transform 0.1s ease;
}

.duckin-says-dismiss:hover {
    transform: translateX(-50%) scale(1.05);
}

.duckin-says-dismiss:active {
    transform: translateX(-50%) scale(0.95);
}

/* --- MOBILE ADJUSTMENTS --- */
@media (max-width: 380px) {
    .duckin-says-message.msg-short { font-size: 1.3rem; }
    .duckin-says-message.msg-medium { font-size: 1.1rem; }
    .duckin-says-message.msg-long { font-size: 1rem; }
    .duckin-says-prefix { font-size: 1rem; }
}


/* ==========================================
   ASK DUCKIN - Interactive Help Overlay
   ========================================== */
.ask-duckin-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ask-duckin-overlay.active {
    opacity: 1;
    visibility: visible;
}

.ask-duckin-container {
    width: 90%;
    max-width: 380px;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    border: 3px solid #fbbf24;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(251, 191, 36, 0.3);
}

.ask-duckin-header {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-bottom: 15px;
}

.ask-duckin-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid #fbbf24;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
}

.ask-duckin-close {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #dc2626;
    border: 2px solid #fff;
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s ease;
}

.ask-duckin-close:hover {
    transform: scale(1.1);
}

.ask-duckin-message {
    font-family: 'Nunito', sans-serif;
    font-size: 1.1rem;
    color: #fff;
    text-align: center;
    line-height: 1.4;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    min-height: 60px;
}

.ask-duckin-input-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.ask-duckin-input {
    flex: 1;
    padding: 12px 15px;
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    border: 2px solid #fbbf24;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.95);
    color: #1a1a1a;
    outline: none;
}

.ask-duckin-input:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.ask-duckin-submit {
    padding: 12px 25px;
    font-family: 'Fredoka One', cursive, sans-serif;
    font-size: 1rem;
    background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
    border: 2px solid #b45309;
    border-radius: 25px;
    color: #1a1a1a;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.ask-duckin-submit:hover {
    transform: scale(1.05);
}

.ask-duckin-submit:active {
    transform: scale(0.95);
}

.ask-duckin-topics {
    margin-top: 10px;
}

.ask-duckin-topics-label {
    font-family: 'Nunito', sans-serif;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
    text-align: center;
}

.ask-duckin-topic-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.ask-duckin-topic-btn {
    padding: 8px 14px;
    font-family: 'Nunito', sans-serif;
    font-size: 0.85rem;
    background: rgba(251, 191, 36, 0.2);
    border: 1px solid rgba(251, 191, 36, 0.5);
    border-radius: 20px;
    color: #fbbf24;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ask-duckin-topic-btn:hover {
    background: rgba(251, 191, 36, 0.4);
    transform: scale(1.05);
}

/* Mobile adjustments */
@media (max-width: 380px) {
    .ask-duckin-container {
        padding: 15px;
    }
    .ask-duckin-avatar {
        width: 65px;
        height: 65px;
    }
    .ask-duckin-message {
        font-size: 1rem;
    }
    .ask-duckin-input {
        font-size: 0.95rem;
        padding: 10px 12px;
    }
    .ask-duckin-submit {
        padding: 10px 18px;
        font-size: 0.95rem;
    }
}
