/* Prevent pull-to-refresh on mobile */
html,
body {
    overscroll-behavior-y: none !important;
    overscroll-behavior-x: none !important;
}

/* ====================================================
   DEĞİŞKENLER VE TEMEL AYARLAR
==================================================== */
:root {
    --bg-color: #fce4ec;
    --text-dark: #1e272e;
    --primary: #9b59b6;
    --secondary: #f1c40f;
    --danger: #ff4757;
    --success: #2ed573;
    --blue: #1e90ff;
    --border-width: 4px;
    --border-color: #1e272e;
}

* {
    box-sizing: border-box;
}

body {
    /* Safe area and 100dvh adjustments for mobile notches */
    min-height: 100vh;
    min-height: -webkit-fill-available;
    min-height: 100dvh;
    padding-top: env(safe-area-inset-top);
    margin: 0;
    padding: 20px;
    font-family: 'Fredoka', sans-serif;
    color: var(--text-dark);
    background-color: var(--bg-color);
    background-image: radial-gradient(var(--primary) 10%, transparent 10%);
    background-size: 40px 40px;
    background-position: 0 0, 20px 20px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    min-height: 100vh;
    flex-direction: column;
    gap: 20px;
}

.hidden {
    display: none !important;
}

/* ====================================================
   ANA PANELLER VE LOBİ DÜZENİ
==================================================== */
.game-panel {
    background: #ffffff;
    width: 100%;
    max-width: 450px;
    padding: 30px;
    border-radius: 20px;
    border: var(--border-width) solid var(--border-color);
    box-shadow: 8px 8px 0px var(--border-color);
    text-align: center;
    position: relative;
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin: 0;
}

h2,
h3 {
    margin-top: 0;
    font-weight: 800;
    color: var(--text-dark);
}

.game-title {
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--primary);
    text-shadow: 3px 3px 0px var(--border-color);
    margin: 0 0 20px 0;
    letter-spacing: 2px;
}

.title-icon {
    display: inline-block;
    animation: bounce 2s infinite;
}

/* --- GİRİŞ ALANLARI VE BUTONLAR --- */
.input-group {
    margin-bottom: 20px;
}

input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 15px;
    font-size: 1.2rem;
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    color: var(--text-dark);
    background: #f1f2f6;
    border: var(--border-width) solid var(--border-color);
    border-radius: 12px;
    text-align: center;
    transition: all 0.2s ease;
}

input:focus {
    outline: none;
    background: #fff;
    transform: scale(1.02);
    box-shadow: 4px 4px 0px var(--primary);
}

.fun-btn {
    width: 100%;
    padding: 15px;
    font-size: 1.3rem;
    font-weight: 900;
    font-family: 'Fredoka', sans-serif;
    color: var(--text-dark);
    border: var(--border-width) solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 4px 4px 0px var(--border-color);
    transition: all 0.1s ease;
    text-transform: uppercase;
    margin-top: 10px;
}

.fun-btn:active {
    transform: translate(4px, 4px);
    box-shadow: 0px 0px 0px transparent;
}

.btn-primary {
    background-color: var(--success);
}

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

.btn-blue {
    background-color: var(--blue);
    color: white;
}

/* --- IZGARA & ODA AYARLARI --- */
.setup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.setup-item label {
    display: block;
    font-weight: 700;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 25px 0;
    color: #a4b0be;
    font-weight: 700;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 3px dashed var(--border-color);
    opacity: 0.3;
}

.divider span {
    padding: 0 10px;
}

.room-type-section {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.fun-radio {
    cursor: pointer;
    flex: 1;
}

.fun-radio input {
    display: none;
}

.radio-box {
    display: block;
    padding: 10px;
    border: 3px solid var(--border-color);
    border-radius: 10px;
    font-weight: 700;
    background: #fff;
    transition: all 0.2s;
}

.fun-radio input:checked+.radio-box {
    background: var(--primary);
    color: #fff;
    transform: scale(1.05);
    box-shadow: 3px 3px 0px var(--border-color);
}

.rooms-list-box,
.spectator-box {
    background: #fff;
    padding: 15px;
    border-radius: 12px;
    border: var(--border-width) solid var(--border-color);
    box-shadow: 4px 4px 0px var(--border-color);
    font-weight: 700;
    margin-bottom: 20px;
}

.room-code-display {
    display: inline-block;
    background: var(--secondary);
    padding: 5px 15px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    cursor: pointer;
}

/* --- TAKIM SEÇİM LOBİSİ --- */
.team-container {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.team-box {
    flex: 1;
    min-width: 200px;
    padding: 20px;
    border-radius: 16px;
    background: #fff;
    border: var(--border-width) solid var(--border-color);
    box-shadow: 4px 4px 0 var(--border-color);
}

.red-team h3 {
    color: var(--danger);
    text-decoration: underline;
    text-decoration-thickness: 3px;
    text-underline-offset: 4px;
}

.blue-team h3 {
    color: var(--blue);
    text-decoration: underline;
    text-decoration-thickness: 3px;
    text-underline-offset: 4px;
}

.player-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
}

.player-list li {
    padding: 8px 0;
    border-bottom: 2px dashed #ccc;
}

.player-list li:last-child {
    border-bottom: none;
}

.wait-text {
    font-size: 0.9rem;
    font-weight: 700;
    color: #888;
    margin-top: 10px;
}


/* ====================================================
   OYUN EKRANI VE KESİN SABİTLEMELER
==================================================== */
#gameScreen {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    gap: 15px;
}

/* --- YATAY SKORBORD KESİN ÇÖZÜMÜ (MOBİLDE BİLE YAN YANA!) --- */
.hud {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-evenly !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 450px !important;
    margin: 10px auto 0 auto !important;
    padding: 10px 5px !important;
    background: #ffffff !important;
    border: 3px solid #1e272e !important;
    border-radius: 20px !important;
    box-shadow: 0 5px 0 rgba(30, 39, 46, 0.2) !important;
    box-sizing: border-box !important;
}

.score-box {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 30% !important;
}

.score-box span:first-child {
    font-size: 0.75rem !important;
    font-weight: 900 !important;
    text-transform: uppercase !important;
    margin-bottom: 2px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
}

.score-box span:last-child {
    font-size: 1.8rem !important;
    font-weight: 900 !important;
    line-height: 1 !important;
}

.red-score {
    color: #ff4757 !important;
}

.blue-score {
    color: #3498db !important;
}

/* --- SÜRE VE KALP ATIŞI ANİMASYONU --- */
.timer-box {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    font-size: 2rem !important;
    font-weight: 900 !important;
    background: #1e272e !important;
    color: #ffde00 !important;
    padding: 5px 15px !important;
    border-radius: 15px !important;
    min-width: 70px !important;
    margin: 0 5px !important;
    box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.5) !important;
}

#gameTimer {
    font-variant-numeric: tabular-nums;
    display: inline-block;
    transition: color 0.3s ease;
}

.timer-danger {
    color: #ff4757 !important;
    animation: pulse-danger 0.5s infinite alternate;
}

@keyframes pulse-danger {
    0% {
        transform: scale(1);
        text-shadow: 0 0 5px rgba(255, 71, 87, 0.5);
    }

    100% {
        transform: scale(1.4);
        text-shadow: 0 0 15px rgba(255, 71, 87, 1);
    }
}

/* --- EN DIŞTAKİ ANA OYUN KARTINI (BEYAZ ÇERÇEVE) TAMAMEN SABİTLEME --- */
#cardArea {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

#cardArea .game-panel {
    width: 100% !important;
    max-width: 400px !important;
    height: auto !important;
    aspect-ratio: 3 / 4.5;
    /* Daha uzun bir kart oranı, butonlara yer açar */
    min-height: 450px !important;
    /* Çok küçük ekranlarda butonların sıkışmasını önler */
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 15px 15px 20px 15px !important;
    /* Alt kısımdan ekstra padding */
    box-sizing: border-box !important;
}

/* --- İÇ KART VE KELİMELER --- */
#viewCard {
    width: 100%;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.taboo-card {
    background: #fff;
    padding: 15px;
    border-radius: 15px;
    border: var(--border-width) solid var(--border-color);
    box-shadow: 6px 6px 0 var(--border-color);
    margin-bottom: 25px !important;
    /* Butonlarla arasına kesin mesafe */
    width: 100%;
    flex: 1 1 auto;
    /* Flex içinde sığması için */
    min-height: 0;
    /* İçeriğin kartı patlatmasını / butonlara değmesini engeller */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    box-sizing: border-box;
    overflow: hidden;
}

.main-word {
    color: var(--text-dark);
    font-size: clamp(1.8rem, 6vw, 2.5rem);
    font-weight: 900;
    border-bottom: 4px dashed var(--border-color);
    padding-bottom: 10px;
    margin: 0 0 15px 0 !important;
    text-transform: uppercase;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    line-height: 1.1;
    width: 100%;
    word-break: break-word;
}

.forbidden-words {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    align-items: center;
    flex: 1;
}

.forbidden-words p {
    font-size: clamp(1.1rem, 4vw, 1.4rem);
    font-weight: 800;
    margin: 0;
    color: var(--danger);
    text-align: center;
    word-break: break-word;
}

.role-status {
    border-bottom: 3px dashed #eee;
    padding-bottom: 10px;
    text-transform: uppercase;
    color: #555;
    width: 100%;
    text-align: center;
    font-size: clamp(1rem, 4vw, 1.2rem);
}

.describer-info {
    background: #f1f2f6;
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 15px;
    font-weight: 800;
    border: 2px solid var(--border-color);
    font-size: clamp(0.9rem, 3.5vw, 1rem);
}

.motivational-text {
    font-size: clamp(0.9rem, 3.5vw, 1.1rem);
    font-weight: 700;
    color: #777;
    font-style: italic;
    text-align: center;
}

/* --- OYUN BUTONLARI (KIRILMA YASAK KISMI) --- */
#actionButtons {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    align-items: stretch !important;
    gap: 8px !important;
    width: 100% !important;
    margin-top: auto !important;
}

#actionButtons button {
    flex: 1 !important;
    height: auto !important;
    min-height: 55px !important;
    font-size: clamp(0.7rem, 2.5vw, 0.95rem) !important;
    font-weight: 900 !important;
    padding: 5px !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    line-height: 1.2;
}

#opponentButtons {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: stretch;
    margin-top: auto;
}

#opponentButtons button {
    width: 100%;
    height: auto !important;
    min-height: 55px !important;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: clamp(1rem, 4vw, 1.3rem) !important;
    padding: 10px !important;
    box-sizing: border-box !important;
    margin: 0 !important;
}

/* ====================================================
   SOHBET VE MİKROFON ARAÇLARI
==================================================== */
.chat-toggle-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 9998;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--blue);
    color: white;
    border: var(--border-width) solid var(--border-color);
    font-size: 2rem;
    cursor: pointer;
    box-shadow: 4px 4px 0 var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.1s;
}

.chat-toggle-btn:active {
    transform: translate(4px, 4px);
    box-shadow: 0 0 0 transparent;
}

.chat-container {
    position: absolute;
    bottom: 90px;
    right: 20px;
    width: 320px;
    height: 400px;
    background: white;
    border: var(--border-width) solid var(--border-color);
    border-radius: 15px;
    box-shadow: 6px 6px 0 var(--border-color);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    background: var(--primary);
    color: white;
    padding: 12px;
    font-weight: 900;
    text-align: center;
    border-bottom: var(--border-width) solid var(--border-color);
}

.chat-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.msg-me {
    text-align: right;
    background: #e0f7fa;
    padding: 5px 10px;
    border-radius: 10px;
    align-self: flex-end;
    max-width: 80%;
}

.msg-other {
    text-align: left;
    background: #f1f2f6;
    padding: 5px 10px;
    border-radius: 10px;
    align-self: flex-start;
    max-width: 80%;
}

.chat-input-area {
    display: flex;
    padding: 10px;
    background: #f9f9f9;
    border-top: var(--border-width) solid var(--border-color);
    gap: 5px;
}

.chat-input-area input {
    flex: 1;
    padding: 8px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    outline: none;
    font-size: 16px;
}

.chat-send-btn {
    background: var(--success);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 0 15px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 2px 2px 0 var(--border-color);
}

.chat-send-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 0 0 0 transparent;
}

/* Mikrofon */
.voice-floating {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 3000;
}

.mic-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: var(--border-width) solid var(--border-color);
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 4px 4px 0 var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.1s;
}

.mic-on {
    background: var(--success);
}

.mic-off {
    background: var(--danger);
    color: white;
}

.mic-btn:active {
    transform: translate(4px, 4px);
    box-shadow: 0 0 0 transparent;
}

/* --- BİLDİRİM (TOAST) --- */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translate(-50%, -150px);
    background: var(--secondary);
    color: var(--text-dark);
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: 900;
    border: var(--border-width) solid var(--border-color);
    border-radius: 12px;
    box-shadow: 4px 4px 0 var(--border-color);
    z-index: 9999;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    text-align: center;
}

.toast.show {
    transform: translate(-50%, 0);
}

/* --- ANİMASYONLAR --- */
@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }

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

@keyframes bounce {

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

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

/* ====================================================
   📱 MOBİL & TABLET UYUMU (RESPONSIVE)
==================================================== */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .game-panel {
        padding: 20px;
        width: 95%;
        box-shadow: 4px 4px 0px var(--border-color);
    }

    .game-title {
        font-size: 2.5rem;
    }

    .setup-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .team-container {
        flex-direction: column;
    }

    /* Mobilde sohbet kutusunu büyüt ve butonun üstüne al */
    .chat-container {
        width: 90vw;
        height: 60vh;
        bottom: 80px;
        right: 5vw;
    }

    /* Alt butonları küçült (Mikrofon ve Chat Toggle) */
    .chat-toggle-btn {
        width: 50px;
        height: 50px;
        bottom: 10px;
        right: 10px;
        font-size: 1.5rem;
    }

    .voice-floating {
        bottom: 10px;
        left: 10px;
    }

    .mic-btn {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    #resultScreen h1 {
        font-size: 3rem;
    }

    #winnerTeamName {
        font-size: 2rem;
    }

    #finalRedScore,
    #finalBlueScore {
        font-size: 2.5rem;
    }
}

#actionButtons.hidden {
    display: none !important;
}

#opponentButtons.hidden {
    display: none !important;
}

/* ── ULTRA-PREMIUM FLOATING (i) BUTTON & MODAL ── */
.global-how-to-btn {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  left: calc(20px + env(safe-area-inset-left, 0px));
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #4d0e0e 0%, #240505 70%, #120202 100%);
  border: 2px solid #ff3838;
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.75),
    inset 0 1px 2px rgba(255, 255, 255, 0.35),
    inset 0 -2px 6px rgba(0, 0, 0, 0.8),
    0 0 16px rgba(255, 56, 56, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 999999;
  outline: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.25s ease, border-color 0.25s ease;
  user-select: none;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.how-to-btn-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ff3838;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
  transition: color 0.25s ease, transform 0.25s ease;
}

.how-to-icon {
  stroke: #ff3838;
  transition: stroke 0.25s ease, transform 0.25s ease;
}

.global-how-to-btn:hover {
  transform: translateY(-3px) scale(1.1);
  border-color: #ffffff;
  box-shadow: 
    0 12px 30px rgba(0, 0, 0, 0.85),
    inset 0 1px 2px rgba(255, 255, 255, 0.5),
    0 0 25px rgba(255, 56, 56, 0.6);
}

.global-how-to-btn:hover .how-to-icon {
  stroke: #ffffff;
  transform: scale(1.1);
}

.global-how-to-btn:active {
  transform: translateY(1px) scale(0.95);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.8);
}

/* Ambient Pulsing Aura Effect */
.btn-glow-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 56, 56, 0.35);
  animation: auraPulse 2.8s infinite cubic-bezier(0.45, 0, 0.55, 1);
  pointer-events: none;
}

@keyframes auraPulse {
  0% { transform: scale(0.92); opacity: 0.85; }
  50% { transform: scale(1.18); opacity: 0.15; }
  100% { transform: scale(0.92); opacity: 0.85; }
}

.global-how-to-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999999;
  padding: 15px;
  animation: fadeInHowToModal 0.25s ease-out forwards;
}

.global-how-to-modal.hidden {
  display: none !important;
}

.global-how-to-box {
  background: linear-gradient(165deg, #2e0707 0%, #140202 100%);
  border: 2px solid #ff3838;
  box-shadow: 0 0 35px rgba(0, 0, 0, 0.9), inset 0 1px 1px rgba(255, 255, 255, 0.15), 0 0 18px rgba(255, 56, 56, 0.25);
  color: #f8fafc;
  padding: 26px 28px;
  border-radius: 20px;
  width: min(92vw, 530px);
  position: relative;
  max-height: calc(88vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  font-family: 'Outfit', 'Inter', 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */}

.global-how-to-box::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}
.global-how-to-box::-webkit-scrollbar-thumb {
  display: none !important;
}

.global-how-to-close {
  position: absolute;
  top: 14px;
  z-index: 10;
  right: 18px;
  width: 36px !important;
  height: 36px !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  color: #ff3838;
  font-size: 2rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: color 0.2s ease, transform 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.global-how-to-close:hover {
  color: #ffffff;
  transform: scale(1.15);
}

.global-how-to-title {
  color: #ff3838;
  font-size: 1.4rem;
  font-weight: 800;
  text-align: center;
  margin: 0 0 4px 0;
  padding: 0 35px;
  letter-spacing: 0.4px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85);
  font-family: inherit;
}

.global-how-to-subtitle {
  color: #cbd5e1;
  font-size: 0.88rem;
  text-align: center;
  margin: 0 0 20px 0;
  font-weight: 500;
  letter-spacing: 0.2px;
  opacity: 0.95;
  font-family: inherit;
}

.global-how-to-content .rules-section {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 56, 56, 0.25);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 14px;
}

.global-how-to-content h4 {
  color: #ff3838;
  font-size: 1.02rem;
  margin: 0 0 10px 0;
  font-weight: 700;
  letter-spacing: 0.2px;
  font-family: inherit;
}

.global-how-to-content p {
  font-size: 0.93rem;
  line-height: 1.65;
  color: #f1f5f9;
  margin: 0;
  font-weight: 400;
  letter-spacing: 0.15px;
  font-family: inherit;
}

.global-how-to-content ul, .global-how-to-content ol {
  margin: 0;
  padding-left: 22px;
  font-size: 0.92rem;
  color: #f1f5f9;
  line-height: 1.68;
  font-weight: 400;
  letter-spacing: 0.15px;
  font-family: inherit;
}

.global-how-to-content li {
  margin-bottom: 8px;
}

.global-how-to-content li strong {
  color: #ffffff;
  font-weight: 700;
}

.global-how-to-content li:last-child {
  margin-bottom: 0;
}

@keyframes fadeInHowToModal {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* ── MOBİL / DİK / YATIK EKRAN UYUMLULUĞU ── */
@media (max-width: 600px) {
  .global-how-to-btn {
    width: 44px;
    height: 44px;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    left: calc(14px + env(safe-area-inset-left, 0px));
  }
  .how-to-icon {
    width: 20px;
    height: 20px;
  }
  .global-how-to-box {
    padding: 20px 20px;
    border-radius: 16px;
  
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */}
  .global-how-to-title {
    font-size: 1.2rem;
  }
  .global-how-to-content .rules-section {
    padding: 12px 14px;
    margin-bottom: 12px;
  }
  .global-how-to-content p, .global-how-to-content ul, .global-how-to-content ol {
    font-size: 0.88rem;
    line-height: 1.6;
  }
}

@media (max-height: 500px) {
  .global-how-to-btn {
    width: 40px;
    height: 40px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    left: calc(10px + env(safe-area-inset-left, 0px));
  }
  .how-to-icon {
    width: 18px;
    height: 18px;
  }
  .global-how-to-box {
    max-height: 90vh;
    padding: 16px 18px;
  
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */}
}

/* ── LANDSCAPE ENGELLEYİCİ (Masaüstü ve Dik Mobilde Gizli, Sadece Mobil Yatık Ekranda Görünür) ── */
#landscape-blocker {
  display: none !important;
}

@media (pointer: coarse) and (orientation: landscape) and (max-height: 500px) {
  #landscape-blocker {
    display: flex !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(13, 3, 23, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 99999999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    text-align: center;
    padding: 20px;
  }
  #landscape-blocker .rotate-icon {
    font-size: 3rem;
    color: #ffde00;
    margin-bottom: 12px;
    animation: rotatePhone 2s infinite ease-in-out;
  }
  #landscape-blocker h2 {
    font-size: 1.4rem;
    color: #ffde00;
    margin-bottom: 6px;
    font-weight: 800;
  }
  #landscape-blocker p {
    font-size: 0.95rem;
    color: #cbd5e1;
    margin: 0;
  }
}

@keyframes rotatePhone {
  0% { transform: rotate(0deg); }
  50% { transform: rotate(-90deg); }
  100% { transform: rotate(0deg); }
}

/* ==========================================================================
   TABU MOBİL MOD SEÇİM MODALI & 3D DOKUNSAL BUTONLAR (KANZI GAMES KÜLTÜRÜ)
   ========================================================================== */

.mode-select-card {
    position: relative;
    z-index: 1;
    background: radial-gradient(ellipse at center, rgba(62, 22, 98, 0.96) 0%, rgba(28, 15, 48, 0.97) 55%, rgba(14, 14, 26, 0.98) 100%);
    border: 2.5px solid rgba(255, 222, 0, 0.75);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.8),
                0 0 45px rgba(139, 92, 246, 0.45),
                0 0 15px rgba(255, 222, 0, 0.25);
    border-radius: 24px;
    padding: 32px 24px 28px;
    width: min(380px, 92vw);
    text-align: center;
    box-sizing: border-box;
    font-family: 'Fredoka', sans-serif;
}

.mode-modal-close-x {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    color: #aaa;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.mode-modal-close-x:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    transform: scale(1.08);
}

.mode-modal-title {
    font-family: 'Fredoka', 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 1.5rem;
    color: #ffde00;
    margin: 0 0 6px 0;
    letter-spacing: 1px;
    text-shadow: 0 2px 8px rgba(255, 222, 0, 0.3);
}

.mode-modal-desc {
    color: #888;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 0 20px 0;
}

.mode-buttons-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 3D Dokunsal Buton Temel Stilleri (Pixel Font, Emojisiz, Açıklamasız, Net ve Tok Basma Hissi) */
.mode-select-btn {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 20px;
    min-height: 54px;
    border-radius: 16px;
    cursor: pointer;
    user-select: none;
    text-align: center;
    font-family: 'Press Start 2P', monospace, sans-serif;
    text-decoration: none;
    border: none;
    outline: none;
    transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

.mode-select-btn .mode-btn-label {
    font-family: 'Press Start 2P', monospace, sans-serif;
    font-size: clamp(0.72rem, 3.2vw, 0.82rem);
    letter-spacing: 0.5px;
    line-height: 1.4;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    text-transform: uppercase;
}

/* 1. Çevrimiçi Mod (Canlı Zümrüt Yeşili) */
.mode-btn-online {
    background: linear-gradient(180deg, #10b981 0%, #059669 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.45);
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
    color: #ffffff;
    box-shadow: 0 6px 0 #047857, 0 10px 22px rgba(5, 150, 105, 0.35);
}
.mode-btn-online:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 0 #047857, 0 14px 26px rgba(5, 150, 105, 0.45);
    filter: brightness(1.05);
}
.mode-btn-online:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #047857, 0 3px 8px rgba(0, 0, 0, 0.35), inset 0 2px 4px rgba(0, 0, 0, 0.25);
    filter: brightness(0.96);
}

/* 2. Yanyana Mod (Sıcak Yakut / Mercan) */
.mode-btn-local {
    background: linear-gradient(180deg, #f43f5e 0%, #e11d48 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.45);
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
    color: #ffffff;
    box-shadow: 0 6px 0 #be123c, 0 10px 22px rgba(225, 29, 72, 0.35);
}
.mode-btn-local:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 0 #be123c, 0 14px 26px rgba(225, 29, 72, 0.45);
    filter: brightness(1.05);
}
.mode-btn-local:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #be123c, 0 3px 8px rgba(0, 0, 0, 0.35), inset 0 2px 4px rgba(0, 0, 0, 0.25);
    filter: brightness(0.96);
}
