/* ================================================== */
/* BİLGİ YARIŞMASI - ANA STİL DOSYASI                 */
/* Bootstrap 5 + Özel Stiller                         */
/* ================================================== */

/* ======================== */
/* 1. CSS DEĞİŞKENLERİ      */
/* ======================== */
:root {
    --primary: #667eea;
    --secondary: #764ba2;
    --success: #00E676;
    --danger: #FF4757;
    --warning: #FFD32A;
    --dark: #434A54;
    --light: #F5F7FA;
    --font: 'DynaPuff', cursive;
    --font-read: 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
    --font-feedback: 'Bungee', cursive;
    /* New font for feedback */
    /* Okunabilir Font */
    --glass: rgba(255, 255, 255, 0.95);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    font-family: var(--font);
}

html,
body {
    height: 100%;
    overflow: hidden;
}

/* ======================== */
/* 2. ANİMASYONLU ARKA PLAN */
/* ======================== */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Purple gradient blur background instead of image */
    background: linear-gradient(135deg,
            #667eea 0%,
            #764ba2 25%,
            #8b5cf6 50%,
            #6366f1 75%,
            #7c3aed 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    z-index: -2;
    /* Performance optimizations */
    will-change: auto;
    contain: strict;
    content-visibility: auto;
}

/* Animated gradient shift */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Blur overlay for depth effect */
.animated-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center,
            transparent 0%,
            rgba(102, 126, 234, 0.2) 50%,
            rgba(118, 75, 162, 0.4) 100%);
    backdrop-filter: blur(0px);
    pointer-events: none;
}

/* Floating Bubbles */
.bubble {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    animation: float 8s ease-in-out infinite;
    z-index: -1;
}

.bubble:nth-child(1) {
    width: 80px;
    height: 80px;
    left: 10%;
    top: 20%;
    animation-delay: 0s;
}

.bubble:nth-child(2) {
    width: 60px;
    height: 60px;
    left: 20%;
    top: 70%;
    animation-delay: 1s;
}

.bubble:nth-child(3) {
    width: 100px;
    height: 100px;
    left: 35%;
    top: 40%;
    animation-delay: 2s;
}

.bubble:nth-child(4) {
    width: 50px;
    height: 50px;
    left: 50%;
    top: 80%;
    animation-delay: 3s;
}

.bubble:nth-child(5) {
    width: 70px;
    height: 70px;
    left: 65%;
    top: 30%;
    animation-delay: 4s;
}

.bubble:nth-child(6) {
    width: 90px;
    height: 90px;
    left: 75%;
    top: 60%;
    animation-delay: 5s;
}

.bubble:nth-child(7) {
    width: 55px;
    height: 55px;
    left: 85%;
    top: 15%;
    animation-delay: 6s;
}

.bubble:nth-child(8) {
    width: 75px;
    height: 75px;
    left: 90%;
    top: 50%;
    animation-delay: 7s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.5;
    }

    50% {
        transform: translateY(-30px) rotate(180deg);
        opacity: 0.8;
    }
}

/* ======================== */
/* 3. EKRAN YAPISI          */
/* ======================== */
.screen {
    display: none;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
    padding: 15px;
}

.screen.active {
    display: flex;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
}

/* ======================== */
/* 4. GLASS MORPHISM        */
/* ======================== */
.glass-morphism {
    background: var(--glass);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* ======================== */
/* 5. GİRİŞ KARTI           */
/* ======================== */
.login-card {
    max-width: 650px;
    width: 95%;
    padding: 30px 40px;
    max-height: 90vh;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.login-card::-webkit-scrollbar {
    display: none;
}

.brand-area {
    margin-bottom: 20px;
}

.subtitle {
    color: #666;
    font-size: 1rem;
    margin-top: 10px;
}

/* Rainbow Title */
.game-title-line {
    font-family: 'DynaPuff', cursive;
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
    line-height: 1.2;
    background: rgba(255, 255, 255, 0.25);
    padding: 10px 20px;
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    display: inline-block;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
}

.rainbow-letter {
    display: inline-block;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    -webkit-text-stroke: 1px #000;
}

@keyframes float-letter {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

/* ======================== */
/* 6. BUTONLAR              */
/* ======================== */
.play-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    cursor: pointer;
}

.play-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.5);
    color: white;
}

/* Mode Tabs */
.tab-btn {
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn.active {
    border-color: var(--primary);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

/* Segment Control */
.segment-control {
    display: flex;
    gap: 0;
    border-radius: 12px;
    overflow: hidden;
    background: #f0f0f0;
    border: 2px solid #e0e0e0;
}

.seg-btn,
.unit-btn,
.time-btn {
    flex: 1;
    padding: 10px 16px;
    font-size: 0.95rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    background: transparent;
    color: #666;
    transition: all 0.3s ease;
}

.seg-btn.active,
.unit-btn.active,
.time-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

/* Circle Buttons */
.circle-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #5D9CEC, #48CFAD);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.circle-btn:hover {
    transform: scale(1.1);
}

.circle-btn.danger {
    background: linear-gradient(135deg, #FF4757, #FF6B6B);
}

.circle-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.round-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.help-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFD93D, #FF9500);
    color: white;
    border: none;
    font-size: 1rem;
}

/* ======================== */
/* 7. FORM ELEMENTLERİ      */
/* ======================== */
.fun-input {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 12px 18px;
    font-size: 1rem;
    font-family: var(--font);
    transition: border-color 0.3s ease;
}

.fun-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
    outline: none;
}

/* Slider */
.slider-container {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 15px 20px;
    border-radius: 15px;
    border: 2px solid #e0e0e0;
}

.slider-label {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fun-slider {
    width: 100%;
    height: 8px;
    background: #ddd;
    border-radius: 4px;
    -webkit-appearance: none;
}

.fun-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.4);
}

.fun-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.slider-hints {
    font-size: 0.75rem;
    color: #888;
    margin-top: 5px;
}

/* ======================== */
/* 8. SETUP VIEWS           */
/* ======================== */
.setup-view {
    display: none;
}

.setup-view.active {
    display: block;
}

/* Player Input */
.player-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.player-input-row .player-color {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    flex-shrink: 0;
}

.player-input-row input {
    flex: 1;
}

/* ======================== */
/* 9. OYUN EKRANI           */
/* ======================== */
.layout-grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    grid-template-rows: auto 1fr auto;
    width: 100%;
    height: 100%;
    padding: 15px;
    gap: 15px;
}

/* Single Mode - Full Width */
body.single-mode .layout-grid {
    grid-template-columns: 1fr;
}

body.single-mode #multiplayer-sidebar {
    display: none !important;
}

.top-bar {
    grid-column: 1 / -1;
    grid-row: 1 / 2;
    padding: 10px 15px;
    min-height: 60px;
}

.game-area {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* safe center desteklenmeyen tarayıcılar için center kalabilir, ama overflow auto ile scroll açılır */
    align-items: center;
    padding: 15px;
    gap: 15px;
    overflow-y: auto;
    /* İçerik sığmazsa scroll çıksın */
    min-height: 0;
    /* Flex item'ın taşmasına izin ver */
}

.bottom-bar {
    grid-column: 1 / -1;
    grid-row: 3 / 4;
    padding: 12px;
    min-height: 80px;
}

/* Sidebar */
.sidebar {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
    padding: 15px;
    overflow-y: auto;
}

.sidebar-title {
    font-weight: 800;
    font-size: 1rem;
    color: var(--primary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.players-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.player-card {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 12px 15px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 4px solid var(--primary);
}

.player-card.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-left-color: white;
}

.player-card .player-name {
    flex: 1;
    font-weight: 700;
}

.player-card .player-score {
    font-weight: 800;
    font-size: 1.1rem;
}

/* ======================== */
/* 10. SORU ALANI           */
/* ======================== */
.category-badge {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 8px 20px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.question-container {
    background: linear-gradient(135deg, #7986CB, #3F51B5);
    /* Soft Lacivert Gradient */
    padding: 20px 30px;
    border-radius: 25px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 3px solid var(--primary);
    max-width: 800px;
    width: 100%;
    text-align: center;
    /* Transition for smooth question switching */
    transition: opacity 0.3s ease;
    opacity: 1;
}

.question-container.fade-out {
    opacity: 0;
}

.question-text {
    font-family: var(--font-read);
    /* Okunabilir Font */
    font-size: 1.3rem;
    font-weight: 800;
    color: #ffffff;
    /* Beyaz Metin */
    line-height: 1.5;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Quiz Options */
.quiz-options-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    max-width: 700px;
    width: 100%;
}

/* 5. şık için ortalama - E şıkkı */
.quiz-option-btn:nth-child(5) {
    grid-column: 1 / -1;
    max-width: 50%;
    justify-self: center;
}

.quiz-option-btn {
    padding: 18px 25px;
    font-family: var(--font-read);
    /* Seçenekler de okunabilir font olsun */
    font-size: 1rem;
    font-weight: 700;
    border: 3px solid #E3F2FD;
    /* Hafif Mavi Kenarlık */
    border-radius: 15px;
    cursor: pointer;
    background: #ffffff;
    /* Beyaz Arka Plan */
    color: #455A64;
    /* Soft Koyu Gri/Mavi (Zıt Renk) */
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    text-align: left;
}

@media (hover: hover) {
    .quiz-option-btn:hover {
        transform: translateY(-3px);
        border-color: var(--primary);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    }
}

.quiz-option-btn.correct {
    background: linear-gradient(135deg, #00E676, #00C853) !important;
    color: white !important;
    border-color: #00C853 !important;
    animation: correctBounce 0.6s ease;
}

.quiz-option-btn.wrong {
    background: linear-gradient(135deg, #FF4757, #FF3838) !important;
    color: white !important;
    border-color: #FF3838 !important;
    animation: wrongShake 0.5s ease;
}

.quiz-option-btn.disabled {
    pointer-events: none;
    opacity: 0.6;
}

@keyframes correctBounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes wrongShake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

/* ======================== */
/* JOKER BUTTONS            */
/* ======================== */
.joker-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.joker-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 70px;
    height: 70px;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-family: var(--font);
    font-weight: 700;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.joker-btn::before {
    content: '-50';
    position: absolute;
    top: 3px;
    right: 5px;
    font-size: 0.55rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 1px 4px;
    border-radius: 4px;
}

.joker-btn i {
    font-size: 1.4rem;
}

.joker-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 50/50 Joker - Purple */
#joker-5050 {
    background: linear-gradient(135deg, #9B59B6, #8E44AD);
}

#joker-5050:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(155, 89, 182, 0.5);
}

/* Pas Joker - Orange */
#joker-pass {
    background: linear-gradient(135deg, #F39C12, #E67E22);
}

#joker-pass:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(243, 156, 18, 0.5);
}

/* Time Joker - Green */
#joker-time {
    background: linear-gradient(145deg, #8e44ad, #9b59b6);
    /* Daha yumuşak mor */
}

#joker-5050:hover {
    transform: scale(1.05);
    /* Daha az büyüme */
    box-shadow: 0 4px 15px rgba(142, 68, 173, 0.4);
}

/* Pas Joker - Orange */
#joker-pass {
    background: linear-gradient(145deg, #d35400, #e67e22);
    /* Daha yumuşak turuncu */
}

#joker-pass:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(211, 84, 0, 0.4);
}

/* Time Joker - Green */
#joker-time {
    background: linear-gradient(145deg, #27ae60, #2ecc71);
    /* Daha yumuşak yeşil */
}

#joker-time:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.4);
}

/* Ortak Joker Buton Stili Güncellemesi */
.joker-btn {
    border: 1px solid rgba(255, 255, 255, 0.2);
    /* Hafif kenarlık */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    /* Daha hafif gölge */
}

.joker-label {
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Joker Used State */
.joker-btn.used {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d) !important;
    cursor: not-allowed;
    opacity: 0.6;
    transform: scale(1) !important;
    box-shadow: none !important;
}

.joker-btn.used::before {
    content: '✓';
    background: rgba(0, 0, 0, 0.4);
}

.joker-btn.used::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(45deg,
            transparent,
            transparent 5px,
            rgba(0, 0, 0, 0.1) 5px,
            rgba(0, 0, 0, 0.1) 10px);
}

/* ======================== */
/* 11. HUD                  */
/* ======================== */
.hud-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 15px;
    border-radius: 25px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.hud-icon {
    font-size: 1.1rem;
}

.timer .hud-icon {
    color: #e17055;
}

.score .hud-icon {
    color: #fdcb6e;
}

.hud-text {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--dark);
}

.progress-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 15px;
    border-radius: 25px;
}

.progress-indicator .current {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary);
}

.progress-indicator .total {
    font-size: 0.9rem;
    color: #888;
}

/* ======================== */
/* 12. SONUÇ KARTI          */
/* ======================== */
.result-card {
    max-width: 500px;
    width: 95%;
    padding: 30px;
    text-align: center;
}

.winner-icon-container {
    font-size: 3rem;
    color: #FFD700;
    margin-bottom: 15px;
    animation: bounce 1s ease infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.result-title {
    font-family: 'Bungee', cursive;
    font-size: 2rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.result-subtitle {
    color: #666;
    font-size: 1.1rem;
}

.result-table {
    margin-top: 20px;
}

.result-table th {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-weight: 700;
    padding: 12px;
}

.result-table td {
    padding: 12px;
    font-weight: 600;
}

/* ======================== */
/* 13. MODAL                */
/* ======================== */
.custom-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.custom-modal.show {
    display: flex;
}

.modal-box {
    max-width: 450px;
    width: 90%;
    padding: 30px;
}

.htp-title {
    font-family: 'Bungee', cursive;
    font-size: 1.5rem;
    text-align: center;
    color: var(--primary);
    margin-bottom: 15px;
}

.htp-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ======================== */
/* 14. TUR FLASH            */
/* ======================== */
#turn-flash-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.95), rgba(118, 75, 162, 0.95));
    z-index: 3000;
    justify-content: center;
    align-items: center;
}

#turn-flash-overlay.show {
    display: flex;
}

#turn-flash-content {
    text-align: center;
    color: white;
    animation: pop-in 0.5s ease;
}

.turn-title {
    display: block;
    font-family: 'Bungee', cursive;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

#turn-flash-text {
    font-size: 3rem;
    font-weight: 800;
}

/* ======================== */
/* 15. INSTAGRAM LINK       */
/* ======================== */
.instagram-follow-link {
    background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045);
    color: white !important;
    padding: 12px 24px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    transition: transform 0.3s ease;
}

.instagram-follow-link:hover {
    transform: scale(1.05);
}

/* ======================== */
/* 16. ANİMASYONLAR         */
/* ======================== */
.pop-in {
    animation: popIn 0.5s ease;
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ======================== */
/* 17. RESPONSIVE           */
/* ======================== */

/* Tablet - 768px */
@media (max-width: 768px) {
    .layout-grid {
        grid-template-columns: 1fr;
        padding: 10px;
        gap: 10px;
    }

    .sidebar {
        display: none;
    }

    .game-title-line {
        font-size: 1.3rem;
    }

    .question-text {
        font-size: 1.1rem;
    }

    .quiz-options-container {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    /* 5. şıkkı mobilde tam genişlik yap */
    .quiz-option-btn:nth-child(5) {
        max-width: 100%;
        justify-self: stretch;
    }

    .quiz-option-btn {
        padding: 15px 20px;
        font-size: 0.95rem;
    }

    .question-container {
        padding: 20px;
    }

    .hud-item,
    .progress-indicator {
        padding: 6px 12px;
        font-size: 0.9rem;
    }

    .bar-center {
        gap: 8px !important;
    }

    .game-area {
        padding: 15px;
        gap: 15px;
    }
}

/* Mobile Portrait - 480px */
@media (max-width: 480px) {
    .screen {
        padding: 8px;
    }

    .login-card {
        padding: 15px;
        max-height: 95vh;
    }

    .game-title-line {
        font-size: 1rem;
    }

    .play-btn {
        padding: 12px 20px;
        font-size: 1rem;
    }

    .layout-grid {
        padding: 6px;
        gap: 6px;
        height: 100vh;
        height: 100dvh;
    }

    .top-bar {
        padding: 6px 10px;
        min-height: 45px;
        border-radius: 15px;
    }

    .bottom-bar {
        padding: 6px;
        min-height: 55px;
        border-radius: 15px;
    }

    .game-area {
        padding: 10px;
        gap: 10px;
        border-radius: 15px;
    }

    .circle-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .btn-label {
        font-size: 0.65rem;
    }

    .control-item {
        gap: 2px;
    }

    .hud-item,
    .progress-indicator {
        padding: 4px 8px;
        font-size: 0.8rem;
        border-radius: 15px;
    }

    .hud-icon {
        font-size: 0.9rem;
    }

    .hud-text {
        font-size: 0.9rem;
    }

    .progress-indicator .current {
        font-size: 1rem;
    }

    .progress-indicator .total {
        font-size: 0.75rem;
    }

    .round-btn {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .help-btn {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .category-badge {
        padding: 5px 12px;
        font-size: 0.75rem;
    }

    .question-container {
        padding: 12px 15px;
        border-radius: 15px;
        border-width: 2px;
    }

    .question-text {
        font-size: 0.95rem;
        line-height: 1.4;
    }

    .quiz-options-container {
        gap: 8px;
    }

    .quiz-option-btn {
        padding: 10px 12px;
        font-size: 0.85rem;
        border-radius: 10px;
        border-width: 2px;
    }

    .header-content {
        padding: 0 5px !important;
    }

    .bar-center {
        gap: 5px !important;
    }

    .bar-left,
    .bar-right {
        gap: 5px;
    }

    .player-info-display {
        font-size: 0.85rem;
    }

    #display-username {
        max-width: 150px;
        /* Daha geniş alan */
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: inline-block;
    }

    /* Joker Buttons - Mobile Portrait */
    .joker-container {
        gap: 10px;
        margin-top: 12px;
    }

    .joker-btn {
        width: 55px;
        height: 55px;
        border-radius: 12px;
    }

    .joker-btn i {
        font-size: 1.1rem;
    }

    .joker-label {
        font-size: 0.55rem;
    }

    .joker-btn::before {
        font-size: 0.45rem;
        top: 2px;
        right: 3px;
    }
}

/* Very Small Phones - Portrait */
@media (max-width: 360px) {
    .layout-grid {
        padding: 4px;
        gap: 4px;
    }

    .top-bar {
        padding: 4px 8px;
        min-height: 40px;
    }

    .bottom-bar {
        min-height: 50px;
    }

    .game-area {
        padding: 8px;
        gap: 8px;
    }

    .question-container {
        padding: 10px;
    }

    .question-text {
        font-size: 0.9rem;
    }

    .quiz-option-btn {
        padding: 8px 10px;
        font-size: 0.8rem;
    }

    .circle-btn {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .hud-item,
    .progress-indicator {
        padding: 3px 6px;
        font-size: 0.75rem;
    }

    .game-title-line {
        font-size: 0.9rem;
    }
}

/* Landscape on small screens (mobile yatay) */
@media (max-height: 500px) and (orientation: landscape) {
    .screen {
        padding: 5px;
    }

    /* Login Card - Landscape Scaling */
    .login-card {
        max-height: 95dvh;
        padding: 8px 12px;
        max-width: 600px;
        /* Daha dar */
        overflow-y: auto;
    }

    .login-card .brand-area {
        margin-bottom: 10px;
    }

    .login-card .subtitle {
        font-size: 0.8rem;
        margin-top: 5px;
    }

    .login-card .mode-tabs {
        margin-bottom: 10px !important;
    }

    .login-card .tab-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .login-card .play-btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }

    /* Result Card - Landscape Scaling */
    .result-card {
        max-height: 95dvh;
        padding: 15px;
        max-width: 90vw;
        overflow-y: auto;
    }

    .result-card .winner-icon-container {
        font-size: 2rem;
        margin-bottom: 8px;
    }

    .result-card .result-title {
        font-size: 1.3rem;
    }

    .result-card .result-subtitle {
        font-size: 0.9rem;
    }

    .result-card .result-table th,
    .result-card .result-table td {
        padding: 6px 8px;
        font-size: 0.8rem;
    }

    .result-card .result-actions {
        margin-top: 10px !important;
    }

    .result-card .result-actions .play-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .game-title-line {
        font-size: 0.85rem;
    }

    .slider-container {
        padding: 6px 10px;
        margin-bottom: 6px !important;
    }

    .slider-label {
        font-size: 0.8rem;
        margin-bottom: 5px;
    }

    .layout-grid {
        padding: 5px;
        gap: 5px;
        grid-template-rows: auto 1fr auto;
        grid-template-columns: 1fr 140px;
        /* Sidebar'ı daralt (220px -> 140px) */
    }

    /* Header - Overflow Fix */
    .top-bar {
        padding: 3px 8px;
        min-height: 38px;
        border-radius: 12px;
    }

    .header-content {
        flex-wrap: nowrap;
        overflow: visible;
        /* Taşmayı serbest bırak ki badge görünsün */
    }

    .bar-left {
        flex-shrink: 1;
        min-width: 0;
        gap: 4px !important;
    }

    .bar-center {
        flex-shrink: 0;
        gap: 4px !important;
    }

    .bar-right {
        flex-shrink: 0;
    }

    .player-info-display {
        position: relative;
        font-size: 0.7rem;
        max-width: none;
        /* Genişliği serbest bırak */
        background: rgba(255, 255, 255, 0.25);
        padding: 4px 8px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        height: 28px;
    }

    #display-username {
        max-width: 120px;
        /* Yeterli alan */
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: inline-block;
        line-height: 1;
    }

    #turn-badge {
        font-size: 0.5rem;
        padding: 2px 5px;
        position: absolute;
        top: -8px;
        right: -15px;
        /* Daha dışarı al */
        left: auto;
        z-index: 100;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
        white-space: nowrap;
        border-radius: 8px;
        display: block !important;
        /* Görünürlüğü zorla */
    }

    .round-btn {
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
    }

    .help-btn {
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
    }

    .hud-item,
    .progress-indicator {
        padding: 2px 5px;
        font-size: 0.65rem;
        background: rgba(255, 255, 255, 0.35);
        /* Kutu görünümü */
        border: 1px solid rgba(255, 255, 255, 0.5);
        border-radius: 8px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }

    .hud-item.timer {
        background: rgba(255, 243, 224, 0.85);
        border-color: #ffe0b2;
    }

    .hud-item.score {
        background: rgba(255, 248, 225, 0.85);
        border-color: #ffecb3;
    }

    .hud-icon {
        font-size: 0.7rem;
        margin-right: 2px;
    }

    .hud-text {
        font-size: 0.7rem;
    }

    .progress-indicator .current {
        font-size: 0.75rem;
    }

    .progress-indicator .total {
        font-size: 0.6rem;
    }

    .bottom-bar {
        padding: 3px;
        min-height: 40px;
        border-radius: 12px;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .bottom-bar>div {
        gap: 8px !important;
        /* Aralığı daralt (15px -> 8px) */
    }

    .game-area {
        padding: 8px;
        gap: 6px;
        border-radius: 12px;
        overflow-y: auto;
    }

    .question-container {
        padding: 8px 12px;
        border-radius: 12px;
    }

    .question-text {
        font-size: 0.85rem;
    }

    .quiz-options-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .quiz-option-btn {
        padding: 6px 10px;
        font-size: 0.75rem;
        border-radius: 8px;
    }

    .quiz-option-btn:nth-child(5) {
        max-width: 60%;
    }

    .category-badge {
        padding: 3px 8px;
        font-size: 0.65rem;
    }

    .circle-btn {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .btn-label {
        font-size: 0.55rem;
    }

    .control-item {
        gap: 2px;
    }

    /* Joker Buttons - Mobile Landscape */
    .joker-container {
        gap: 8px;
        margin-top: 8px;
    }

    .joker-btn {
        width: 45px;
        height: 45px;
        border-radius: 10px;
    }

    .joker-btn i {
        font-size: 0.95rem;
    }

    .joker-label {
        font-size: 0.45rem;
    }

    .joker-btn::before {
        font-size: 0.4rem;
        top: 1px;
        right: 2px;
        padding: 0 2px;
    }

    /* Sidebar - Mobile Landscape */
    .sidebar {
        padding: 5px;
        gap: 5px;
    }

    .sidebar-header {
        padding-bottom: 5px;
        margin-bottom: 5px;
    }

    .player-card {
        padding: 4px 8px;
        margin-bottom: 4px;
        min-height: 35px;
    }

    .player-name {
        font-size: 0.65rem;
    }

    .player-score {
        font-size: 0.75rem;
    }

    .rank-badge {
        font-size: 0.65rem;
        top: 8px;
        right: 8px;
    }

    .sidebar-header h3 {
        font-size: 0.75rem;
    }
}

/* Extra small landscape (very short screens) */
@media (max-height: 400px) and (orientation: landscape) {
    .layout-grid {
        padding: 3px;
        gap: 3px;
    }

    .top-bar {
        min-height: 35px;
        padding: 3px 8px;
    }

    .bottom-bar {
        min-height: 40px;
        padding: 3px;
    }

    .game-area {
        padding: 5px;
        gap: 5px;
    }

    .question-container {
        padding: 8px 10px;
    }

    .question-text {
        font-size: 0.85rem;
    }

    .quiz-option-btn {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .circle-btn {
        width: 30px;
        height: 30px;
        font-size: 0.75rem;
    }

    .btn-label {
        display: none;
    }

    .category-badge {
        display: none;
    }
}

/* ======================== */
/* 18. ROTATE SCREEN OVERLAY */
/* ======================== */
#rotate-screen-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.98), rgba(118, 75, 162, 0.98));
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

#rotate-screen-overlay.show {
    display: flex;
}

.rotate-content {
    text-align: center;
    color: white;
    animation: pop-in 0.5s ease;
}

.rotate-icon {
    font-size: 4rem;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.rotate-icon .fa-mobile-alt {
    animation: rotateTilt 2s ease-in-out infinite;
}

.rotate-arrow {
    font-size: 2rem;
    animation: rotateArrow 1.5s ease-in-out infinite;
}

@keyframes rotateTilt {

    0%,
    100% {
        transform: rotate(0deg);
    }

    50% {
        transform: rotate(90deg);
    }
}

@keyframes rotateArrow {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

.rotate-content h2 {
    font-family: 'Bungee', cursive;
    font-size: 2rem;
    margin-bottom: 15px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
}

.rotate-content p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* ======================== */
/* 19. MULTIPLAYER LANDSCAPE FIX */
/* ======================== */
/* Mobil yatay mod - Arkadaşlarla modu için özel düzeltmeler */
@media (max-height: 500px) and (orientation: landscape) {
    body.multi-mode .layout-grid {
        height: 100dvh;
        max-height: 100dvh;
        overflow: hidden;
        grid-template-rows: minmax(35px, auto) 1fr minmax(40px, auto);
    }

    body.multi-mode .top-bar {
        padding: 3px 8px;
        min-height: 35px;
        max-height: 40px;
    }

    body.multi-mode .bottom-bar {
        padding: 3px 5px;
        min-height: 40px;
        max-height: 50px;
    }

    body.multi-mode .game-area {
        padding: 5px;
        gap: 5px;
        overflow-y: auto;
        max-height: calc(100dvh - 90px);
    }

    body.multi-mode .circle-btn {
        width: 30px;
        height: 30px;
        font-size: 0.75rem;
    }

    body.multi-mode .btn-label {
        font-size: 0.55rem;
    }

    body.multi-mode .hud-item,
    body.multi-mode .progress-indicator {
        padding: 3px 6px;
        font-size: 0.7rem;
    }

    body.multi-mode .round-btn,
    body.multi-mode .help-btn {
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
    }

    body.multi-mode .question-container {
        padding: 8px 12px;
    }

    body.multi-mode .question-text {
        font-size: 0.85rem;
    }

    body.multi-mode .quiz-option-btn {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    body.multi-mode .category-badge {
        padding: 3px 8px;
        font-size: 0.65rem;
    }
}

/* Çok küçük yatay ekranlar için multiplayer ek düzeltmeler */
@media (max-height: 400px) and (orientation: landscape) {
    body.multi-mode .layout-grid {
        grid-template-rows: minmax(30px, auto) 1fr minmax(35px, auto);
    }

    body.multi-mode .top-bar {
        min-height: 30px;
        max-height: 35px;
    }

    body.multi-mode .bottom-bar {
        min-height: 35px;
        max-height: 40px;
    }

    body.multi-mode .game-area {
        max-height: calc(100dvh - 75px);
    }

    body.multi-mode .btn-label {
        display: none;
    }

    body.multi-mode .category-badge {
        display: none;
    }
}

/* ======================== */
/* 20. LEGAL LINKS          */
/* ======================== */
.legal-links {
    font-size: 0.85rem;
}

.legal-link {
    color: #666;
    text-decoration: none;
    transition: color 0.3s ease;
}

.legal-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* ======================== */
/* 21. SIDEBAR TITLE FIX    */
/* ======================== */
.sidebar-header {
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.sidebar-header h3 {
    font-weight: 800;
    font-size: 1rem;
    color: var(--primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ======================== */
/* 22. LOADING ANIMATION    */
/* ======================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    z-index: 5000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #e0e0e0;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-family: var(--font);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ======================== */
/* 11. FEEDBACK OVERLAY     */
/* ======================== */
.feedback-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 30px 50px;
    border-radius: 25px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    border: 4px solid white;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.feedback-overlay.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.feedback-icon {
    font-size: 4rem;
    margin-bottom: 10px;
}

.feedback-text {
    font-family: 'Bungee', cursive;
    font-size: 2rem;
    font-weight: 800;
    text-transform: uppercase;
    text-align: center;
    letter-spacing: 2px;
    -webkit-text-stroke: 1px rgba(0, 0, 0, 0.1);
}

/* Correct Style */
.feedback-overlay.correct .feedback-icon {
    color: #00E676;
    animation: successPop 0.5s ease forwards;
}

.feedback-overlay.correct .feedback-text {
    color: #00E676;
    text-shadow: 0 4px 0 #00b35c;
}

.feedback-overlay.correct {
    border-color: #00E676;
    box-shadow: 0 0 50px rgba(0, 230, 118, 0.4);
}

/* Wrong Style */
.feedback-overlay.wrong .feedback-icon {
    color: #FF4757;
    animation: wrongShakeIcon 0.5s ease forwards;
}

.feedback-overlay.wrong .feedback-text {
    color: #FF4757;
    text-shadow: 0 4px 0 #d63031;
}

.feedback-overlay.wrong {
    border-color: #FF4757;
    box-shadow: 0 0 50px rgba(255, 71, 87, 0.4);
}

@keyframes successPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes wrongShakeIcon {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-15px) rotate(-10deg);
    }

    40% {
        transform: translateX(15px) rotate(10deg);
    }

    60% {
        transform: translateX(-10px) rotate(-5deg);
    }

    80% {
        transform: translateX(10px) rotate(5deg);
    }
}

/* ======================== */
/* MASAÜSTÜ - GENİŞ KART    */
/* ======================== */
@media (min-width: 600px) {
    .login-card {
        padding: 35px 45px;
    }

    .game-main-title .text-gradient-primary {
        font-size: 2.6rem !important;
    }

    .game-main-title .text-gradient-secondary {
        font-size: 2rem !important;
    }

    /* Single player setup iki sütunlu düzen */
    #single-player-setup {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px 20px;
        align-items: start;
    }

    /* Oyuncu adı - tam genişlik */
    #single-player-setup > .mb-3:first-child {
        grid-column: 1 / -1;
    }

    /* Soru sayısı sliderı - sol sütun */
    #single-player-setup > .slider-container.mb-3 {
        grid-column: 1 / 2;
    }

    /* Süre kontrolleri - sağ sütun */
    #single-player-setup > .time-controls.mb-3 {
        grid-column: 2 / 3;
    }

    /* Başla butonu - tam genişlik */
    #single-player-setup > .play-btn,
    #single-player-setup > .btn.play-btn {
        grid-column: 1 / -1;
    }

    /* Mode tabs daha büyük */
    .mode-tabs .tab-btn {
        padding: 14px 24px;
        font-size: 1.05rem;
    }

    /* Subtitle büyüt */
    .subtitle {
        font-size: 1.1rem;
    }

    /* Multi player setup düzeni */
    #mp-step-1 {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px 20px;
    }

    #mp-step-1 > .slider-container.mb-3 {
        grid-column: 1 / -1;
    }

    #mp-step-1 > .mb-3:has(#player-inputs-container) {
        grid-column: 1 / -1;
    }

    #player-inputs-container {
        grid-column: 1 / -1;
    }

    #mp-continue-btn {
        grid-column: 1 / -1;
    }
}