/* Gaming Platform v1.3.0 */
@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
    --gp-bg:       #0d0f14;
    --gp-surface:  #161a24;
    --gp-surface2: #1e2435;
    --gp-border:   #2a3050;
    --gp-accent:   #00d4ff;
    --gp-accent2:  #7c3aed;
    --gp-gold:     #f59e0b;
    --gp-green:    #10b981;
    --gp-red:      #ef4444;
    --gp-text:     #e2e8f0;
    --gp-muted:    #64748b;
    --gp-radius:   12px;
    --gp-font:     'Rajdhani', sans-serif;
    --gp-body:     'Inter', sans-serif;
}

.gp-platform, .gp-platform * { box-sizing: border-box; }
.gp-platform { font-family: var(--gp-body); color: var(--gp-text); max-width: 960px; margin: 0 auto; }
.gp-hidden { display: none !important; }

/* ── Auth Panel ─────────────────────────────────────────────────── */
.gp-auth-panel { background: var(--gp-surface); border: 1px solid var(--gp-border); border-radius: var(--gp-radius); max-width: 440px; margin: 40px auto; overflow: hidden; }
.gp-auth-tabs { display: flex; border-bottom: 1px solid var(--gp-border); }
.gp-tab-btn { flex: 1; padding: 16px; background: none; border: none; color: var(--gp-muted); font-family: var(--gp-font); font-size: 15px; font-weight: 600; letter-spacing: .5px; cursor: pointer; text-transform: uppercase; transition: color .2s; }
.gp-tab-btn.active { color: var(--gp-accent); border-bottom: 2px solid var(--gp-accent); margin-bottom: -1px; }
.gp-tab-content { padding: 28px; }

/* ── Forms ──────────────────────────────────────────────────────── */
.gp-form h2 { font-family: var(--gp-font); font-size: 22px; font-weight: 700; margin: 0 0 20px; letter-spacing: 1px; }
.gp-form-group { margin-bottom: 16px; }
.gp-form-group label { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .8px; color: var(--gp-muted); margin-bottom: 6px; }
.gp-form-group input { width: 100%; padding: 12px 14px; background: var(--gp-bg); border: 1px solid var(--gp-border); border-radius: 8px; color: var(--gp-text); font-size: 15px; font-family: var(--gp-body); outline: none; transition: border-color .2s; }
.gp-form-group input:focus { border-color: var(--gp-accent); box-shadow: 0 0 0 3px rgba(0,212,255,.1); }
.gp-form-group small { display: block; margin-top: 4px; font-size: 11px; color: var(--gp-muted); }
.gp-checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--gp-muted); margin-bottom: 16px; cursor: pointer; }
.gp-form-message { min-height: 0; font-size: 13px; border-radius: 6px; transition: all .2s; }
.gp-form-message.error   { color: var(--gp-red);   background: rgba(239,68,68,.1);   padding: 10px 14px; margin-bottom: 12px; }
.gp-form-message.success { color: var(--gp-green); background: rgba(16,185,129,.1);  padding: 10px 14px; margin-bottom: 12px; }

/* ── Buttons ────────────────────────────────────────────────────── */
.gp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 20px; border: none; border-radius: 8px; font-family: var(--gp-font); font-size: 15px; font-weight: 600; letter-spacing: .5px; cursor: pointer; transition: all .2s; text-decoration: none; }
.gp-btn-primary { background: linear-gradient(135deg, var(--gp-accent), var(--gp-accent2)); color: #fff; }
.gp-btn-primary:hover { opacity: .88; transform: translateY(-1px); }
.gp-btn-primary:active { transform: none; }
.gp-btn-full { width: 100%; }
.gp-btn-ghost { background: transparent; border: 1px solid var(--gp-border); color: var(--gp-muted); }
.gp-btn-ghost:hover { border-color: var(--gp-accent); color: var(--gp-accent); }
.gp-btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ── Banners ────────────────────────────────────────────────────── */
.gp-verify-banner { background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.3); color: var(--gp-gold); padding: 12px 18px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; }
.gp-verify-banner a { color: var(--gp-gold); }
.gp-top-banner { padding: 12px 18px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; animation: gp-slide-down .3s ease; }
.gp-banner-success { background: rgba(16,185,129,.15); border: 1px solid rgba(16,185,129,.3); color: var(--gp-green); }
.gp-banner-error   { background: rgba(239,68,68,.12);  border: 1px solid rgba(239,68,68,.3);  color: var(--gp-red); }
@keyframes gp-slide-down { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:none; } }

/* ── Badges ─────────────────────────────────────────────────────── */
.gp-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; }
.gp-rank-badge { background: linear-gradient(135deg, var(--gp-accent2), #4f46e5); color: #fff; }
.gp-comp-badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 20px; margin-bottom: 8px; background: rgba(16,185,129,.15); color: var(--gp-green); border: 1px solid rgba(16,185,129,.3); }
.gp-badge-active { background: rgba(0,212,255,.15) !important; color: var(--gp-accent) !important; border-color: rgba(0,212,255,.3) !important; }

/* ── Player Header ───────────────────────────────────────────────── */
.gp-player-header { display: flex; align-items: center; gap: 14px; padding: 16px 20px; background: var(--gp-surface); border: 1px solid var(--gp-border); border-radius: var(--gp-radius); margin-bottom: 16px; }
.gp-player-avatar img { width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--gp-accent); }
.gp-player-info { flex: 1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gp-player-info h3 { margin: 0; font-family: var(--gp-font); font-size: 20px; font-weight: 700; letter-spacing: .5px; width: 100%; }
.gp-score { font-size: 13px; color: var(--gp-gold); font-weight: 600; }

/* ── Nav Tabs ────────────────────────────────────────────────────── */
.gp-nav-tabs { display: flex; gap: 4px; margin-bottom: 20px; background: var(--gp-surface); border: 1px solid var(--gp-border); border-radius: var(--gp-radius); padding: 4px; }
.gp-nav-btn { flex: 1; padding: 10px; background: none; border: none; border-radius: 8px; color: var(--gp-muted); font-family: var(--gp-font); font-size: 14px; font-weight: 600; letter-spacing: .5px; cursor: pointer; transition: all .2s; }
.gp-nav-btn.active { background: var(--gp-surface2); color: var(--gp-accent); }

/* ── Competitions Grid ───────────────────────────────────────────── */
.gp-competitions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.gp-comp-card { background: var(--gp-surface); border: 1px solid var(--gp-border); border-radius: var(--gp-radius); padding: 20px; transition: border-color .2s, transform .2s; display: flex; flex-direction: column; gap: 12px; }
.gp-comp-card:hover { border-color: var(--gp-accent); transform: translateY(-2px); }
.gp-comp-card.gp-comp-completed { border-color: var(--gp-green); opacity: .85; }
.gp-comp-card-header h3 { font-family: var(--gp-font); font-size: 19px; font-weight: 700; margin: 0 0 6px; }
.gp-comp-card-header p { font-size: 13px; color: var(--gp-muted); margin: 0; line-height: 1.5; }
.gp-comp-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--gp-muted); }
.gp-comp-result { background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.2); border-radius: 8px; padding: 10px 14px; font-size: 13px; color: var(--gp-green); }

/* ── Leaderboard ─────────────────────────────────────────────────── */
.gp-lb-title { font-family: var(--gp-font); font-size: 22px; font-weight: 700; letter-spacing: 1px; margin: 0 0 16px; }
.gp-lb-table { display: flex; flex-direction: column; gap: 4px; }
.gp-lb-row { display: grid; grid-template-columns: 48px 1fr 120px 80px; align-items: center; gap: 12px; padding: 12px 16px; background: var(--gp-surface); border: 1px solid var(--gp-border); border-radius: 8px; transition: border-color .15s; }
.gp-lb-row:hover { border-color: var(--gp-accent); }
.gp-lb-row.gp-lb-top { border-color: rgba(245,158,11,.4); background: rgba(245,158,11,.05); }
.gp-lb-row.gp-lb-current { border-color: var(--gp-accent); background: rgba(0,212,255,.05); }
.gp-lb-pos { font-size: 22px; text-align: center; }
.gp-lb-name { font-family: var(--gp-font); font-size: 16px; font-weight: 600; }
.gp-lb-rank { display: block; font-size: 11px; color: var(--gp-muted); font-family: var(--gp-body); font-weight: 400; }
.gp-lb-score { font-family: var(--gp-font); font-weight: 700; color: var(--gp-gold); text-align: right; }
.gp-lb-played { font-size: 12px; color: var(--gp-muted); text-align: right; }

/* ── Modal ───────────────────────────────────────────────────────── */
.gp-modal { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; padding: 16px; }
.gp-modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.85); backdrop-filter: blur(4px); }
.gp-modal-content { position: relative; z-index: 1; background: var(--gp-surface); border: 1px solid var(--gp-border); border-radius: 16px; width: 100%; max-width: 960px; max-height: 92vh; overflow-y: auto; }

/* ── Video Stage ─────────────────────────────────────────────────── */
.gp-video-stage { padding: 28px 32px; }
.gp-video-stage h2 { font-family: var(--gp-font); font-size: 22px; font-weight: 700; margin: 0 0 16px; }
.gp-video-wrap { position: relative; padding-bottom: 56.25%; height: 0; border-radius: 10px; overflow: hidden; margin-bottom: 16px; background: #000; }
.gp-video-wrap iframe, .gp-video-wrap video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }
.gp-video-notice { background: rgba(0,212,255,.1); border: 1px solid rgba(0,212,255,.2); border-radius: 8px; padding: 12px 16px; font-size: 13px; color: var(--gp-accent); margin-bottom: 16px; }
.gp-video-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── Quiz Stage ──────────────────────────────────────────────────── */
.gp-quiz-stage { padding: 24px; }
.gp-quiz-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.gp-quiz-progress-text { font-family: var(--gp-font); font-size: 14px; font-weight: 600; color: var(--gp-muted); }
.gp-timer { font-family: var(--gp-font); font-size: 24px; font-weight: 700; color: var(--gp-accent); min-width: 48px; text-align: right; transition: color .3s; }
.gp-timer.urgent { color: var(--gp-red); animation: gp-pulse .5s infinite; }
@keyframes gp-pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }
.gp-progress-bar { height: 4px; background: var(--gp-surface2); border-radius: 2px; margin-bottom: 20px; overflow: hidden; }
.gp-progress-fill { height: 100%; background: linear-gradient(90deg, var(--gp-accent), var(--gp-accent2)); border-radius: 2px; transition: width .4s ease; }
.gp-question-text { font-family: var(--gp-font); font-size: 20px; font-weight: 600; line-height: 1.4; margin-bottom: 20px; }
.gp-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.gp-option { display: flex; align-items: center; gap: 14px; padding: 14px 18px; background: var(--gp-bg); border: 2px solid var(--gp-border); border-radius: 10px; cursor: pointer; transition: all .15s; font-size: 15px; text-align: left; color: var(--gp-text); width: 100%; font-family: var(--gp-body); }
.gp-option:hover:not(:disabled) { border-color: var(--gp-accent); background: rgba(0,212,255,.05); }
.gp-option.selected { border-color: var(--gp-accent); background: rgba(0,212,255,.1); }
.gp-option:disabled { cursor: default; }
.gp-option-letter { width: 28px; height: 28px; border-radius: 50%; background: var(--gp-surface2); display: flex; align-items: center; justify-content: center; font-family: var(--gp-font); font-weight: 700; font-size: 13px; flex-shrink: 0; text-transform: uppercase; }
.gp-quiz-nav { display: flex; justify-content: space-between; align-items: center; }
.gp-score-display { font-family: var(--gp-font); font-size: 16px; font-weight: 700; color: var(--gp-gold); }

/* ── Results ─────────────────────────────────────────────────────── */
.gp-results-stage { padding: 32px; text-align: center; }
.gp-results-stage h2 { font-family: var(--gp-font); font-size: 28px; font-weight: 700; margin: 0 0 8px; letter-spacing: 1px; }
.gp-results-big-score { font-family: var(--gp-font); font-size: 64px; font-weight: 700; color: var(--gp-gold); line-height: 1; margin: 16px 0; }
.gp-results-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin: 20px 0; }
.gp-results-stat { background: var(--gp-surface2); border-radius: 10px; padding: 16px; }
.gp-results-stat-num { font-family: var(--gp-font); font-size: 24px; font-weight: 700; display: block; }
.gp-results-stat-label { font-size: 11px; color: var(--gp-muted); text-transform: uppercase; letter-spacing: .8px; }
.gp-pass-badge { display: inline-block; padding: 6px 18px; border-radius: 20px; font-family: var(--gp-font); font-size: 15px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 8px; }
.gp-pass-badge.passed { background: rgba(16,185,129,.15); color: var(--gp-green); border: 1px solid var(--gp-green); }
.gp-pass-badge.failed { background: rgba(239,68,68,.1);    color: var(--gp-red);   border: 1px solid var(--gp-red); }
.gp-speed-bonus { font-size: 14px; color: var(--gp-accent); margin-bottom: 12px; }

/* ── Profile ─────────────────────────────────────────────────────── */
.gp-profile-wrap { display: flex; flex-direction: column; gap: 16px; }
.gp-profile-card { display: flex; align-items: center; gap: 18px; padding: 24px; background: var(--gp-surface); border: 1px solid var(--gp-border); border-radius: var(--gp-radius); }
.gp-profile-avatar img { width: 80px; height: 80px; border-radius: 50%; border: 3px solid var(--gp-accent); display: block; }
.gp-profile-info { display: flex; flex-direction: column; gap: 6px; }
.gp-profile-info h2 { font-family: var(--gp-font); font-size: 26px; font-weight: 700; margin: 0; letter-spacing: .5px; }
.gp-profile-global-rank { font-size: 13px; color: var(--gp-muted); }
.gp-rank-progress-wrap { padding: 18px 20px; background: var(--gp-surface); border: 1px solid var(--gp-border); border-radius: var(--gp-radius); }
.gp-rank-progress-header { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; margin-bottom: 10px; color: var(--gp-muted); }
.gp-profile-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.gp-profile-stat { background: var(--gp-surface); border: 1px solid var(--gp-border); border-radius: var(--gp-radius); padding: 18px; text-align: center; transition: border-color .2s; }
.gp-profile-stat:hover { border-color: var(--gp-accent); }
.gp-profile-stat-num { display: block; font-family: var(--gp-font); font-size: 28px; font-weight: 700; color: var(--gp-gold); margin-bottom: 4px; }
.gp-profile-stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--gp-muted); font-weight: 600; }
.gp-profile-history { background: var(--gp-surface); border: 1px solid var(--gp-border); border-radius: var(--gp-radius); padding: 20px; }
.gp-profile-history h3 { font-family: var(--gp-font); font-size: 18px; font-weight: 700; margin: 0 0 14px; letter-spacing: .5px; }
.gp-history-list { display: flex; flex-direction: column; gap: 8px; }
.gp-history-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; background: var(--gp-bg); border: 1px solid var(--gp-border); border-radius: 8px; gap: 12px; transition: border-color .15s; }
.gp-history-row:hover { border-color: var(--gp-accent); }
.gp-history-left { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.gp-history-title { font-family: var(--gp-font); font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gp-history-date { font-size: 11px; color: var(--gp-muted); }
.gp-history-right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.gp-history-score { font-family: var(--gp-font); font-weight: 700; color: var(--gp-gold); font-size: 15px; }
.gp-history-acc { font-size: 13px; font-weight: 700; padding: 2px 8px; border-radius: 12px; }
.gp-history-acc.pass { background: rgba(16,185,129,.15); color: var(--gp-green); }
.gp-history-acc.fail { background: rgba(239,68,68,.1);    color: var(--gp-red); }
.gp-history-correct { font-size: 12px; color: var(--gp-muted); }

/* ── Misc ────────────────────────────────────────────────────────── */
.gp-empty-state { padding: 40px; text-align: center; color: var(--gp-muted); font-size: 15px; background: var(--gp-surface); border: 1px dashed var(--gp-border); border-radius: var(--gp-radius); }
.gp-notice { padding: 12px 16px; background: var(--gp-surface); border-radius: 8px; color: var(--gp-muted); }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .gp-lb-row        { grid-template-columns: 40px 1fr 90px; }
    .gp-lb-played     { display: none; }
    .gp-results-grid  { grid-template-columns: 1fr 1fr; }
    .gp-profile-stats { grid-template-columns: repeat(2,1fr); }
    .gp-player-header { flex-wrap: wrap; }
    .gp-history-correct { display: none; }
    .gp-nav-btn { font-size: 12px; padding: 8px 6px; }
}

/* ── Real-time leaderboard ──────────────────────────────────────────────── */
.gp-lb-live {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: var(--gp-green, #22c55e);
    animation: gp-pulse 1.4s ease-in-out infinite;
    vertical-align: middle;
    margin-left: 8px;
}
@keyframes gp-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.3; }
}

/* ── Live score pop animation ───────────────────────────────────────────── */
.gp-score-display {
    font-weight: 700;
    font-size: 16px;
    transition: transform 0.2s ease, color 0.2s ease;
}
.gp-score-pop {
    transform: scale(1.3);
    color: var(--gp-green, #22c55e) !important;
}

/* ── Answer feedback ─────────────────────────────────────────────────────── */
.gp-option-correct {
    background: rgba(34, 197, 94, 0.18) !important;
    border-color: #22c55e !important;
    color: #22c55e !important;
}
.gp-option-wrong {
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: #ef4444 !important;
    color: #ef4444 !important;
}

/* ── Retake button ───────────────────────────────────────────────────────── */
.gp-btn-warning {
    background: var(--gp-warning, #f59e0b);
    color: #000;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
}
.gp-btn-warning:hover { opacity: 0.85; }
.gp-btn-warning small { font-weight: 400; font-size: 12px; margin-left: 4px; }

/* ── Retake page elements ─────────────────────────────────────────────────── */
.gp-attempts-used { font-size: 12px; color: var(--gp-muted); margin-left: 6px; }
.gp-notice-small  { font-size: 12px; color: var(--gp-muted); margin-top: 8px; }
