:root {
    --bg-main: #060913;
    --card-w: 68px;
    --card-h: 88px;
    --tray-w: 410px;
    --tray-h: 108px;
    --accent-gold: #fbbf24;
    --accent-cyan: #38bdf8;
    --accent-purple: #c084fc;
}

* {
    box-sizing: border-box;
    user-select: none !important;
    -webkit-user-select: none !important;
    -khtml-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    -webkit-touch-callout: none !important;
    -webkit-tap-highlight-color: transparent !important;
    margin: 0;
    padding: 0;
    touch-action: manipulation;
}

img, canvas, svg {
    -webkit-user-drag: none !important;
    user-drag: none !important;
    -webkit-touch-callout: none !important;
}

@keyframes shakeReject {
    0%, 100% { transform: translateX(0) scale(1); }
    20%, 60% { transform: translateX(-8px) rotate(-5deg) scale(1.05); }
    40%, 80% { transform: translateX(8px) rotate(5deg) scale(1.05); }
}

.shake-reject {
    animation: shakeReject 0.4s ease-in-out !important;
    border-color: #ef4444 !important;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.9) !important;
}

html {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    min-width: 100vw !important;
    min-height: 100vh !important;
    overflow: hidden !important;
    touch-action: none !important;
    -ms-touch-action: none !important;
    overscroll-behavior: none !important;
    overscroll-behavior-y: none !important;
    -webkit-text-size-adjust: 100% !important;
}

body {
    font-family: 'Fredoka', 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-main);
    color: #f8fafc;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    min-width: 100vw !important;
    min-height: 100vh !important;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden !important;
    touch-action: none !important;
    -ms-touch-action: none !important;
    overscroll-behavior: none !important;
    overscroll-behavior-y: none !important;
}

#app-wrapper {
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    display: flex;
    justify-content: center;
    align-items: center;
    background: url("data:image/svg+xml,%3Csvg width='30' height='30' viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h30v30H0z' fill='none'/%3E%3Cpath d='M0 30L30 0h-2L0 28v2zm0-4L26 0h-2L0 24v2zm0-4L22 0h-2L0 20v2zm0-4L18 0h-2L0 16v2zm0-4L14 0h-2L0 12v2zm0-4L10 0H8L0 8v2zm0-4L6 0H4L0 4v2z' fill='%23ffffff' fill-opacity='0.08'/%3E%3C/svg%3E"), radial-gradient(circle at 50% 40%, #10b981 0%, #059669 45%, #047857 75%, #065f46 100%);
    touch-action: none !important;
    overscroll-behavior: none !important;
}

/* Mobile Screen Container with Full Screen Filling and Ultra-Stable Gradient Background */
#game-container {
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    background: url("data:image/svg+xml,%3Csvg width='30' height='30' viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h30v30H0z' fill='none'/%3E%3Cpath d='M0 30L30 0h-2L0 28v2zm0-4L26 0h-2L0 24v2zm0-4L22 0h-2L0 20v2zm0-4L18 0h-2L0 16v2zm0-4L14 0h-2L0 12v2zm0-4L10 0H8L0 8v2zm0-4L6 0H4L0 4v2z' fill='%23ffffff' fill-opacity='0.08'/%3E%3C/svg%3E"), radial-gradient(circle at 50% 40%, #10b981 0%, #059669 45%, #047857 75%, #065f46 100%);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 0;
    contain: layout style;
    touch-action: none !important;
    overscroll-behavior: none !important;
}

/* Canvas Particle & Confetti Layer */
#fx-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 900;
    contain: strict;
}

/* Main Menu Overlay Screen with Stable Premium Dark Gradient */
.menu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e1b4b 0%, #31104b 50%, #0f172a 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5000;
    transition: opacity 0.4s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 18px 10px;
    box-sizing: border-box;
}

.menu-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    display: none !important;
}

/* Rich Floating Background Character Cards (Perimeter Only - Never in Center) */
.menu-bg-characters {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.bg-char {
    position: absolute;
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: #ffffff;
    padding: 3px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35), inset 0 0 0 2px #ffffff;
    opacity: 0.85;
    object-fit: cover;
    animation: floatCharacter 5s ease-in-out infinite alternate;
}

.svg-bg-char {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
}

.svg-bg-char svg {
    width: 80%;
    height: 80%;
}

/* Outer Perimeter Placement Only - Keeps Screen Center Clean */
.char-1 { top: 3%; left: 4%; animation-delay: 0s; transform: rotate(-12deg); }
.char-2 { top: 3%; right: 4%; animation-delay: 1.2s; transform: rotate(15deg); }
.char-3 { top: 22%; left: 2%; animation-delay: 2.2s; transform: rotate(-8deg); }
.char-4 { top: 24%; right: 2%; animation-delay: 0.6s; transform: rotate(10deg); }
.char-5 { top: 46%; left: 1%; animation-delay: 1.6s; transform: rotate(14deg); }
.char-6 { top: 48%; right: 1%; animation-delay: 2.8s; transform: rotate(-14deg); }
.char-7 { bottom: 22%; left: 2%; animation-delay: 3.2s; transform: rotate(-10deg); }
.char-8 { bottom: 24%; right: 2%; animation-delay: 1.9s; transform: rotate(12deg); }
.char-9 { bottom: 3%; left: 4%; animation-delay: 0.8s; transform: rotate(8deg); }
.char-10 { bottom: 3%; right: 4%; animation-delay: 2.4s; transform: rotate(-15deg); }
.char-11 { top: 2%; left: 22%; animation-delay: 1.5s; opacity: 0.5; scale: 0.75; }
.char-12 { top: 2%; right: 22%; animation-delay: 2.7s; opacity: 0.5; scale: 0.75; }
.char-13 { bottom: 2%; left: 22%; animation-delay: 0.4s; opacity: 0.5; scale: 0.75; }
.char-14 { bottom: 2%; right: 22%; animation-delay: 3.0s; opacity: 0.5; scale: 0.75; }
.char-15 { top: 70%; left: 1%; animation-delay: 2.1s; opacity: 0.4; scale: 0.7; }
.char-16 { bottom: 70%; right: 1%; animation-delay: 1.1s; opacity: 0.4; scale: 0.7; }

@keyframes floatCharacter {
    0% { transform: translateY(0px) rotate(-10deg) scale(1); }
    50% { transform: translateY(-14px) rotate(8deg) scale(1.05); }
    100% { transform: translateY(10px) rotate(-6deg) scale(0.96); }
}

/* Opaque Solid-Backdrop Menu Card Panel (Zero bleed-through) */
.menu-card {
    position: relative;
    background: linear-gradient(180deg, #16193b 0%, #0d1226 100%);
    border: 2.5px solid rgba(251, 191, 36, 0.6);
    border-radius: clamp(22px, 3.5vh, 32px);
    padding: clamp(14px, 2.2vh, 24px) clamp(12px, 3vw, 18px);
    width: 92%;
    max-width: 360px;
    max-height: 95vh;
    max-height: 95dvh;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    text-align: center;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.9), 0 0 35px rgba(245, 158, 11, 0.25), inset 0 2px 0 rgba(255, 255, 255, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(6px, 1.2vh, 12px);
    z-index: 10;
    margin: auto;
    box-sizing: border-box;
}

.menu-card::-webkit-scrollbar {
    display: none;
}

/* Charming Heart-Shaped 3D Tile Logo Emblem Frame with Sunburst Aura & Crown */
.menu-logo-frame {
    width: clamp(72px, 11vh, 108px);
    height: clamp(72px, 11vh, 108px);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 85%, #cbd5e1 100%);
    border-radius: clamp(18px, 2.4vh, 26px);
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.5), inset 0 -4px 0 #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #ffffff;
    position: relative;
    animation: floatLogo 2.4s ease-in-out infinite alternate;
    flex-shrink: 0;
}

/* Rotating Sunburst Aura behind emblem */
.sunburst-aura {
    position: absolute;
    width: 170px;
    height: 170px;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.35) 0%, rgba(245, 158, 11, 0.15) 50%, transparent 70%);
    border-radius: 50%;
    animation: rotateAura 12s linear infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes rotateAura {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

/* Floating Golden Crown Crest */
.logo-crown {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 28px;
    filter: drop-shadow(0 4px 10px rgba(245, 158, 11, 0.8));
    animation: crownFloat 2s ease-in-out infinite alternate;
    z-index: 20;
}

@keyframes crownFloat {
    0% { transform: translateX(-50%) translateY(0) rotate(-4deg); }
    100% { transform: translateX(-50%) translateY(-6px) rotate(4deg); }
}

/* Sparkle Star Dots */
.sparkle-dot {
    position: absolute;
    pointer-events: none;
    z-index: 15;
    animation: sparkleTwinkle 1.8s ease-in-out infinite alternate;
}

.dot-1 {
    top: 4px;
    left: 4px;
    font-size: 16px;
    animation-delay: 0.2s;
}

.dot-2 {
    bottom: 8px;
    left: -8px;
    font-size: 14px;
    animation-delay: 0.9s;
}

@keyframes sparkleTwinkle {
    0% { transform: scale(0.6) rotate(0deg); opacity: 0.4; }
    100% { transform: scale(1.3) rotate(35deg); opacity: 1; filter: drop-shadow(0 0 10px #fbbf24); }
}

.logo-heart-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-hero-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 24px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
}

.badge-3d-star {
    position: absolute;
    bottom: -6px;
    right: -6px;
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
    color: #0f172a;
    font-weight: 900;
    font-size: 11px;
    padding: 3px 7px;
    border-radius: 10px;
    border: 2px solid #ffffff;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.6);
    z-index: 10;
}

@keyframes floatLogo {
    0% { transform: translateY(0) rotate(0deg); }
    100% { transform: translateY(-12px) rotate(4deg); }
}

.menu-title {
    font-size: clamp(20px, 3.4vh, 27px);
    line-height: 1.15;
    margin: 0;
    font-weight: 900;
    letter-spacing: 1.2px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 15px rgba(245, 158, 11, 0.35);
    white-space: nowrap;
    flex-shrink: 0;
}

.menu-subtitle {
    font-size: clamp(11px, 1.6vh, 13px);
    font-weight: 600;
    color: #cbd5e1;
    line-height: 1.25;
    margin: 0;
    opacity: 0.9;
    flex-shrink: 0;
}

.menu-btn-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: clamp(6px, 1.1vh, 10px);
    margin-top: clamp(4px, 0.8vh, 8px);
    flex-shrink: 0;
}

.btn-menu {
    padding: clamp(9px, 1.4vh, 13px) 12px;
    min-height: clamp(38px, 4.8vh, 46px);
    font-size: clamp(12px, 3.2vw, 14px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    flex-shrink: 0;
}

/* =========================================================
   INTERACTIVE CHARACTER GUIDED TUTORIAL MODAL (4 STEPS)
   ========================================================= */

.tutorial-card {
    max-width: 380px;
    position: relative;
    padding: 28px 22px 24px 22px;
    gap: 16px;
    border-color: #38bdf8;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.9), 0 0 35px rgba(56, 189, 248, 0.25);
}

.tutorial-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
}

.tutorial-avatar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

.tut-avatar {
    width: 82px;
    height: 82px;
    border-radius: 24px;
    object-fit: cover;
    border: 3.5px solid #ffffff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 20px rgba(251, 191, 36, 0.6);
    animation: tutorFloat 2s ease-in-out infinite alternate;
}

@keyframes tutorFloat {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(-8px) scale(1.05); }
}

.tut-character-name {
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
    color: #0f172a;
    font-weight: 900;
    font-size: 12px;
    padding: 3px 12px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
    letter-spacing: 0.5px;
}

.speech-bubble {
    background: rgba(30, 41, 59, 0.9);
    border: 2px solid rgba(56, 189, 248, 0.5);
    border-radius: 20px;
    padding: 16px 18px;
    position: relative;
    width: 100%;
    text-align: center;
    box-shadow: inset 0 2px 8px rgba(255, 255, 255, 0.08);
}

.speech-bubble::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 12px 12px 12px;
    border-style: solid;
    border-color: transparent transparent rgba(56, 189, 248, 0.5) transparent;
}

.tut-slide-title {
    font-size: 17px;
    font-weight: 900;
    color: var(--accent-cyan);
    margin-bottom: 8px;
}

.tut-slide-body {
    font-size: 13.5px;
    color: #e2e8f0;
    line-height: 1.55;
    font-weight: 500;
}

.tut-dots-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tut-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
}

.tut-dot.active {
    width: 24px;
    border-radius: 10px;
    background: var(--accent-gold);
    box-shadow: 0 0 10px var(--accent-gold);
}

.tut-nav-btns {
    width: 100%;
    display: flex;
    gap: 10px;
}

.tut-btn-prev {
    flex: 1;
    padding: 12px;
    font-size: 13px;
}

.tut-btn-next {
    flex: 2;
    padding: 12px;
    font-size: 14px;
}

.settings-full-btn {
    width: 100%;
    padding: 12px 16px;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 16px;
}

/* =========================================================
   PREMIUM BUTTON HOVER GLOW & TACTILE PRESS ANIMATIONS
   ========================================================= */

.btn-primary {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
    border: none;
    border-radius: 20px;
    padding: 14px 16px;
    font-size: clamp(12px, 3.6vw, 15px);
    font-weight: 900;
    cursor: pointer;
    width: 100%;
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, filter 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 14px 32px rgba(245, 158, 11, 0.7), 0 0 24px rgba(251, 191, 36, 0.8);
    filter: brightness(1.1);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 50%;
    height: 200%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: rotate(25deg);
    transition: left 0.6s ease;
    pointer-events: none;
}

.btn-primary:hover::before {
    left: 130%;
}

.btn-primary:active {
    transform: translateY(2px) scale(0.96);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

/* Time Trial Red Gradient Menu Button */
.btn-timetrial {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    border: none;
    border-radius: 20px;
    padding: 14px 16px;
    font-size: clamp(12px, 3.6vw, 15px);
    font-weight: 900;
    cursor: pointer;
    width: 100%;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.45);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, filter 0.2s ease;
}

.btn-timetrial:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 14px 32px rgba(239, 68, 68, 0.7), 0 0 24px rgba(248, 113, 113, 0.8);
    filter: brightness(1.1);
}

.btn-timetrial:active {
    transform: translateY(2px) scale(0.96);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-secondary {
    background: rgba(30, 41, 59, 0.88);
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    border-radius: 20px;
    font-size: clamp(12px, 3.6vw, 15px);
    font-weight: 800;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, background 0.2s ease;
}

.btn-secondary:hover {
    transform: translateY(-4px) scale(1.03);
    background: rgba(51, 65, 85, 0.95);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 18px rgba(255, 255, 255, 0.25);
}

.btn-secondary:active {
    transform: translateY(2px) scale(0.96);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.btn-danger-reset {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    padding: 12px 18px;
    font-size: 13px;
    font-weight: 900;
    border-radius: 16px;
    border: none;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-danger-reset:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.6);
}

.btn-danger-reset:active {
    transform: scale(0.96);
}

/* Reset Confirmation Choice Modal Dialog */
.reset-choice-card {
    max-width: 360px;
    gap: 14px;
}

.reset-desc {
    font-size: 13px;
    color: #cbd5e1;
    margin-bottom: 4px;
}

.reset-btn-stack {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.reset-option-btn {
    padding: 12px 14px;
    font-size: 13px;
    border-radius: 16px;
}

/* Modals & Settings Overlay Screen (Z-Index 6000 - Above Main Menu 5000 & All HUD) */
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(6, 9, 19, 0.92);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 6000;
    transition: opacity 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 14px 8px;
    box-sizing: border-box;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    display: none !important;
}

.modal-card {
    background: linear-gradient(180deg, #1e1b4b 0%, #0f172a 100%);
    border: 2.5px solid var(--accent-gold);
    border-radius: 28px;
    padding: 24px 20px;
    width: 90%;
    max-width: 350px;
    max-height: calc(100dvh - 28px);
    max-height: calc(100vh - 28px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(251, 191, 36, 0.4) transparent;
}

/* =========================================================
   MODERN ULTRA-PREMIUM SETTINGS MODAL PANEL
   ========================================================= */
.settings-card {
    max-width: 400px;
    width: 92%;
    padding: 16px 14px 14px 14px;
    gap: 12px;
    background: linear-gradient(180deg, #161538 0%, #0c1021 100%);
    border: 2px solid rgba(251, 191, 36, 0.45);
    border-radius: 26px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
}

.settings-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-title-icon {
    font-size: 20px;
    filter: drop-shadow(0 2px 6px rgba(245, 158, 11, 0.5));
}

.settings-card .modal-title {
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 0.5px;
    color: #ffffff;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.btn-close-x {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e2e8f0;
    font-size: 15px;
    font-weight: 900;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s ease, border-color 0.2s ease;
}

.btn-close-x:hover {
    transform: scale(1.12) rotate(90deg);
    background: rgba(239, 68, 68, 0.85);
    border-color: #ef4444;
    color: #ffffff;
}

.btn-close-x:active {
    transform: scale(0.92);
}

/* Scrollable Inner Body Container */
.settings-body-scroll {
    width: 100%;
    max-height: min(62vh, 460px);
    max-height: min(62dvh, 460px);
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 2px 2px 6px 2px;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: rgba(251, 191, 36, 0.35) transparent;
}

.settings-body-scroll::-webkit-scrollbar {
    width: 4px;
}

.settings-body-scroll::-webkit-scrollbar-thumb {
    background: rgba(251, 191, 36, 0.35);
    border-radius: 4px;
}

/* Modern Card Groups inside Settings */
.settings-group-card {
    width: 100%;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-sizing: border-box;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.settings-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 2px 0 2px;
}

.settings-group-title {
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.8px;
    color: #94a3b8;
    text-transform: uppercase;
}

.setting-row {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(15, 23, 42, 0.65);
    padding: 8px 12px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-sizing: border-box;
}

.setting-row-switch {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 7px 12px;
}

.setting-info {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.setting-label {
    font-size: 12.5px;
    font-weight: 700;
    color: #f1f5f9;
}

.setting-val {
    font-size: 12.5px;
    font-weight: 900;
    color: var(--accent-gold);
}

/* Modern High-End Slider Styling */
.setting-slider {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 7px;
    border-radius: 999px;
    background: rgba(51, 65, 85, 0.7);
    outline: none;
    cursor: pointer;
    margin: 4px 0 2px 0;
    transition: background 0.2s ease;
}

.setting-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
    border: 2px solid #ffffff;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.7);
    cursor: pointer;
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.15s ease;
}

.setting-slider::-webkit-slider-thumb:hover {
    transform: scale(1.18);
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.9);
}

.setting-slider::-webkit-slider-thumb:active {
    transform: scale(0.95);
}

.setting-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
    border: 2px solid #ffffff;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.7);
    cursor: pointer;
}

/* Toggle Button (Modern Gaming Capsule) */
.toggle-btn {
    background: rgba(51, 65, 85, 0.8);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    color: #94a3b8;
    padding: 5px 14px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.toggle-btn:hover {
    transform: scale(1.06);
}

.toggle-btn.active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    border-color: #34d399;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.45);
}

/* Track Picker Segmented Grid */
.track-grid-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    width: 100%;
}

.track-btn {
    padding: 7px 4px !important;
    font-size: 11px !important;
    text-align: center;
    border-radius: 10px !important;
}

/* Language Grid Selector (Clean 4+3 Grid) */
.lang-grid-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    width: 100%;
    box-sizing: border-box;
}

.lang-btn {
    background: rgba(30, 41, 59, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
    padding: 7px 3px;
    border-radius: 10px;
    font-size: 11.5px;
    font-weight: 800;
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
    transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.lang-btn:hover {
    transform: translateY(-1px);
    background: rgba(51, 65, 85, 0.95);
    border-color: rgba(255, 255, 255, 0.25);
}

.lang-btn.active {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #0f172a;
    border-color: #fbbf24;
    font-weight: 900;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

/* Settings Action Buttons List (Modern Sleek Rows) */
.settings-buttons-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.settings-list-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
    font-size: 11.5px;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
    width: 100%;
    transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.settings-list-btn:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

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

.settings-list-btn.btn-playgames {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(6, 95, 70, 0.12) 100%);
    border-color: rgba(16, 185, 129, 0.4);
    color: #6ee7b7;
}

.settings-list-btn.btn-playgames:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(6, 95, 70, 0.22) 100%);
    border-color: #34d399;
}

.settings-list-btn.btn-playgames.connected {
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.22) 0%, rgba(4, 120, 87, 0.16) 100%);
    border-color: rgba(52, 211, 153, 0.6);
    color: #a7f3d0;
}

.playgames-btn-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.playgames-icon {
    font-size: 15px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.playgames-status-badge {
    padding: 3px 10px;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.playgames-status-badge.badge-connect {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35);
}

.playgames-status-badge.badge-connected {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #ecfdf5;
    border: 1px solid rgba(52, 211, 153, 0.5);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-list-btn.btn-profile {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.35);
    color: #fbbf24;
}

.settings-list-btn.btn-profile:hover {
    background: rgba(245, 158, 11, 0.2);
    border-color: #fbbf24;
}

.settings-list-btn.btn-update {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.18) 0%, rgba(5, 150, 105, 0.1) 100%);
    border-color: rgba(16, 185, 129, 0.35);
    color: #34d399;
}

.settings-list-btn.btn-update:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.28) 0%, rgba(5, 150, 105, 0.18) 100%);
    border-color: #34d399;
}

.settings-list-btn.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.settings-list-btn.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
}

.btn-chevron {
    font-size: 13px;
    opacity: 0.5;
    transition: transform 0.16s ease, opacity 0.16s ease;
    flex-shrink: 0;
}

.settings-list-btn:hover .btn-chevron {
    opacity: 1;
    transform: translateX(2px);
}

/* Pinned Save & Close Button */
.settings-save-btn {
    width: 100% !important;
    padding: 11px 16px !important;
    border-radius: 14px !important;
    font-size: 13px !important;
    font-weight: 900 !important;
    letter-spacing: 0.5px !important;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    border: none !important;
    color: #ffffff !important;
    cursor: pointer !important;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.45) !important;
    transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s ease !important;
    margin-top: 2px !important;
}

.settings-save-btn:hover {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6) !important;
}

.settings-save-btn:active {
    transform: scale(0.97);
}

/* =========================================================
   PRO 2-ROW TOP HUD HEADER (Spacious, Rich & Highly Legible!)
   ========================================================= */

#hud-header {
    padding: max(10px, env(safe-area-inset-top, 10px)) 12px 10px 12px;
    background: linear-gradient(180deg, rgba(12, 16, 33, 0.94) 0%, rgba(15, 23, 42, 0.88) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    border-bottom: 1.5px solid rgba(251, 191, 36, 0.35);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.5), inset 0 -1px 0 rgba(255, 255, 255, 0.06);
    width: 100%;
    box-sizing: border-box;
}

/* Single Clean Row: Home, Level, Timer (if TT), Score, Gold, Settings */
.hud-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 6px;
}

.hud-info-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.hud-icon-btn {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
    border: 1.5px solid rgba(251, 191, 36, 0.55);
    color: #ffffff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.18s ease, box-shadow 0.18s ease;
}

.hud-icon-btn:hover {
    transform: translateY(-2px) scale(1.08);
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.35) 0%, rgba(245, 158, 11, 0.2) 100%);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.hud-icon-btn:active {
    transform: scale(0.92);
}

.hud-item {
    padding: 4px 8px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 1;
    min-width: 0;
    white-space: nowrap;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.badge-level {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.18) 0%, rgba(14, 165, 233, 0.08) 100%);
    border: 1.5px solid rgba(56, 189, 248, 0.65);
}

.badge-score {
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.18) 0%, rgba(16, 185, 129, 0.08) 100%);
    border: 1.5px solid rgba(52, 211, 153, 0.65);
}

.badge-gold {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2) 0%, rgba(217, 119, 6, 0.1) 100%);
    border: 1.5px solid rgba(251, 191, 36, 0.65);
}

.badge-timer {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.25) 0%, rgba(220, 38, 38, 0.12) 100%);
    border: 1.5px solid #ef4444;
}

.badge-timer.hidden {
    display: none !important;
}

.badge-timer.timer-warning {
    animation: timerPulse 0.5s infinite alternate;
    background: #dc2626;
    border-color: #ffffff;
}

@keyframes timerPulse {
    0% { transform: scale(1); box-shadow: 0 0 8px #ef4444; }
    100% { transform: scale(1.1); box-shadow: 0 0 20px #ef4444, 0 0 30px #dc2626; }
}

.timer-icon {
    font-size: 13px;
}

.hud-label {
    font-size: 9.5px;
    font-weight: 800;
    color: #cbd5e1;
    letter-spacing: 0.4px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.hud-val {
    font-size: 13.5px;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.badge-gold .hud-val {
    color: #fbbf24;
}

.badge-level .hud-val {
    color: #38bdf8;
}

.badge-score .hud-val {
    color: #34d399;
}

/* =========================================================
   IN-GAME ERGONOMIC BOTTOM BOOSTER DOCK (Positioned above tray)
   ========================================================= */
.hud-bottom-boosters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    width: calc(100% - 24px);
    max-width: 440px;
    margin: 0 auto 6px auto;
    padding: 6px 10px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.88) 0%, rgba(8, 12, 24, 0.96) 100%);
    border: 1.5px solid rgba(251, 191, 36, 0.3);
    border-radius: 20px;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6), 0 8px 24px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-sizing: border-box;
    z-index: 250;
    flex-shrink: 0;
}

/* Tactile 3D Arcade Booster Action Pills */
.booster-pill {
    flex: 1 1 0;
    min-width: 0;
    padding: 6px 3px 5px 3px;
    min-height: 52px;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.15s ease, filter 0.15s ease;
}

/* Subtle glossy glass reflection highlight */
.booster-pill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 42%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 100%);
    border-radius: 12px 12px 3px 3px;
    pointer-events: none;
}

/* Distinct Booster Themes with 3D Depth & Radiant Aura */
.undo-pill {
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.35) 0%, rgba(5, 150, 105, 0.2) 100%);
    border: 1.5px solid rgba(52, 211, 153, 0.85);
    color: #34d399;
    box-shadow: 0 3px 0 #065f46, 0 6px 14px rgba(16, 185, 129, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.hint-pill {
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.35) 0%, rgba(14, 165, 233, 0.2) 100%);
    border: 1.5px solid rgba(56, 189, 248, 0.85);
    color: #38bdf8;
    box-shadow: 0 3px 0 #0369a1, 0 6px 14px rgba(14, 165, 233, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.slot-pill {
    background: linear-gradient(180deg, rgba(251, 191, 36, 0.35) 0%, rgba(217, 119, 6, 0.2) 100%);
    border: 1.5px solid rgba(251, 191, 36, 0.9);
    color: #fbbf24;
    box-shadow: 0 3px 0 #92400e, 0 6px 14px rgba(245, 158, 11, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.shuffle-pill {
    background: linear-gradient(180deg, rgba(192, 132, 252, 0.35) 0%, rgba(147, 51, 234, 0.2) 100%);
    border: 1.5px solid rgba(192, 132, 252, 0.9);
    color: #c084fc;
    box-shadow: 0 3px 0 #6b21a8, 0 6px 14px rgba(147, 51, 234, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.booster-pill:hover {
    transform: translateY(-2px);
    filter: brightness(1.15);
}

.booster-pill:active {
    transform: translateY(2px) scale(0.95);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.booster-pill.disabled-cost {
    opacity: 0.52;
    filter: grayscale(0.45);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
}

.booster-pill.disabled-cost:hover {
    transform: none;
    filter: grayscale(0.45);
}

.booster-pill.shaking {
    animation: boosterErrorShake 0.25s ease-in-out;
}

@keyframes boosterErrorShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-5px); }
    40% { transform: translateX(5px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.booster-pill.activated {
    animation: boosterActivatePulse 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes boosterActivatePulse {
    0% { transform: scale(0.92); }
    50% { transform: scale(1.1); filter: brightness(1.35); }
    100% { transform: scale(1); filter: brightness(1); }
}

.booster-icon {
    font-size: 19px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    transition: transform 0.15s ease;
}

.booster-pill:hover .booster-icon {
    transform: scale(1.12);
}

.booster-name {
    font-size: clamp(9px, 2.4vw, 10.5px);
    font-weight: 800;
    color: #f1f5f9;
    letter-spacing: 0.2px;
    white-space: nowrap;
    line-height: 1.1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* Luminous Capsule Cost Badges with 'P' (Puan) Indicator */
.cost-badge {
    font-size: clamp(8.5px, 2.2vw, 10px);
    font-weight: 900;
    padding: 1.5px 6px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45);
    flex-shrink: 0;
    white-space: nowrap;
    line-height: 1.1;
    letter-spacing: 0.2px;
}

.cost-emerald {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.cost-sky {
    background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.cost-gold {
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
    color: #0f172a;
}

.cost-purple {
    background: linear-gradient(135deg, #c084fc 0%, #9333ea 100%);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* Toast Alert Notification (Z-Index 999999 - Above ALL Modals & Overlays!) */
.toast-msg {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 2px solid #38bdf8;
    color: #f8fafc;
    padding: 10px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 18px rgba(56, 189, 248, 0.4);
    z-index: 999999 !important;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 88vw;
    width: max-content;
    text-align: center;
    line-height: 1.35;
    word-break: break-word;
}

.journal-gold-badge {
    position: absolute;
    top: 14px;
    right: 18px;
    background: rgba(15, 23, 42, 0.92);
    border: 1.5px solid var(--accent-gold);
    border-radius: 20px;
    padding: 4px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 800;
    color: var(--accent-gold);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.toast-msg.hidden {
    opacity: 0;
    transform: translate(-50%, -20px) scale(0.9);
    pointer-events: none;
}

/* Defeat Penalty Info Badge in Modal Defeat */
.penalty-badge {
    background: rgba(239, 68, 68, 0.18);
    border: 1.5px solid #ef4444;
    border-radius: 16px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.penalty-icon {
    font-size: 16px;
}

#penalty-text {
    font-size: 12px;
    font-weight: 800;
    color: #fca5a5;
    line-height: 1.3;
}

/* Combo Multiplier Floating HUD Badge (Z-Index 1500) */
.combo-badge {
    position: absolute;
    top: 105px;
    right: 16px;
    background: linear-gradient(135deg, #ec4899 0%, #f59e0b 100%);
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 20px;
    border: 2px solid #ffffff;
    font-size: 13px;
    font-weight: 900;
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.5), 0 0 12px rgba(245, 158, 11, 0.4);
    z-index: 1500;
    pointer-events: none;
    animation: cuteComboPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition: opacity 0.3s ease;
}

.combo-badge.hidden {
    opacity: 0;
    pointer-events: none;
}

@keyframes cuteComboPop {
    0% { transform: scale(0.3) rotate(-6deg); opacity: 0; }
    60% { transform: scale(1.18) rotate(3deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* Main Board Area - Full Height & Width Sprawling Mahjong Stage */
#board-container {
    flex: 1;
    position: relative;
    z-index: 10;
    contain: layout;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    padding: 10px 4px;
    background: radial-gradient(ellipse at 50% 50%, rgba(6, 95, 70, 0.45) 0%, rgba(4, 120, 87, 0.35) 60%, rgba(2, 44, 34, 0.5) 100%);
    border-radius: 18px;
    box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.35), inset 0 0 2px rgba(255, 255, 255, 0.15);
}

#board {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Symmetrical Mahjong Card Tile Element */
.tile {
    position: absolute;
    width: var(--card-w);
    height: var(--card-h);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 85%, #e2e8f0 100%);
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5), inset 0 -3.5px 0 #cbd5e1, inset 0 2px 0 #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
    -webkit-user-select: none;
    transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.16s;
    border: 2.2px solid #ffffff;
    padding: 2.5px;
    overflow: hidden;
    will-change: transform;
}

.tile:hover:not(.locked) {
    transform: translateY(-4px) scale(1.06);
}

.tile:active {
    transform: scale(0.92);
}

/* Smart Hint Tile Highlight Animation */
.tile.hint-highlight {
    animation: hintPulse 0.6s infinite alternate cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 3px solid #fbbf24 !important;
    z-index: 999 !important;
}

@keyframes hintPulse {
    0% { transform: scale(1); box-shadow: 0 0 12px #fbbf24, 0 0 24px #f59e0b; }
    100% { transform: scale(1.14); box-shadow: 0 0 25px #fbbf24, 0 0 45px #38bdf8; }
}

/* Tile Icon Container & Sweet-Spot Aesthetic Character Image */
.tile-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    overflow: hidden;
}

.tile-img {
    width: 82%;
    height: 78%;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    pointer-events: none;
}

.svg-icon {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.2));
}

/* Locked Tile Overlay & Shaking */
.tile.locked {
    filter: brightness(0.46) grayscale(0.35);
    cursor: pointer;
}

.tile.locked::after {
    content: '🔒';
    position: absolute;
    bottom: 4px;
    right: 4px;
    font-size: 10px;
    opacity: 0.7;
    pointer-events: none;
}

.tile.shaking {
    animation: lockShake 0.18s ease-in-out infinite;
}

@keyframes lockShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

/* Floating Top Emergency 6th Slot Holder (Positioned cleanly above bottom booster dock) */
.floating-extra-slot {
    position: absolute;
    bottom: 245px;
    bottom: calc(var(--tray-h, 108px) + 138px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    z-index: 500;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.floating-extra-slot.hidden {
    opacity: 0;
    transform: translate(-50%, 20px) scale(0.7);
    pointer-events: none;
}

.extra-slot-badge {
    background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
    color: #ffffff;
    font-size: 10px;
    font-weight: 900;
    padding: 2px 8px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.6);
    letter-spacing: 0.5px;
    animation: pulseBadge 1.2s infinite alternate;
}

@keyframes pulseBadge {
    0% { transform: scale(1); }
    100% { transform: scale(1.08); box-shadow: 0 0 15px rgba(56, 189, 248, 0.9); }
}

.extra-slot-box {
    width: var(--card-w);
    height: var(--card-h);
    border: 2.5px dashed #38bdf8;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.85);
    box-shadow: 0 8px 25px rgba(56, 189, 248, 0.35), inset 0 0 12px rgba(56, 189, 248, 0.2);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Bottom 5-Slot Fixed Tray Bar */
#slot-tray-container {
    padding: 14px 14px 26px 14px;
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 300;
}

#slot-tray-bg {
    width: var(--tray-w);
    height: var(--tray-h);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.96) 0%, rgba(30, 41, 59, 0.94) 100%);
    border: 2.5px solid rgba(251, 191, 36, 0.75);
    border-radius: 24px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(251, 191, 36, 0.2), inset 0 2px 8px rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 0 7px;
    gap: 14px;
    position: relative;
}

.slot-marker {
    width: var(--card-w);
    height: var(--card-h);
    border: 2px dashed rgba(251, 191, 36, 0.35);
    border-radius: 14px;
    background: radial-gradient(circle at 50% 50%, rgba(15, 23, 42, 0.8) 0%, rgba(2, 6, 23, 0.95) 100%);
    box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.7), 0 1px 2px rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

#slot-tiles-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Matched Burst Animation */
.tile.matching {
    animation: matchBurst 0.14s ease-out forwards;
}

@keyframes matchBurst {
    0% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.30); filter: brightness(2) drop-shadow(0 0 25px #fbbf24); }
    100% { transform: scale(0); opacity: 0; }
}

.modal-card.modal-defeat {
    border-color: #ef4444;
}

.modal-icon {
    font-size: 54px;
}

.modal-title {
    font-size: 26px;
    font-weight: 900;
    color: #ffffff;
}

.modal-desc {
    font-size: 14px;
    color: #94a3b8;
    line-height: 1.5;
}

.modal-stat {
    font-size: 18px;
    font-weight: 800;
    color: var(--accent-gold);
}

/* =========================================================
   GOLD COIN HUD & CHEST & PUZZLE GALLERY STYLES
   ========================================================= */

.badge-gold {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.28) 0%, rgba(217, 119, 6, 0.18) 100%);
    border: 1.5px solid #f59e0b;
}

.gold-icon {
    font-size: 14px;
}

/* Chest Modal */
.chest-card {
    background: linear-gradient(145deg, #1e1b4b 0%, #0f172a 100%);
    border: 2px solid #fbbf24;
    box-shadow: 0 0 35px rgba(245, 158, 11, 0.4);
    max-width: 380px;
    width: 90%;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
}

/* Star-Based Dynamic Chest Visuals */
.chest-card.card-star-1 {
    background: linear-gradient(145deg, #1e1b4b 0%, #0f172a 100%);
    border: 2px solid #d97706;
    box-shadow: 0 0 25px rgba(217, 119, 6, 0.4);
}

.chest-card.card-star-2 {
    background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
    border: 2px solid #cbd5e1;
    box-shadow: 0 0 30px rgba(203, 213, 225, 0.5);
}

.chest-card.card-star-3 {
    background: linear-gradient(145deg, #312e81 0%, #1e1b4b 100%);
    border: 2.5px solid #fbbf24;
    box-shadow: 0 0 35px rgba(251, 191, 36, 0.6);
}

.chest-card.card-star-4 {
    background: linear-gradient(145deg, #4c1d95 0%, #1e1b4b 100%);
    border: 2.5px solid #c084fc;
    box-shadow: 0 0 45px rgba(192, 132, 252, 0.7);
}

.chest-card.card-star-5 {
    background: linear-gradient(145deg, #581c87 0%, #311b92 50%, #0f172a 100%);
    border: 3px solid #f43f5e;
    box-shadow: 0 0 55px rgba(244, 63, 94, 0.8), 0 0 30px rgba(251, 191, 36, 0.7);
    animation: mythicPulse 2s infinite alternate;
}

@keyframes mythicPulse {
    0% { border-color: #f43f5e; box-shadow: 0 0 40px rgba(244, 63, 94, 0.8); }
    50% { border-color: #fbbf24; box-shadow: 0 0 55px rgba(251, 191, 36, 0.9); }
    100% { border-color: #a855f7; box-shadow: 0 0 65px rgba(168, 85, 247, 0.9); }
}

.chest-box.chest-star-1 { font-size: 80px; }
.chest-box.chest-star-2 { font-size: 84px; filter: drop-shadow(0 0 10px #cbd5e1); }
.chest-box.chest-star-3 { font-size: 88px; filter: drop-shadow(0 0 15px #fbbf24); }
.chest-box.chest-star-4 { font-size: 92px; filter: drop-shadow(0 0 20px #c084fc); }
.chest-box.chest-star-5 { font-size: 96px; filter: drop-shadow(0 0 25px #f43f5e) drop-shadow(0 0 15px #fbbf24); animation: chestBounce 1s infinite ease-in-out alternate; }

.chest-star-rating {
    font-size: 22px;
    margin-bottom: 4px;
    letter-spacing: 2px;
}

.chest-box-container {
    margin: 20px 0;
    cursor: pointer;
}

.chest-box {
    font-size: 80px;
    display: inline-block;
    transition: transform 0.2s ease;
    animation: chestBounce 1.2s infinite ease-in-out alternate;
}

.chest-box:hover {
    transform: scale(1.15) rotate(5deg);
}

@keyframes chestBounce {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(-12px) scale(1.08); }
}

.chest-reward-list {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 16px 0;
}

.chest-reward-item {
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid #fbbf24;
    border-radius: 14px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
    0% { transform: scale(0.2); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.reward-icon {
    font-size: 32px;
}

.reward-val {
    font-size: 15px;
    font-weight: 900;
    color: #fbbf24;
}

/* 7-Language Single Row Selector in Settings */
.lang-grid-selector {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 100%;
    padding: 4px 0;
    overflow-x: auto;
}

.lang-btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 8px 2px;
    border-radius: 10px;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    background: rgba(15, 23, 42, 0.6);
    color: #cbd5e1;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.lang-btn:hover {
    border-color: #38bdf8;
    color: #ffffff;
}

.lang-btn.active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: #34d399;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.5);
}

/* Round Floating Pop-Up Ad Chest Widget in Top-Right Corner of Main Menu Card */
.floating-ad-chest-widget {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a855f7 0%, #7e22ce 60%, #ec4899 100%);
    border: 2.5px solid #f472b6;
    box-shadow: 0 8px 24px rgba(168, 85, 247, 0.6), 0 0 16px rgba(244, 114, 182, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    animation: adWidgetBounce 2.2s ease-in-out infinite alternate;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

.floating-ad-chest-widget:hover {
    transform: scale(1.14) rotate(6deg);
    box-shadow: 0 12px 30px rgba(168, 85, 247, 0.8), 0 0 25px rgba(244, 114, 182, 0.7);
}

.floating-ad-chest-widget:active {
    transform: scale(0.92);
}

/* Floating Camera/Video Badge on Top Left of Circle */
.ad-camera-badge {
    position: absolute;
    top: -4px;
    left: -4px;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border: 1.5px solid #ffffff;
    border-radius: 50%;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
    z-index: 55;
    animation: cameraPulse 1.4s ease-in-out infinite alternate;
}

/* Big Sparkling Center Gift Box Icon */
.ad-chest-gift-icon {
    font-size: 26px;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
    animation: giftSparkle 1.8s ease-in-out infinite alternate;
}

/* Bottom Mini Pill Tag (Ücretsiz / Free) */
.ad-widget-label {
    position: absolute;
    bottom: -8px;
    background: #10b981;
    color: #ffffff;
    border: 1px solid #34d399;
    font-size: 10px;
    font-weight: 900;
    padding: 1px 7px;
    border-radius: 10px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.5);
    text-transform: uppercase;
}

@keyframes adWidgetBounce {
    0% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-5px) scale(1.05); }
    100% { transform: translateY(0) scale(1); }
}

@keyframes cameraPulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.2) rotate(-8deg); }
}

@keyframes giftSparkle {
    0% { transform: scale(1) rotate(0deg); }
    100% { transform: scale(1.12) rotate(6deg); }
}

/* Main Menu Dedicated AdMob Banner Slot Styling */
.main-menu-ad-banner {
    width: 100%;
    max-width: 335px;
    margin-top: clamp(4px, 0.8vh, 8px);
    padding: clamp(3px, 0.6vh, 6px);
    flex-shrink: 0;
    background: rgba(15, 23, 42, 0.75);
    border: 1.5px solid rgba(251, 191, 36, 0.35);
    border-radius: 16px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    box-sizing: border-box;
}

.ad-banner-badge {
    position: absolute;
    top: -9px;
    left: 14px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #ffffff;
    font-size: 9px;
    font-weight: 900;
    padding: 1px 7px;
    border-radius: 8px;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.admob-banner-slot {
    width: 100%;
    height: 50px;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 700;
    border: 1px dashed rgba(255, 255, 255, 0.2);
}

.ad-banner-demo-text {
    font-size: 11px;
    font-weight: 700;
    color: #cbd5e1;
}

/* Round Floating Pop-up Leaderboard Widget on Top Right (Below Ad Chest) */
.floating-leaderboard-widget {
    position: absolute;
    top: 80px;
    right: 14px;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 60%, #b45309 100%);
    border: 2.5px solid #fef08a;
    box-shadow: 0 8px 24px rgba(251, 191, 36, 0.6), 0 0 16px rgba(254, 240, 138, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    animation: adWidgetBounce 2.4s ease-in-out infinite alternate;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

.floating-leaderboard-widget:hover {
    transform: scale(1.14);
    box-shadow: 0 12px 30px rgba(251, 191, 36, 0.8), 0 0 25px rgba(254, 240, 138, 0.7);
}

.floating-leaderboard-widget:active {
    transform: scale(0.92);
}

.leaderboard-sparkle-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    border: 1.5px solid #ffffff;
    border-radius: 50%;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(139, 92, 246, 0.5);
    z-index: 102;
}

.leaderboard-center-icon {
    font-size: 24px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
    transform: translateY(-1px);
}

.leaderboard-widget-label {
    font-size: 9px;
    font-weight: 900;
    color: #ffffff;
    background: #d97706;
    padding: 1px 6px;
    border-radius: 8px;
    margin-top: 1px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* NICKNAME REGISTRATION MODAL STYLES */
.nickname-card {
    max-width: 360px;
    width: 90%;
    padding: 22px 18px;
    text-align: center;
    background: linear-gradient(180deg, #1e1b4b 0%, #0f172a 100%);
    border: 2px solid #fbbf24;
    border-radius: 24px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(251, 191, 36, 0.3);
}

.nickname-subtext {
    font-size: 13px;
    color: #cbd5e1;
    margin: 8px 0 16px 0;
    line-height: 1.4;
}

.nickname-form-group {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: left;
    margin-bottom: 18px;
}

.nickname-label {
    font-size: 12px;
    font-weight: 800;
    color: #fbbf24;
    margin-bottom: 4px;
}

.input-with-random, .tag-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nickname-input, .tag-input {
    flex: 1;
    background: rgba(15, 23, 42, 0.9);
    border: 1.5px solid rgba(251, 191, 36, 0.5);
    border-radius: 12px;
    padding: 10px 14px;
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    outline: none;
    transition: border-color 0.2s;
}

.nickname-input:focus, .tag-input:focus {
    border-color: #fbbf24;
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.4);
}

.tag-hash-symbol {
    font-size: 20px;
    font-weight: 900;
    color: #fbbf24;
}

.tag-input {
    width: 90px;
    letter-spacing: 2px;
    text-align: center;
}

.btn-random-dice {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    border: 1.5px solid #c084fc;
    color: #ffffff;
    border-radius: 12px;
    width: 42px;
    height: 42px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(139, 92, 246, 0.4);
    transition: transform 0.15s;
    flex-shrink: 0;
}

.btn-random-dice:active {
    transform: scale(0.9);
}

.nickname-error {
    font-size: 12px;
    font-weight: 800;
    color: #ef4444;
    margin-top: 8px;
    display: block;
    text-align: center;
}

.nickname-submit-btn {
    width: 100%;
    padding: 12px;
    font-size: 15px;
}

/* =========================================================
   LEADERBOARD MODAL: AIRY, SPATIAL & MODERN GLASSMORPHIC CARD
   ========================================================= */
.leaderboard-modal-card {
    max-width: 430px;
    width: 94%;
    height: 86vh;
    max-height: 780px;
    display: flex;
    flex-direction: column;
    padding: 16px 14px 12px 14px;
    background: linear-gradient(180deg, #0b1120 0%, #030712 100%);
    border: 1.5px solid rgba(251, 191, 36, 0.5);
    border-radius: 22px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), 0 0 25px rgba(251, 191, 36, 0.12);
    overflow: hidden;
    box-sizing: border-box;
}

.leaderboard-header {
    margin-bottom: 8px;
    padding: 0 4px;
}

.lb-header-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
}

.leaderboard-tabs-row {
    display: flex;
    gap: 6px;
    background: rgba(30, 41, 59, 0.65);
    padding: 3px;
    border-radius: 12px;
    margin-bottom: 8px;
    flex-shrink: 0;
}

.lb-tab-btn {
    flex: 1;
    padding: 7px 4px;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lb-tab-btn.active {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(245, 158, 11, 0.35);
}

/* Scrollable Container with Smooth Scrollbar & Zero Squish */
.leaderboard-list-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 2px 4px 6px 2px;
}

.leaderboard-list-scroll::-webkit-scrollbar {
    width: 4px;
}

.leaderboard-list-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
}

.leaderboard-list-scroll::-webkit-scrollbar-thumb {
    background: rgba(251, 191, 36, 0.35);
    border-radius: 4px;
}

/* =========================================================
   CLEAN, AIRY & ELEGANT LEADERBOARD ROWS (No Overlaps, No Squishing!)
   ========================================================= */
.lb-player-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    min-height: 52px;
    flex-shrink: 0 !important;
    background: rgba(30, 41, 59, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 13px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.lb-player-row:hover {
    background: rgba(51, 65, 85, 0.7);
    transform: translateX(2px);
}

.lb-player-row.self-highlight {
    border-color: #38bdf8 !important;
    background: rgba(56, 189, 248, 0.12) !important;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

/* =========================================================
   RANK 1: REFINED FIERY GOLD CHAMPION (Classy, not suffocating)
   ========================================================= */
.lb-player-row.top-1 {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.22) 0%, rgba(220, 38, 38, 0.14) 60%, rgba(15, 23, 42, 0.7) 100%);
    border: 1.5px solid #fbbf24;
    box-shadow: 0 4px 18px rgba(245, 158, 11, 0.3), inset 0 0 10px rgba(251, 191, 36, 0.15);
}

.lb-player-row.top-1::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -75%;
    width: 45%;
    height: 200%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.04) 20%,
        rgba(255, 237, 160, 0.4) 50%,
        rgba(255, 255, 255, 0.08) 80%,
        transparent 100%
    );
    transform: rotate(25deg);
    pointer-events: none;
    animation: kingShimmerSweep 3.2s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes kingShimmerSweep {
    0% { left: -75%; }
    35%, 100% { left: 160%; }
}

.rank-1-badge, .rank-2-badge, .rank-3-badge, .rank-10-badge {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 13px;
    flex-shrink: 0;
}

.rank-1-badge {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
    border: 1px solid rgba(254, 240, 138, 0.8);
}

.rank-1-badge .rank-digit {
    font-size: 13px;
    font-weight: 900;
    color: #ffffff;
}

.king-elite-pill {
    display: inline-flex;
    align-items: center;
    font-size: 9px;
    font-weight: 900;
    color: #ffffff;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    padding: 1px 7px;
    border-radius: 6px;
    margin-left: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4);
}

.lb-player-row.top-1 .lb-name-tag {
    color: #fffbeb;
    font-weight: 900;
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
}

.lb-player-row.top-1 .lb-tier-badge {
    color: #fef08a;
    font-weight: 700;
}

.lb-player-row.top-1 .lb-score-val {
    color: #fef08a;
    font-weight: 900;
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.7);
}

/* =========================================================
   RANK 2: REFINED METALLIC SILVER
   ========================================================= */
.lb-player-row.top-2 {
    background: linear-gradient(90deg, rgba(226, 232, 240, 0.14) 0%, rgba(148, 163, 184, 0.08) 60%, rgba(15, 23, 42, 0.7) 100%);
    border: 1.5px solid rgba(203, 213, 225, 0.6);
    box-shadow: 0 2px 10px rgba(203, 213, 225, 0.15);
}

.rank-2-badge {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
    color: #ffffff;
    box-shadow: 0 0 8px rgba(148, 163, 184, 0.4);
    border: 1px solid rgba(241, 245, 249, 0.7);
}

.rank-2-badge .rank-digit {
    font-size: 13px;
    font-weight: 900;
    color: #ffffff;
}

.lb-player-row.top-2 .lb-name-tag {
    color: #f8fafc;
}

.lb-player-row.top-2 .lb-tier-badge {
    color: #cbd5e1;
}

.lb-player-row.top-2 .lb-score-val {
    color: #e2e8f0;
}

/* =========================================================
   RANK 3: REFINED METALLIC BRONZE
   ========================================================= */
.lb-player-row.top-3 {
    background: linear-gradient(90deg, rgba(217, 119, 6, 0.14) 0%, rgba(146, 64, 14, 0.08) 60%, rgba(15, 23, 42, 0.7) 100%);
    border: 1.5px solid rgba(217, 119, 6, 0.6);
    box-shadow: 0 2px 10px rgba(217, 119, 6, 0.15);
}

.rank-3-badge {
    background: linear-gradient(135deg, #b45309 0%, #78350f 100%);
    color: #ffffff;
    box-shadow: 0 0 8px rgba(180, 83, 9, 0.4);
    border: 1px solid rgba(251, 191, 36, 0.5);
}

.rank-3-badge .rank-digit {
    font-size: 13px;
    font-weight: 900;
    color: #ffffff;
}

.lb-player-row.top-3 .lb-name-tag {
    color: #fef3c7;
}

.lb-player-row.top-3 .lb-tier-badge {
    color: #fcd34d;
}

.lb-player-row.top-3 .lb-score-val {
    color: #f59e0b;
}

/* =========================================================
   RANKS 4+: SLEEK, SUBTLE & CLEAN (ZERO VISUAL CLUTTER)
   ========================================================= */
.lb-rank-num {
    font-size: 13px;
    font-weight: 800;
    min-width: 36px;
    text-align: center;
    color: #94a3b8;
    flex-shrink: 0;
}

.rank-10-badge {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.4);
}

.rank-10-badge .rank-digit {
    font-size: 12px;
    font-weight: 800;
    color: #38bdf8;
}

.lb-player-row.top-10 .lb-tier-badge {
    color: #38bdf8;
}

.lb-player-row.top-50 .lb-rank-num {
    color: #c084fc;
}

.lb-player-row.top-50 .lb-tier-badge {
    color: #a855f7;
}

.lb-player-row.top-100 .lb-rank-num {
    color: #fbbf24;
}

.lb-player-row.top-100 .lb-tier-badge {
    color: #d97706;
}

.lb-player-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    margin: 0 10px;
}

.lb-name-tag {
    font-size: 13px;
    font-weight: 800;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}

.lb-name-text {
    font-weight: 800;
    color: inherit;
}

.lb-tag-pill {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.45);
    margin-left: 3px;
}

.lb-tier-badge {
    font-size: 10px;
    font-weight: 600;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.lb-score-val {
    font-size: 13px;
    font-weight: 900;
    color: #38bdf8;
    white-space: nowrap;
    text-align: right;
    flex-shrink: 0;
}

/* STICKY SELF RANK BOTTOM BAR */
.leaderboard-self-bar {
    margin-top: 8px;
    padding: 8px 12px;
    background: linear-gradient(90deg, #1e1b4b 0%, #172554 100%);
    border: 1.5px solid #38bdf8;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 16px rgba(56, 189, 248, 0.25);
    flex-shrink: 0;
}

.self-rank-badge {
    font-size: 15px;
    font-weight: 900;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.2);
    padding: 4px 10px;
    border-radius: 10px;
    border: 1px solid rgba(56, 189, 248, 0.5);
}

.self-info-col {
    display: flex;
    flex-direction: column;
    margin: 0 10px;
    flex: 1;
}

.self-name-tag {
    font-size: 13px;
    font-weight: 900;
    color: #ffffff;
}

.self-title-badge {
    font-size: 11px;
    font-weight: 700;
    color: #fbbf24;
}

.self-score-val {
    font-size: 14px;
    font-weight: 900;
    color: #fbbf24;
}

.btn-edit-nick-pill {
    background: rgba(251, 191, 36, 0.2);
    border: 1px solid rgba(251, 191, 36, 0.6);
    color: #fbbf24;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    cursor: pointer;
    transition: transform 0.15s, background 0.15s;
    line-height: 1.2;
}

.btn-edit-nick-pill:active {
    transform: scale(0.92);
    background: rgba(251, 191, 36, 0.45);
}

/* PLAYER PROFILE CARD MODAL STYLES */
.player-profile-card {
    max-width: 380px;
    width: 90%;
    padding: 20px 16px;
    background: linear-gradient(180deg, #1e1b4b 0%, #0f172a 100%);
    border: 2px solid #c084fc;
    border-radius: 24px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.9), 0 0 30px rgba(192, 132, 252, 0.3);
    text-align: center;
}

.profile-header-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 16px;
}

.profile-avatar-frame {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
    border: 3px solid #fef08a;
    font-size: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(251, 191, 36, 0.5);
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.profile-avatar-frame.king-avatar-glow {
    animation: kingAvatarPulse 2s infinite alternate;
    border-color: #fef08a !important;
}

@keyframes kingAvatarPulse {
    0% {
        box-shadow: 0 0 20px rgba(245, 158, 11, 0.8), 0 0 35px rgba(239, 68, 68, 0.5);
        transform: scale(1);
    }
    100% {
        box-shadow: 0 0 32px rgba(245, 158, 11, 1), 0 0 55px rgba(239, 68, 68, 0.8), 0 0 70px rgba(249, 115, 22, 0.5);
        transform: scale(1.06);
    }
}

.profile-avatar-frame.silver-avatar-glow {
    box-shadow: 0 0 22px rgba(226, 232, 240, 0.85), inset 0 0 10px rgba(255, 255, 255, 0.5) !important;
    border-color: #ffffff !important;
    background: linear-gradient(135deg, #cbd5e1 0%, #64748b 100%) !important;
}

.profile-avatar-frame.bronze-avatar-glow {
    box-shadow: 0 0 20px rgba(217, 119, 6, 0.85), inset 0 0 10px rgba(251, 191, 36, 0.3) !important;
    border-color: #fde68a !important;
    background: linear-gradient(135deg, #d97706 0%, #78350f 100%) !important;
}

.profile-avatar-frame.diamond-avatar-glow {
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.85), inset 0 0 10px rgba(186, 230, 253, 0.4) !important;
    border-color: #bae6fd !important;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
}

.profile-name-tag {
    font-size: 18px;
    font-weight: 900;
    color: #ffffff;
    margin: 0;
}

.profile-tier-badge {
    font-size: 12px;
    font-weight: 800;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.4);
    padding: 2px 10px;
    border-radius: 12px;
    margin-top: 4px;
}

.profile-global-rank {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    margin-top: 4px;
}

.profile-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.profile-stat-box {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.full-width-stat {
    grid-column: span 2;
}

.stat-icon {
    font-size: 20px;
}

.stat-label {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    margin-top: 2px;
}

.stat-val {
    font-size: 14px;
    font-weight: 900;
    color: #ffffff;
    margin-top: 2px;
}

.stat-sub {
    font-size: 11px;
    font-weight: 800;
    color: #fbbf24;
}

/* Mid-Level Quit Confirmation Modal Styles */
.confirm-quit-card {
    max-width: 360px;
    width: 90%;
    padding: 22px 18px;
    text-align: center;
    background: linear-gradient(180deg, #1e1b4b 0%, #0f172a 100%);
    border: 2px solid #ef4444;
    border-radius: 24px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.9), 0 0 30px rgba(239, 68, 68, 0.3);
}

.quit-warning-text {
    font-size: 13.5px;
    color: #cbd5e1;
    line-height: 1.5;
    margin: 14px 0 20px 0;
    text-align: left;
    background: rgba(239, 68, 68, 0.1);
    border: 1px dashed rgba(239, 68, 68, 0.5);
    padding: 12px 14px;
    border-radius: 14px;
}

.quit-btn-row {
    display: flex;
    gap: 10px;
}

.quit-btn {
    flex: 1;
    padding: 12px 8px;
    font-size: 13px;
}

.penalty-accept-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    border-color: #fca5a5 !important;
}

/* Floating Lucky Wheel Widget */
.floating-wheel-widget {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 60%, #ef4444 100%);
    border: 2.5px solid #fbbf24;
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.6), 0 0 16px rgba(251, 191, 36, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    animation: adWidgetBounce 2.4s ease-in-out infinite alternate;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

.floating-wheel-widget:hover {
    transform: scale(1.14) rotate(-6deg);
    box-shadow: 0 12px 30px rgba(245, 158, 11, 0.8), 0 0 25px rgba(251, 191, 36, 0.7);
}

.floating-wheel-widget:active {
    transform: scale(0.92);
}

/* Floating Sparkle Badge on Top Right of Wheel Circle */
.wheel-sparkle-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: 1.5px solid #ffffff;
    border-radius: 50%;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
    z-index: 55;
    animation: cameraPulse 1.6s ease-in-out infinite alternate;
}

/* Big Sparkling Center Wheel Icon */
.wheel-center-icon {
    font-size: 26px;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
    animation: giftSparkle 2s ease-in-out infinite alternate;
}

/* =========================================================
   FLOATING DAILY GIFT WIDGET (Positioned below wheel: top: 80px; left: 14px)
   ========================================================= */
.floating-daily-gift-widget {
    position: absolute;
    top: 80px;
    left: 14px;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981 0%, #059669 60%, #047857 100%);
    border: 2.5px solid #34d399;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.55), 0 0 16px rgba(52, 211, 153, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    animation: adWidgetBounce 2.3s ease-in-out infinite alternate;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

.floating-daily-gift-widget:hover {
    transform: scale(1.14);
    box-shadow: 0 12px 30px rgba(16, 185, 129, 0.8), 0 0 25px rgba(52, 211, 153, 0.7);
}

.floating-daily-gift-widget:active {
    transform: scale(0.92);
}

.daily-gift-center-icon {
    font-size: 24px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
    transform: translateY(-1px);
}

.daily-gift-widget-label {
    font-size: 9px;
    font-weight: 900;
    color: #ffffff;
    background: #047857;
    padding: 1px 6px;
    border-radius: 8px;
    margin-top: 1px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.widget-notify-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 15px;
    height: 15px;
    background: #ef4444;
    border: 2px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 10px #ef4444;
    animation: pulseNotify 1.5s infinite;
    z-index: 105;
}

@keyframes pulseNotify {
    0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1.15); box-shadow: 0 0 0 7px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* =========================================================
   DAILY & WEEKLY REWARDS MODAL CARD
   ========================================================= */
.daily-rewards-card {
    max-width: 440px;
    width: 92%;
    max-height: 88vh;
    overflow-y: auto;
    background: linear-gradient(180deg, #0f172a 0%, #1e1b4b 100%);
    border: 2px solid rgba(16, 185, 129, 0.6);
    border-radius: 24px;
    padding: 20px 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(16, 185, 129, 0.25);
    position: relative;
}

.daily-rewards-header {
    text-align: center;
    margin-bottom: 14px;
}

.daily-title-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Weekly Milestone Progress Card */
.weekly-milestone-card {
    background: rgba(30, 41, 59, 0.7);
    border: 1.5px solid rgba(251, 191, 36, 0.4);
    border-radius: 16px;
    padding: 12px 14px;
    margin-bottom: 14px;
    position: relative;
    overflow: hidden;
}

.weekly-milestone-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.weekly-chest-svg {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.5));
}

.weekly-milestone-texts {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.weekly-title {
    display: block;
    font-size: 13px;
    font-weight: 900;
    color: #fbbf24;
    letter-spacing: 0.3px;
}

.weekly-reward-preview {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #cbd5e1;
}

.weekly-streak-badge {
    font-size: 11px;
    font-weight: 900;
    color: #ffffff;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    padding: 3px 8px;
    border-radius: 8px;
    white-space: nowrap;
}

.weekly-progress-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    overflow: hidden;
}

.weekly-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #fbbf24 100%);
    border-radius: 999px;
    transition: width 0.3s ease;
}

.weekly-claim-btn.hidden {
    display: none !important;
}

.weekly-claim-btn {
    width: 100%;
    margin-top: 10px;
    padding: 10px;
    font-size: 13px;
    font-weight: 900;
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
    border: 1px solid #fef08a;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.5);
    animation: pulseNotify 1.8s infinite;
}

/* 7-Day Grid Layout */
.daily-grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.daily-day-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 10px 6px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    position: relative;
    min-height: 108px;
    transition: transform 0.2s, border-color 0.2s, background 0.2s;
}

.daily-day-card.vip-day {
    grid-column: span 3;
    min-height: 85px;
    flex-direction: row;
    justify-content: space-between;
    padding: 10px 16px;
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.15) 0%, rgba(16, 185, 129, 0.15) 100%);
    border-color: rgba(251, 191, 36, 0.6);
}

.daily-day-card.claimed {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(16, 185, 129, 0.35);
    opacity: 0.75;
}

.daily-day-card.active-today {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(5, 150, 105, 0.2) 100%);
    border-color: #34d399;
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.4), inset 0 0 8px rgba(52, 211, 153, 0.2);
    transform: scale(1.02);
}

.daily-day-card.locked {
    opacity: 0.45;
}

.day-badge {
    font-size: 10px;
    font-weight: 800;
    color: #94a3b8;
    letter-spacing: 0.5px;
}

.daily-day-card.active-today .day-badge {
    color: #34d399;
}

.daily-day-card.vip-day .day-badge {
    color: #fbbf24;
    font-size: 11px;
}

.day-icon-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 3px auto;
    transition: all 0.2s ease;
}
.daily-day-card.active-today .day-icon-circle {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(52, 211, 153, 0.5);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}
.daily-day-card.vip-day .day-icon-circle {
    width: 44px;
    height: 44px;
    background: rgba(251, 191, 36, 0.15);
    border-color: rgba(251, 191, 36, 0.45);
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.35);
}
.day-status-pill.pill-tomorrow {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.35);
}

.day-icon-wrap {
    margin: 4px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.day-reward-svg {
    width: 26px;
    height: 26px;
    stroke: #fbbf24;
}

.day-reward-text {
    font-size: 11px;
    font-weight: 800;
    color: #f1f5f9;
    margin-bottom: 6px;
    line-height: 1.2;
}

.daily-claim-btn {
    width: 88%;
    padding: 5px 0;
    font-size: 10px;
    font-weight: 900;
    border-radius: 8px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: 1px solid #34d399;
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.5);
    transition: transform 0.15s;
}

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

.day-status-pill {
    font-size: 9px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
}

.day-status-pill.pill-claimed {
    color: #34d399;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.day-status-pill.pill-locked {
    color: #64748b;
    background: rgba(100, 116, 139, 0.15);
    border: 1px solid rgba(100, 116, 139, 0.25);
}

/* Bottom Mini Pill Tag (Çark / Wheel) */
.wheel-widget-label {
    position: absolute;
    bottom: -8px;
    background: #f59e0b;
    color: #ffffff;
    border: 1px solid #fbbf24;
    font-size: 10px;
    font-weight: 900;
    padding: 1px 7px;
    border-radius: 10px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.5);
    text-transform: uppercase;
}

/* 3D Lucky Wheel Modal Container Styling */
.wheel-card {
    background: linear-gradient(145deg, #1e1b4b 0%, #0f172a 100%);
    border: 2.5px solid #fbbf24;
    box-shadow: 0 0 45px rgba(245, 158, 11, 0.5), inset 0 0 20px rgba(0, 0, 0, 0.7);
    padding: 24px 18px;
    max-width: 360px;
    width: 90%;
    text-align: center;
    border-radius: 28px;
    position: relative;
}

.wheel-wrapper {
    position: relative;
    width: 280px;
    height: 280px;
    margin: 16px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Golden Pointer Indicator at Top */
.wheel-pointer {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 28px;
    color: #fbbf24;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
    z-index: 80;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8));
    animation: pointerWiggle 1s ease-in-out infinite alternate;
}

@keyframes pointerWiggle {
    0% { transform: translateX(-50%) translateY(0); }
    100% { transform: translateX(-50%) translateY(3px); }
}

.wheel-disc {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.6), inset 0 0 15px rgba(255, 255, 255, 0.2);
    border: 4px solid #fbbf24;
    overflow: hidden;
    transition: transform 4s cubic-bezier(0.15, 0.9, 0.25, 1);
}

.wheel-center-cap {
    position: absolute;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border: 3px solid #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    z-index: 70;
}

.wheel-status-badge {
    background: rgba(255, 255, 255, 0.1);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.4);
    padding: 4px 14px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 800;
    display: inline-block;
    margin-bottom: 12px;
}

.btn-spin-wheel {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    border: 2px solid #fde047 !important;
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5) !important;
    color: #ffffff !important;
    font-size: 16px !important;
    font-weight: 900 !important;
    width: 100% !important;
}

/* Stage 2 Reward Announcement Styling */
.wheel-reward-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0;
}

.wheel-reward-icon-large {
    font-size: 72px;
    margin-bottom: 12px;
    filter: drop-shadow(0 4px 15px rgba(251, 191, 36, 0.6));
    animation: rewardIconBounce 1s cubic-bezier(0.34, 1.56, 0.64, 1) infinite alternate;
}

@keyframes rewardIconBounce {
    0% { transform: scale(1) translateY(0); }
    100% { transform: scale(1.15) translateY(-8px); }
}

.wheel-reward-detail {
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid #fbbf24;
    border-radius: 16px;
    padding: 12px 20px;
    color: #ffffff;
    font-size: 18px;
    font-weight: 900;
    margin-top: 10px;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

/* Journal Book & Jigsaw Styling */
.btn-journal {
    background: linear-gradient(135deg, #b45309 0%, #78350f 100%) !important;
    border: 1.5px solid #f59e0b !important;
    box-shadow: 0 4px 14px rgba(180, 83, 9, 0.4) !important;
    color: #fef3c7 !important;
}

.journal-book-card {
    background: linear-gradient(145deg, #2e1065 0%, #1e1b4b 100%) !important;
    border: 3px solid #f59e0b !important;
    box-shadow: 0 0 40px rgba(245, 158, 11, 0.4), inset 0 0 15px rgba(0, 0, 0, 0.6) !important;
}

.journal-book-header {
    text-align: center;
    margin-bottom: 8px;
}

.journal-ribbon {
    display: inline-block;
    background: linear-gradient(135deg, #d97706 0%, #92400e 100%);
    color: #ffffff;
    font-size: 11px;
    font-weight: 900;
    padding: 3px 12px;
    border-radius: 12px;
    border: 1px solid #fbbf24;
    letter-spacing: 1px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.journal-page-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.3);
    padding: 6px 10px;
    border-radius: 14px;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.journal-nav-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #f1f5f9;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.journal-nav-btn:hover {
    background: #f59e0b;
    color: #ffffff;
}

.journal-page-badge {
    font-size: 12px;
    font-weight: 900;
    color: #fbbf24;
}

/* Jigsaw Puzzle Piece Shapes */
.puzzle-slot {
    border: 1.5px dashed rgba(255, 255, 255, 0.25);
    transition: transform 0.2s ease, filter 0.2s ease;
}

.puzzle-slot.jigsaw-shaped,
.puzzle-piece-item.jigsaw-shaped {
    box-shadow: none !important;
    filter: drop-shadow(0px 3px 5px rgba(0, 0, 0, 0.6));
}

.puzzle-slot.filled.jigsaw-shaped {
    border: none !important;
    filter: drop-shadow(0px 2px 4px rgba(0, 0, 0, 0.7));
}

.puzzle-piece-item {
    transition: transform 0.15s ease, filter 0.15s ease;
}

.puzzle-piece-item:hover {
    transform: scale(1.12);
    filter: drop-shadow(0px 5px 10px rgba(251, 191, 36, 0.8));
}

/* Puzzle Gallery Modal */
.gallery-modal-card {
    max-width: 420px;
    width: 94%;
    max-height: 94vh;
    overflow-y: auto;
    background: linear-gradient(145deg, #0f172a 0%, #1e1b4b 100%);
    border: 2px solid #38bdf8;
    box-shadow: 0 0 40px rgba(56, 189, 248, 0.3);
    padding: 12px 14px;
}

.puzzle-tabs-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 6px 4px;
    margin-bottom: 8px;
    scrollbar-width: thin;
}

.puzzle-tab-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 5px 10px;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.puzzle-tab-btn.active {
    background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
    border-color: #38bdf8;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.4);
}

.journal-character-selector-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 4px 0;
    width: 100%;
}

.journal-arrow-nav-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
    border: 1.5px solid #fef08a;
    border-radius: 12px;
    width: 38px;
    height: 38px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transition: transform 0.15s, filter 0.15s;
    user-select: none;
    touch-action: manipulation;
}

.journal-arrow-nav-btn:active {
    transform: scale(0.92);
}

.puzzle-pct-badge {
    background: rgba(251, 191, 36, 0.18);
    border: 1px solid rgba(251, 191, 36, 0.6);
    color: #fbbf24;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 900;
}

.puzzle-tab-btn.active .puzzle-pct-badge {
    background: rgba(255, 255, 255, 0.25);
    border-color: #ffffff;
    color: #ffffff;
}

.puzzle-tab-btn.locked {
    opacity: 0.65;
    background: rgba(15, 23, 42, 0.45);
    border-color: rgba(148, 163, 184, 0.25);
    color: #64748b;
}

.puzzle-tab-btn.locked.active {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    border-color: #94a3b8;
    color: #f1f5f9;
    box-shadow: 0 4px 12px rgba(71, 85, 105, 0.4);
}

.puzzle-tab-btn.locked .puzzle-pct-badge {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: #f87171;
}

.puzzle-locked-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    text-align: center;
    z-index: 10;
    gap: 8px;
    border-radius: 11px;
}

.puzzle-locked-overlay .lock-icon {
    font-size: 34px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.6));
    animation: lockBounce 2s infinite ease-in-out;
}

.puzzle-locked-overlay .lock-title {
    font-size: 13px;
    font-weight: 900;
    color: #f1f5f9;
    letter-spacing: 0.5px;
}

.puzzle-locked-overlay .lock-desc {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 600;
    line-height: 1.4;
}

.puzzle-locked-overlay .lock-progress {
    margin-top: 4px;
    padding: 4px 12px;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: 20px;
    color: #fbbf24;
    font-size: 10px;
    font-weight: 800;
}

@keyframes lockBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.puzzle-board-wrapper {
    position: relative;
    margin: 6px auto;
    width: 195px;
    height: 260px;
    max-width: 75vw;
    border-radius: 14px;
    border: 3px solid #fbbf24;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.3), inset 0 0 15px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    background-size: 100% 100%;
    background-position: center;
    flex-shrink: 0;
}

.puzzle-board-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: grayscale(80%);
    pointer-events: none;
    z-index: 1;
}

.puzzle-grid-3x4 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 0;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 2;
}

.puzzle-slot {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    font-size: 13px;
    font-weight: 900;
    color: rgba(251, 191, 36, 0.8);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
    border: 1px dashed rgba(255, 255, 255, 0.25);
    transition: all 0.2s ease;
}

.puzzle-slot.empty {
    background: rgba(0, 0, 0, 0.2);
}

.puzzle-slot.filled {
    border: none !important;
    z-index: 3;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.4));
}

.puzzle-slot.drag-over {
    border-color: #fbbf24;
    background: rgba(251, 191, 36, 0.25);
}

.puzzle-slot.filled .puzzle-piece-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.completed-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(16, 185, 129, 0.92);
    color: #ffffff;
    font-size: 18px;
    font-weight: 900;
    padding: 10px 20px;
    border-radius: 20px;
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.8);
    z-index: 10;
}

.completed-badge.hidden {
    display: none !important;
}

.puzzle-slot.watermark {
    opacity: 0.25;
    filter: grayscale(90%) brightness(0.6);
}

.gallery-action-bar {
    margin: 6px 0;
    display: flex;
    justify-content: center;
}

.buy-piece-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: 1.5px solid #fbbf24;
    color: #ffffff;
    font-weight: 900;
    padding: 5px 12px;
    font-size: 13px;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(245, 158, 11, 0.4);
}

.buy-cost-tag {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

.inventory-section {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 6px 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.inventory-title {
    font-size: 12px;
    font-weight: 800;
    color: #cbd5e1;
    margin-bottom: 8px;
    text-align: left;
}

.inventory-tray {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    min-height: 70px;
    padding: 4px;
    align-items: center;
}

.puzzle-piece-item {
    width: 54px;
    height: 70px;
    flex-shrink: 0;
    border-radius: 8px;
    border: 2px solid #fbbf24;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    cursor: grab;
    position: relative;
    overflow: hidden;
    touch-action: none;
    user-select: none;
}

.puzzle-piece-item:active {
    cursor: grabbing;
    transform: scale(1.1);
}

.piece-label {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.7);
    color: #fbbf24;
    font-size: 9px;
    font-weight: 900;
    padding: 1px 4px;
    border-radius: 4px;
}

.board-mat-frame {
    position: absolute;
    inset: 10px 12px 14px 12px;
    border: 2px solid rgba(251, 191, 36, 0.45);
    border-radius: 24px;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.4), 0 8px 30px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.mat-corner {
    position: absolute;
    width: 22px;
    height: 22px;
    background: radial-gradient(circle at 35% 35%, #fef08a 0%, #fbbf24 60%, #d97706 100%);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0l3.5 8.5L24 12l-8.5 3.5L12 24l-3.5-8.5L0 12l8.5-3.5z'/%3E%3C/svg%3E") no-repeat center / contain;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0l3.5 8.5L24 12l-8.5 3.5L12 24l-3.5-8.5L0 12l8.5-3.5z'/%3E%3C/svg%3E") no-repeat center / contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 6px rgba(251, 191, 36, 0.7));
    opacity: 0.85;
    user-select: none;
    pointer-events: none;
    z-index: 2;
}

.mat-corner.corner-tl { top: 10px; left: 10px; transform: rotate(0deg); }
.mat-corner.corner-tr { top: 10px; right: 10px; transform: rotate(90deg); }
.mat-corner.corner-bl { bottom: 10px; left: 10px; transform: rotate(270deg); }
.mat-corner.corner-br { bottom: 10px; right: 10px; transform: rotate(180deg); }


/* GPU Acceleration & Anti-Flickering Layer Optimization */
.card-3d, .card-inner, .tile-moving {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Strict Landscape Lock: Keeps game strictly centered in Portrait column when turned sideways */
@media screen and (orientation: landscape) {
    #app-wrapper {
        background: radial-gradient(circle at 50% 50%, #059669 0%, #047857 50%, #064e3b 85%, #022c22 100%) !important;
    }
    #game-container {
        width: 100vh !important;
        max-width: 480px !important;
        height: 100vh !important;
        height: 100dvh !important;
        margin: 0 auto !important;
        border-left: 2px solid rgba(255, 255, 255, 0.25);
        border-right: 2px solid rgba(255, 255, 255, 0.25);
        box-shadow: 0 0 60px rgba(0, 0, 0, 0.7);
    }
}

/* Small Screen Phones (< 380px width, e.g. iPhone SE, Galaxy A Series) */
@media (max-width: 380px) {
    .menu-card {
        padding: 24px 14px;
        gap: 12px;
        border-radius: 28px;
    }
    .menu-logo-frame {
        width: 96px;
        height: 96px;
        border-radius: 22px;
    }
    .menu-title {
        font-size: 24px !important;
    }
    .menu-subtitle {
        font-size: 13px !important;
    }
    .btn-menu {
        padding: 12px 16px !important;
        font-size: 13px !important;
    }
    .bg-char {
        width: 46px;
        height: 46px;
        border-radius: 14px;
    }
    .sunburst-aura {
        width: 130px;
        height: 130px;
    }
    .floating-wheel-widget,
    .floating-ad-chest-widget {
        width: 54px;
        height: 54px;
    }
    #slot-tray-container {
        padding: 10px 8px 20px 8px;
    }
    #slot-tray-bg {
        gap: 8px;
        padding: 0 5px;
    }
    .tile {
        border-radius: 10px;
        border-width: 1.8px;
    }
    .hud-bar {
        padding: 6px 8px !important;
        gap: 6px !important;
    }
}

/* Extra Small Screen Phones (< 340px width) */
@media (max-width: 340px) {
    .menu-card {
        padding: 18px 10px;
        gap: 10px;
    }
    .menu-logo-frame {
        width: 80px;
        height: 80px;
    }
    .menu-title {
        font-size: 20px !important;
    }
    .btn-menu {
        padding: 10px 14px;
        font-size: 13px;
    }
}

/* Compact Height Phones (< 740px viewport height, e.g. iPhone SE, 667px-740px) */
@media (max-height: 740px) {
    .menu-card {
        padding: 16px 12px !important;
        gap: 8px !important;
    }
    .menu-logo-frame {
        width: 80px !important;
        height: 80px !important;
    }
    .menu-hero-icon {
        width: 60px !important;
        height: 60px !important;
    }
    .menu-title {
        font-size: 20px !important;
    }
    .menu-subtitle {
        font-size: 11px !important;
    }
    .btn-menu {
        padding: 8px 12px !important;
        min-height: 36px !important;
        font-size: 12px !important;
    }
    .menu-btn-group {
        gap: 6px !important;
        margin-top: 4px !important;
    }
    .wheel-card {
        padding: 14px 10px !important;
        gap: 8px !important;
    }
    .wheel-wrapper {
        width: 220px !important;
        height: 220px !important;
        margin: 6px auto !important;
    }
    #wheel-canvas {
        width: 220px !important;
        height: 220px !important;
    }
    .chest-card {
        padding: 16px 12px !important;
        gap: 8px !important;
    }
    .chest-reward-list {
        max-height: 140px !important;
    }
    .settings-card {
        padding: 14px 10px !important;
        gap: 8px !important;
    }
    .setting-row {
        padding: 6px 10px !important;
    }
    .settings-body-scroll {
        max-height: calc(72dvh - 85px) !important;
        max-height: calc(72vh - 85px) !important;
    }
}

/* ================= =========================================
   CYBERCORE INTERACTIVE STUDIO INTRO STAGE (STANDALONE / COLD BOOT)
   ========================================================= */
#cybercore-intro-stage {
    position: absolute;
    inset: 0;
    z-index: 999999;
    background: radial-gradient(circle at center, #0a1428 0%, #03050a 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: opacity 0.5s ease, filter 0.5s ease;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

#cybercore-intro-stage.fade-out,
#cybercore-intro-stage.intro-hidden {
    opacity: 0 !important;
    filter: blur(10px) !important;
    pointer-events: none !important;
    transition: opacity 0.6s ease, filter 0.6s ease !important;
}

.intro-grid {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(0, 242, 254, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 242, 254, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center center;
    opacity: 0.2;
}

.glow-aura {
    position: absolute;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 242, 254, 0.4) 0%, rgba(56, 189, 248, 0.12) 50%, transparent 75%);
    filter: blur(50px);
    opacity: 0.9;
}

.logo-box {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    animation: instantSnap 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes instantSnap {
    0% { opacity: 0; transform: scale(0.85); filter: blur(8px); }
    100% { opacity: 1; transform: scale(1); filter: blur(0px); }
}

.vector-ci-logo {
    width: 130px;
    height: 130px;
    filter: drop-shadow(0 0 20px rgba(0, 242, 254, 0.8)) drop-shadow(0 0 40px rgba(2, 132, 199, 0.5));
    animation: logoPulse 3s ease-in-out infinite alternate;
}

@keyframes logoPulse {
    0% { transform: translateY(0px) scale(1); }
    100% { transform: translateY(-4px) scale(1.02); }
}

.brand-title {
    font-family: 'Orbitron', 'Fredoka', sans-serif;
    font-size: 2.4rem;
    font-weight: 900;
    letter-spacing: 6px;
    background: linear-gradient(135deg, #ffffff 20%, #00f2fe 70%, #38bdf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 35px rgba(0, 242, 254, 0.55);
    line-height: 1;
    position: relative;
}

.brand-subtitle {
    font-family: 'Orbitron', 'Fredoka', sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 13px;
    text-transform: uppercase;
    margin-right: -13px;
    opacity: 0.95;
}

.light-sweep {
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.75), transparent);
    transform: skewX(-25deg);
    animation: sweep 1.4s ease-in-out forwards 0.1s;
    pointer-events: none;
}

@keyframes sweep {
    0% { left: -100%; }
    100% { left: 200%; }
}

/* Safe Area Insets for Notched Phones */
@supports (padding-top: env(safe-area-inset-top)) {
    #game-container {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
    #slot-tray-container {
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }
}

/* =========================================================
   LIVE LEADERBOARD REFRESH CONTROLS & COUNTDOWN TIMER STYLES
   ========================================================= */
.lb-live-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 6px;
}

.btn-refresh-lb {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.2);
    border: 1.5px solid #10b981;
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-refresh-lb:hover {
    background: rgba(16, 185, 129, 0.35);
    transform: scale(1.08);
}

.btn-refresh-lb:active {
    transform: scale(0.92);
}

.btn-refresh-lb .refresh-icon {
    font-size: 14px;
    line-height: 1;
    display: inline-block;
}

.btn-refresh-lb.spinning .refresh-icon,
.btn-refresh-lb.spinning .refresh-svg {
    animation: spinIcon 0.6s linear infinite;
}

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

.lb-timer-countdown {
    font-size: 11px;
    font-weight: 700;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid rgba(56, 189, 248, 0.25);
}

/* =========================================================
   MODERN MINIMALIST VECTOR SVG ICONS & PRESTIGE BADGES
   ========================================================= */
.menu-widget-svg {
    width: 24px;
    height: 24px;
    stroke: #ffffff;
    display: block;
}

.logo-crown-svg {
    width: 44px;
    height: 44px;
    stroke: #fbbf24;
    fill: rgba(251, 191, 36, 0.2);
    filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.6));
    animation: crownHover 2.5s ease-in-out infinite;
    display: block;
    margin: 0 auto 6px auto;
}

.hud-svg {
    width: 20px;
    height: 20px;
    stroke: #e2e8f0;
    display: block;
    transition: stroke 0.2s, transform 0.2s;
}

.hud-icon-btn:hover .hud-svg {
    stroke: #ffffff;
    transform: scale(1.08);
}

.booster-svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    display: block;
}

.timer-svg {
    width: 15px;
    height: 15px;
    stroke: #38bdf8;
    display: inline-block;
    vertical-align: middle;
}

.gold-svg {
    width: 15px;
    height: 15px;
    stroke: #fbbf24;
    fill: rgba(251, 191, 36, 0.25);
    display: inline-block;
    vertical-align: middle;
}

.modal-title-svg {
    width: 22px;
    height: 22px;
    stroke: #94a3b8;
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
}

.modal-icon-svg {
    width: 52px;
    height: 52px;
    display: block;
    margin: 0 auto 12px auto;
}

.modal-icon-svg.victory-svg {
    stroke: #fbbf24;
    fill: rgba(251, 191, 36, 0.15);
    filter: drop-shadow(0 0 12px rgba(251, 191, 36, 0.6));
}

.modal-icon-svg.defeat-svg {
    stroke: #ef4444;
    fill: rgba(239, 68, 68, 0.15);
    filter: drop-shadow(0 0 12px rgba(239, 68, 68, 0.6));
}

.chest-box-svg {
    width: 54px;
    height: 54px;
    stroke: #fbbf24;
    fill: rgba(251, 191, 36, 0.18);
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.5));
}

.wheel-center-svg {
    width: 18px;
    height: 18px;
    display: block;
}

.dice-svg {
    width: 18px;
    height: 18px;
    stroke: #94a3b8;
    display: block;
    transition: stroke 0.2s;
}

.btn-random-dice:hover .dice-svg {
    stroke: #fbbf24;
}

.refresh-svg {
    width: 18px;
    height: 18px;
    stroke: #94a3b8;
    display: block;
    transition: stroke 0.2s, transform 0.3s;
}

.btn-refresh-lb:hover .refresh-svg {
    stroke: #38bdf8;
}

.chest-star-display {
    color: #fbbf24;
    font-size: 20px;
    letter-spacing: 4px;
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.6);
}
