@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@700;900&family=Cinzel:wght@400;700;900&display=swap');

/* ===================== RESET & BASE ===================== */
* { box-sizing: border-box; }

body {
    font-family: 'Cinzel', serif;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh; /* Mobil tarayıcı adres çubuğu için */
    background: radial-gradient(ellipse at center, #1a0000 0%, #0a0000 70%, #000 100%);
    overflow-x: hidden;
    position: relative;
}

/* ===================== ARKAPLAN ===================== */
.flag-bg {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-image: url('https://upload.wikimedia.org/wikipedia/commons/b/b4/Flag_of_Turkey.svg');
    background-size: cover;
    background-position: center;
    opacity: 0.12;
    z-index: 0;
    animation: wave 12s ease-in-out infinite alternate;
}

.overlay-glow {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: radial-gradient(ellipse at 50% 50%, rgba(184,134,11,0.08) 0%, transparent 70%);
    z-index: 0;
    pointer-events: none;
}

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

.particle {
    position: absolute;
    width: 4px; height: 4px;
    background: #DAA520;
    border-radius: 50%;
    opacity: 0;
    animation: floatParticle linear infinite;
}

@keyframes floatParticle {
    0%   { opacity: 0; transform: translateY(100vh) scale(0); }
    10%  { opacity: 0.6; }
    90%  { opacity: 0.3; }
    100% { opacity: 0; transform: translateY(-10px) scale(1); }
}

@keyframes wave {
    0%   { transform: scale(1) rotate(0deg); }
    50%  { transform: scale(1.1) rotate(1.5deg); }
    100% { transform: scale(1.05) rotate(-1deg); }
}

/* ===================== CONTAINER ===================== */
.container {
    background: linear-gradient(160deg, rgba(20,5,0,0.97) 0%, rgba(10,0,0,0.97) 100%);
    padding: 30px 25px;
    border-radius: 4px;
    box-shadow:
        0 0 0 1px #DAA520,
        0 0 0 3px #8B1A1A,
        0 0 40px rgba(184,134,11,0.25),
        0 20px 60px rgba(0,0,0,0.9);
    text-align: center;
    max-width: 700px;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* Köşe süslemeleri */
.container::before,
.container::after {
    content: '✦';
    position: absolute;
    font-size: 1.5em;
    color: #DAA520;
    opacity: 0.7;
}
.container::before { top: 10px; left: 15px; }
.container::after  { bottom: 10px; right: 15px; }

/* ===================== BAŞLIKLAR ===================== */
.slogan-box {
    border: 1px solid #8B1A1A;
    border-left: 4px solid #8B1A1A;
    border-right: 4px solid #8B1A1A;
    padding: 8px 15px;
    margin-bottom: 15px;
    background: rgba(139,26,26,0.15);
}

.slogan {
    color: #ff4444;
    font-family: 'Cinzel Decorative', serif;
    font-size: 1em;
    text-transform: uppercase;
    margin: 0;
    font-weight: 900;
    letter-spacing: 3px;
    animation: pulse-red 2s infinite alternate;
}

@keyframes pulse-red {
    0%   { text-shadow: 0 0 5px rgba(255,68,68,0.5), 0 0 10px rgba(255,68,68,0.3); }
    100% { text-shadow: 0 0 15px rgba(255,68,68,0.9), 0 0 30px rgba(255,68,68,0.5), 0 0 45px rgba(255,68,68,0.2); }
}

.game-title {
    font-family: 'Cinzel Decorative', serif;
    color: #DAA520;
    font-size: 1.6em;
    margin: 10px 0 20px;
    line-height: 1.4;
    text-shadow: 0 0 20px rgba(218,165,32,0.6), 0 2px 4px rgba(0,0,0,0.8);
    letter-spacing: 3px;
}

.subtitle {
    font-family: 'Cinzel', serif;
    font-size: 0.55em;
    color: #c8a44a;
    letter-spacing: 6px;
    text-transform: uppercase;
    display: block;
}

/* ===================== HATA SAYACI ===================== */
#error-counter {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    padding: 8px;
    border-bottom: 1px solid rgba(218,165,32,0.2);
}

#error-hearts {
    font-size: 1.4em;
    letter-spacing: 3px;
    transition: all 0.3s;
}

#error-text {
    color: #c8a44a;
    font-size: 0.85em;
    letter-spacing: 2px;
}

/* ===================== SVG SAVAŞÇI ===================== */
#hangman-drawing svg {
    filter: drop-shadow(0 0 10px rgba(184,134,11,0.3));
}

/* ===================== KATEGORİ ROZET ===================== */
#category-badge {
    display: inline-block;
    padding: 4px 16px;
    background: rgba(139,26,26,0.3);
    border: 1px solid #8B1A1A;
    color: #ff8888;
    font-size: 0.75em;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 15px;
    border-radius: 2px;
}

/* ===================== KELİME ===================== */
#word-display {
    font-family: 'Cinzel', serif;
    font-size: 2.2em;
    margin: 15px 0;
    font-weight: 900;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    color: #DAA520;
    text-shadow: 0 0 10px rgba(218,165,32,0.4);
}

.letter-span {
    display: inline-block;
    min-width: 32px;
    border-bottom: 3px solid #DAA520;
    padding-bottom: 4px;
    text-align: center;
    color: #FFD700;
    text-shadow: 0 0 10px rgba(255,215,0,0.6);
}

.letter-span.pop {
    animation: popLetter 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes popLetter {
    0%   { transform: scale(0) rotateY(90deg); opacity: 0; }
    60%  { transform: scale(1.4) rotateY(0deg); }
    100% { transform: scale(1); opacity: 1; }
}

/* ===================== İPUCU ===================== */
#hint-text {
    color: rgba(200,164,74,0.6);
    font-size: 0.8em;
    letter-spacing: 2px;
    margin-bottom: 5px;
    min-height: 20px;
    font-style: italic;
}

/* ===================== MESAJ ===================== */
#message {
    font-family: 'Cinzel Decorative', serif;
    font-size: 1.3em;
    font-weight: 900;
    margin: 10px 0 15px;
    min-height: 40px;
    animation: fadeInDown 0.5s both;
    letter-spacing: 2px;
    text-shadow: 0 0 15px currentColor;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-15px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===================== KLAVYE ===================== */
#keyboard {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-bottom: 20px;
}

.key {
    padding: 10px 14px;
    font-family: 'Cinzel', serif;
    font-size: 1em;
    font-weight: 700;
    background: linear-gradient(to bottom, #2a0a00, #1a0500);
    border: 1px solid #DAA520;
    border-bottom: 3px solid #8B6914;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s;
    color: #DAA520;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.key::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(218,165,32,0.15), transparent);
    transition: left 0.3s;
}
.key:hover::before { left: 100%; }

.key:hover:not(:disabled) {
    background: linear-gradient(to bottom, #3d1200, #2a0800);
    box-shadow: 0 0 12px rgba(218,165,32,0.5);
    transform: translateY(-1px);
}

.key:active:not(:disabled) {
    transform: translateY(2px);
    border-bottom-width: 1px;
}

.key.correct {
    background: linear-gradient(to bottom, #1a3a1a, #0d2a0d);
    border-color: #4caf50;
    border-bottom-color: #2e7d32;
    color: #69f069;
    text-shadow: 0 0 8px #4caf50;
}

.key.wrong {
    background: linear-gradient(to bottom, #3a0a0a, #2a0000);
    border-color: #8B1A1A;
    border-bottom-color: #600000;
    color: #ff4444;
    opacity: 0.7;
    text-decoration: line-through;
}

.key:disabled:not(.correct):not(.wrong) {
    background: #0d0500;
    border-color: #333;
    border-bottom-color: #222;
    color: #444;
    cursor: not-allowed;
}

/* ===================== GÖRSELLER ===================== */
#custom-image-container {
    margin: 10px 0;
}

.result-image-wrapper {
    flex: 1;
    max-width: 48%;
    position: relative;
}

.result-image-wrapper img {
    width: 100%;
    border-radius: 4px;
    border: 2px solid #DAA520;
    box-shadow: 0 0 20px rgba(218,165,32,0.4), 0 0 40px rgba(0,0,0,0.8);
    animation: popInImage 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes popInImage {
    0%   { transform: scale(0.1) rotate(-5deg); opacity: 0; }
    70%  { transform: scale(1.05) rotate(1deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* ===================== BUTONLAR ===================== */
#restart-btn {
    padding: 12px 30px;
    font-family: 'Cinzel', serif;
    font-size: 1.1em;
    font-weight: 700;
    background: linear-gradient(to bottom, #8B1A1A, #600000);
    color: #FFD700;
    border: 2px solid #DAA520;
    border-radius: 3px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(139,26,26,0.5), 0 0 30px rgba(218,165,32,0.1);
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-top: 10px;
}

#restart-btn:hover {
    background: linear-gradient(to bottom, #aa2222, #8B1A1A);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(139,26,26,0.7), 0 0 40px rgba(218,165,32,0.2);
}

/* ===================== SHAKE ===================== */
.shake {
    animation: shake 0.45s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-3px, 0, 0); }
    20%, 80% { transform: translate3d(5px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-8px, 0, 0); }
    40%, 60% { transform: translate3d(8px, 0, 0); }
}

/* ===================== KONFETİ CANVAS ===================== */
#confetti-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 999;
}
/* ===================== TEHDİT BANNER ===================== */
#threat-banner {
    font-family: 'Cinzel Decorative', serif;
    font-size: 0.85em;
    font-weight: 900;
    color: #FFD700;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: linear-gradient(90deg, transparent, rgba(139,26,26,0.6), transparent);
    border-top: 1px solid #8B1A1A;
    border-bottom: 1px solid #8B1A1A;
    padding: 10px 5px;
    margin: 12px 0;
    text-shadow: 0 0 10px rgba(255,68,68,0.8), 0 0 20px rgba(255,68,68,0.4);
    animation: threatPulse 1.2s ease-in-out infinite alternate, fadeInDown 0.6s both;
}

@keyframes threatPulse {
    0%   { letter-spacing: 2px; text-shadow: 0 0 8px rgba(255,68,68,0.7); }
    100% { letter-spacing: 4px; text-shadow: 0 0 20px rgba(255,68,68,1), 0 0 40px rgba(255,68,68,0.5); }
}

@media (max-width: 600px) {
    #threat-banner { font-size: 0.62em; letter-spacing: 1px; }
}

/* ===================== MOBİL ===================== */
@media (max-width: 600px) {
    body {
        align-items: center;
        padding: 10px;
    }

    .container {
        padding: 15px 12px;
        width: 100%;
        max-width: 100%;
        margin: auto;
        border-radius: 6px;
    }

    .game-title {
        font-size: 1.1em;
        margin: 6px 0 12px;
    }

    .slogan {
        font-size: 0.75em;
        letter-spacing: 1px;
    }

    #warrior-svg {
        width: 160px;
        height: 180px;
    }

    #word-display {
        font-size: 1.5em;
        gap: 5px;
        margin: 10px 0;
    }

    .letter-span {
        min-width: 22px;
    }

    .key {
        padding: 8px 10px;
        font-size: 0.85em;
    }

    #message {
        font-size: 1em;
    }

    .result-image-wrapper img {
        max-height: 160px;
        object-fit: cover;
    }

    #error-hearts {
        font-size: 1em;
    }

    #restart-btn {
        padding: 10px 20px;
        font-size: 0.9em;
    }
}
