@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --gold: #d4af37;
    --gold-glow: rgba(212, 175, 55, 0.4);
    --bg-dark: #050508;
    --card-red: #8b0000;
    --card-green: #006400;
    --card-blue: #00008b;
    --panel-glow-red: rgba(255, 0, 0, 0.3);
    --panel-glow-green: rgba(0, 255, 0, 0.2);
    --panel-glow-blue: rgba(0, 0, 255, 0.3);
}

body {
    background-color: transparent;
    color: white;
    font-family: 'Inter', sans-serif;
    margin: 0;
    overflow: hidden;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Background Grid */
.dashboard-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    background: transparent;
    display: flex;
    flex-direction: column;
    padding: 10px 20px;
    box-sizing: border-box;
}

.dashboard-wrapper::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(0, 102, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 102, 255, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

/* Torches */
.torch {
    position: absolute;
    top: 20px;
    width: 40px;
    height: 120px;
    background: linear-gradient(to bottom, #ff4500, #ff8c00, transparent);
    filter: blur(20px);
    opacity: 0.6;
    animation: flicker 2s infinite alternate;
}

.torch-left {
    left: 40px;
}

.torch-right {
    right: 40px;
}

@keyframes flicker {
    0% {
        opacity: 0.5;
        transform: scale(1);
    }

    100% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    margin-bottom: 5px;

}

.profile-section {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(26, 26, 46, 0.9);
    border: 2px solid rgba(212, 175, 55, 0.7);
    padding: 5px 10px;
    border-radius: 8px;
    position: relative;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.7);
}

.avatar-container {
    width: 35px;
    height: 35px;
    border: 1.5px solid var(--gold);
    background: #111;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    border-radius: 6px;
}

.avatar-container img {
    width: 80%;
    height: 80%;
}

.level-badge {
    position: absolute;
    bottom: -6px;
    background: #d4af37;
    color: black;
    font-weight: bold;
    padding: 1px 4px;
    border-radius: 4px;
    font-size: 10px;
}

.player-meta {
    display: flex;
    flex-direction: column;
}

.player-name {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 1px;
    color: white;
}

.player-rank {
    font-size: 10px;
    color: var(--gold);
    text-transform: uppercase;
}

.xp-bar-container {
    width: 90px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin-top: 3px;
    overflow: hidden;
}

.xp-fill {
    width: 50%;
    height: 100%;
    background: #00ff88;
    box-shadow: 0 0 10px #00ff88;
}

/* Logo */
.header-layout {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    z-index: 10;
}

.logo-container {
    text-align: center;
}

.logo-main {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(24px, 3.5vh, 36px);
    font-weight: 700;
    background: linear-gradient(to bottom, #fff9e6 0%, #d4af37 50%, #8a6d1e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
    line-height: 0.9;
    filter: drop-shadow(0 0 15px rgba(212, 175, 55, 0.5));
    text-transform: uppercase;
}

.logo-sub {
    font-size: 10px;
    letter-spacing: 4px;
    color: #fff;
    opacity: 0.8;
    text-transform: uppercase;
    margin-top: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.logo-sub::before,
.logo-sub::after {
    content: "✦";
    color: var(--gold);
    font-size: 10px;
}

/* Stats */
.stats-section {
    display: flex;
    gap: 15px;
    align-items: center;
}

.stat-item {
    background: rgba(26, 26, 46, 0.9);
    border: 2px solid rgba(212, 175, 55, 0.7);
    padding: 5px 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-val {
    font-weight: 700;
    color: white;
    font-size: 14px;
}

.plus-btn {
    background: #c9a96e;
    color: black;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    cursor: pointer;
    font-size: 12px;
}

.settings-btn {
    width: 32px;
    height: 32px;
    background: rgba(26, 26, 46, 0.9);
    border: 2px solid rgba(212, 175, 55, 0.7);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 16px;
}

/* Layout Main */
.main-layout {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex: 1;
    z-index: 5;
    padding: 10px 0;
    overflow: hidden;
}

.side-nav {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.nav-item {
    width: 140px;
    height: 110px;
    background: rgba(26, 26, 46, 0.9);
    border: 2px solid rgba(212, 175, 55, 0.6);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.6);
}

.nav-icon {
    font-size: 36px;
}

.nav-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--gold);
    font-weight: 700;
}

/* Main Cards */
.game-card {
    width: 280px;
    height: min(55vh, 400px);
    border-radius: 20px;
    padding: 15px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s, box-shadow 0.3s;
    overflow: visible;
    backdrop-filter: blur(20px);
}

.card-disabled {
    opacity: 0.3;
    pointer-events: none;
    filter: grayscale(0.8);
    transform: scale(0.98);
}

.game-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.05), transparent);
    pointer-events: none;
}

.card-red {
    background: linear-gradient(to bottom, rgba(139, 0, 0, 0.2), rgba(139, 0, 0, 0.1));
    border: 1px solid rgba(255, 0, 0, 0.3);
    box-shadow: 0 0 40px rgba(255, 0, 0, 0.15), inset 0 0 20px rgba(255, 0, 0, 0.1);
}

.card-green {
    background: linear-gradient(to bottom, rgba(0, 100, 0, 0.2), rgba(0, 100, 0, 0.1));
    border: 1px solid rgba(0, 255, 0, 0.3);
    box-shadow: 0 0 40px rgba(0, 255, 0, 0.15), inset 0 0 20px rgba(0, 255, 0, 0.1);
}

.card-blue {
    background: linear-gradient(to bottom, rgba(0, 0, 139, 0.2), rgba(0, 0, 139, 0.1));
    border: 1px solid rgba(0, 0, 255, 0.3);
    box-shadow: 0 0 40px rgba(0, 0, 255, 0.15), inset 0 0 20px rgba(0, 0, 255, 0.1);
}

.card-gold {
    background: linear-gradient(to bottom, rgba(180, 130, 0, 0.2), rgba(120, 80, 0, 0.1));
    border: 1px solid rgba(255, 215, 0, 0.35);
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.18), inset 0 0 20px rgba(255, 215, 0, 0.08);
}

.game-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.4);
}

.card-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(24px, 4vh, 36px);
    color: white;
    margin: 10px 0 10px;
    letter-spacing: 2px;
    font-weight: 900;
    line-height: 1.1;
}

.card-desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-icon-main {
    width: clamp(90px, 15vh, 140px);
    height: clamp(90px, 15vh, 140px);
    margin-bottom: 15px;
    filter: drop-shadow(0 0 30px rgba(255, 255, 255, 0.4));
    display: flex;
    justify-content: center;
    align-items: center;
}

.slot-container {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.slot-box {
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    color: rgba(255, 255, 255, 0.9);
}

.otp-input {
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 1);
    border: 3px solid rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    color: white;
    text-align: center;
    font-size: 24px;
    outline: none;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.9);
}

.card-btn {
    margin-top: auto;
    width: 100%;
    padding: 10px;
    border: 3px solid rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(20px, 3vh, 26px);
    font-weight: 700;
    color: white;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.3s;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}

.btn-red {
    background: linear-gradient(to bottom, #a00, #400);
}

.btn-green {
    background: linear-gradient(to bottom, #080, #030);
}

.btn-blue {
    background: linear-gradient(to bottom, #00a, #004);
}

.footer-layout {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    padding: 10px 0 20px;
    z-index: 10;
    height: 20px;
}

/* Bottom Bar */
.bottom-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;

    z-index: 10;
}

.footer-btn {
    width: 300px;
    height: 55px;
    background: rgba(26, 26, 46, 0.6);
    border: 2px solid rgba(212, 175, 55, 0.6);
    padding: 5px 15px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.footer-btn:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--gold);
}

.footer-btn-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.footer-title {
    font-weight: 600;
    color: var(--gold);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.footer-desc {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    margin-top: 2px;
}

.footer-btn i {
    font-size: 24px;
    color: #55aaff;
}

.dice-container-outer {
    position: relative;
    bottom: 5px;
}

.dice-button {
    width: 60px;
    height: 60px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--gold);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
    cursor: pointer;
    position: relative;
}

.dice-button img {
    width: 45px;
    height: 45px;
}

.dice-label {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    text-transform: uppercase;
    color: var(--gold);
    width: 120px;
    text-align: center;
    letter-spacing: 2px;
}

/* Animations */
@keyframes glow-red {
    0% {
        box-shadow: 0 0 20px var(--panel-glow-red);
    }

    100% {
        box-shadow: 0 0 40px var(--panel-glow-red);
    }
}

@keyframes glow-green {
    0% {
        box-shadow: 0 0 20px var(--panel-glow-green);
    }

    100% {
        box-shadow: 0 0 40px var(--panel-glow-green);
    }
}

/* Game State Transitions */
#game-container {
    display: none;
}

body.game-active .dashboard-wrapper {
    display: none !important;
}

body.game-active #game-container {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100vh;
    overflow: auto;
}

body.game-active {
    overflow: auto;
}

@keyframes dice-violent-jump {
    0% {
        transform: scale(1) translateY(0) rotate(0deg);
    }

    10% {
        transform: scale(1.2) translateY(-10px) rotate(-10deg);
        filter: brightness(1.5);
    }

    20% {
        transform: scale(1.1) translateY(0) rotate(10deg);
    }

    30% {
        transform: scale(1.5) translateY(-50px) rotate(-20deg);
        filter: hue-rotate(90deg);
    }

    40% {
        transform: scale(1.3) translateY(0) rotate(20deg);
    }

    50% {
        transform: scale(2) translateY(-100px) rotate(360deg);
        filter: brightness(2) drop-shadow(0 0 50px #fff);
    }

    100% {
        transform: scale(1) translateY(0) rotate(0deg);
    }
}

.violent-active {
    animation: dice-violent-jump 0.8s cubic-bezier(0.36, 0, 0.66, -0.56) infinite !important;
}

.firecracker {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1000;
    animation: burst-out 1.2s ease-out forwards;
}

@keyframes burst-out {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

/* MOBILE OPTIMIZATION */
@media (max-width: 768px) {
    body {
        overflow-y: auto !important;
        height: auto !important;
        display: block !important;
    }

    .dashboard-wrapper {
        height: auto !important;
        padding: 10px !important;
        min-height: 100vh;
    }

    .header-layout {
        flex-direction: column !important;
        gap: 15px !important;
        text-align: center !important;
        align-items: center !important;
    }

    .profile-section {
        width: 100% !important;
        max-width: 320px;
        justify-content: center !important;
    }

    .stats-container {
        flex-direction: row !important;
        width: 100% !important;
        justify-content: center !important;
        gap: 10px !important;
        flex-wrap: wrap;
    }

    .settings-btn {
        position: absolute;
        top: 10px;
        right: 10px;
        width: 40px !important;
        height: 40px !important;
    }

    .logo-main {
        font-size: 42px !important;
        margin: 10px 0 !important;
    }

    .main-layout {
        flex-direction: column !important;
        gap: 20px !important;
        padding: 20px 0 80px !important;
        height: auto !important;
        overflow: visible !important;
    }

    .side-nav {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        width: 100% !important;
        gap: 10px !important;
        order: 2;
    }

    .nav-item {
        width: 45% !important;
        height: 90px !important;
    }

    .nav-icon {
        font-size: 28px !important;
    }

    .nav-label {
        font-size: 10px !important;
    }

    .game-card {
        width: 90% !important;
        max-width: 340px;
        height: auto !important;
        min-height: 380px !important;
        padding: 25px 20px !important;
        border-radius: 20px !important;
        order: 1;
    }

    .card-title {
        font-size: 32px !important;
    }

    .card-icon-main {
        width: 140px !important;
        height: 140px !important;
        margin-bottom: 20px !important;
    }

    .footer-layout {
        flex-direction: column !important;
        gap: 15px !important;
        padding: 20px 10px !important;
        position: relative !important;
        width: 100% !important;
        align-items: center !important;
    }

    .footer-btn {
        width: 100% !important;
        max-width: 340px;
        height: 75px !important;
        padding: 10px 20px !important;
    }

    .footer-title {
        font-size: 18px !important;
    }

    .footer-desc {
        font-size: 11px !important;
    }

    .footer-btn i {
        font-size: 28px !important;
    }

    .dice-container-outer {
        margin: 30px 0 !important;
        order: 3;
    }

    /* Game Arena Mobile */
    body.game-active #game-container {
        height: auto !important;
        padding: 15px 10px !important;
        min-height: 100vh;
    }

    .ludo-board {
        width: 92vw !important;
        height: 92vw !important;
        margin: 0 auto !important;
    }

    .dice-bar-wrapper {
        width: 92vw !important;
        margin: 25px auto 15px !important;
        padding: 4px 10px !important;
    }

    .dice-bar-center #dice-roll-btn {
        width: 45px !important;
        height: 45px !important;
    }
    
    .dice-bar-center #dice-value-display {
        width: 35px !important;
        height: 35px !important;
        --dice-size: 35px !important;
        --dice-half: 17.5px !important;
    }
    
    .dice-bar-center .dice-cube {
        width: 35px !important;
        height: 35px !important;
    }
    
    .dice-bar-center .face-1 { transform: translateZ(17.5px) !important; }
    .dice-bar-center .face-2 { transform: rotateY(180deg) translateZ(17.5px) !important; }
    .dice-bar-center .face-3 { transform: rotateY(90deg) translateZ(17.5px) !important; }
    .dice-bar-center .face-4 { transform: rotateY(-90deg) translateZ(17.5px) !important; }
    .dice-bar-center .face-5 { transform: rotateX(90deg) translateZ(17.5px) !important; }
    .dice-bar-center .face-6 { transform: rotateX(-90deg) translateZ(17.5px) !important; }

    .dice-bar-center .dot {
        width: 5px !important;
        height: 5px !important;
        background: white !important;
    }

    .player-name-text {
        font-size: 16px !important;
    }

    .dice-panel {
        margin-top: 25px !important;
        width: 100% !important;
        justify-content: center !important;
    }
}

/* Matching Overlay Styles */
.matching-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 5, 8, 0.85);
    backdrop-filter: blur(15px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    color: white;
    font-family: 'Inter', sans-serif;
}

.matching-card {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.95), rgba(16, 16, 32, 0.95));
    border: 2.5px solid var(--gold);
    box-shadow: 0 0 35px rgba(212, 175, 55, 0.35), inset 0 0 20px rgba(0, 0, 0, 0.8);
    border-radius: 24px;
    padding: 40px;
    width: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0.85);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.radar-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.radar-ring {
    position: absolute;
    border: 2px solid var(--gold);
    border-radius: 50%;
    width: 100%;
    height: 100%;
    opacity: 0;
    animation: radarPulse 2.5s infinite linear;
}

.ring-1 {
    animation-delay: 0s;
}
.ring-2 {
    animation-delay: 0.8s;
}
.ring-3 {
    animation-delay: 1.6s;
}

@keyframes radarPulse {
    0% {
        transform: scale(0.2);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

.radar-pawn {
    font-size: 36px;
    filter: drop-shadow(0 0 10px var(--gold));
    animation: floatPawn 2s ease-in-out infinite;
    z-index: 2;
}

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

.matching-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(to bottom, #fff9e6 0%, #d4af37 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 10px 0 5px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.matching-subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 20px;
    letter-spacing: 0.5px;
}

.matching-timer {
    font-size: 20px;
    font-weight: 700;
    color: var(--gold);
    background: rgba(0, 0, 0, 0.4);
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    margin-bottom: 25px;
    font-family: monospace;
}

.matching-cancel-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(to bottom, #a00, #400);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 20px;
    font-weight: 700;
    color: white;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.matching-cancel-btn:hover {
    background: linear-gradient(to bottom, #c00, #500);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
}

