* {
    margin: 0; padding: 0;
    box-sizing: border-box;
    font-family: 'Nunito', sans-serif;
}

body {
    background: #0f172a;
    height: 100vh;
    overflow: hidden;
    position: relative;
    user-select: none;
    color: white;
}

/* Mevsim renk gradyanları — köşelere göre */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 18% 22%, rgba(147,197,253,0.15) 0%, transparent 48%),  /* kış - sol üst */
        radial-gradient(ellipse at 82% 22%, rgba(253,186,116,0.14) 0%, transparent 48%),  /* ilkbahar - sağ üst */
        radial-gradient(ellipse at 18% 78%, rgba(250,204,21,0.14)  0%, transparent 48%),  /* yaz - sol alt */
        radial-gradient(ellipse at 82% 78%, rgba(251,146,60,0.14)  0%, transparent 48%);  /* sonbahar - sağ alt */
    pointer-events: none;
    z-index: 0;
}

.input_video { display: none; }

.output_canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 10;
    pointer-events: none;
}

/* ==========================================
   MEVSİM KUTULARI (4 köşe)
   ========================================== */
.zone-box {
    position: fixed;
    width: 155px;
    min-height: 130px;
    border-radius: 22px;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 1rem 0.8rem;
    z-index: 20;
    transition: box-shadow 0.2s, transform 0.2s, background 0.2s;
}

.zone-box.visible { display: flex; }
.zone-box.inactive { opacity: 0.14; pointer-events: none; }

.zone-top-left     { top: 88px;   left: 28px;  }
.zone-top-right    { top: 88px;   right: 28px; }
.zone-bottom-left  { bottom: 75px; left: 28px;  }
.zone-bottom-right { bottom: 75px; right: 28px; }

/* Mevsim renkleri */
#zone-winter {
    background: rgba(147,197,253,0.18);
    border: 3px solid rgba(147,197,253,0.55);
    box-shadow: 0 6px 24px rgba(147,197,253,0.12);
}
#zone-spring {
    background: rgba(249,168,212,0.18);
    border: 3px solid rgba(249,168,212,0.55);
    box-shadow: 0 6px 24px rgba(249,168,212,0.12);
}
#zone-summer {
    background: rgba(250,204,21,0.18);
    border: 3px solid rgba(250,204,21,0.55);
    box-shadow: 0 6px 24px rgba(250,204,21,0.12);
}
#zone-autumn {
    background: rgba(251,146,60,0.18);
    border: 3px solid rgba(251,146,60,0.55);
    box-shadow: 0 6px 24px rgba(251,146,60,0.12);
}

/* Hover */
#zone-winter.hovered { background: rgba(147,197,253,0.45); border-color: #93c5fd; box-shadow: 0 0 44px rgba(147,197,253,0.75); transform: scale(1.08); }
#zone-spring.hovered { background: rgba(249,168,212,0.45); border-color: #f9a8d4; box-shadow: 0 0 44px rgba(249,168,212,0.75); transform: scale(1.08); }
#zone-summer.hovered { background: rgba(250,204,21,0.45);  border-color: #facc15; box-shadow: 0 0 44px rgba(250,204,21,0.75);  transform: scale(1.08); }
#zone-autumn.hovered { background: rgba(251,146,60,0.45);  border-color: #fb923c; box-shadow: 0 0 44px rgba(251,146,60,0.75);  transform: scale(1.08); }

.zone-box.correct-flash { animation: correctFlash 0.5s ease-out; }
.zone-box.wrong-flash   { animation: wrongFlash   0.5s ease-out; }

@keyframes correctFlash {
    0%  { filter: brightness(1); }
    30% { filter: brightness(2.8); }
    100%{ filter: brightness(1); }
}
@keyframes wrongFlash {
    0%,100% { filter: brightness(1); }
    25% { filter: brightness(0.4) sepia(1) hue-rotate(-30deg); }
    75% { filter: brightness(0.4) sepia(1) hue-rotate(-30deg); }
}

.zone-emoji {
    font-size: 2.4rem;
    line-height: 1;
}

.zone-label {
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 2px;
    opacity: 0.8;
}

/* ==========================================
   NESNE KARTI (orta)
   ========================================== */
#season-card {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 30;
    display: none;
    width: 190px;
    min-height: 190px;
    border-radius: 28px;
    background: white;
    box-shadow: 0 16px 48px rgba(0,0,0,0.35), 0 0 0 4px rgba(255,255,255,0.3);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.2rem 1rem;
    animation: cardBob 2s ease-in-out infinite;
    will-change: left, top;
}

@keyframes cardBob {
    0%, 100% { transform: translate(-50%, -50%) translateY(0px); }
    50%       { transform: translate(-50%, -50%) translateY(-10px); }
}

#season-card.grabbed {
    animation: none;
    transform: translate(-50%, -50%) scale(1.1) rotate(-3deg);
    box-shadow: 0 24px 60px rgba(0,0,0,0.5), 0 0 0 4px rgba(251,191,36,0.7), 0 0 30px rgba(251,191,36,0.4);
    z-index: 50;
}

#season-card.spawning {
    animation: cardSpawn 0.4s cubic-bezier(0.22,1,0.36,1) forwards, cardBob 2s ease-in-out 0.4s infinite;
}
@keyframes cardSpawn {
    from { transform: translate(-50%,-50%) scale(0.3); opacity: 0; }
    to   { transform: translate(-50%,-50%) scale(1);   opacity: 1; }
}

#season-card.flying-up    { animation: flyUp    0.35s cubic-bezier(0.55,0,1,0.45) forwards !important; }
#season-card.flying-right { animation: flyRight 0.35s cubic-bezier(0.55,0,1,0.45) forwards !important; }
#season-card.flying-left  { animation: flyLeft  0.35s cubic-bezier(0.55,0,1,0.45) forwards !important; }
#season-card.flying-down  { animation: flyDown  0.35s cubic-bezier(0.55,0,1,0.45) forwards !important; }

@keyframes flyUp    { to { top: -20vh  !important; opacity:0; transform:translate(-50%,-50%) scale(0.5) rotate(-10deg); } }
@keyframes flyRight { to { left: 120vw !important; opacity:0; transform:translate(-50%,-50%) scale(0.5) rotate(15deg);  } }
@keyframes flyLeft  { to { left:-20vw  !important; opacity:0; transform:translate(-50%,-50%) scale(0.5) rotate(-15deg); } }
@keyframes flyDown  { to { top: 120vh  !important; opacity:0; transform:translate(-50%,-50%) scale(0.5) rotate(10deg);  } }

#card-emoji {
    font-size: 5rem;
    line-height: 1;
}

#card-name {
    font-size: 1rem;
    font-weight: 900;
    color: #1e293b;
    letter-spacing: 1px;
    text-align: center;
}

/* ==========================================
   HUD
   ========================================== */
#game-ui {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 2rem;
    pointer-events: none;
}

.hud-panel {
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 16px;
    padding: 0.6rem 1.5rem;
    text-align: center;
    min-width: 110px;
}

.hud-label {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.5);
    margin-bottom: 0.2rem;
}

.hud-value {
    font-size: 2.2rem;
    font-weight: 900;
    color: #fff;
    line-height: 1;
}

.timer-value { transition: color 0.3s; }
.timer-value.urgent {
    color: #f87171;
    animation: heartbeat 0.7s ease-in-out infinite;
}
@keyframes heartbeat {
    0%,100% { transform: scale(1); }
    40%     { transform: scale(1.15); }
}

.hud-status {
    position: fixed;
    bottom: 1.5rem; left: 1.5rem;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 1px;
    pointer-events: none;
    z-index: 50;
}

.status-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 8px #ef4444;
    transition: all 0.3s;
}
.status-dot.active { background: #22c55e; box-shadow: 0 0 12px #22c55e; }

.hud-value.bump { animation: bump 0.25s cubic-bezier(0.175,0.885,0.32,1.275); }
@keyframes bump {
    0%  { transform: scale(1); }
    50% { transform: scale(1.4); }
    100%{ transform: scale(1); }
}

/* ==========================================
   FLOATING SCORE
   ========================================== */
.floating-score {
    position: fixed;
    font-weight: 900;
    font-size: 1.8rem;
    pointer-events: none;
    z-index: 60;
    animation: floatUp 0.9s ease-out forwards;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
@keyframes floatUp {
    0%  { opacity:1; transform: translateY(0) scale(1); }
    60% { transform: translateY(-40px) scale(1.2); }
    100%{ opacity:0; transform: translateY(-60px) scale(0.9); }
}

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

.modal-content {
    text-align: center;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 28px;
    padding: 2rem 3rem;
    max-width: 480px;
    width: 92%;
    box-shadow: 0 24px 64px rgba(0,0,0,0.5);
    animation: modalIn 0.45s cubic-bezier(0.22,1,0.36,1);
}
@keyframes modalIn {
    from { opacity:0; transform: scale(0.85) translateY(20px); }
    to   { opacity:1; transform: scale(1)    translateY(0); }
}

.modal-icon {
    font-size: 3rem;
    margin-bottom: 0.6rem;
    animation: iconBounce 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: 3px;
    background: linear-gradient(135deg, #fff 30%, #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.4rem;
}

.modal-subtitle {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.65);
    margin-bottom: 1.2rem;
    line-height: 1.6;
}

.score-rules {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-bottom: 1.2rem;
    text-align: left;
}
.rule-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 0.5rem 0.9rem;
    border: 1px solid rgba(255,255,255,0.08);
}
.rule-icon  { font-size: 1rem; }
.rule-text  { flex: 1; color: rgba(255,255,255,0.8); font-size: 0.88rem; }
.rule-points { font-weight: 900; font-size: 0.92rem; }
.rule-item.hit    .rule-points { color: #34d399; }
.rule-item.miss   .rule-points { color: #f87171; }
.rule-item.escape .rule-points { color: #fbbf24; }
.rule-item.time   .rule-points { color: #60a5fa; }

.diff-section { margin-bottom: 1.2rem; }
.diff-label {
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 3px;
    color: rgba(255,255,255,0.4);
    margin-bottom: 0.5rem;
}
.diff-row { display: flex; gap: 0.6rem; }

.diff-btn {
    flex: 1;
    padding: 0.7rem 0.4rem;
    border-radius: 12px;
    border: 2px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.7);
    font-family: 'Nunito', sans-serif;
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1.35;
}
.diff-btn span { display: block; font-size: 0.62rem; font-weight: 700; opacity: 0.6; letter-spacing: 0; margin-top: 2px; }
.diff-btn:hover { background: rgba(255,255,255,0.1); }
.diff-btn.easy.selected   { background: rgba(34,197,94,0.25);  border-color: #22c55e; color: #86efac; }
.diff-btn.medium.selected { background: rgba(251,191,36,0.25); border-color: #fbbf24; color: #fde68a; }
.diff-btn.hard.selected   { background: rgba(239,68,68,0.25);  border-color: #ef4444; color: #fca5a5; }
.diff-btn.hovered { transform: scale(1.05); filter: brightness(1.3); }

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    border: none;
    border-radius: 14px;
    color: white;
    font-size: 1.2rem;
    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(124,58,237,0.5);
}
.action-btn.disabled { opacity: 0.35; cursor: not-allowed; pointer-events: none; }
.action-btn.hovered  { transform: scale(1.05); filter: brightness(1.3); box-shadow: 0 0 30px rgba(124,58,237,0.9); }

.btn-hint {
    margin-top: 0.6rem;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.3);
    letter-spacing: 1px;
}
.privacy-notice {
    margin-top: 0.8rem;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.3);
    border-left: 2px solid rgba(255,255,255,0.1);
    padding-left: 0.8rem;
    text-align: left;
}

.stats-grid { display: flex; gap: 0.8rem; margin: 1.2rem 0 1.5rem; }
.stat-box {
    flex: 1;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    padding: 0.8rem 0.5rem;
}
.stat-label { font-size: 0.68rem; letter-spacing: 2px; color: rgba(255,255,255,0.4); margin-bottom: 0.3rem; }
.stat-value    { font-size: 2.2rem; font-weight: 900; color: #fff; }
.correct-color { color: #34d399 !important; }
.wrong-color   { color: #f87171 !important; }

/* ==========================================
   CROSSHAIR
   ========================================== */
#crosshair {
    position: fixed;
    width: 48px; height: 48px;
    border: 2.5px solid rgba(255,255,255,0.6);
    border-radius: 50%;
    transform: translate(-50%,-50%);
    display: none;
    pointer-events: none;
    z-index: 100;
    transition: width 0.12s, height 0.12s, border-color 0.12s, background 0.12s;
}
#crosshair .dot {
    position: absolute; top: 50%; left: 50%;
    width: 8px; height: 8px;
    background: #fbbf24; border-radius: 50%;
    transform: translate(-50%,-50%);
    box-shadow: 0 0 10px #fbbf24;
    transition: all 0.12s;
}
#crosshair .ring {
    position: absolute; top: 50%; left: 50%;
    width: 20px; height: 20px;
    border: 1.5px solid rgba(251,191,36,0.4); border-radius: 50%;
    transform: translate(-50%,-50%);
}
#crosshair.pinching {
    width: 28px; height: 28px;
    border-color: #fbbf24;
    background: rgba(251,191,36,0.15);
    box-shadow: 0 0 20px rgba(251,191,36,0.6);
}
#crosshair.pinching .dot {
    background: #f59e0b;
    box-shadow: 0 0 16px #f59e0b;
    transform: translate(-50%,-50%) scale(1.5);
}

@keyframes screenShake {
    0%  { transform: translate(0,0); }
    20% { transform: translate(-8px,4px); }
    40% { transform: translate(8px,-4px); }
    60% { transform: translate(-8px,-4px); }
    80% { transform: translate(8px,4px); }
    100%{ transform: translate(0,0); }
}
.shake { animation: screenShake 0.35s ease both; }

@media (max-width: 768px) {
    .zone-box { width: 118px; min-height: 105px; }
    .zone-emoji { font-size: 1.8rem; }
    .zone-label { font-size: 0.58rem; }
    .zone-top-left  { top: 80px; left: 8px; }
    .zone-top-right { top: 80px; right: 8px; }
    .zone-bottom-left  { bottom: 58px; left: 8px; }
    .zone-bottom-right { bottom: 58px; right: 8px; }
    #game-ui { padding: 0.5rem 0.4rem; }
    .hud-panel { min-width: 70px; padding: 0.4rem 0.6rem; }
    .hud-value { font-size: 1.4rem; }
    #card-emoji { font-size: 3.8rem; }
}
