* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body { font-family: 'Montserrat', sans-serif; background-color: #121215; color: #ffffff; margin: 0; padding: 0; min-height: 100vh; overflow-x: hidden; }

:root {
    --bg-main: #121215;
    --bg-card: #1c1c21;
    --bg-card-light: #282830;
    --accent-gold: #f5c518;
    --accent-cyan: #00f2fe;
    --text-muted: #8b8b99;
}

.app-container {
    width: 100%; max-width: 600px; min-height: 100vh; margin: 0 auto;
    background: linear-gradient(180deg, #18181c 0%, #0d0d0f 100%);
    padding: 20px 20px 110px; position: relative;
}

.page-section { display: none; width: 100%; }
.page-section.active { display: block; animation: fadeUp 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; padding-top: 10px; }
.top-bar h2 { font-weight: 900; letter-spacing: 1px; font-size: 20px; color: #fff; }

.user-profile { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.avatar-ring {
    width: 48px; height: 48px; border-radius: 50%;
    background: #1c1c21; border: 2px solid var(--accent-gold);
    display: flex; justify-content: center; align-items: center;
    font-size: 20px; color: var(--accent-gold);
}
.user-info h3 { font-size: 16px; font-weight: 900; letter-spacing: 0.5px; margin-bottom: 2px; }
.user-info span { font-size: 11px; color: var(--text-muted); font-weight: 700; letter-spacing: 1px; }

.header-actions { display: flex; gap: 10px; }
.icon-btn {
    width: 44px; height: 44px; border-radius: 14px;
    background: var(--bg-card); border: 1px solid rgba(255,255,255,0.05);
    color: #fff; font-size: 18px; cursor: pointer; position: relative;
    display: flex; justify-content: center; align-items: center;
}

/* --- DIAGONAL MODES DESIGN (GAYA JAUH / OPSI B) --- */
.modes-container { display: flex; flex-direction: column; gap: 20px; }

.diagonal-row { display: flex; gap: 35px; height: 130px; }
.diagonal-row.reverse { height: 110px; }

.mode-card {
    flex: 1; background: var(--bg-card); border-radius: 12px;
    position: relative; overflow: hidden; cursor: pointer;
    display: flex; justify-content: center; align-items: center;
    border: 2px solid rgba(255,255,255,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}
.mode-card:active { transform: scale(0.95); }

.skew-left { transform: skewX(-10deg); margin-left: 10px; }
.skew-right { transform: skewX(10deg); margin-right: 10px; }
.unskew-left { transform: skewX(10deg); }
.unskew-right { transform: skewX(-10deg); }

.mode-card.ranked { 
    background: linear-gradient(135deg, #2b2b36 0%, #1a1a24 100%); 
    border: 2px solid var(--accent-gold); 
    box-shadow: 0 0 15px rgba(245, 197, 24, 0.2);
}
.mode-card.ranked .mode-icon { color: var(--accent-gold); }

.mode-card.classic { 
    background: linear-gradient(135deg, #1c1c21 0%, #121215 100%); 
    border: 2px solid rgba(0, 242, 254, 0.4); 
}
.mode-card.classic .mode-icon { color: var(--accent-cyan); }

.mode-card.mayhem { background: var(--bg-card-light); }
.mode-card.mayhem .mode-icon { color: #ff4757; }

/* Challenge Mode Card Styling */
.mode-card.challenge { 
    height: 80px; background: #1c1c21; border-radius: 16px; margin-top: 5px; 
    transform: none; margin-left: 0; margin-right: 0;
    border: 2px solid rgba(255, 255, 255, 0.1);
}
.mode-card.challenge .mode-icon { color: var(--accent-cyan); margin-right: 5px; }

.content { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 2; padding: 10px; }
.mode-icon { font-size: 32px; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.4)); }
.mode-title { font-size: 12px; font-weight: 900; letter-spacing: 1.5px; color: #fff; }

.placeholder-box { background: var(--bg-card); border-radius: 20px; padding: 50px 20px; text-align: center; color: var(--text-muted); border: 1px dashed rgba(255,255,255,0.1); }
.placeholder-box i { font-size: 40px; margin-bottom: 15px; opacity: 0.5; }

/* --- ELEGANT BOTTOM NAV --- */
.bottom-nav {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
    width: calc(100% - 40px); max-width: 560px;
    background: rgba(28, 28, 33, 0.85); backdrop-filter: blur(15px);
    height: 70px; border-radius: 35px;
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 10px; box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.05); z-index: 1000;
}
.nav-item {
    width: 50px; height: 50px; border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    color: var(--text-muted); font-size: 20px; text-decoration: none;
    transition: all 0.3s ease;
}
.nav-item.center-play {
    width: 66px; height: 66px; background: linear-gradient(135deg, #2b2b36 0%, #1a1a24 100%);
    border: 2px solid rgba(255,255,255,0.1); transform: translateY(-15px);
    color: #fff; font-size: 24px; box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}
.nav-item.active:not(.center-play) { color: var(--accent-cyan); }
.nav-item.center-play.active { border-color: var(--accent-cyan); box-shadow: 0 10px 20px rgba(0, 242, 254, 0.2); }

/* --- HIDDEN DEVELOPER OVERLAY (ABSOLUTELY SLEEK & INVISIBLE) --- */
.dev-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background-color: #0c0c0e; z-index: 99999; display: none;
    flex-direction: column; padding: 20px; font-family: monospace;
}
.dev-overlay.active { display: flex; animation: fadeInDev 0.2s ease-out; }
@keyframes fadeInDev { from { opacity: 0; } to { opacity: 1; } }

.dev-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #222; padding-bottom: 15px; }
.dev-header h3 { font-size: 16px; font-weight: 700; color: #f5c518; letter-spacing: 1px; }
.dev-close-btn { background: none; border: none; color: #ff4757; font-size: 24px; cursor: pointer; }

.dev-body { flex: 1; display: flex; flex-direction: column; padding-top: 15px; gap: 15px; }
.dev-status { font-size: 12px; color: #2ecc71; display: flex; align-items: center; gap: 8px; font-weight: bold; }
.status-dot { width: 8px; height: 8px; background-color: #2ecc71; border-radius: 50%; display: inline-block; box-shadow: 0 0 8px #2ecc71; }

#cl-sandbox-container { flex: 1; background-color: #141418; border: 1px solid #222; border-radius: 8px; display: flex; justify-content: center; align-items: center; position: relative; overflow: auto; }
.sandbox-placeholder { text-align: center; max-width: 80%; color: #666; }
.sandbox-placeholder i { font-size: 48px; color: #333; margin-bottom: 15px; }
.sandbox-placeholder h4 { color: #aaa; margin-bottom: 8px; font-size: 14px; }
.sandbox-placeholder p { font-size: 11px; line-height: 1.5; }
