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

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

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: #f8fafc;
    color: #334155;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
    padding: 40px 0;
    text-align: center;
    border-bottom: 4px solid #eab308;
}

.header-content h1 { 
    font-size: 32px; 
    font-weight: 700;
    margin-bottom: 8px; 
    color: #f8fafc;
    letter-spacing: -0.5px;
}

.header-content p { 
    font-size: 16px;
    color: #94a3b8; 
    font-weight: 500;
}

main.container { padding: 40px 20px 80px; }

/* Hero Section */
.hero {
    text-align: center;
    padding: 20px 20px 40px;
    max-width: 800px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-block;
    background: #fef9c3;
    color: #a16207;
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
}

.hero h2 { 
    font-size: 36px; 
    font-weight: 700;
    color: #0f172a; 
    margin-bottom: 16px; 
    line-height: 1.2;
    letter-spacing: -1px;
}

.hero p { 
    color: #64748b; 
    margin-bottom: 16px;
    font-size: 16px;
}

.hero .hero-lead {
    font-size: 18px;
    color: #475569;
}

.hero .hero-lead strong {
    color: #0f172a;
}

/* Forms & Modals */
.form-section, .success-section {
    background: #ffffff;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f5f9;
}

.form-section h2 { margin-bottom: 24px; color: #0f172a; font-weight: 700; }

.form-group { margin-bottom: 24px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 8px; color: #334155; }
.form-group input[type="text"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s ease;
    background: #f8fafc;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}
.form-group small { display: block; margin-top: 8px; color: #94a3b8; font-size: 13px; }

/* Games Grid */
.game-grid-section { padding: 10px 0 40px; }

.game-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
}

.game-grid-nested { margin-top: 20px; }

.game-category-block {
    width: 100%;
    flex: 1 1 100%;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    background: #ffffff;
    margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
.game-category-title { color: #0f172a; margin-bottom: 6px; font-weight: 700; font-size: 20px;}
.game-category-desc { font-size: 15px; color: #64748b; margin-bottom: 8px; }

.game-card {
    width: 240px;
    flex: 0 1 240px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.game-card:hover {
    border-color: #cbd5e1;
    background: #ffffff;
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -8px rgba(0,0,0,0.08);
}
.game-card:focus { outline: 2px solid #3b82f6; outline-offset: 2px; }
.game-card.registered {
    cursor: default;
    border-color: #e2e8f0;
    background: #f8fafc;
    box-shadow: none;
    opacity: 0.8;
}
.game-card.registered:hover {
    border-color: #e2e8f0;
    background: #f8fafc;
    transform: none;
    box-shadow: none;
}

.game-badge {
    display: inline-block;
    margin-top: 16px;
    padding: 6px 14px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 600;
    background: #f1f5f9;
    color: #64748b;
    transition: all 0.2s ease;
}
.game-badge-daftar { background: #eff6ff; color: #2563eb; }
.game-card:hover .game-badge-daftar { background: #2563eb; color: #ffffff; }

.game-icon {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 16px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}
.game-icon-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    background: #f1f5f9;
    box-shadow: none;
}

.game-name { font-weight: 700; margin-bottom: 6px; color: #1e293b; font-size: 16px; }
.game-desc { font-size: 13px; color: #64748b; line-height: 1.5; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s ease;
}
.btn-primary { background: #0f172a; color: #ffffff; }
.btn-primary:hover { background: #1e293b; transform: translateY(-1px); box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); }
.btn-secondary { background: #f1f5f9; color: #334155; }
.btn-secondary:hover { background: #e2e8f0; }
.btn-danger { background: #ef4444; color: #ffffff; }
.btn-danger:hover { background: #dc2626; }

/* Alerts */
.alert {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}
.alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.alert ul { padding-left: 20px; margin-top: 8px; }

/* Success Section */
.success-section { text-align: center; padding: 60px 30px; }
.success-icon { font-size: 64px; margin-bottom: 20px; }
.success-box h2 { color: #0f172a; margin-bottom: 12px; font-weight: 700; font-size: 28px; }
.success-box p { margin-bottom: 10px; color: #475569; font-size: 16px; }
.success-box .btn { margin-top: 24px; }

/* Footer */
.site-footer {
    text-align: center;
    padding: 30px 0;
    color: #94a3b8;
    font-size: 14px;
    border-top: 1px solid #e2e8f0;
    margin-top: 20px;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal-box {
    background: #ffffff;
    border-radius: 20px;
    padding: 32px;
    width: 100%;
    max-width: 460px;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalPop {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
    position: absolute;
    top: 20px; right: 20px;
    background: #f1f5f9;
    border: none;
    border-radius: 50%;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s ease;
}
.modal-close:hover { background: #e2e8f0; color: #0f172a; }

.modal-game-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-right: 24px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 20px;
}
.modal-game-icon {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 12px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.modal-game-header h3 { color: #0f172a; margin-bottom: 4px; font-size: 18px; font-weight: 700; }
.modal-game-header p { font-size: 14px; color: #64748b; line-height: 1.4; }

/* Admin */
.admin-wrapper { display: flex; min-height: 100vh; background: #f8fafc; }
.admin-sidebar {
    width: 260px;
    background: #0f172a;
    color: #ffffff;
    padding: 24px 0;
    box-shadow: 4px 0 10px rgba(0,0,0,0.05);
}
.admin-sidebar h2 { padding: 0 24px 24px; font-size: 20px; font-weight: 700; color: #f8fafc; border-bottom: 1px solid #1e293b; margin-bottom: 16px; }
.admin-sidebar a {
    display: block;
    padding: 14px 24px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
}
.admin-sidebar a:hover, .admin-sidebar a.active { background: #1e293b; color: #ffffff; border-left: 4px solid #3b82f6; padding-left: 20px; }
.admin-content { flex: 1; padding: 32px; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; }

.card { background: #ffffff; border-radius: 16px; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); margin-bottom: 24px; border: 1px solid #f1f5f9; }

table.data-table { width: 100%; border-collapse: collapse; }
table.data-table th, table.data-table td {
    text-align: left;
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    color: #334155;
}
table.data-table th { background: #f8fafc; font-weight: 600; color: #475569; text-transform: uppercase; font-size: 12px; letter-spacing: 0.5px; }
table.data-table tr:hover { background: #f8fafc; }

.badge { display: inline-block; padding: 4px 12px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.badge-active { background: #f0fdf4; color: #15803d; }
.badge-inactive { background: #fef2f2; color: #b91c1c; }
.badge-category { background: #eff6ff; color: #2563eb; }

.login-wrapper { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #f8fafc; padding: 20px; }
.login-box { background: #ffffff; padding: 40px; border-radius: 20px; width: 100%; max-width: 400px; box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1); border: 1px solid #f1f5f9; }
.login-box h2 { text-align: center; margin-bottom: 28px; color: #0f172a; font-weight: 700; font-size: 24px; }

.actions a { margin-right: 12px; font-size: 14px; font-weight: 500; color: #3b82f6; text-decoration: none; }
.actions a:hover { text-decoration: underline; }

/* Responsive Adjustments */
@media (max-width: 768px) {
    .site-header { padding: 30px 0; }
    .header-content h1 { font-size: 26px; }
    .header-content p { font-size: 14px; }
    .hero h2 { font-size: 28px; }
    .hero p { font-size: 15px; }
    .hero .hero-lead { font-size: 16px; }
    
    .game-grid { gap: 16px; }
    .game-card { width: 160px; flex: 0 1 160px; padding: 20px 16px; }
    .game-icon { width: 48px; height: 48px; font-size: 24px; }
    .game-name { font-size: 15px; }
    
    .admin-wrapper { flex-direction: column; }
    .admin-sidebar { width: 100%; display: flex; overflow-x: auto; padding: 10px 0; }
    .admin-sidebar h2 { display: none; }
    .admin-sidebar a { display: inline-block; white-space: nowrap; padding: 10px 20px; }
    .admin-sidebar a:hover, .admin-sidebar a.active { border-left: none; border-bottom: 4px solid #3b82f6; padding-left: 20px; }
}