/* ===== Kelime Düellosu - Düello Arena Estetiği ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --gold: #ffd23f;
    --gold-deep: #f4a800;
    --you: #38bdf8;
    --you-deep: #0284c7;
    --ai: #fb7185;
    --ai-deep: #e11d48;
    --green-ok: #4ade80;
    --ink: #14182a;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background:
        radial-gradient(circle at 15% 0%, rgba(56,189,248,0.12) 0%, transparent 40%),
        radial-gradient(circle at 85% 0%, rgba(251,113,133,0.12) 0%, transparent 40%),
        linear-gradient(160deg, #1a1f38 0%, #11142a 100%);
    min-height: 100vh; color: #fff; padding: 0 14px 40px; overflow-x: hidden;
}

.game-header {
    position: fixed; top: 0; left: 0; right: 0;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 15px 20px; display: flex; justify-content: center; align-items: center;
    z-index: 10000; box-shadow: 0 2px 18px rgba(0,0,0,0.5); border-bottom: 2px solid var(--gold);
}
.header-logo {
    font-size: 1.4rem; color: var(--gold); letter-spacing: 1px; text-decoration: none; font-weight: 900;
    text-shadow: 0 0 12px var(--gold-deep), 0 0 24px rgba(255,210,63,0.4); transition: transform .3s;
}
.header-logo:hover { transform: scale(1.04); }

.game-container { max-width: 540px; margin: 0 auto; }

/* Düello skor tahtası */
.duel-board {
    display: flex; align-items: stretch; gap: 10px; margin-bottom: 20px;
}
.player-side {
    flex: 1; background: rgba(0,0,0,0.3); border-radius: 16px; padding: 14px; text-align: center;
    border: 2px solid rgba(255,255,255,0.12);
}
.player-side.you { border-color: var(--you); box-shadow: 0 0 16px rgba(56,189,248,0.2); }
.player-side.ai { border-color: var(--ai); box-shadow: 0 0 16px rgba(251,113,133,0.2); }
.side-label { font-size: 0.85rem; opacity: 0.9; margin-bottom: 6px; }
.side-score { font-size: 2.4rem; font-weight: 900; }
.you .side-score { color: var(--you); }
.ai .side-score { color: var(--ai); }
.side-score.pop { animation: pop .4s ease; }
@keyframes pop { 0%{transform:scale(1)} 50%{transform:scale(1.3)} 100%{transform:scale(1)} }

.duel-mid {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 4px; min-width: 110px;
}
.level-badge { font-size: 0.9rem; font-weight: 800; color: var(--gold); }
.round-info { font-size: 0.8rem; opacity: 0.8; }
.difficulty-tag {
    font-size: 0.78rem; padding: 3px 10px; border-radius: 12px; margin-top: 4px;
    background: rgba(74,222,128,0.15); color: var(--green-ok); font-weight: 700;
}

/* Süre çubuğu */
.timer-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.timer-bar-wrap {
    flex: 1; height: 14px; background: rgba(0,0,0,0.4); border-radius: 8px; overflow: hidden;
    border: 1px solid rgba(255,255,255,0.12);
}
.timer-bar {
    height: 100%; width: 100%; border-radius: 8px;
    background: linear-gradient(90deg, var(--green-ok), var(--gold));
    transition: width .1s linear;
}
.timer-bar.warning { background: linear-gradient(90deg, var(--gold), var(--ai)); }
.timer-bar.danger { background: var(--ai); animation: timerPulse .5s ease-in-out infinite; }
@keyframes timerPulse { 50% { opacity: 0.5; } }
.timer-text {
    min-width: 42px; text-align: center; font-size: 1.2rem; font-weight: 900; color: var(--gold);
}
.timer-text.danger { color: var(--ai); }

/* Harf havuzu */
.pool-section { margin-bottom: 18px; text-align: center; }
.pool-label { font-size: 0.85rem; opacity: 0.75; margin-bottom: 10px; letter-spacing: 1px; }
.letter-pool { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.letter-tile {
    width: 52px; height: 56px; border-radius: 12px; border: none; cursor: pointer;
    background: linear-gradient(180deg, #fffdf5, #e6dcc4); color: var(--ink);
    font-size: 1.6rem; font-weight: 900; text-transform: uppercase;
    box-shadow: 0 4px 0 #b8ac8c, 0 5px 10px rgba(0,0,0,0.3);
    transition: transform .1s, opacity .2s; position: relative;
}
.letter-tile:active { transform: translateY(3px); box-shadow: 0 1px 0 #b8ac8c; }
.letter-tile.used { opacity: 0.28; cursor: default; transform: scale(0.92); pointer-events: none; }
.letter-tile .lv {
    position: absolute; bottom: 3px; right: 5px; font-size: 0.6rem; font-weight: 700; opacity: 0.6;
}

/* Kurulan kelime */
.word-build { text-align: center; margin-bottom: 16px; }
.current-word {
    min-height: 60px; background: rgba(0,0,0,0.3); border: 2px solid var(--you);
    border-radius: 14px; display: flex; align-items: center; justify-content: center;
    font-size: 2rem; font-weight: 900; letter-spacing: 3px; text-transform: uppercase;
    padding: 10px; box-shadow: inset 0 0 18px rgba(56,189,248,0.15);
}
.word-placeholder { font-size: 0.95rem; font-weight: 400; opacity: 0.4; letter-spacing: 0; text-transform: none; }
.word-score-preview { margin-top: 8px; font-size: 1rem; font-weight: 700; min-height: 22px; color: var(--gold); }

/* Aksiyon butonları */
.build-actions { display: flex; gap: 10px; justify-content: center; margin-bottom: 16px; flex-wrap: wrap; }
.action-btn {
    padding: 13px 22px; border-radius: 12px; border: none; cursor: pointer; font-size: 0.98rem;
    font-weight: 700; color: #fff; transition: transform .12s, opacity .2s;
}
.action-btn:active { transform: translateY(2px); }
.action-btn.clear { background: #6b4040; }
.action-btn.back { background: #4a5070; }
.action-btn.submit { background: linear-gradient(135deg, var(--you), var(--you-deep)); }
.action-btn.submit:disabled { opacity: 0.4; cursor: not-allowed; }

/* Mesajlar */
.duel-msg { text-align: center; min-height: 28px; font-size: 1.1rem; font-weight: 800; margin-bottom: 10px; }
.duel-msg.win { color: var(--green-ok); }
.duel-msg.lose { color: var(--ai); }
.duel-msg.tie { color: var(--gold); }
.duel-msg.err { color: #fbbf24; font-size: 0.95rem; }

.ai-play {
    text-align: center; min-height: 24px; font-size: 0.95rem; margin-bottom: 16px; opacity: 0.9;
}
.ai-play .ai-word { color: var(--ai); font-weight: 800; text-transform: uppercase; }

/* Kontroller */
.game-controls { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 18px; }
.btn {
    padding: 12px 20px; border: 2px solid rgba(255,255,255,0.22); border-radius: 12px;
    background: rgba(255,255,255,0.07); color: #fff; cursor: pointer; font-size: 0.92rem;
    font-weight: 600; transition: background .2s, transform .12s;
}
.btn:hover { background: rgba(255,255,255,0.16); transform: translateY(-2px); }

.best-score { text-align: center; opacity: 0.85; font-size: 0.92rem; }
.best-score span { color: var(--gold); font-weight: 800; }

/* Overlay / Menü */
.overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.85); backdrop-filter: blur(6px);
    display: none; align-items: center; justify-content: center; z-index: 20000; padding: 20px;
}
.overlay.show { display: flex; }
.menu-card {
    background: linear-gradient(160deg, #1f2540, #14182a); border: 3px solid var(--gold);
    border-radius: 22px; padding: 32px 26px; max-width: 460px; width: 100%; text-align: center;
    box-shadow: 0 0 40px rgba(255,210,63,0.25); max-height: 90vh; overflow-y: auto;
}
.menu-card h1 { font-size: 2rem; color: var(--gold); text-shadow: 0 0 14px rgba(255,210,63,0.5); }
.info-block { background: rgba(255,255,255,0.06); border-radius: 12px; padding: 16px; margin: 14px 0; text-align: left; }
.info-block.strategy { background: rgba(56,189,248,0.1); border: 1px solid rgba(56,189,248,0.3); }
.info-block h3 { color: var(--you); margin-bottom: 8px; }
.info-text div { line-height: 1.9; color: rgba(255,255,255,0.92); }
.btn-primary {
    margin-top: 10px; padding: 15px 34px; border: none; border-radius: 50px; cursor: pointer;
    font-size: 1.1rem; font-weight: 900; color: var(--ink);
    background: linear-gradient(135deg, var(--gold), var(--gold-deep));
    box-shadow: 0 5px 0 #b87d00; transition: transform .1s;
}
.btn-primary:active { transform: translateY(4px); box-shadow: 0 1px 0 #b87d00; }

.final-score { font-size: 2.4rem; font-weight: 900; margin: 16px 0; }
.duel-result-msg { font-size: 1.05rem; line-height: 1.5; margin-bottom: 18px; opacity: 0.92; }

.confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 19000; overflow: hidden; }
.confetti { position: absolute; width: 10px; height: 14px; top: -20px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); opacity: 0.2; } }

.seo-content {
    max-width: 800px; margin: 40px auto 0; padding: 30px;
    background: rgba(0,0,0,0.3); border-radius: 15px; line-height: 1.8; border: 1px solid rgba(255,210,63,0.2);
}
.seo-content h2 { color: var(--gold); margin-bottom: 18px; }
.seo-content h3 { color: var(--you); margin: 22px 0 12px; }
.seo-content ul { padding-left: 22px; }
.seo-content li { margin-bottom: 6px; }

@media (max-width: 520px) {
    .header-logo { font-size: 1.1rem; }
    .letter-tile { width: 46px; height: 50px; font-size: 1.4rem; }
    .side-score { font-size: 2rem; }
    .duel-mid { min-width: 92px; }
    .current-word { font-size: 1.6rem; }
}
