* { box-sizing: border-box; }
body { font-family: system-ui, -apple-system, sans-serif; margin: 0; min-height: 100vh; }

/* Login – gradient background, white card, two columns */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(180deg, #22c55e 0%, #06b6d4 50%, #2563eb 100%);
}
.login-card {
    display: flex;
    width: 100%;
    max-width: 820px;
    min-height: 420px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    overflow: hidden;
}
.login-card-left {
    flex: 1;
    min-width: 0;
    background: #fef3c7 url('assets/login-panel.png') center/cover no-repeat;
    background-color: #fef3c7;
}
.login-card-right {
    flex: 1;
    padding: 2.5rem 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 280px;
}
.login-title {
    margin: 0 0 1.5rem;
    font-size: 1.6rem;
    font-weight: 700;
    color: #374151;
}
.login-error {
    color: #dc2626;
    font-size: 0.9rem;
    margin: 0 0 1rem;
}
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.login-form input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 1rem;
    color: #111;
    background: #fff;
}
.login-form input::placeholder {
    color: #9ca3af;
}
.login-form .login-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.25rem;
}
.login-form .login-btn:hover {
    background: #1d4ed8;
}
@media (max-width: 640px) {
    .login-card { flex-direction: column; min-height: auto; }
    .login-card-left { min-height: 180px; }
}

/* Dashboard – sidebar layout, green & white */
.admin-body { margin: 0; min-height: 100vh; background: #f8fafc; }
.admin-wrap { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 240px;
    min-width: 240px;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #22c55e 0%, #16a34a 50%, #15803d 100%);
    color: #fff;
    padding: 1.5rem 0;
    box-shadow: 2px 0 12px rgba(0,0,0,0.08);
}
.sidebar-brand { font-size: 1.25rem; font-weight: 700; padding: 0 1.25rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,0.2); margin-bottom: 1rem; }
.sidebar-nav { display: flex; flex-direction: column; gap: 0.25rem; }
.sidebar-nav a {
    padding: 0.75rem 1.25rem;
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.15); color: #fff; }
.sidebar-nav a.active { background: rgba(255,255,255,0.25); color: #fff; }

.admin-main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: #fff; }
.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 1rem;
}
.dash-header h1 { margin: 0; font-size: 1.25rem; font-weight: 600; color: #1e293b; }
.dash-header-right { display: flex; align-items: center; gap: 0.75rem; }
.dash-header a.logout-link { color: red; text-decoration: none; font-weight: 600; }
.dash-header a.logout-link:hover { text-decoration: underline; color: #15803d; }
.profile-btn {
    width: 40px; height: 40px; border-radius: 50%;
    border: 2px solid #22c55e; background: #fff; color: #22c55e;
    cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0;
    transition: background 0.2s, color 0.2s;
}
.profile-btn:hover { background: #22c55e; color: #fff; }
.profile-icon { width: 20px; height: 20px; }

.dash-messages { padding: 0.75rem 1.5rem; }
.dash-messages .error { margin: 0; font-size: 0.9rem; }
.dashboard { padding: 1.5rem; max-width: 900px; color: #334155; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.4); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); z-index: 1000; opacity: 0; visibility: hidden; transition: opacity 0.2s, visibility 0.2s; }
.modal-backdrop.open { opacity: 1; visibility: visible; }
.profile-modal { position: fixed; inset: 0; z-index: 1001; display: flex; align-items: center; justify-content: center; padding: 1rem; opacity: 0; visibility: hidden; transition: opacity 0.2s, visibility 0.2s; pointer-events: none; }
.profile-modal.open { opacity: 1; visibility: visible; pointer-events: auto; }
.profile-modal .modal-content { background: #fff; border-radius: 12px; padding: 1.5rem; max-width: 400px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,0.2); border: 1px solid #e2e8f0; }
.profile-modal .modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.profile-modal .modal-header h2 { margin: 0; font-size: 1.2rem; color: #1e293b; }
.profile-modal .modal-close { background: none; border: none; color: #64748b; font-size: 1.5rem; cursor: pointer; line-height: 1; padding: 0 0.25rem; }
.profile-modal .modal-close:hover { color: #1e293b; }
.profile-form label { display: block; margin-bottom: 0.35rem; font-size: 0.9rem; color: #475569; }
.profile-form input { width: 100%; padding: 0.6rem; margin-bottom: 1rem; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; color: #1e293b; font-size: 1rem; }
.profile-form .modal-actions { display: flex; gap: 0.75rem; margin-top: 1rem; }
.profile-form .btn-cancel { background: #e2e8f0; color: #475569; border: none; padding: 0.5rem 1rem; border-radius: 8px; cursor: pointer; }
.profile-form .btn-cancel:hover { background: #cbd5e1; }

.card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.card h2 { margin: 0 0 1rem; font-size: 1.1rem; font-weight: 600; color: #1e293b; }

.form-row { display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: 1rem; }
.form-row label { display: block; margin-bottom: 0.35rem; font-size: 0.9rem; color: #475569; }
.form-row input, .form-row select { padding: 0.5rem 0.7rem; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; color: #1e293b; }
.form-row input[type="number"] { width: 80px; }
.form-row input[type="date"] { width: 160px; }
.form-row button { padding: 0.5rem 1rem; border-radius: 8px; border: none; cursor: pointer; font-size: 0.9rem; }
.btn-primary { background: #22c55e; color: #fff; }
.btn-primary:hover { background: #16a34a; }
.btn-small { padding: 0.35rem 0.6rem; font-size: 0.8rem; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-edit { background: #2563eb; color: #fff; }
.btn-edit:hover { background: #1d4ed8; }

table { width: 100%; border-collapse: collapse; }
table th, table td { padding: 0.6rem; text-align: left; border-bottom: 1px solid #e2e8f0; color: #334155; }
table th { font-weight: 600; color: #64748b; font-size: 0.85rem; }
.actions { display: flex; gap: 0.5rem; }

.headline-form { margin-bottom: 1rem; }
.headline-form input[type="text"] { width: 100%; max-width: 400px; padding: 0.6rem; margin-right: 0.5rem; margin-bottom: 0.5rem; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; color: #1e293b; }
.headline-list { list-style: none; padding: 0; margin: 0; }
.headline-list li { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0; border-bottom: 1px solid #e2e8f0; color: #334155; }
.headline-list li span { flex: 1; }
.headline-list li input[type="text"] { border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; color: #1e293b; padding: 0.35rem; }

@media (max-width: 768px) {
    .admin-wrap { flex-direction: column; }
    .admin-sidebar { width: 100%; flex-direction: row; padding: 0.75rem 1rem; }
    .sidebar-brand { padding: 0; margin: 0; border: none; margin-right: 1rem; }
    .sidebar-nav { flex-direction: row; flex-wrap: wrap; }
    .sidebar-nav a { padding: 0.5rem 0.75rem; }
}

/* Old Results Grid Styling */
.old-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.old-result-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    border-radius: 16px;
    text-decoration: none;
    color: #fff;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: none;
    cursor: pointer;
}

.old-result-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left 0.3s ease;
    z-index: -1;
}

.old-result-btn:hover::before {
    left: 100%;
}

.old-result-btn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.game1-btn {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
}

.game1-btn:hover {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
}

.game2-btn {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
}

.game2-btn:hover {
    background: linear-gradient(135deg, #6d28d9 0%, #5b21b6 100%);
}

.btn-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    display: block;
}

.btn-label {
    font-size: 0.9rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.25rem;
}

.btn-text {
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.btn-arrow {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.old-result-btn:hover .btn-arrow {
    transform: translateX(4px);
}

@media (max-width: 640px) {
    .old-results-grid {
        grid-template-columns: 1fr;
    }
    
    .old-result-btn {
        padding: 1.5rem;
    }
    
    .btn-icon {
        font-size: 2rem;
    }
    
    .btn-text {
        font-size: 1.2rem;
    }
}

