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

body {
    background: #0f172a;
    font-family: 'Nunito', 'Segoe UI', sans-serif;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    color: white;
    user-select: none;
}

body::before {
    content: '';
    position: fixed; inset: 0;
    background:
        radial-gradient(ellipse at 20% 80%, rgba(59,130,246,0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(16,185,129,0.06) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

#input-video { position: fixed; left: -9999px; }

#output-canvas {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    opacity: 0;
    z-index: 5;
}

/* ─── MODAL ───────────────────────────────────────────────── */
.game-modal {
    position: fixed; inset: 0; z-index: 300;
    display: flex; align-items: center; justify-content: center;
    background: rgba(5, 8, 22, 0.92);
}
.game-modal.hidden { display: none; }

.modal-content {
    text-align: center;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.13);
    border-radius: 28px;
    padding: 2rem 2.6rem;
    max-width: 460px;
    width: 92%;
    box-shadow: 0 24px 64px rgba(0,0,0,0.55);
    animation: modalIn 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    max-height: 94vh;
    overflow-y: auto;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.86) translateY(22px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-icon {
    font-size: 3rem; margin-bottom: 0.5rem;
    animation: iconBounce 2.2s ease-in-out infinite;
}
@keyframes iconBounce {
    0%,100% { transform: translateY(0); }
    50%     { transform: translateY(-8px); }
}

.modal-title {
    font-size: 2.2rem; font-weight: 900;
    letter-spacing: 4px;
    background: linear-gradient(135deg, #fff 30%, #fbbf24);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.modal-subtitle {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.62);
    margin-bottom: 1.1rem;
    line-height: 1.75;
}

.score-rules {
    display: flex; flex-direction: column; gap: 0.4rem;
    margin-bottom: 1.1rem; text-align: left;
}
.rule-item {
    display: flex; align-items: center; gap: 0.75rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px; padding: 0.45rem 0.85rem;
}
.rule-icon  { font-size: 1rem; width: 1.4rem; text-align: center; }
.rule-text  { flex: 1; color: rgba(255,255,255,0.78); font-size: 0.85rem; }
.rule-points { font-weight: 900; font-size: 0.9rem; }
.rule-item.hit    .rule-points { color: #34d399; }
.rule-item.bonus  .rule-points { color: #a78bfa; }
.rule-item.escape .rule-points { color: #fbbf24; }
.rule-item.miss   .rule-points { color: #f87171; }

.diff-section { margin-bottom: 1.1rem; }
.diff-label {
    font-size: 0.66rem; font-weight: 900; letter-spacing: 3px;
    color: rgba(255,255,255,0.38); margin-bottom: 0.5rem;
}
.diff-row { display: flex; gap: 0.55rem; }
.diff-btn {
    flex: 1; padding: 0.65rem 0.4rem;
    border-radius: 12px;
    border: 2px solid rgba(255,255,255,0.13);
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.65);
    font-family: 'Nunito', sans-serif;
    font-size: 0.8rem; font-weight: 900;
    letter-spacing: 0.5px; cursor: pointer;
    transition: all 0.2s; line-height: 1.4;
}
.diff-btn span { display: block; font-size: 0.6rem; font-weight: 700; opacity: 0.6; margin-top: 2px; }
.diff-btn:hover { background: rgba(255,255,255,0.1); }
.diff-btn.easy.selected   { background: rgba(34,197,94,0.22);  border-color: #22c55e; color: #86efac; }
.diff-btn.medium.selected { background: rgba(251,191,36,0.22); border-color: #fbbf24; color: #fde68a; }
.diff-btn.hard.selected   { background: rgba(239,68,68,0.22);  border-color: #ef4444; color: #fca5a5; }
.diff-btn.hovered { transform: scale(1.04); filter: brightness(1.25); }

/* ─── ŞEHİR BİLGİ POPUP ──────────────────────────────────────── */
.diff-section { position: relative; }

#diff-info-popup {
    position: absolute;
    left: 0; right: 0;
    bottom: calc(100% + 0.4rem);
    z-index: 20;
    background: rgba(10, 16, 36, 0.97);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 12px;
    padding: 0.75rem 0.9rem 0.6rem;
    animation: diffInfoIn 0.25s ease-out;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
#diff-info-popup.hidden { display: none; }

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

.diff-info-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 0.55rem;
}
#diff-info-title {
    font-size: 0.7rem; font-weight: 900; letter-spacing: 2px;
    color: rgba(255,255,255,0.55);
}
#diff-info-close {
    background: none; border: none; color: rgba(255,255,255,0.3);
    font-size: 0.75rem; cursor: pointer; padding: 0 0.2rem;
    transition: color 0.15s;
}
#diff-info-close:hover { color: rgba(255,255,255,0.8); }

#diff-info-cities {
    display: flex; flex-wrap: wrap; gap: 0.3rem;
    margin-bottom: 0.65rem;
}
.city-tag {
    font-size: 0.65rem; font-weight: 700;
    padding: 0.18rem 0.55rem;
    border-radius: 20px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.7);
}
.city-tag.new {
    background: rgba(96,165,250,0.15);
    border-color: rgba(96,165,250,0.35);
    color: #93c5fd;
}
.city-tag.hard-new {
    background: rgba(251,146,60,0.15);
    border-color: rgba(251,146,60,0.35);
    color: #fdba74;
}

.diff-info-bar-wrap {
    height: 3px; border-radius: 2px;
    background: rgba(255,255,255,0.08);
    overflow: hidden;
}
#diff-info-bar {
    height: 100%; width: 0%;
    border-radius: 2px;
    background: linear-gradient(90deg, #3b82f6, #0ea5e9);
    transition: width linear;
}

.action-btn {
    display: flex; align-items: center; justify-content: center;
    gap: 0.6rem; width: 100%; padding: 0.95rem 2rem;
    background: linear-gradient(135deg, #1d4ed8, #0ea5e9);
    border: none; border-radius: 14px; color: white;
    font-family: 'Nunito', sans-serif;
    font-size: 1.15rem; font-weight: 900; letter-spacing: 3px; cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
    box-shadow: 0 4px 20px rgba(14,165,233,0.4);
}
.action-btn.disabled { opacity: 0.32; cursor: not-allowed; pointer-events: none; }
.action-btn.hovered  { transform: scale(1.05); filter: brightness(1.3); box-shadow: 0 0 30px rgba(14,165,233,0.8); }
.btn-icon { font-size: 1.2rem; }
.btn-hint { margin-top: 0.55rem; font-size: 0.72rem; color: rgba(255,255,255,0.28); letter-spacing: 0.5px; }
.privacy-notice {
    margin-top: 0.75rem; font-size: 0.68rem;
    color: rgba(255,255,255,0.28);
    border-left: 2px solid rgba(255,255,255,0.1);
    padding-left: 0.75rem; text-align: left;
}

.stats-grid { display: flex; gap: 0.75rem; margin: 1.1rem 0 1.4rem; }
.stat-box {
    flex: 1; background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px; padding: 0.75rem 0.4rem;
}
.stat-label { font-size: 0.6rem; letter-spacing: 1.5px; color: rgba(255,255,255,0.38); margin-bottom: 0.3rem; }
.stat-value { font-size: 2rem; font-weight: 900; }
.correct-color { color: #34d399; }
.wrong-color   { color: #f87171; }

/* ─── GAME UI ─────────────────────────────────────────────── */
#game-ui {
    position: fixed; inset: 0;
    display: flex; flex-direction: column;
    z-index: 10;
}
#game-ui.hidden { display: none; }

/* Üst bar */
#top-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 190px 0 1.2rem;
    height: 80px; flex-shrink: 0;
    background: rgba(255,255,255,0.04);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    z-index: 20;
}

#hearts-display {
    display: flex; gap: 4px; font-size: 1.6rem;
    min-width: 110px;
}
.heart { transition: all 0.3s; }
.heart.lost { filter: grayscale(1) opacity(0.3); transform: scale(0.8); }

#question-area {
    text-align: center; flex: 1;
}
#question-label {
    font-size: 0.6rem; font-weight: 900; letter-spacing: 3px;
    color: rgba(255,255,255,0.35); margin-bottom: 2px;
}
#city-name {
    font-size: 1.9rem; font-weight: 900; letter-spacing: 3px;
    background: linear-gradient(135deg, #fff 40%, #fbbf24);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.3s;
}
#city-name.pulse {
    animation: namePulse 0.4s ease-out;
}
@keyframes namePulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.08); }
    100% { transform: scale(1); }
}

#score-area {
    text-align: right; min-width: 110px;
}
#score-display {
    font-size: 1.6rem; font-weight: 900; color: #fbbf24;
    transition: all 0.2s;
}
#round-display {
    font-size: 0.9rem; font-weight: 700; letter-spacing: 2px;
    color: rgba(255,255,255,0.35);
}

/* Harita */
#map-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px 4px;
    min-height: 0;
}

#turkey-map {
    width: 100%;
    height: 100%;
    max-height: 100%;
}

/* İl path'leri */
.province-path {
    fill: #1a3a5c;
    stroke: #3b82f6;
    stroke-width: 0.5;
    stroke-linejoin: round;
    cursor: pointer;
    transition: fill 0.12s;
}
.province-path.hovered {
    fill: #2d5f9e;
    filter: drop-shadow(0 0 4px rgba(96,165,250,0.5));
}
.province-path.correct {
    fill: #166534;
    stroke: #86efac;
    stroke-width: 1;
    filter: drop-shadow(0 0 8px rgba(34,197,94,0.8));
    animation: provincePop 0.5s ease-out;
}
.province-path.wrong {
    fill: #7f1d1d;
    stroke: #fca5a5;
    stroke-width: 1;
    filter: drop-shadow(0 0 6px rgba(239,68,68,0.7));
    animation: provinceShake 0.4s ease-out;
}
.province-path.revealed {
    fill: #1e3a5f;
    stroke: #60a5fa;
    stroke-width: 1.5;
    filter: drop-shadow(0 0 10px rgba(96,165,250,0.9));
    animation: provincePulse 1s ease-in-out infinite;
}

@keyframes provincePop {
    0%   { filter: drop-shadow(0 0 0px rgba(34,197,94,0)); }
    50%  { filter: drop-shadow(0 0 18px rgba(34,197,94,1)); }
    100% { filter: drop-shadow(0 0 8px rgba(34,197,94,0.8)); }
}
@keyframes provinceShake {
    0%,100% { transform: translateX(0); }
    25%     { transform: translateX(-3px); }
    75%     { transform: translateX(3px); }
}
@keyframes provincePulse {
    0%,100% { stroke-width: 1.5; opacity: 1; }
    50%     { stroke-width: 3; opacity: 0.8; }
}

/* İl etiketleri */
.province-label {
    font-family: 'Nunito', sans-serif;
    font-size: 7px;
    font-weight: 800;
    fill: rgba(255,255,255,0.9);
    text-anchor: middle;
    dominant-baseline: central;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}
.province-label.visible { opacity: 1; }

/* Geri bildirim şeridi */
#feedback-bar {
    height: 36px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem; font-weight: 800; letter-spacing: 2px;
    color: rgba(255,255,255,0.5);
    transition: color 0.3s;
}
#feedback-bar.correct { color: #34d399; }
#feedback-bar.wrong   { color: #f87171; }
#feedback-bar.reveal  { color: #93c5fd; }

/* ─── EL NOKTASI ──────────────────────────────────────────── */
#hand-dot {
    position: fixed;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: rgba(251,191,36,0.85);
    border: 2px solid white;
    box-shadow: 0 0 12px rgba(251,191,36,0.6);
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 100;
    display: none;
    transition: background 0.1s, box-shadow 0.1s;
}
#hand-dot.pinching {
    background: rgba(239,68,68,0.9);
    box-shadow: 0 0 20px rgba(239,68,68,0.8);
    width: 14px; height: 14px;
}

/* ─── DWELL HALKASI ──────────────────────────────────────────── */
#dwell-ring {
    position: fixed;
    width: 56px; height: 56px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 101;
    display: none;
}

/* ─── FLAŞ EFEKTİ ─────────────────────────────────────────── */
#feedback-flash {
    position: fixed; inset: 0;
    pointer-events: none;
    z-index: 200;
    opacity: 0;
}
#feedback-flash.correct {
    background: radial-gradient(ellipse at center, rgba(34,197,94,0.25) 0%, transparent 70%);
    animation: flashAnim 0.5s ease-out forwards;
}
#feedback-flash.wrong {
    background: radial-gradient(ellipse at center, rgba(239,68,68,0.25) 0%, transparent 70%);
    animation: flashAnim 0.4s ease-out forwards;
}
@keyframes flashAnim {
    0%   { opacity: 1; }
    100% { opacity: 0; }
}
