/* ============================================================
   ARENA — tasarim sistemi
   Koyu "oyun arenasi" temasi: mor-camgobegi degrade vurgular
   ============================================================ */

:root {
    --bg: #0b0b16;
    --bg-soft: #12121f;
    --card: rgba(255, 255, 255, 0.045);
    --card-border: rgba(255, 255, 255, 0.09);
    --text: #eef0f6;
    --text-dim: #9aa0b4;
    --accent-1: #8b5cf6;
    --accent-2: #22d3ee;
    --grad: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    --ok: #34d399;
    --bad: #f87171;
    --warn: #fbbf24;
    --radius: 18px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: none;
}

body {
    background:
        radial-gradient(1100px 500px at 80% -10%, rgba(139, 92, 246, 0.16), transparent 60%),
        radial-gradient(900px 500px at -10% 110%, rgba(34, 211, 238, 0.10), transparent 60%),
        var(--bg);
    background-attachment: fixed;
    min-height: 100vh;
    min-height: 100dvh;
}

a { color: var(--accent-2); text-decoration: none; }

h1, h2, h3 { margin: 0; }
h1:focus, h1:focus-visible { outline: none; }

/* ---------- iskelet ---------- */

.shell {
    max-width: 560px;
    margin: 0 auto;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.content {
    flex: 1;
    padding: calc(16px + var(--safe-top)) 16px calc(96px + var(--safe-bottom)) 16px;
}

section { margin-top: 26px; }

/* ---------- alt sekme cubugu ---------- */

.tabbar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    max-width: 560px;
    margin: 0 auto;
    display: flex;
    background: rgba(16, 16, 28, 0.82);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-top: 1px solid var(--card-border);
    padding: 8px 6px calc(8px + var(--safe-bottom)) 6px;
    z-index: 50;
}

.tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 0;
    color: var(--text-dim);
    border-radius: 12px;
    transition: color 0.15s;
}

.tab-icon svg { width: 23px; height: 23px; display: block; }

.tab-label { font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em; }

.tab.active {
    color: var(--text);
}

.tab.active .tab-icon {
    color: var(--accent-1);
    filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.7));
}

/* ---------- baslik ---------- */

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.page-title { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.head-hello { font-size: 20px; font-weight: 700; }
.head-sub { color: var(--text-dim); font-size: 13.5px; margin-top: 2px; }

.section-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--text);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge {
    background: var(--grad);
    color: #fff;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    padding: 2px 9px;
}

.back-link {
    display: inline-block;
    color: var(--text-dim);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

/* ---------- kartlar ---------- */

.card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 18px;
}

.row-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 10px;
}

.row-left { display: flex; align-items: center; gap: 12px; color: var(--text); min-width: 0; }
.row-name { font-weight: 700; font-size: 15px; }
.row-sub { color: var(--text-dim); font-size: 12.5px; }

.empty-card {
    text-align: center;
    padding: 36px 20px;
    background: var(--card);
    border: 1px dashed var(--card-border);
    border-radius: var(--radius);
    color: var(--text-dim);
}

.empty-icon { font-size: 40px; margin-bottom: 8px; }
.empty-card .btn { margin-top: 12px; }

/* ---------- ozet istatistik seridi ---------- */

.hero-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.hero-stat {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 14px 6px;
    text-align: center;
}

.hero-num { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.hero-num.dim { color: var(--text-dim); }
.hero-label { font-size: 11px; color: var(--text-dim); margin-top: 3px; font-weight: 600; }

.grad-text {
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* ---------- rekabet karti ---------- */

.rivalry-card {
    display: block;
    color: var(--text);
    margin-bottom: 12px;
    transition: transform 0.12s ease, border-color 0.12s ease;
}

.rivalry-card:active { transform: scale(0.985); border-color: rgba(139, 92, 246, 0.5); }

.rivalry-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.rivalry-game { font-weight: 700; font-size: 14.5px; color: var(--text-dim); }

.rivalry-vs {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.rivalry-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 84px;
}

.rivalry-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-dim);
    max-width: 84px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rivalry-score { display: flex; align-items: baseline; gap: 10px; }
.rs-num { font-size: 38px; font-weight: 800; letter-spacing: -0.03em; }
.rs-sep { font-size: 24px; color: var(--text-dim); font-weight: 300; }

.rivalry-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    color: var(--text-dim);
    font-size: 12.5px;
}

.form-dots { display: inline-flex; gap: 4px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-w { background: var(--ok); box-shadow: 0 0 6px rgba(52, 211, 153, 0.7); }
.dot-l { background: var(--bad); }
.dot-d { background: var(--text-dim); }

/* ---------- duello (rekabet detay) ---------- */

.duel-card { text-align: center; }
.duel-game { color: var(--text-dim); font-weight: 700; font-size: 14px; margin-bottom: 16px; }

.duel-vs { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.duel-side { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 92px; }
.duel-name { font-size: 13.5px; font-weight: 700; max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duel-score { display: flex; align-items: center; gap: 12px; }
.duel-num { font-size: 46px; font-weight: 800; letter-spacing: -0.04em; }
.duel-sep { font-size: 13px; font-weight: 800; color: var(--text-dim); letter-spacing: 0.1em; }

.duel-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--card-border);
}

.duel-stat { display: flex; flex-direction: column; gap: 2px; }
.duel-stat b { font-size: 15px; }
.duel-stat span { font-size: 10.5px; color: var(--text-dim); font-weight: 600; }

.duel-form {
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12.5px;
}

.big-cta { margin-top: 16px; }

/* ---------- mac karti ---------- */

.match-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 10px;
}

.match-rejected { opacity: 0.55; }

.match-game { font-size: 12px; font-weight: 700; color: var(--text-dim); margin-bottom: 8px; }

.match-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.match-player { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.match-player.right { justify-content: flex-end; }
.match-player.winner .match-name { color: var(--text); }
.match-name {
    font-size: 13px; font-weight: 600; color: var(--text-dim);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.match-score { display: flex; gap: 8px; font-size: 22px; font-weight: 800; align-items: baseline; }
.score-sep { color: var(--text-dim); font-weight: 300; }
.score-win { color: var(--accent-2); text-shadow: 0 0 12px rgba(34, 211, 238, 0.45); }

.match-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    color: var(--text-dim);
    font-size: 12px;
}

.match-note { margin-top: 8px; color: var(--text-dim); font-size: 13px; font-style: italic; }

.match-photo {
    margin-top: 10px;
    width: 84px;
    height: 84px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    cursor: pointer;
}

.photo-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 12, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 18px;
}

.photo-overlay img { max-width: 100%; max-height: 88vh; border-radius: 14px; }

.match-actions { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--card-border); }
.match-hint { font-size: 13px; color: var(--text-dim); margin-bottom: 8px; }

/* ---------- cipler ---------- */

.chip {
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
}

.chip-ok { background: rgba(52, 211, 153, 0.14); color: var(--ok); }
.chip-bad { background: rgba(248, 113, 113, 0.14); color: var(--bad); }
.chip-warn { background: rgba(251, 191, 36, 0.14); color: var(--warn); }
.chip-fire { background: rgba(251, 146, 60, 0.16); color: #fb923c; }

/* ---------- butonlar ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    border-radius: 14px;
    padding: 12px 18px;
    font-size: 14.5px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    color: var(--text);
    background: var(--card);
    transition: transform 0.1s ease, opacity 0.15s;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; pointer-events: none; }

.btn-primary {
    background: var(--grad);
    color: #fff;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.35);
}

.btn-ok { background: rgba(52, 211, 153, 0.16); color: var(--ok); }
.btn-bad { background: rgba(248, 113, 113, 0.16); color: var(--bad); }
.btn-ghost { background: transparent; border: 1px solid var(--card-border); color: var(--text-dim); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 11px; }
.btn-row { display: flex; gap: 8px; }
.btn-row .btn { flex: 1; }

.danger-text { color: var(--bad) !important; margin-top: 18px; }

/* ---------- formlar ---------- */

.input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    color: var(--text);
    font-size: 15.5px;
    font-family: inherit;
    padding: 13px 15px;
    margin-bottom: 11px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.input:focus { border-color: var(--accent-1); box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18); }
.input::placeholder { color: rgba(154, 160, 180, 0.65); }

select.input { color-scheme: dark; }
input[type="date"].input { color-scheme: dark; }
input[type="number"].input { color-scheme: dark; }

.form-card { margin-bottom: 16px; margin-top: 14px; }
.form-title { font-size: 17px; font-weight: 800; margin-bottom: 14px; }
.form-label { display: block; font-size: 12.5px; font-weight: 700; color: var(--text-dim); margin: 4px 0 6px 2px; }

.score-inputs { display: flex; align-items: center; gap: 12px; }
.score-input { flex: 1; }
.input-score { text-align: center; font-size: 26px; font-weight: 800; }
.score-dash { font-size: 22px; color: var(--text-dim); padding-top: 18px; }

.search-box { margin-bottom: 6px; }

.file-drop {
    display: block;
    border: 1px dashed var(--card-border);
    border-radius: 14px;
    padding: 16px;
    text-align: center;
    color: var(--text-dim);
    font-size: 13.5px;
    cursor: pointer;
    margin-bottom: 11px;
    position: relative;
    overflow: hidden;
}

.file-drop input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* ---------- uyari kutulari ---------- */

.alert {
    border-radius: 12px;
    padding: 11px 14px;
    font-size: 13.5px;
    margin-bottom: 11px;
    line-height: 1.45;
}

.alert-bad { background: rgba(248, 113, 113, 0.12); color: var(--bad); }
.alert-ok { background: rgba(52, 211, 153, 0.12); color: var(--ok); }
.alert-warn { background: rgba(251, 191, 36, 0.1); color: var(--warn); }
.alert code { font-size: 12px; }

/* ---------- avatar ---------- */

.avatar {
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.12);
    flex-shrink: 0;
}

.avatar-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #fff;
}

.av-0 { background: linear-gradient(135deg, #8b5cf6, #6366f1); }
.av-1 { background: linear-gradient(135deg, #22d3ee, #3b82f6); }
.av-2 { background: linear-gradient(135deg, #f472b6, #a855f7); }
.av-3 { background: linear-gradient(135deg, #34d399, #14b8a6); }
.av-4 { background: linear-gradient(135deg, #fb923c, #f43f5e); }

/* ---------- profil ---------- */

.profile-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    padding: 18px 0 6px 0;
}

.profile-name { font-size: 24px; font-weight: 800; margin-top: 6px; }
.profile-username { color: var(--text-dim); font-size: 14px; font-weight: 600; }
.profile-bio { color: var(--text); font-size: 14.5px; margin: 6px 0 0 0; max-width: 320px; }
.profile-since { color: var(--text-dim); font-size: 12.5px; margin-top: 4px; margin-bottom: 8px; }

.avatar-edit { position: relative; cursor: pointer; }
.avatar-edit input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 2; }
.avatar-edit-badge {
    position: absolute;
    bottom: 0; right: 0;
    background: var(--grad);
    border-radius: 50%;
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
    border: 2px solid var(--bg);
}

/* ---------- basarilar ---------- */

.ach-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.ach {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 14px;
    text-align: center;
}

.ach.earned {
    border-color: rgba(139, 92, 246, 0.45);
    background: linear-gradient(160deg, rgba(139, 92, 246, 0.14), rgba(34, 211, 238, 0.07));
    box-shadow: 0 0 18px rgba(139, 92, 246, 0.12);
}

.ach.locked { opacity: 0.45; filter: grayscale(0.8); }
.ach-icon { font-size: 28px; }
.ach-title { font-weight: 800; font-size: 13.5px; margin-top: 6px; }
.ach-desc { color: var(--text-dim); font-size: 11.5px; margin-top: 3px; }

/* ---------- giris / kayit ---------- */

.auth-wrap {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 18px;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.auth-logo { font-size: 52px; filter: drop-shadow(0 0 24px rgba(139, 92, 246, 0.55)); }

.auth-title {
    font-size: 34px;
    font-weight: 900;
    letter-spacing: 0.12em;
    margin: 8px 0 4px 0;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-sub { color: var(--text-dim); font-size: 14.5px; margin: 0 0 26px 0; }
.auth-alt { margin-top: 18px; color: var(--text-dim); font-size: 14px; }
.auth-alt a { font-weight: 700; }

/* ---------- acilis / yukleme ---------- */

.splash {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.splash-logo { font-size: 56px; filter: drop-shadow(0 0 28px rgba(139, 92, 246, 0.6)); animation: pulse 1.6s ease-in-out infinite; }

.splash-title {
    font-size: 26px;
    font-weight: 900;
    letter-spacing: 0.18em;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.spinner {
    width: 26px; height: 26px;
    border: 3px solid rgba(255, 255, 255, 0.12);
    border-top-color: var(--accent-1);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-top: 8px;
}

.center-spin { display: flex; justify-content: center; padding: 60px 0; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }

.fade-up { animation: fadeUp 0.35s ease both; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- cesitli ---------- */

.dim-text { color: var(--text-dim); }
.small { font-size: 12.5px; margin: 10px 2px 0 2px; }

#blazor-error-ui {
    background: #2a1220;
    color: #fecaca;
    bottom: 0;
    box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.5);
    display: none;
    left: 0;
    padding: 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 200;
    font-size: 14px;
}

#blazor-error-ui .reload { color: #fff; font-weight: 700; margin-left: 8px; }
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.6rem;
}
