:root {
    --bg-color: #2b2d42;
    --text-color: #edf2f4;
    --primary-color: #ef233c;
    --secondary-color: #d90429;
    --card-bg: rgba(255, 255, 255, 0.1);
}

.theme-space {
    --bg-color: #0b0c10;
    --text-color: #66fcf1;
    --primary-color: #45a29e;
    --secondary-color: #1f2833;
    --card-bg: rgba(255, 255, 255, 0.1);
    background-image: radial-gradient(circle at 50% 50%, #1f2833 0%, #0b0c10 100%);
}

.theme-jungle {
    --bg-color: #2b4122;
    --text-color: #f4d03f;
    --primary-color: #8e9146;
    --secondary-color: #41521f;
    --card-bg: rgba(255, 255, 255, 0.15);
    background-image: radial-gradient(circle at 50% 0%, #41521f 0%, #2b4122 100%);
}

.theme-magic {
    --bg-color: #240046;
    --text-color: #e0aaff;
    --primary-color: #5a189a;
    --secondary-color: #3c096c;
    --card-bg: rgba(255, 255, 255, 0.1);
    background-image: radial-gradient(circle at 50% 100%, #3c096c 0%, #240046 100%);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
    touch-action: manipulation; /* Çift dokunuşta zoom yapmayı engeller */
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.5s ease, color 0.5s ease;
    overflow: hidden; /* Tablet/Telefonda scroll yapışmasını önler */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    height: 100dvh; /* Modern tarayıcılarda URL çubuğunu hesaba katar */
    width: 100vw;
}

#app {
    width: 100%;
    max-width: 900px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: min(3vh, 20px) 20px;
    transition: opacity 0.3s ease;
    height: 100%;
    overflow: hidden;
}

.screen.hidden {
    display: none !important;
    opacity: 0;
}

/* ================== */
/* SİHİRBAZ ADIMLARI  */
/* ================== */

.step {
    justify-content: space-between; 
    align-items: center;
    text-align: center;
}

h1 {
    font-size: min(10vw, 4rem); 
    text-shadow: 3px 3px 0px rgba(0,0,0,0.3);
}

.step-title {
    margin-top: min(4vh, 20px);
}

.subtitle {
    font-size: min(4vw, 1.5rem);
    margin: min(2vh, 10px) 0;
    opacity: 0.9;
}

.step-box {
    background: var(--card-bg);
    padding: min(4vh, 30px) 20px;
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    border: 2px solid rgba(255,255,255,0.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: auto; 
}

.step-options {
    display: flex;
    flex-direction: column;
    gap: min(3vh, 20px);
    width: 100%;
    max-width: 500px;
    margin: auto;
}

.wizard-btn {
    width: 100%;
    padding: min(2.5vh, 20px);
    font-size: min(5vw, 1.8rem);
}

.wizard-nav {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 500px;
    margin-top: auto; 
    gap: 20px;
}

.name-input {
    width: 100%;
    padding: min(2vh, 15px);
    font-size: min(4vw, 1.5rem);
    border-radius: 12px;
    border: none;
    text-align: center;
    background: rgba(255,255,255,0.9);
    color: #333;
    outline: none;
    font-family: 'Outfit', sans-serif;
}

.quick-names {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.quick-name-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: var(--text-color);
    padding: 10px 15px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s;
}

.quick-name-btn:hover { background: var(--primary-color); transform: scale(1.05); }

.character-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 15px !important;
    max-width: 800px !important;
    padding: 10px;
    overflow-y: auto;
}

.character-btn {
    flex-direction: column;
    padding: min(2vh, 15px);
    width: auto;
    height: auto;
    gap: 10px;
    font-size: min(3.5vw, 1.2rem);
    text-align: center;
}

.big-avatar {
    width: min(15vh, 100px);
    height: min(15vh, 100px);
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border: 4px solid white;
}

.question-counter-box {
    font-size: min(4vw, 1.5rem);
    background: var(--card-bg);
    padding: 10px 15px;
    border-radius: 15px;
    white-space: nowrap;
}

/* BUTONLAR */
.option-btn {
    background: var(--secondary-color);
    color: var(--text-color);
    border: 3px solid transparent;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.option-btn:hover {
    transform: scale(1.02);
}

.option-btn.selected {
    background: var(--primary-color);
    border-color: #fff;
    transform: scale(1.05); /* Seçili olanı öne çıkar */
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
}

.main-btn {
    flex: 1; 
    background: var(--primary-color);
    color: var(--text-color);
    border: none;
    padding: min(2.5vh, 15px) min(3vw, 20px);
    font-size: min(6vw, 1.8rem);
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 8px 0 var(--secondary-color), 0 15px 20px rgba(0,0,0,0.3);
    transition: all 0.1s;
    font-weight: bold;
}

.main-btn:active {
    transform: translateY(8px);
    box-shadow: 0 0 0 var(--secondary-color), 0 5px 10px rgba(0,0,0,0.3);
}

.secondary-btn {
    flex: 1; 
    background: var(--card-bg);
    border: 3px solid var(--text-color);
    color: var(--text-color);
    padding: min(2.5vh, 15px) min(3vw, 20px);
    font-size: min(5vw, 1.5rem);
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.2s;
}

.secondary-btn:active {
    background: var(--text-color);
    color: var(--bg-color);
}

/* OYUN EKRANI */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.score-board {
    font-size: min(5vw, 2rem);
    background: var(--card-bg);
    padding: 10px 20px;
    border-radius: 15px;
    white-space: nowrap;
}

.timer-container {
    flex: 1;
    max-width: 300px;
    height: 30px;
    background: var(--card-bg);
    border-radius: 15px;
    border: 2px solid var(--text-color);
    overflow: hidden;
    margin: 0 10px;
}

.timer-bar {
    height: 100%;
    width: 100%;
    background: #4cd137;
    transition: width 0.1s linear, background-color 0.3s;
}

.timer-bar.warning { background: #fbc531; }
.timer-bar.danger { background: #e84118; }
.timer-container.hidden { display: none; }

.character-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    position: relative;
    gap: 20px;
    margin-top: min(2vh, 10px);
}

.game-avatar {
    width: min(30vh, 200px);
    height: min(30vh, 200px);
    object-fit: cover;
    border-radius: 50%;
    border: 5px solid var(--text-color);
    background-color: var(--card-bg);
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    animation: float 3s ease-in-out infinite;
}

.speech-bubble {
    background: white;
    color: black;
    padding: 15px 25px;
    border-radius: 20px;
    font-size: min(4vw, 1.5rem);
    position: absolute;
    top: -10px;
    right: 15%;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
}

.speech-bubble.hidden { display: none; }

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 20px;
    border-width: 15px 15px 0 0;
    border-style: solid;
    border-color: white transparent transparent transparent;
}

.question-container {
    text-align: center;
    margin: auto;
}

#question {
    font-size: min(15vw, 6rem);
    text-shadow: 4px 4px 0 rgba(0,0,0,0.2);
}

.answers-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: min(3vh, 20px);
    max-width: 600px;
    width: 100%;
    margin: 0 auto min(4vh, 20px); /* Alt tarafta hep biraz boşluk bırakır */
}

.answer-btn {
    background: var(--card-bg);
    border: 4px solid var(--primary-color);
    color: var(--text-color);
    font-size: min(8vw, 3rem);
    padding: min(2vh, 15px);
    height: min(15vh, 120px); /* Yükseklik tabletlere uyumlu */
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 8px 0 var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.answer-btn:active {
    transform: translateY(8px);
    box-shadow: 0 0 0 var(--secondary-color);
}

.answer-btn.correct { background: #4cd137 !important; border-color: #44bd32 !important; box-shadow: 0 8px 0 #44bd32; }
.answer-btn.wrong { background: #e84118 !important; border-color: #c23616 !important; box-shadow: 0 8px 0 #c23616; }

/* SKOR EKRANI */
.scoreboard-container {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 20px;
    max-height: 50vh;
    overflow-y: auto;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    border: 2px solid rgba(255,255,255,0.2);
}

#score-table { width: 100%; border-collapse: collapse; font-size: min(4vw, 1.2rem); }
#score-table th, #score-table td { padding: 10px; text-align: center; border-bottom: 2px solid rgba(255,255,255,0.1); }
#score-table th { color: var(--primary-color); text-transform: uppercase; }
#score-table tr:hover { background: rgba(255,255,255,0.05); }

/* ANİMASYONLAR */
@keyframes float { 0% { transform: translateY(0px); } 50% { transform: translateY(-15px); } 100% { transform: translateY(0px); } }
@keyframes popIn { 0% { transform: scale(0.5); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.bounce { animation: bounce 2s infinite; }
@keyframes bounce { 0%, 20%, 50%, 80%, 100% { transform: translateY(0); } 40% { transform: translateY(-30px); } 60% { transform: translateY(-15px); } }
.pulse { animation: pulse 2s infinite; }
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } }
.emoji-avatar { font-size: min(6vw, 2rem); }
.emoji-large { font-size: min(20vw, 8rem); animation: float 3s ease-in-out infinite; }

/* YATAY TELEFON / KÜÇÜK TABLET ÖZEL */
@media (max-height: 600px) and (orientation: landscape) {
    .game-avatar { width: 100px; height: 100px; background: white; padding: 5px; }
    #question { font-size: 4rem; }
    .answer-btn { height: 60px; font-size: 2rem; }
    h1 { font-size: 2.5rem; }
    .subtitle { display: none; } /* Yatayda yer açmak için altyazıyı gizle */
}

/* Kilitli Avatar Stili */
.option-btn.locked {
    opacity: 0.6;
    filter: grayscale(1);
    cursor: not-allowed;
    position: relative;
    border-color: #666 !important;
}

.option-btn.locked::after {
    content: '🔒';
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 2rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.option-btn.locked:hover {
    transform: none;
    background: var(--secondary-color) !important;
}

/* 2D Orijinal Avatarlar İçin Sticker Görünümü */
.big-avatar {
    width: 60px;
    height: 60px;
    object-fit: contain;
    background: white;
    border-radius: 50%;
    padding: 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.game-avatar {
    background: white;
    border-radius: 50%;
    padding: 10px;
    border: 5px solid white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    object-fit: contain;
}

