@import url('variables.css');

/* --- 1. GLOBAL RESETS & TYPOGRAPHY --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    /* Pattern Dotted Paper Canvas */
    background-image: radial-gradient(rgba(43, 45, 66, 0.09) 1.5px, transparent 1.5px);
    background-size: 24px 24px;
    color: var(--white);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Custom Scrollbar Soft Neobrutalism */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: var(--color-bg-base);
    border-left: var(--border-width) solid var(--color-border);
}
::-webkit-scrollbar-thumb {
    background: var(--color-bg-surface);
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--border-radius-sm);
    box-shadow: 1px 1px 0 var(--color-border);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}

/* Custom Selection */
::selection {
    background-color: var(--gold);
    color: #2b2d42;
}

/* Layout Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    align-items: center;
}
@media (min-width: 768px) {
    .grid-2 {
        grid-template-columns: 1.2fr 0.8fr;
    }
}

/* --- 2. HEADER & FLOATING NAVBAR --- */
.header {
    position: sticky;
    top: 0;
    width: 100%;
    height: 75px;
    background-color: rgba(251, 249, 244, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: var(--border-width) solid var(--color-border);
    z-index: 999;
    transition: background-color var(--transition-normal), border-color var(--transition-normal);
}
body.dark-mode .header {
    background-color: rgba(18, 19, 24, 0.8);
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.navbar__brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--white);
    font-weight: 700;
    font-size: 1.2rem;
    transition: transform var(--transition-fast);
}
.navbar__brand:hover {
    transform: rotate(-1deg) scale(1.02);
}

.navbar__brand-logo {
    display: inline-block;
    padding: 4px 8px;
    background-color: var(--gold);
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--border-radius-sm);
    color: #2b2d42;
    margin-right: 10px;
    box-shadow: var(--shadow-sm);
    font-size: 0.8rem;
}

/* Control Buttons (Dark Mode) */
.control-btn {
    background: var(--color-bg-surface);
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--border-radius-sm);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
    color: var(--white);
}
.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background-color: var(--color-bg-raised);
}
.control-btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

/* --- 3. HERO SECTION & POLAROID --- */
.hero-section {
    padding: 60px 0;
    min-height: calc(85vh - 75px);
    display: flex;
    align-items: center;
}

.hero-card-left {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* XP Bar (Gamified Badge) */
/* Premium Gamified Profile HUD Card */
.profile-hud-card {
    position: relative;
    max-width: 320px;
    background: rgba(24, 24, 27, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 2px solid var(--color-border);
    border-radius: var(--border-radius-md);
    padding: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 2px rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
}

.profile-hud-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.05) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: skewX(-25deg);
    transition: none;
    pointer-events: none;
}

.profile-hud-card:hover {
    transform: translateY(-4px);
    border-color: var(--gold);
    box-shadow: 0 12px 40px rgba(212, 175, 55, 0.15), 0 0 1px rgba(212, 175, 55, 0.5);
}

.profile-hud-card:hover::before {
    left: 150%;
    transition: all 0.8s ease-in-out;
}

.profile-hud-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.profile-hud-avatar-wrapper {
    position: relative;
    cursor: pointer;
}

.profile-hud-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #18181b, #27272a);
    border: 2px solid var(--color-border);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--gold);
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.profile-hud-avatar-wrapper:hover .profile-hud-avatar {
    border-color: var(--gold);
    transform: scale(1.05);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.4);
}

.profile-hud-level-badge {
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gold);
    color: #18181b;
    font-size: 8px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--color-border);
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.profile-hud-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.profile-hud-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.profile-name-text {
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text-primary);
    letter-spacing: -0.3px;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-edit-btn {
    background: transparent;
    border: none;
    color: var(--color-text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 2px;
    transition: color 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-edit-btn:hover {
    color: var(--gold);
    transform: scale(1.1);
}

.profile-hud-rank-tag {
    font-family: var(--font-display);
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--gold);
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.2);
    padding: 2px 8px;
    border-radius: 100px;
    letter-spacing: 0.5px;
    width: fit-content;
}

.profile-hud-xp-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.profile-hud-xp-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.profile-hud-xp-label {
    font-family: var(--font-body);
    font-size: 8px;
    font-weight: 700;
    color: var(--color-text-secondary);
    letter-spacing: 0.5px;
}

.profile-hud-xp-track {
    height: 6px;
    background: rgba(39, 39, 42, 0.5);
    border: 1px solid var(--color-border);
    border-radius: 100px;
    overflow: hidden;
}

.profile-hud-xp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold) 0%, #f39c12 100%);
    border-radius: 100px;
    position: relative;
}

.xp-bar__track {
    height: 8px;
    background: var(--color-bg-raised);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    overflow: hidden;
}
.xp-bar__fill {
    height: 100%;
    background: var(--gold);
    transition: width 0.5s ease;
}

.main-title {
    font-family: var(--font-body);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -1px;
}
.gold-dot {
    color: var(--gold);
}

.hero-desc {
    font-size: 1.1rem;
    color: var(--text-secondary);
    min-height: 2.2rem;
}

/* Polaroid & Tape Layout */
.hero-polaroid-right {
    position: relative;
    justify-self: center;
}
.tape {
    position: absolute;
    height: 24px;
    background-color: rgba(244, 162, 97, 0.6); 
    border-left: 2px dashed rgba(43, 45, 66, 0.4);
    border-right: 2px dashed rgba(43, 45, 66, 0.4);
    transform: rotate(-3deg);
    z-index: 10;
}
.tape--blue {
    background-color: rgba(163, 196, 243, 0.7);
    transform: rotate(4deg);
}

.polaroid {
    background-color: var(--color-bg-surface);
    padding: 16px 16px 28px 16px;
    border: var(--border-width) solid var(--color-border);
    box-shadow: var(--shadow-md);
    display: inline-block;
    transform: rotate(2deg);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.polaroid:hover {
    transform: rotate(-1deg) scale(1.02);
    box-shadow: var(--shadow-lg);
}
.polaroid__image-wrapper {
    background-color: var(--color-bg-surface);
    border: var(--border-width) solid var(--color-border);
    overflow: hidden;
    aspect-ratio: 1/1;
    width: min(280px, 60vw);
    position: relative;
}
.polaroid__image {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.polaroid__caption {
    font-size: 0.65rem;
    margin-top: 15px;
    text-align: center;
    color: var(--white);
}

/* --- 4. INTERACTIVE CLASS DIRECTORY (CABINET FOLDERS) --- */
.class-grid-section {
    padding: 80px 0;
    border-top: var(--border-width) dashed var(--color-border);
}

.section-header {
    margin-bottom: 50px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}
.vox-line {
    height: 3px;
    background: var(--color-border);
    width: 60px;
    border-radius: 2px;
}

/* Cabinet Folders Grid */
.class-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 35px 25px;
    padding-top: 20px;
}

/* Folder Card Style */
.folder-card {
    position: relative;
    display: block;
    text-decoration: none;
    color: var(--white);
    background: var(--color-bg-surface);
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    margin-top: 15px;
}
.folder-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: inherit;
    border-radius: inherit;
    z-index: -1;
}

/* Folder Tabs (Neobrutal top tabs) */
.folder-tab {
    position: absolute;
    top: -15px;
    left: 20px;
    font-family: var(--font-display);
    font-size: 0.55rem;
    background: var(--color-border);
    color: var(--color-bg-surface);
    padding: 4px 10px;
    border-radius: 6px 6px 0 0;
    border: var(--border-width) solid var(--color-border);
    border-bottom: none;
    z-index: 5;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

/* Card Content inside Folder */
.card-content {
    display: flex;
    align-items: center;
    gap: 20px;
    height: 100%;
}

.class-letter {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: normal;
    color: var(--white);
    background: var(--color-bg-raised);
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--border-radius-sm);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast);
}

.class-info h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 6px;
}
.status-indicator {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    gap: 6px;
}
.blink-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-border);
}

/* Pastel Accents for Folders */
.folder-card.accent-peach { background: var(--accent-peach); }
.folder-card.accent-blue { background: var(--accent-blue); }
.folder-card.accent-green { background: var(--accent-green); }
.folder-card.accent-purple { background: var(--accent-purple); }
.folder-card.accent-red { background: var(--accent-red); }
.folder-card.accent-yellow { background: var(--accent-yellow); }

.folder-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.folder-card:hover .class-letter {
    transform: scale(1.05) rotate(-2deg);
}

/* --- 5. SLIM FOOTER --- */
.slim-footer {
    border-top: var(--border-width) solid var(--color-border);
    background: var(--color-bg-surface);
    padding: 40px 0 20px 0;
    transition: background-color var(--transition-normal);
}
body.dark-mode .slim-footer {
    background: var(--color-bg-raised);
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(43, 45, 66, 0.1);
}
@media (min-width: 768px) {
    .footer-content {
        flex-direction: row;
    }
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.brand-info h3 {
    font-size: 1.1rem;
}
.brand-info span {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.footer-links-compact {
    display: flex;
    gap: 15px;
}
.f-link {
    text-decoration: none;
    color: var(--white);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 12px;
    border: var(--border-width) solid transparent;
    transition: all var(--transition-fast);
}
.f-link:hover {
    background-color: var(--color-bg-raised);
    border-color: var(--color-border);
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-sm);
}

.footer-bottom-bar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    padding-top: 20px;
    font-size: 0.75rem;
    color: var(--text-muted);
}
@media (min-width: 768px) {
    .footer-bottom-bar {
        flex-direction: row;
    }
}

.dev-secret-zone {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
}
.status-led {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #8ac926;
    box-shadow: 0 0 4px #8ac926;
}

/* --- 6. UTILITY CURSOR --- */
#legal-pointer {
    width: 8px;
    height: 8px;
    background: var(--color-border);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 99999;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s;
}
#pointer-trail {
    width: 24px;
    height: 24px;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 99998;
    transform: translate(-50%, -50%);
    transition: transform 0.08s ease-out;
}
@media (max-width: 768px) {
    #legal-pointer, #pointer-trail {
        display: none !important;
    }
}

/* --- 7. LEADERBOARD SECTION --- */
.leaderboard-section {
    padding: 60px 0;
    border-top: var(--border-width) dashed var(--color-border);
}
.leaderboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
}
.leaderboard-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--white);
}
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--gold);
    box-shadow: 0 0 6px var(--gold);
}
#sync-status {
    color: var(--text-muted);
}

.grid-rank-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* Rank Card */
.rank-card {
    background: rgba(24, 24, 27, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 2px solid var(--color-border);
    border-radius: var(--border-radius-md);
    padding: 16px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.rank-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
}

.rank-card:hover {
    transform: translateY(-4px);
    border-color: var(--color-accent-blue);
    box-shadow: 0 8px 30px rgba(66, 135, 245, 0.15), 0 0 1px rgba(66, 135, 245, 0.4);
}

.rank-card.p1 {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1) 0%, rgba(24, 24, 27, 0.95) 100%);
    border-color: var(--gold);
    box-shadow: 0 6px 24px rgba(212, 175, 55, 0.1), inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

.rank-card.p1:hover {
    box-shadow: 0 10px 32px rgba(212, 175, 55, 0.2), 0 0 1px rgba(212, 175, 55, 0.6);
}

.rank-number {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    background: linear-gradient(135deg, #18181b, #27272a);
    border: 2px solid var(--color-border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    color: var(--color-text-secondary);
    transition: all 0.3s ease;
}

.rank-card.p1 .rank-number {
    border-color: var(--gold);
    background: linear-gradient(135deg, var(--gold) 0%, #d4af37 100%);
    color: #18181b;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
}

.rank-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rank-class-name {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--color-text-primary);
    letter-spacing: -0.2px;
}

.rank-card.p1 .rank-class-name {
    color: var(--gold);
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.25);
}

.telemetry-bar-bg {
    height: 6px;
    background: rgba(39, 39, 42, 0.5);
    border: 1px solid var(--color-border);
    border-radius: 100px;
    overflow: hidden;
}

.telemetry-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-accent-blue) 0%, #3b82f6 100%);
    border-radius: inherit;
    transition: width 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.rank-card.p1 .telemetry-bar-fill {
    background: linear-gradient(90deg, var(--gold) 0%, #f39c12 100%);
}

.rank-stats {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    line-height: 1.3;
    text-align: right;
    color: var(--color-text-secondary);
    font-weight: 600;
}

.rank-card.p1 .rank-stats {
    color: var(--gold);
}

/* --- 8. GAMIFICATION & POLAROID EDITOR VISUAL STYLES --- */
.polaroid-actions-wrapper {
    margin-top: 15px;
    text-align: center;
    opacity: 0;
    transform: translateY(5px);
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}
.hero-polaroid-right:hover .polaroid-actions-wrapper {
    opacity: 1;
    transform: translateY(0);
}
.editor-trigger-btn {
    background: var(--color-bg-surface);
    color: var(--white);
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--border-radius-sm);
    padding: 8px 16px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}
.editor-trigger-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background-color: var(--color-bg-raised);
}

/* Tampilkan tombol selalu di perangkat mobile / layar sentuh */
@media (max-width: 768px) {
    .polaroid-actions-wrapper {
        opacity: 1 !important;
        transform: translateY(0) !important;
    }
}
@media (hover: none) {
    .polaroid-actions-wrapper {
        opacity: 1 !important;
        transform: translateY(0) !important;
    }
}

/* Modals Overlay & Cards */
.gamify-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeIn 0.4s ease forwards;
    overflow: hidden;
}

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

/* Premium Level Up Modal Styles */
.level-up-card-premium {
    background: linear-gradient(180deg, #18181b 0%, #09090b 100%) !important;
    border: 2px solid var(--gold) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(212, 175, 55, 0.25) !important;
}

.modal-badge-wrapper {
    position: relative;
    margin-bottom: 5px;
}

.modal-badge-glow {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: var(--gold);
    opacity: 0.3;
    filter: blur(8px);
    animation: pulseGlow 2s infinite ease-in-out;
    z-index: 1;
}

@keyframes pulseGlow {
    0%, 100% { transform: scale(1); opacity: 0.2; }
    50% { transform: scale(1.15); opacity: 0.4; }
}

.modal-badge {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px solid var(--gold);
    background: linear-gradient(135deg, var(--gold) 0%, #f39c12 100%);
    color: #18181b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
    z-index: 2;
    animation: floatIcon 3s ease-in-out infinite;
}

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

.level-up-title-gold {
    background: linear-gradient(90deg, #ffe066 0%, var(--gold) 50%, #ffa500 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
    font-size: 1.5rem;
    letter-spacing: 2px;
    filter: drop-shadow(0 2px 10px rgba(212, 175, 55, 0.3));
    margin-top: 5px;
}

.modal-line-gold {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.level-up-p {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
    margin: 5px 0;
}

.level-up-close-btn {
    background: linear-gradient(90deg, var(--gold) 0%, #f39c12 100%) !important;
    color: #18181b !important;
    border: 1px solid var(--gold) !important;
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.3) !important;
    transition: all 0.3s ease !important;
}

.level-up-close-btn:hover {
    transform: translateY(-2px) scale(1.02) !important;
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5) !important;
}

/* Falling Gold Confetti particles */
.confetti-particle {
    position: absolute;
    width: 6px;
    height: 12px;
    background: var(--gold);
    border-radius: 1px;
    top: -20px;
    opacity: 0.8;
    z-index: 999998;
    pointer-events: none;
    animation: confettiFall 3s linear infinite;
}

.confetti-particle.p1 { left: 8%; animation-delay: 0s; background: var(--gold); }
.confetti-particle.p2 { left: 23%; animation-delay: 0.5s; background: #f39c12; width: 8px; height: 16px; }
.confetti-particle.p3 { left: 38%; animation-delay: 1.2s; background: #f1c40f; }
.confetti-particle.p4 { left: 52%; animation-delay: 0.2s; background: var(--gold); width: 7px; height: 14px; }
.confetti-particle.p5 { left: 67%; animation-delay: 0.8s; background: #e67e22; }
.confetti-particle.p6 { left: 78%; animation-delay: 1.5s; background: #f1c40f; width: 8px; height: 12px; }
.confetti-particle.p7 { left: 89%; animation-delay: 0.4s; background: var(--gold); }
.confetti-particle.p8 { left: 95%; animation-delay: 1.0s; background: #e67e22; width: 9px; height: 15px; }

@keyframes confettiFall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(105vh) rotate(720deg); opacity: 0; }
}

.gamify-modal-card {
    background: var(--color-bg-surface);
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 35px 30px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    animation: scaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

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

.modal-line {
    width: 50px;
    height: 3px;
    background: var(--color-border);
    border-radius: 1px;
}

.modal-level-display {
    font-family: var(--font-display);
    font-size: 2.8rem;
    font-weight: 900;
    color: var(--gold);
    text-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
    margin: 5px 0;
    letter-spacing: -1px;
}

.modal-rank-display {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--white);
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid var(--gold);
    padding: 4px 16px;
    border-radius: 100px;
}

.modal-close-btn {
    width: 100%;
    background: var(--gold);
    color: #2b2d42;
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--border-radius-sm);
    padding: 12px;
    font-family: var(--font-body);
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
    margin-top: 10px;
}
.modal-close-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Tamper Card Specific styles */
.tamper-card {
    border-color: var(--color-accent-red);
}
.tamper-badge {
    background: var(--color-accent-red);
    color: #ffffff;
}
.tamper-warning-box {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    padding: 12px;
    background: var(--gold-dim);
    border: 1px dashed var(--color-border);
    border-radius: var(--border-radius-sm);
    color: var(--white);
    line-height: 1.4;
}
.warning-btn {
    background: var(--color-accent-red);
    color: #ffffff;
}

/* Visual Cropper Viewport */
.crop-preview-viewport {
    width: 220px;
    height: 220px;
    position: relative;
    overflow: hidden;
    background: var(--color-bg-surface);
    border: var(--border-width) solid var(--color-border);
    border-radius: 0;
    cursor: grab;
    user-select: none;
    box-shadow: var(--shadow-sm);
    margin: 10px 0;
}
.crop-preview-viewport:active {
    cursor: grabbing;
}
#crop-preview-img {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none; /* input drag ditangani oleh container viewport */
    user-select: none;
}
.crop-overlay-guide {
    position: absolute;
    inset: 0;
    pointer-events: none;
    border: 2px dashed rgba(244, 162, 97, 0.8);
    box-shadow: 0 0 0 9999px rgba(43, 45, 66, 0.45);
    border-radius: inherit;
}

/* Polaroid Editor Slider Styles */
.editor-sliders-grid {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
    text-align: left;
}
.slider-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.slider-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
}
.editor-slider {
    width: 100%;
    height: 8px;
    background: var(--color-bg-raised);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    appearance: none;
}
.editor-slider::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--gold);
    border: var(--border-width) solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.editor-buttons {
    display: flex;
    width: 100%;
    gap: 10px;
    margin-top: 15px;
}
.editor-btn-primary, .editor-btn-secondary {
    flex: 1;
    padding: 10px;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.8rem;
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}
.editor-btn-primary {
    background: var(--gold);
    color: #2b2d42;
}
.editor-btn-secondary {
    background: var(--color-bg-raised);
    color: var(--white);
}
.editor-btn-primary:hover, .editor-btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Floating XP Toast Notification */
#xp-toast-container {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.xp-toast {
    background: var(--color-bg-surface);
    color: var(--white);
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--border-radius-sm);
    padding: 12px 18px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: var(--shadow-md);
    transform: translateX(-150%);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}
.xp-toast.show {
    transform: translateX(0);
    opacity: 1;
}
.xp-toast i {
    color: var(--gold);
}
.xp-toast.warning {
    border-color: var(--color-border);
}
.xp-toast.warning i {
    color: var(--text-muted);
}

/* --- 9. ONBOARDING & PERSONALIZED NAME BADGE STYLES --- */
.user-badge-name {
    margin: 0 10px;
}
.profile-name-text {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gold);
    background: var(--color-bg-raised);
    border: 1px solid var(--color-border);
    padding: 3px 10px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}
.profile-name-text:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    background: var(--color-bg-surface);
}
.edit-name-icon {
    font-size: 0.65rem;
    opacity: 0.65;
}

.text-center-input {
    width: 100%;
    text-align: center;
    background: var(--color-bg-raised);
    color: var(--white);
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--border-radius-sm);
    padding: 12px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    outline: none;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}
.text-center-input:focus {
    border-color: var(--gold);
    box-shadow: var(--shadow-md);
    background: var(--color-bg-surface);
}