:root {
    /* PEDAGOJİK RENK PALETİ - GÖZ YORMAYAN PASTEL TONLAR */
    --primary: #5D9CEC;
    /* Yumuşak Mavi */
    --secondary: #AC92EC;
    /* Yumuşak Lavanta */
    --accent: #FF4757;
    /* Neon Kırmızı */
    --success: #00E676;
    /* Neon Yeşil */
    --danger: #FF4757;
    /* Neon Kırmızı */
    --warning: #FFD32A;
    /* Neon Sarı */
    --dark: #434A54;
    /* Koyu Gri-Mavi (Siyah yerine) */
    --light: #F5F7FA;
    /* Kırık Beyaz */
    --font: 'DynaPuff', cursive;
    --glass: rgba(255, 255, 255, 0.95);
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    /* Gölge azaltıldı */
    --active-player-color: #5D9CEC;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    font-family: var(--font);
    /* HARF ARALIGI - OKUNABILIRLIK */
    letter-spacing: 0.5px;

    /* GÖLGE VE IŞIK EFEKTİ - PEDAGOJİK OLARAK AZALTILDI */
    text-shadow: none;
}

body {
    height: 100dvh;
    width: 100vw;
    overflow: hidden;
    color: var(--dark);
    /* YUMUŞAK MAVİ-YEŞİL ANİMASYONLU ARKA PLAN */
    background: linear-gradient(-45deg, #1CB5E0, #38ef7d, #11998e, #1CB5E0);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    background-attachment: fixed;
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
}

#risk-flash-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 107, 107, 0.3);
    /* Daha yumuşak kırmızı */
    z-index: 200;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.1s;
}

.risk-active-flash #risk-flash-overlay {
    opacity: 1;
}

/* SIRA SENDE EKRANI */
#turn-flash-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(67, 74, 84, 0.7);
    /* Biraz daha koyu arka plan */
    backdrop-filter: blur(5px);
    z-index: 300;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

#turn-flash-content {
    background: white;
    padding: 30px 50px;
    border-radius: 30px;
    box-shadow: 0 0 30px rgba(93, 156, 236, 0.5);
    border: 8px solid var(--active-player-color);
    /* Çerçeve kalınlaştırıldı */
    text-align: center;
    transform: scale(0.5);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    min-width: 300px;
}

.turn-flash-active #turn-flash-overlay {
    opacity: 1;
}

.turn-flash-active #turn-flash-content {
    transform: scale(1.1);
}

.turn-title {
    font-size: 1.5rem;
    color: #AAB2BD;
    margin-bottom: 10px;
    display: block;
    font-weight: 800;
}

#turn-flash-text {
    font-family: var(--font);
    font-size: 4.5rem;
    /* İsim büyütüldü */
    color: var(--active-player-color);
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.1);
    display: block;
    line-height: 1;
    font-weight: 900;
}

/* EKRAN DÖNDÜRME MESAJI */
#rotate-screen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #E0F7FA 0%, #81D4FA 100%);
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 20px;
}

.rotate-message {
    text-align: center;
    color: var(--dark);
    max-width: 400px;
    animation: pulse 2s infinite;
}

.rotate-icon {
    font-size: 5rem;
    margin-bottom: 30px;
    animation: rotateDevice 2s ease-in-out infinite;
    display: block;
    color: var(--primary);
}

.rotate-message h2 {
    font-family: var(--font);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--primary);
}

.rotate-message p {
    font-size: 1.2rem;
    opacity: 0.9;
    line-height: 1.6;
}

@keyframes rotateDevice {

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

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

/* PORTRAIT MODDA OYUN AÇILSIN - Engelleme kaldırıldı */
/* Overlay her zaman gizli kalır, portrait modda da oyun oynanabilir */

/* SARSINTI ANİMASYONLARI */
@keyframes shake {
    0% {
        transform: translateX(0);
    }

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

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

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

.shake-anim {
    animation: shake 0.4s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake-hard {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    10% {
        transform: translate(-10px, -10px) rotate(-5deg);
    }

    20% {
        transform: translate(10px, 10px) rotate(5deg);
    }

    30% {
        transform: translate(-10px, 10px) rotate(-5deg);
    }

    40% {
        transform: translate(10px, -10px) rotate(5deg);
    }

    50% {
        transform: translate(-5px, 5px) rotate(-2deg);
    }

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

.shake-hard-anim {
    animation: shake-hard 0.6s ease-in-out both;
}

.screen {
    position: absolute;
    width: 100%;
    height: 100%;
    display: none;
    z-index: 10;
    flex-direction: column;
    overflow: hidden;
    max-width: 100vw;
    max-height: 100vh;
}

.screen.active {
    display: flex;
}

.screen.overlay {
    background: linear-gradient(135deg, rgba(168, 216, 234, 0.95), rgba(135, 206, 235, 0.95), rgba(176, 224, 230, 0.95));
    backdrop-filter: blur(10px);
    justify-content: center;
    align-items: center;
    z-index: 200;
    overflow-y: auto;
}

.glass-morphism {
    background: var(--glass);
    backdrop-filter: blur(15px);
    border: 3px solid #E6E9ED;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: border-color 0.3s ease;
}

/* GİRİŞ EKRANI */
#login-screen {
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    padding: 10px;
}

.login-card {
    width: 40%;
    min-width: min(350px, 95vw);
    max-width: 650px;
    padding: clamp(25px, 4vw, 45px);
    display: flex;
    flex-direction: column;
    align-items: center;
    max-height: 90vh;
    overflow: visible;
    /* OPAK BEYAZ KART */
    background: #E6E6FA;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: none;
    border-radius: 35px;
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    position: relative;
    animation: cardFloat 20s ease-in-out infinite;
    /* RESPONSIVE SCALING */
    transform-origin: center;
}

.login-card::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 34px;
    background: #E6E6FA;
    z-index: -1;
}

@keyframes cardFloat {

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

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

@keyframes gradientBorder {
    0% {
        background-position: 0% 50%;
    }

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

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

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

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

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

.brand-area {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
    margin-top: 0;
    flex-shrink: 0;
}

/* EKRANDA DOLAŞAN BÜYÜK MASCOT */
.floating-mascot {
    position: fixed;
    width: 600px;
    /* BÜYÜTÜLDÜ */
    height: auto;
    z-index: 0;
    pointer-events: none;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.2));
    animation: floatAround 25s ease-in-out infinite;
    opacity: 0.9;
}

@keyframes mascotFloat1 {
    0% {
        top: 10%;
        left: -20%;
        transform: rotate(-10deg) scale(0.9);
    }

    25% {
        top: 60%;
        left: 30%;
        transform: rotate(10deg) scale(1.1);
    }

    50% {
        top: 10%;
        left: 80%;
        transform: rotate(-5deg) scale(1);
    }

    75% {
        top: 70%;
        left: 50%;
        transform: rotate(15deg) scale(0.95);
    }

    100% {
        top: 10%;
        left: -20%;
        transform: rotate(-10deg) scale(0.9);
    }
}

@keyframes mascotFloat2 {
    0% {
        top: 80%;
        left: 110%;
        transform: rotate(10deg) scale(1);
    }

    33% {
        top: 20%;
        left: 60%;
        transform: rotate(-15deg) scale(0.9);
    }

    66% {
        top: 70%;
        left: 10%;
        transform: rotate(5deg) scale(1.1);
    }

    100% {
        top: 80%;
        left: 110%;
        transform: rotate(10deg) scale(1);
    }
}

.mascot-1 {
    animation: mascotFloat1 25s ease-in-out infinite;
    z-index: 1;
}

.mascot-2 {
    animation: mascotFloat2 32s ease-in-out infinite;
    z-index: 0;
    opacity: 0.9;
}

/* ESKİ MASCOT STİLİ (geriye uyumluluk için) */
.mascot-bounce {
    display: none;
}

.title-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    margin-top: 0;
}

.game-title-line {
    font-family: 'Bungee', cursive;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-transform: uppercase;
    animation: titleFloat 3s ease-in-out infinite;
}

/* Rainbow harflere ince siyah çerçeve */
.game-title-line .rainbow-letter {
    -webkit-text-stroke: 1px #000000;
    text-stroke: 1px #000000;
    paint-order: stroke fill;
}

@keyframes titleGradient {
    0% {
        background-position: 0% 50%;
    }

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

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

@keyframes titleFloat {

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

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

.game-title-line.large {
    font-size: clamp(1.1rem, 5vw, 3.2rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 95vw;
}

.game-title-line.small {
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    letter-spacing: 3px;
}

.mode-tabs {
    display: flex;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(240, 240, 240, 0.9));
    padding: 6px;
    border-radius: 20px;
    width: 100%;
    margin-bottom: 20px;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.tab-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 14px 16px;
    border-radius: 16px;
    font-weight: 800;
    font-size: clamp(0.85rem, 2.5vw, 1rem);
    color: #656D78;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.tab-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #00C9A7, #1CB5E0);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 16px;
    z-index: -1;
}

.tab-btn:hover {
    transform: translateY(-3px) scale(1.03);
    color: #00C9A7;
}

.tab-btn:hover::before {
    opacity: 0.1;
}

.tab-btn.active {
    background: linear-gradient(135deg, #00C9A7, #1CB5E0);
    color: white;
    box-shadow: 0 8px 25px rgba(0, 201, 167, 0.35), 0 0 0 2px rgba(255, 255, 255, 0.5) inset;
    transform: scale(1.02);
}

.tab-btn.active i {
    animation: iconBounce 0.5s ease;
}

@keyframes iconBounce {

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

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

.setup-view {
    display: none;
    width: 100%;
}

.setup-view.active {
    display: block;
    animation: fadeIn 0.3s;
}

.fun-input {
    width: 100%;
    padding: 18px;
    border: 3px solid #E6E9ED;
    border-radius: 18px;
    font-size: 1.4rem;
    text-align: center;
    font-weight: 700;
    color: #434A54;
    outline: none;
    background: #FFFFFF;
}

.fun-input:focus {
    border-color: var(--primary);
}

.control-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-weight: 700;
    font-size: 1.1rem;
    gap: 15px;
    color: #434A54;
}

.control-row.centered {
    justify-content: center;
}

.control-row label {
    min-width: 80px;
    flex-shrink: 0;
}

.segment-control {
    display: flex;
    gap: 12px;
    align-items: center;
    flex: 1;
    justify-content: flex-end;
    padding: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08), inset 0 0 0 2px #E6E9ED;
}

.mode-seg-btn {
    flex: 1;
    padding: 8px 14px;
    border: none;
    background: transparent;
    border-radius: 999px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 0.9rem;
    color: #656D78;
}

.mode-seg-btn:hover {
    transform: translateY(-1px);
}

.mode-seg-btn.active {
    background: linear-gradient(135deg, #5D9CEC, #4A89DC);
    color: white;
    box-shadow: 0 4px 10px rgba(93, 156, 236, 0.3);
}

.seg-btn,
.time-btn,
.unit-btn {
    flex: 1;
    min-width: 50px;
    height: 40px;
    border-radius: 12px;
    border: 2px solid #E6E9ED;
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    background: #FFFFFF;
    color: #656D78;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

.seg-btn::after,
.time-btn::after,
.unit-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
}

.seg-btn:hover,
.time-btn:hover,
.unit-btn:hover {
    transform: translateY(-2px);
    border-color: #FF6B6B;
    color: #FF6B6B;
    box-shadow: 0 6px 15px rgba(255, 107, 107, 0.25);
}

.seg-btn:active,
.time-btn:active,
.unit-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.seg-btn.active,
.time-btn.active,
.unit-btn.active {
    background: linear-gradient(135deg, #FF6B6B, #ee5a5a);
    color: white;
    border-color: #FF6B6B;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.plus-btn {
    background: linear-gradient(135deg, #A0D468, #8CC152);
    color: white;
}

.plus-btn:hover {
    background: linear-gradient(135deg, #b3e679, #9bd360);
}

.time-btn,
.unit-btn {
    flex: 1;
    min-width: 70px;
    padding: 0 12px;
}

.slider-container {
    width: 100%;
    margin: 20px 0 25px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 20px;
    border-radius: 20px;
    flex-shrink: 0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.slider-label {
    font-weight: 800;
    font-size: 1rem;
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    color: var(--dark);
}

.fun-slider {
    width: 100%;
    height: 14px;
    border-radius: 10px;
    /* MODERN GRADIENT TRACK */
    background: linear-gradient(90deg, #FFB5BA, #FFEAA7, #B8E994, #74B9FF);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.fun-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    /* COLORFUL THUMB */
    background: linear-gradient(135deg, #FF6B6B, #ee5a5a);
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(255, 107, 107, 0.4);
    border: 4px solid white;
    transition: transform 0.2s ease;
}

.fun-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.fun-slider::-moz-range-thumb {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF6B6B, #ee5a5a);
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(255, 107, 107, 0.4);
    border: 4px solid white;
}

.play-btn {
    width: 100%;
    padding: 18px;
    border: none;
    border-radius: 18px;
    /* CANLI GRADIENT */
    background: linear-gradient(135deg, #00C9A7 0%, #1CB5E0 50%, #00C9A7 100%);
    background-size: 200% 200%;
    color: white;
    font-size: clamp(1.2rem, 4vw, 1.5rem);
    font-weight: 900;
    cursor: pointer;
    box-shadow:
        0 6px 0 #00A98B,
        0 10px 30px rgba(0, 201, 167, 0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin-top: 15px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    animation: playBtnPulse 2s ease-in-out infinite, gradientShift 3s ease infinite;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.play-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

@keyframes playBtnPulse {

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

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

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

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

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

.play-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow:
        0 12px 0 #00A98B,
        0 20px 40px rgba(0, 201, 167, 0.4);
    animation: none;
}

.play-btn:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #00A98B;
}

.continue-btn {
    background: linear-gradient(45deg, #5D9CEC, #4A89DC);
    box-shadow: 0 6px 0 #4A89DC;
}

.continue-btn:hover {
    box-shadow: 0 8px 0 #4A89DC, 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* GRID LAYOUT */
.layout-grid {
    display: grid;
    width: 100vw;
    height: 100dvh;
    padding: 10px;
    gap: 10px;
    max-width: 100%;
    max-height: 100%;
    overflow: hidden;
    grid-template-columns: 280px 1fr;
    grid-template-rows: min-content 1fr min-content;
    grid-template-areas: "header header" "sidebar map" "sidebar footer";
    transition: all 0.3s ease;
}

.layout-grid.single-view {
    grid-template-columns: 1fr;
    grid-template-areas: "header" "map" "footer";
}

/* Sidebar */
.sidebar {
    grid-area: sidebar;
    padding: 10px;
    display: flex;
    flex-direction: column;
    /* YUMUŞAK PASTEL MAVİ ARKA PLAN */
    background: rgba(224, 247, 250, 0.9);
    backdrop-filter: blur(10px);
    overflow-y: auto;
    border-radius: 20px;
}

.sidebar-title {
    text-align: center;
    font-weight: 900;
    color: #F6BB42;
    margin-bottom: 10px;
    letter-spacing: 1.5px;
    font-size: 1rem;
    text-transform: uppercase;
    text-shadow: none;
    font-family: 'Bungee', cursive, var(--font);
}

.p-card {
    background: white;
    border-radius: 12px;
    padding: 8px 12px;
    border: 2px solid #E6E9ED;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
    opacity: 0.9;
}

.p-card.active-turn {
    border-color: var(--p-color);
    box-shadow: 0 0 6px var(--p-color), inset 0 0 3px var(--p-color);
    transform: scale(1.02) translateX(3px);
    z-index: 2;
    opacity: 1;
    background: #fff;
}

.pc-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pc-name {
    font-weight: 800;
    font-size: 1rem;
    color: var(--dark);
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pc-score {
    font-family: var(--font);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark);
}

.pc-slots {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 3px;
    padding-top: 3px;
    border-top: 1px solid #eee;
}

.slot-box {
    width: 24px;
    height: 24px;
    background: #F5F7FA;
    border-radius: 6px;
    border: 1px solid #CCD1D9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: white;
}

.slot-box.filled {
    cursor: pointer;
    animation: pop 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border: none;
}

.pc-slots {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 3px;
    padding-top: 3px;
    border-top: 1px solid #eee;
}

.slot-box {
    width: 24px;
    height: 24px;
    background: #F5F7FA;
    border-radius: 6px;
    border: 1px solid #CCD1D9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: white;
}

.slot-box.filled {
    cursor: pointer;
    animation: pop 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border: none;
}

/* HEADER */
.top-bar {
    grid-area: header;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: relative;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.bar-left {
    display: flex;
    gap: 10px;
    align-items: center;
    min-width: 150px;
}

.bar-right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    min-width: 150px;
}

.bar-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.nav-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.round-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #F5F7FA;
    color: var(--dark);
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.round-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.player-info-display {
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(245, 247, 250, 0.95));
    padding: 8px 16px;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.8);
}

#display-username {
    color: var(--active-player-color, #1CB5E0);
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-shadow: none;
    transition: color 0.3s ease;
}

.turn-badge {
    font-size: 0.7rem;
    padding: 5px 12px;
    border-radius: 20px;
    color: white;
    font-weight: 800;
    background: linear-gradient(135deg, #FF6B6B, #ee5a5a);
    animation: badgePulse 1.5s ease-in-out infinite;
    white-space: nowrap;
    box-shadow: 0 3px 10px rgba(255, 107, 107, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

@keyframes badgePulse {

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

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

.hud-group {
    display: flex;
    align-items: center;
    gap: 20px;
}

.hud-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 5px 15px;
    border-radius: 25px;
    border: 2px solid #E6E9ED;
}

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

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

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

.hud-text {
    font-family: var(--font);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    color: var(--dark);
    min-width: 40px;
    text-align: center;
}

.province-display {
    background: #fff;
    color: var(--active-player-color);
    padding: 8px 30px;
    border-radius: 30px;
    border: 3px solid var(--active-player-color);
    box-shadow: 0 0 8px rgba(93, 156, 236, 0.2);
    min-width: 220px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

#current-province {
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-family: 'Bungee', cursive, var(--font);
    text-shadow: none;
    -webkit-text-stroke: 0px;
}

.risk-pill {
    background: #FFCE54;
    color: #434A54;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 0 #F6BB42;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 1rem;
}

.risk-pill:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 0 #F6BB42, 0 8px 15px rgba(246, 187, 66, 0.3);
}

.risk-pill:active {
    transform: translateY(4px);
    box-shadow: none;
}

.risk-pill.active-mode {
    background: #FC6E51;
    color: #ffffff;
    animation: pulse 1s infinite;
    border: 2px solid white;
    box-shadow: 0 0 12px rgba(252, 110, 81, 0.5);
}

/* YENİ YARDIM BUTONU */
.help-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #5D9CEC;
    background: white;
    color: #5D9CEC;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    margin-right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.help-btn:hover {
    background: #5D9CEC;
    color: white;
    transform: rotate(15deg);
}

/* HARİTA ALANI */
.map-area {
    grid-area: map;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.8);
    padding: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: border-color 0.5s ease, box-shadow 0.5s ease;
}

.layout-grid:not(.single-view) .map-area {
    border: 3px solid var(--active-player-color, #5D9CEC);
    box-shadow: 0 0 20px rgba(93, 156, 236, 0.15);
}

#map-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.05));
    display: block;
}

:fullscreen #map-container,
:-webkit-full-screen #map-container,
:-moz-full-screen #map-container,
:-ms-fullscreen #map-container {
    width: 100vw;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
}

:fullscreen #map-container svg,
:-webkit-full-screen #map-container svg,
:-moz-full-screen #map-container svg,
:-ms-fullscreen #map-container svg {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
}

:fullscreen .map-area,
:-webkit-full-screen .map-area,
:-moz-full-screen .map-area,
:-ms-fullscreen .map-area {
    border-radius: 0;
    height: 100vh;
    width: 100vw;
    position: absolute;
    top: 0;
    left: 0;
}

/* HARİTA RENKLERİ - İL SINIRLARI BELİRGİN */
.province {
    fill: #F0F3F5;
    stroke: #656D78;
    stroke-width: 1.5px;
    cursor: pointer;
    transition: fill 0.15s, stroke 0.15s;
    vector-effect: non-scaling-stroke;
}

.province:hover {
    fill: #48dbfb;
    transform: translateY(-1px);
    z-index: 10;
}

/* Dokunmatik cihazlarda hover efektini kaldır */
@media (hover: none) and (pointer: coarse) {
    .province:hover {
        fill: #F0F3F5;
        /* Varsayılan renk - hover yok */
        transform: none;
    }
}

/* Yumuşak Cyan */
.province.correct {
    fill: var(--success) !important;
    stroke: white !important;
    animation: pop 0.4s;
}

.province.wrong {
    fill: var(--danger) !important;
}

.province.persistent-wrong {
    fill: var(--danger) !important;
    stroke: white !important;
}

.province.revealed-briefly {
    fill: var(--warning) !important;
    animation: pulseFast 0.5s infinite;
}

.province.hint {
    fill: var(--warning) !important;
    animation: pulseFast 0.8s infinite;
}

#map-container.hide-corrects .province.correct {
    fill: #E6E9ED !important;
    stroke: #AAB2BD !important;
}

#map-container.hide-wrongs .province.persistent-wrong {
    fill: #E6E9ED !important;
    stroke: #AAB2BD !important;
}

#map-container.hide-wrongs .map-label.wrong-label {
    display: none;
}

.map-label {
    font-size: 9px;
    font-weight: 700;
    text-anchor: middle;
    fill: #434A54;
    pointer-events: none;
    text-shadow: 0 0 3px white, 0 0 3px white;
}

.map-label.wrong-label {
    fill: white;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
    font-size: 10px;
    z-index: 100;
    font-weight: 800;
}

.province-label {
    font-size: 7px;
    fill: #656D78;
    text-anchor: middle;
    pointer-events: none;
    opacity: 0;
}

.province-label.visible {
    opacity: 1;
}

/* Footer */
.bottom-bar {
    grid-area: footer;
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.control-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.hidden-cb {
    display: none;
}

.circle-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    background: #CCD1D9;
    filter: grayscale(0%);
    opacity: 0.8;
}

.circle-btn:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.1), 0 8px 15px rgba(0, 0, 0, 0.1);
}

.circle-btn:active {
    transform: translateY(4px);
    box-shadow: none;
}

.hidden-cb:checked+.circle-btn,
.circle-btn.active {
    opacity: 1;
    transform: translateY(0);
}

.hidden-cb:checked+.circle-btn.blue,
.circle-btn.blue.active {
    background: #5D9CEC;
}

.hidden-cb:checked+.circle-btn.orange,
.circle-btn.orange.active {
    background: #FC6E51;
}

.hidden-cb:checked+.circle-btn.green,
.circle-btn.green.active {
    background: #A0D468;
}

.hidden-cb:checked+.circle-btn.red,
.circle-btn.red.active {
    background: #ED5565;
}

.circle-btn.dark-red {
    background: #ED5565;
    opacity: 1;
}

.circle-btn.gray {
    background: #656D78;
    opacity: 1;
}

.btn-label {
    font-size: 10px;
    font-weight: 900;
    color: #656D78;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-align: center;
    line-height: 1.1;
}

.float-btn {
    position: absolute;
    bottom: 20px;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 4px solid white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    pointer-events: auto;
    z-index: 60;
}

.float-btn.pass {
    left: 20px;
    background: #4FC1E9;
}

.float-btn.hint {
    right: 20px;
    background: #AC92EC;
}

.float-btn:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.float-btn:active {
    transform: scale(0.95);
}

.f-icon {
    font-size: 1.6rem;
    line-height: 1;
}

.f-label {
    font-size: 0.75rem;
    line-height: 1;
    text-align: center;
    margin-top: 2px;
}

/* Mobilde sadece ikon göster */
@media (max-width: 900px) {
    .f-label {
        display: none !important;
    }
}

/* Feedback - ANİMASYON DÜZELTMESİ (Madde 1) */
#cinematic-feedback-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    /* Z-index yükseltildi */
    overflow: hidden;
}

.cinematic-feedback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* Başlangıç merkezi */
    font-size: 4rem;
    font-weight: 900;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    animation: fadeUp 1.5s ease-out forwards;
    z-index: 100;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    /* Başlangıçta görünmez */
}

@keyframes fadeUp {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }

    20% {
        opacity: 1;
        transform: translate(-50%, -100%) scale(1.2);
    }

    80% {
        opacity: 1;
        transform: translate(-50%, -200%) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -250%) scale(1);
    }
}

.text-green {
    color: #A0D468 !important;
    text-shadow: 0 0 2px #fff;
}

.text-red {
    color: #ED5565 !important;
    text-shadow: 0 0 2px #fff;
}

@keyframes pop {
    0% {
        transform: scale(0.5);
    }

    80% {
        transform: scale(1.1);
    }

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

@keyframes pulseFast {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
        fill: #FFCE54 !important;
    }

    100% {
        opacity: 0.6;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

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

.pop-in {
    animation: pop 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

/* Ödül Kartları - MODERN TASARIM */
.r-card {
    background: linear-gradient(145deg, #ffffff, #f0f2f5);
    padding: 18px 12px;
    border-radius: 20px;
    width: 100px;
    cursor: pointer;
    font-size: 0.85rem;
    border: 3px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.r-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
}

.r-card:hover::before {
    left: 100%;
}

.r-card:hover {
    border-color: #667eea;
    background: linear-gradient(145deg, #ffffff, #e8ecf0);
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.25);
}

.r-icon-box {
    width: 55px;
    height: 55px;
    border-radius: 18px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 5px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
    position: relative;
}

/* BLOKE ÖDÜLÜ - TURUNCU/KIRMIZI */
.r-card[data-reward="block"] .r-icon-box {
    background: linear-gradient(135deg, #ff9a56, #ff6b6b);
}

/* PUAN SİLME ÖDÜLÜ - MOR */
.r-card[data-reward="slash200"] .r-icon-box {
    background: linear-gradient(135deg, #a855f7, #8b5cf6);
}

/* HERKESE PUAN SİLME ÖDÜLÜ - MAVİ */
.r-card[data-reward="slashAll75"] .r-icon-box {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.r-title {
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--dark);
    text-align: center;
}

.r-desc {
    font-size: 0.7rem;
    color: #656D78;
    text-align: center;
    line-height: 1.2;
}

.swal2-popup {
    border-radius: 20px !important;
    font-family: var(--font) !important;
    border: 4px solid var(--primary) !important;
}

.swal2-title {
    color: var(--dark) !important;
    font-weight: 900 !important;
}

.swal2-confirm {
    background: linear-gradient(45deg, #48CFAD, #37BC9B) !important;
    border-radius: 12px !important;
}

.swal2-cancel {
    background: #E6E9ED !important;
    color: var(--dark) !important;
    border-radius: 12px !important;
}

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

.modal-box {
    background: white;
    padding: 25px;
    border-radius: 25px;
    text-align: center;
    width: 90%;
    max-width: 400px;
    position: relative;
    animation: pop 0.3s;
}

.target-grid {
    display: grid;
    gap: 10px;
    margin: 15px 0;
}

.target-btn {
    padding: 15px;
    border: 2px solid #eee;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
}

.reward-row {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 15px;
}

/* YENİ RİSK POPUP VE NASIL OYNANIR STİLLERİ */
.risk-popup-container {
    background: linear-gradient(135deg, #fff3e0 0%, #ffffff 100%);
    border-radius: 15px;
    padding: 20px;
    border: 2px dashed #FFCE54;
}

.risk-popup-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    animation: pulse 1s infinite;
}

.risk-rule {
    font-size: 1.1rem;
    margin: 8px 0;
    color: var(--dark);
    font-weight: 700;
}

.risk-rule strong {
    font-weight: 900;
}

.htp-box {
    max-width: 500px;
    text-align: left;
}

.htp-title {
    text-align: center;
    color: var(--primary);
    font-size: 2rem;
    margin-bottom: 20px;
    border-bottom: 3px solid #E6E9ED;
    padding-bottom: 10px;
}

.htp-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 60vh;
    overflow-y: auto;
}

.htp-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #F5F7FA;
    padding: 10px;
    border-radius: 12px;
}

.htp-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    border-radius: 50%;
    background: #CCD1D9;
    color: white;
    flex-shrink: 0;
}

.htp-icon.pass-icon {
    background: #4FC1E9;
}

.htp-icon.hint-icon {
    background: #AC92EC;
}

.htp-icon.risk-icon {
    background: #FC6E51;
}

.htp-text {
    font-size: 0.95rem;
    color: #656D78;
    line-height: 1.4;
}

.htp-text strong {
    color: var(--dark);
    display: block;
    margin-bottom: 2px;
}

.close-htp-btn {
    margin-top: 20px;
    width: 100%;
}

/* --- YENİ OYUN SONU EKRANI (POP-UP) --- */
.result-card {
    background: white;
    padding: 30px;
    border-radius: 30px;
    width: 90%;
    max-width: 420px;
    max-height: 95vh;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    position: relative;
    animation: pop 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    overflow: visible;
    display: flex;
    flex-direction: column;
}

.winner-icon-container {
    font-size: 3.5rem;
    color: #FFCE54;
    margin-bottom: 10px;
    filter: drop-shadow(0 5px 10px rgba(255, 206, 84, 0.3));
    animation: bounce 2s infinite;
}

.result-title {
    font-family: var(--font);
    font-size: 2.2rem;
    color: var(--dark);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.result-subtitle {
    color: #AAB2BD;
    font-weight: 700;
    margin-bottom: 20px;
    font-size: 1rem;
}

.leaderboard-container {
    background: #FFF9C4;
    /* Çok uçuk sarı arka plan */
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    border: none;
    flex-shrink: 0;
    min-height: 0;
}

.leaderboard-cards {
    display: none;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
    max-height: 50vh;
    overflow-y: auto;
}

@media (min-width: 901px) {
    .desktop-leaderboard {
        display: block;
    }

    .mobile-leaderboard {
        display: none !important;
    }
}

.result-card-item {
    background: #F5F7FA;
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 2px solid #E6E9ED;
    transition: all 0.2s;
}

.result-card-item.winner {
    background: #FFF9C4;
    border-color: #FFCE54;
    box-shadow: 0 2px 8px rgba(255, 206, 84, 0.2);
}

.result-card-item-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.result-card-rank {
    font-weight: 900;
    font-size: 1.1rem;
    color: #656D78;
    min-width: 25px;
}

.result-card-item.winner .result-card-rank {
    color: #F6BB42;
    font-size: 1.3rem;
}

.result-card-name {
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-card-item-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.result-card-score {
    font-weight: 800;
    font-size: 1rem;
    min-width: 50px;
    text-align: right;
}

.result-card-stats {
    font-size: 0.75rem;
    color: #656D78;
    display: flex;
    gap: 4px;
    align-items: center;
}

.result-card-stats .correct {
    color: #A0D468;
    font-weight: 700;
}

.result-card-stats .wrong {
    color: #ED5565;
    font-weight: 700;
}

.result-card-crown {
    color: #FFCE54;
    margin-left: 4px;
}

.result-table {
    width: 100%;
    border-collapse: collapse;
}

.result-table th {
    background: #E6E9ED;
    color: #656D78;
    padding: 10px;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    text-align: center;
}

.result-table td {
    padding: 12px;
    font-weight: 800;
    color: var(--dark);
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
    text-align: center;
}

.result-table tr:last-child td {
    border-bottom: none;
}

.winner-row {
    background-color: #FFF9C4 !important;
}

.winner-crown {
    color: #F6BB42;
    margin-left: 5px;
}

.result-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
    margin-top: auto;
}

.sub-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-family: var(--font);
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: uppercase;
}

.action-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.action-btn:active {
    transform: scale(0.96);
}

.purple-btn {
    background: #AC92EC;
    color: white;
    width: 100%;
    box-shadow: 0 4px 0px #967ADC;
}

.gray-btn {
    background: #E6E9ED;
    color: #656D78;
    box-shadow: 0 4px 0px #CCD1D9;
}

.gray-btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* MEDIA QUERIES */

@media (min-width: 1024px) {
    .hud-text {
        font-size: 2.8rem;
    }

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

    #current-province {
        font-size: 3rem;
    }

    .province-display {
        padding: 12px 40px;
        min-width: 300px;
    }

    .hud-item {
        padding: 8px 25px;
    }
}

@media (max-width: 900px) {
    .layout-grid {
        grid-template-columns: 1fr;
        grid-template-rows: min-content min-content 1fr min-content;
        grid-template-areas: "header" "sidebar" "map" "footer";
        gap: 0;
        padding: 0;
        height: 100dvh;
        width: 100vw;
    }

    .layout-grid.single-view {
        grid-template-rows: min-content 1fr min-content;
        grid-template-areas: "header" "map" "footer";
    }

    .top-bar {
        padding: 5px 10px;
        min-height: auto;
        border-radius: 0;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .header-content {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 5px;
        width: 100%;
        justify-content: space-between;
        align-items: center;
    }

    .bar-left {
        width: auto;
        min-width: auto;
        flex: 0 0 auto;
        order: 1;
        gap: 5px;
    }

    .player-info-display {
        font-size: 0.85rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 120px;
    }

    #display-username {
        font-size: 0.9rem;
    }

    .round-btn {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .bar-right {
        width: auto;
        min-width: auto;
        flex: 0 0 auto;
        order: 2;
    }

    .bar-center {
        width: 100%;
        order: 3;
        margin-top: 5px;
        flex: 1 1 100%;
    }

    .hud-group {
        gap: 5px;
        padding: 0;
        width: 100%;
        justify-content: space-between;
        flex-wrap: nowrap;
    }

    .hud-item {
        padding: 2px 8px;
        flex: 1;
        display: flex;
        justify-content: center;
        min-width: 0;
    }

    .province-display {
        padding: 2px 5px;
        border-width: 2px;
        min-width: auto;
        flex: 2;
        width: auto;
    }

    #current-province {
        font-size: 1.4rem;
        letter-spacing: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .hud-text {
        font-size: 0.85rem;
        min-width: 30px;
        white-space: nowrap;
        overflow: visible;
    }

    /* Büyük puanlar için skor alanını genişlet */
    .hud-item.score {
        flex: 1.5;
        min-width: 70px;
        padding: 2px 10px;
    }

    .hud-item.score .hud-text {
        font-size: 0.85rem;
        min-width: 50px;
    }

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

    .risk-pill {
        padding: 5px 10px;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    .risk-text {
        display: none;
    }

    .sidebar {
        flex-direction: row;
        overflow-x: auto;
        padding: 5px;
        height: 65px;
        align-items: center;
        border-right: none;
        border-bottom: 2px solid #E6E9ED;
        border-radius: 0;
        /* Scroll-snap: Aktif oyuncu kartının görünür olmasını sağlar */
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }

    .sidebar-title {
        display: none;
    }

    .players-list {
        flex-direction: row;
        gap: 8px;
        display: flex;
        width: 100%;
    }

    .p-card {
        min-width: 110px;
        height: 100%;
        justify-content: center;
        margin-bottom: 0;
        padding: 4px;
        flex-shrink: 0;
        /* Scroll-snap hedefi */
        scroll-snap-align: center;
    }

    .map-area {
        border-radius: 0;
        overflow: hidden;
        position: relative;
        width: 100%;
        height: 100%;
        min-height: 0;
    }

    #map-container {
        width: 100%;
        height: 100%;
        overflow: hidden;
        position: relative;
        min-height: 0;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    #map-container svg {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
        display: block;
    }

    .bottom-bar {
        overflow-x: auto;
        justify-content: space-around;
        padding: 5px;
        height: 75px;
        gap: 8px;
        border-radius: 0;
    }

    .control-item {
        gap: 2px;
        flex-shrink: 0;
    }

    .circle-btn {
        width: 38px;
        height: 38px;
        font-size: 1rem;
        flex-shrink: 0;
    }

    .btn-label {
        font-size: 0.5rem;
        line-height: 1.1;
    }

    .float-btn {
        width: 60px;
        height: 60px;
        bottom: 100px;
        z-index: 60;
    }

    .float-btn.pass {
        left: 15px;
    }

    .float-btn.hint {
        right: 15px;
    }

    .f-icon {
        font-size: 1.8rem;
    }

    .f-label {
        display: none !important;
    }

    .float-btn small {
        display: none !important;
    }

    /* Giriş Ekranı Mobil Optimizasyonu */
    #login-screen {
        padding: 5px;
        align-items: flex-start;
        justify-content: flex-start;
        padding-top: 10px;
    }

    .login-card {
        padding: 15px 20px;
        width: 95%;
        max-width: 100%;
        max-height: calc(100vh - 20px);
        gap: 10px;
        margin: 0 auto;
    }

    .brand-area {
        margin-top: 40px;
        margin-bottom: 15px;
    }

    .mascot-bounce {
        width: 140px;
        top: -110px;
    }

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

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

    .fun-input {
        padding: 10px;
        font-size: 1rem;
    }

    .slider-container {
        padding: 10px;
        margin: 10px 0;
    }

    .slider-label {
        font-size: 0.85rem;
    }

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

    .mode-tabs {
        margin-bottom: 15px;
    }

    .setup-view {
        margin-bottom: 10px;
    }

    /* Oyun Sonu Ekranı Mobil Optimizasyonu */
    .screen.overlay {
        padding: 5px;
        align-items: center;
        justify-content: center;
    }

    .result-card {
        padding: 15px 12px;
        width: 95%;
        max-width: 100%;
        max-height: calc(100vh - 10px);
        margin: 0 auto;
        gap: 10px;
        overflow-y: auto;
        border-radius: 20px;
    }

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

    .result-title {
        font-size: 1.4rem;
        margin-bottom: 5px;
    }

    .result-subtitle {
        font-size: 0.8rem;
        margin-bottom: 12px;
    }

    .desktop-leaderboard {
        display: none;
    }

    .mobile-leaderboard {
        display: flex !important;
    }

    .leaderboard-cards {
        margin-bottom: 12px;
        max-height: 40vh;
    }

    .result-card-item {
        padding: 12px;
        border-radius: 12px;
    }

    .result-card-rank {
        font-size: 1.2rem;
        min-width: 30px;
    }

    .result-card-item.winner .result-card-rank {
        font-size: 1.4rem;
    }

    .result-card-name {
        font-size: 1rem;
    }

    .result-card-score {
        font-size: 1.1rem;
        min-width: 60px;
    }

    .result-card-stats {
        font-size: 0.8rem;
    }

    .result-actions {
        gap: 8px;
        margin-top: 5px;
    }

    .action-btn {
        padding: 12px;
        font-size: 0.9rem;
    }

    .sub-actions {
        gap: 8px;
    }

    .sub-actions .action-btn {
        padding: 10px;
        font-size: 0.85rem;
    }
}

@media (max-height: 500px) and (orientation: landscape) {
    .layout-grid {
        grid-template-columns: 1fr 140px;
        grid-template-rows: 40px 1fr 40px;
        grid-template-areas: "header sidebar" "map sidebar" "footer sidebar";
        gap: 0;
        width: 100vw;
        height: 100dvh;
    }

    .layout-grid.single-view {
        grid-template-columns: 1fr;
        grid-template-rows: 40px 1fr 40px;
        grid-template-areas: "header" "map" "footer";
    }

    .top-bar {
        padding: 0 10px;
        height: 100%;
        border-radius: 0;
    }

    .header-content {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 5px;
    }

    .bar-left {
        min-width: auto;
        gap: 5px;
        order: 1;
    }

    .round-btn {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }

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

    .bar-center {
        gap: 5px;
        order: 2;
        flex: 1;
        width: auto;
        margin-top: 0;
    }

    .hud-group {
        gap: 5px;
        width: auto;
    }

    .hud-item {
        padding: 2px 8px;
    }

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

    .hud-text {
        font-size: 1.1rem;
        min-width: 20px;
    }

    .province-display {
        min-width: auto;
        padding: 0 15px;
        border-width: 2px;
    }

    #current-province {
        font-size: 1.2rem;
    }

    .bar-right {
        min-width: auto;
        order: 3;
    }

    .risk-pill {
        padding: 3px 10px;
        font-size: 0.7rem;
    }

    .sidebar {
        display: flex;
        flex-direction: column;
        height: 100%;
        border-bottom: none;
        border-left: 3px solid #E6E9ED;
        width: 100%;
        padding: 5px;
        border-radius: 0;
    }

    .p-card {
        min-width: unset;
        width: 100%;
        padding: 2px;
    }

    .pc-name {
        font-size: 0.8rem;
    }

    .pc-score {
        font-size: 0.9rem;
    }

    .map-area {
        border-radius: 0;
        overflow: hidden;
    }

    .bottom-bar {
        justify-content: center;
        padding: 2px;
        gap: 10px;
        border-radius: 0;
    }

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

    .btn-label {
        display: none;
    }

    .float-btn {
        width: 40px;
        height: 40px;
        bottom: 45px;
        transform: scale(0.9);
    }

    .float-btn:hover {
        transform: scale(0.95) translateY(-5px);
    }

    .f-icon {
        font-size: 1.2rem;
    }

    /* Yatay Ekran - Giriş Ekranı Optimizasyonu */
    #login-screen {
        padding: 5px;
        overflow-y: auto;
    }

    .login-card {
        padding: 8px 12px;
        max-width: 380px;
        max-height: calc(100dvh - 10px);
        overflow-y: auto;
        gap: 4px;
        border-radius: 20px;
        min-width: unset;
        width: 90%;
    }

    .login-card::before {
        border-radius: 20px;
    }

    .brand-area {
        margin-top: 5px;
        margin-bottom: 5px;
    }

    .mascot-bounce {
        width: 70px;
        top: -50px;
    }

    .floating-mascot {
        display: none;
    }

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

    .game-title-line.small {
        font-size: 0.7rem;
        letter-spacing: 1px;
    }

    .title-wrapper {
        gap: 2px;
    }

    .fun-input {
        padding: 6px;
        font-size: 0.85rem;
    }

    .slider-container {
        padding: 4px;
        margin: 4px 0;
    }

    .slider-label {
        font-size: 0.7rem;
    }

    .play-btn {
        padding: 6px;
        font-size: 0.85rem;
    }

    .mode-tabs {
        margin-bottom: 6px;
        padding: 3px;
    }

    .tab-btn {
        padding: 5px;
        font-size: 0.7rem;
    }

    .control-row {
        margin-bottom: 6px;
        font-size: 0.85rem;
        gap: 8px;
    }

    .seg-btn,
    .time-btn,
    .unit-btn {
        height: 30px;
        min-width: 40px;
        font-size: 0.75rem;
    }

    .segment-control {
        gap: 6px;
        padding: 4px;
    }

    /* Yatay Ekran - Oyun Sonu Optimizasyonu */
    .screen.overlay {
        padding: 5px;
    }

    .result-card {
        padding: 12px;
        max-width: 95%;
        max-height: calc(100vh - 10px);
        transform: none;
        flex-direction: column;
        gap: 10px;
        overflow-y: auto;
    }

    .winner-icon-container {
        font-size: 1.5rem;
        margin-bottom: 3px;
    }

    .result-title {
        font-size: 1.1rem;
        margin-bottom: 3px;
    }

    .result-subtitle {
        margin-bottom: 8px;
        font-size: 0.7rem;
    }

    .desktop-leaderboard {
        display: none;
    }

    .mobile-leaderboard {
        display: flex !important;
    }

    .leaderboard-cards {
        margin-bottom: 8px;
        max-height: 35vh;
    }

    .result-card-item {
        padding: 8px 10px;
    }

    .result-card-rank {
        font-size: 1rem;
        min-width: 25px;
    }

    .result-card-name {
        font-size: 0.85rem;
    }

    .result-card-score {
        font-size: 0.9rem;
        min-width: 50px;
    }

    .result-card-stats {
        font-size: 0.7rem;
    }

    .result-actions {
        flex: 0 0 auto;
        gap: 6px;
        margin-top: 5px;
    }

    .action-btn {
        padding: 10px;
        font-size: 0.8rem;
    }

    .sub-actions .action-btn {
        padding: 8px;
        font-size: 0.75rem;
    }
}

h1,
h2,
h3,
.score-board span,
.r-title {
    text-shadow: none;
    letter-spacing: 0.5px;
}

/* ==========================================
   MODERN GAME OVER & POPUP EKRANLARI
   ========================================== */

/* GAME OVER EKRANI - ŞEFFAF/BLUR */
#game-over-screen {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
}

.result-card {
    width: 40%;
    min-width: 350px;
    max-width: 550px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 35px;
    padding: clamp(25px, 4vw, 40px);
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    position: relative;
    overflow: visible;
    animation: resultCardEntry 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ANIMATED GRADIENT BORDER - GİRİŞ KARTI İLE AYNI */
.result-card::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 39px;
    background: linear-gradient(135deg, #FFD93D, #FF6B6B, #C44569, #6C5CE7, #FFD93D);
    background-size: 300% 300%;
    animation: gradientBorder 4s ease infinite;
    z-index: -1;
}

@keyframes resultCardEntry {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(50px);
    }

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

@keyframes rotateGlow {
    100% {
        transform: rotate(360deg);
    }
}

/* KUPA İKONU */
.winner-icon-container {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: trophyBounce 1s ease-in-out infinite, trophyGlow 2s ease-in-out infinite;
    box-shadow:
        0 10px 30px rgba(255, 215, 0, 0.4),
        0 0 0 5px rgba(255, 215, 0, 0.2);
}

.winner-icon-container i {
    font-size: 2.5rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

@keyframes trophyBounce {

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

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

@keyframes trophyGlow {

    0%,
    100% {
        box-shadow: 0 10px 30px rgba(255, 215, 0, 0.4), 0 0 0 5px rgba(255, 215, 0, 0.2);
    }

    50% {
        box-shadow: 0 15px 40px rgba(255, 215, 0, 0.6), 0 0 0 10px rgba(255, 215, 0, 0.3);
    }
}

.result-title {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    font-weight: 900;
    background: linear-gradient(135deg, #00C9A7, #1CB5E0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    margin-bottom: 5px;
}

.result-subtitle {
    color: #656D78;
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    text-align: center;
    margin-bottom: 20px;
}

/* SONUÇ TABLOSU */
.result-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

.result-table th {
    background: linear-gradient(135deg, #00C9A7, #1CB5E0);
    color: white;
    padding: 12px;
    font-weight: 700;
}

.result-table th:first-child {
    border-radius: 10px 0 0 10px;
}

.result-table th:last-child {
    border-radius: 0 10px 10px 0;
}

.result-table td {
    background: #F5F7FA;
    padding: 12px;
    text-align: center;
    font-weight: 600;
}

.result-table tr:hover td {
    background: linear-gradient(135deg, rgba(0, 201, 167, 0.1), rgba(28, 181, 224, 0.1));
}

/* AKSİYON BUTONLARI */
.result-actions {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-btn {
    padding: 14px 24px;
    border: none;
    border-radius: 15px;
    font-weight: 800;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.action-btn.purple-btn {
    background: linear-gradient(135deg, #00C9A7, #1CB5E0);
    color: white;
    box-shadow: 0 6px 0 #00A98B, 0 10px 25px rgba(0, 201, 167, 0.3);
}

.action-btn.purple-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 0 #00A98B, 0 15px 35px rgba(0, 201, 167, 0.4);
}

.action-btn.gray-btn {
    background: linear-gradient(135deg, #F5F7FA, #E6E9ED);
    color: #656D78;
    box-shadow: 0 4px 0 #CCD1D9;
}

.action-btn.gray-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 0 #CCD1D9, 0 10px 20px rgba(0, 0, 0, 0.1);
    color: #00C9A7;
}

.action-btn.gray-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.sub-actions {
    display: flex;
    gap: 10px;
}

.sub-actions .action-btn {
    flex: 1;
}

/* SWEETALERT ÖZEL TEMA */
.swal2-popup {
    border-radius: 25px !important;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(20px) !important;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2) !important;
}

.swal2-title {
    color: #434A54 !important;
    font-weight: 800 !important;
}

.swal2-html-container {
    color: #656D78 !important;
}

.swal2-confirm {
    background: linear-gradient(135deg, #00C9A7, #1CB5E0) !important;
    border-radius: 12px !important;
    font-weight: 800 !important;
    padding: 12px 30px !important;
    box-shadow: 0 4px 0 #00A98B !important;
}

.swal2-confirm:hover {
    transform: translateY(-2px) !important;
}

.swal2-cancel {
    background: linear-gradient(135deg, #F5F7FA, #E6E9ED) !important;
    color: #656D78 !important;
    border-radius: 12px !important;
    font-weight: 800 !important;
    padding: 12px 30px !important;
    box-shadow: 0 4px 0 #CCD1D9 !important;
}

.swal2-deny {
    background: linear-gradient(135deg, #FC6E51, #ED5565) !important;
    border-radius: 12px !important;
    font-weight: 800 !important;
}

/* RİSK BİLGİLENDİRME POPUP */
.risk-info-modal .swal2-popup {
    background: linear-gradient(135deg, rgba(255, 206, 84, 0.95), rgba(255, 255, 255, 0.98)) !important;
}

/* ÇIKIŞ ONAY POPUP */
.exit-confirm-modal .swal2-popup {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(240, 248, 255, 0.98)) !important;
}

/* MOBİL LEADERBOARD KARTLARI */
.leaderboard-cards {
    display: none;
}

@media (max-width: 600px) {
    .desktop-leaderboard {
        display: none;
    }

    .leaderboard-cards {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .leaderboard-card {
        background: linear-gradient(135deg, #F5F7FA, #ffffff);
        border-radius: 15px;
        padding: 12px 15px;
        display: flex;
        align-items: center;
        gap: 12px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
        animation: slideInUp 0.4s ease forwards;
    }

    .leaderboard-card:nth-child(1) {
        background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), #ffffff);
        border: 2px solid #FFD700;
    }

    .leaderboard-card:nth-child(2) {
        background: linear-gradient(135deg, rgba(192, 192, 192, 0.2), #ffffff);
        border: 2px solid #C0C0C0;
    }

    .leaderboard-card:nth-child(3) {
        background: linear-gradient(135deg, rgba(205, 127, 50, 0.2), #ffffff);
        border: 2px solid #CD7F32;
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* RESPONSIVE LOGIN CARD & RESULT CARD */
@media (max-width: 1200px) {

    .login-card,
    .result-card {
        width: 50%;
    }
}

@media (max-width: 900px) {

    .login-card,
    .result-card {
        width: 70%;
    }
}

@media (max-width: 600px) {

    .login-card,
    .result-card {
        width: 90%;
        min-width: unset;
        padding: 20px;
    }
}

/* ERİŞİLEBİLİRLİK: Hareket azaltma tercihi olan kullanıcılar için */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .floating-mascot {
        animation: none !important;
        position: fixed !important;
        top: 10% !important;
        left: 5% !important;
        opacity: 0.5 !important;
    }

    .mascot-2 {
        right: 5% !important;
        left: auto !important;
    }

    body {
        animation: none !important;
        background-size: 100% 100% !important;
    }

    .login-card {
        animation: none !important;
    }

    .login-card::before {
        animation: none !important;
    }

    .play-btn {
        animation: none !important;
    }
}

/* INSTAGRAM TAKİP LİNKİ */
.instagram-follow-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #833AB4 0%, #FD1D1D 50%, #F77737 100%);
    border-radius: 50px;
    text-decoration: none;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(131, 58, 180, 0.3);
    position: relative;
    overflow: hidden;
}

.instagram-follow-link::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.instagram-follow-link:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(131, 58, 180, 0.4);
}

.instagram-follow-link:hover::before {
    opacity: 1;
}

.instagram-follow-link i {
    font-size: 1.3rem;
    transition: transform 0.3s ease;
}

.instagram-follow-link:hover i {
    transform: rotate(15deg) scale(1.1);
}

.instagram-follow-link span {
    position: relative;
    z-index: 1;
}