/* --- KANZIGAMES: WORDLE ULTRA-PREMIUM STYLES --- */

:root {
    --bg-gradient: radial-gradient(circle at 50% 20%, #1e1b4b 0%, #0f172a 60%, #090d16 100%);
    --glass-bg: rgba(26, 34, 52, 0.75);
    --glass-border: rgba(255, 255, 255, 0.14);
    --glass-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    
    --color-correct: #10b981;
    --color-correct-glow: rgba(16, 185, 129, 0.22);
    --color-present: #f59e0b;
    --color-present-glow: rgba(245, 158, 11, 0.22);
    --color-absent: #334155;
    --color-empty: rgba(255, 255, 255, 0.04);
    --color-border-empty: rgba(255, 255, 255, 0.18);
    --color-border-active: #a855f7;
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent-purple: #a855f7;
    --accent-blue: #3b82f6;

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    font-family: var(--font-body);
    background: url('images/desktop_bg.jpg') no-repeat center top / cover fixed;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

#app-container {
    width: 100%;
    max-width: 1100px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 16px;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

/* --- GLASSMORPHISM CARD --- */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    box-shadow: var(--glass-shadow);
}

/* --- MAIN SCREEN ROUTING --- */
.main-content {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.screen {
    display: none;
    height: 100%;
    width: 100%;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

/* --- LOBBY WAITING SCREEN --- */
#lobby-screen {
    justify-content: center;
    align-items: center;
}

.lobby-card {
    width: 100%;
    max-width: 520px;
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    background: #c68d56;
    border: 3px solid #2b1b0e;
    border-radius: 6px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), inset 0 1px 2px rgba(255, 255, 255, 0.25);
    position: relative;
}

/* RETRO CORNER PINS */
.corner-pin {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #94a3b8;
    border: 2px solid #1e293b;
    border-radius: 2px;
    box-shadow: inset 1px 1px 1px rgba(255, 255, 255, 0.4);
    z-index: 5;
}
.corner-pin.top-left { top: 6px; left: 6px; }
.corner-pin.bottom-right { bottom: 6px; right: 6px; }

/* BRAND LOGO & HEADER INSIDE CARD */
.lobby-brand-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 12px;
    background: #4a301a;
    padding: 14px 16px;
    border-radius: 4px;
    border: 2px solid #26160a;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.brand-logo-btn,
.brand-logo {
    font-family: var(--font-heading);
    font-size: clamp(1.2rem, 4.5vw, 1.8rem);
    font-weight: 900;
    letter-spacing: -0.5px;
    line-height: 1;
    white-space: nowrap;
    background: #c68d56;
    border: 2px solid #1a0f07;
    border-bottom: 4px solid #0d0703;
    outline: 1px solid rgba(0, 0, 0, 0.8);
    border-radius: 4px;
    padding: 8px 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    cursor: default;
    user-select: none;
}

.brand-kanzi,
.brand-wordle {
    color: #ffffff !important;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8) !important;
    margin: 0;
}

.brand-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.header-action-btns {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.header-btn {
    background: rgba(74, 48, 26, 0.75);
    border: 1.5px solid #c68d56;
    border-bottom: 3.5px solid #9c6738;
    color: #fcd34d;
    width: 42px;
    height: 42px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.15rem;
    transition: all 0.08s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.header-btn:hover {
    color: #ffffff;
}

.header-btn:active {
    transform: translateY(2px);
    border-bottom-width: 1px;
}

/* LOBBY MODE SELECTOR (Retro Wooden Style) */
.lobby-mode-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #4a301a;
    padding: 16px;
    border-radius: 4px;
    border: 2px solid #26160a;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.section-label {
    font-family: var(--font-heading);
    font-size: clamp(0.8rem, 3.2vw, 0.95rem);
    font-weight: 900;
    color: #fcd34d;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
    white-space: nowrap;
}

.mode-pills {
    display: flex;
    gap: 8px;
}

.mode-pill {
    flex: 1;
    background: #f59e0b;
    border: 2px solid #1a0f07;
    border-bottom: 4px solid #0d0703;
    outline: 1px solid rgba(0, 0, 0, 0.8);
    border-radius: 4px;
    color: #ffffff;
    padding: 10px 4px;
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: clamp(0.72rem, 3vw, 1rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.08s ease;
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    user-select: none;
}

.mode-pill:active {
    transform: translateY(3px);
    border-bottom-width: 1px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.mode-pill.active {
    background: #48a655;
    border: 2px solid #143d1a;
    border-bottom: 4px solid #0b240f;
    outline: 1px solid rgba(0, 0, 0, 0.8);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.mode-pill.active:active {
    transform: translateY(3px);
    border-bottom-width: 1px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* LOBBY PLAYERS BOX & INDIVIDUAL PLAYER CARDS */
.lobby-players-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #4a301a;
    padding: 16px;
    border-radius: 4px;
    border: 2px solid #26160a;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.players-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: clamp(0.8rem, 3.2vw, 0.95rem);
    color: #fcd34d;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
    white-space: nowrap;
}

.player-count-badge {
    background: rgba(252, 211, 77, 0.15);
    border: 1px solid rgba(252, 211, 77, 0.4);
    color: #fcd34d;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: clamp(0.7rem, 2.8vw, 0.8rem);
    font-weight: 800;
    text-shadow: none;
    white-space: nowrap;
}

.players-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-height: 260px;
    overflow-y: auto;
    width: 100%;
}

/* RETRO DARK COFFEE PLAYER CARD CHIP */
.player-card-chip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 1 1 calc(50% - 5px);
    height: 52px;
    min-height: 52px;
    max-height: 52px;
    box-sizing: border-box;
    padding: 10px 10px;
    background: #321e0f;
    border: 1.5px solid #c68d56;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: background 0.15s ease, border-color 0.15s ease;
    transform: none !important;
}

/* If the last card is an odd number (1st of 1, or 3rd of 3), span full 100% width */
.player-card-chip:last-child:nth-child(odd) {
    flex: 1 1 100%;
}

.player-card-chip:hover {
    background: #3c2412;
    border-color: #d99a62;
    transform: none !important;
}

.player-card-left {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    min-width: 0;
}

.player-dot {
    color: #c68d56;
    font-size: 1.25rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.player-card-name {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: clamp(0.75rem, 3.2vw, 1rem);
    color: #fef08a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-card-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.host-crown-icon {
    color: #c68d56;
    font-size: 0.95rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* TACTILE LAYERED 3D BUTTONS */
.btn {
    padding: 12px 18px;
    border-radius: 4px;
    border: none;
    font-family: var(--font-body);
    font-weight: 800;
    font-size: clamp(0.85rem, 3.5vw, 1rem);
    white-space: nowrap;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: all 0.08s ease;
    position: relative;
    user-select: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: #a855f7;
    color: #fff;
    border: 1px solid #7c3aed;
    border-bottom: 5px solid #6b21a8;
    box-shadow: 0 4px 10px rgba(168, 85, 247, 0.18);
}

.btn-primary:active {
    transform: translateY(4px);
    border-bottom-width: 1px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-bottom: 4px solid rgba(255, 255, 255, 0.4);
}

.btn-secondary:active {
    transform: translateY(3px);
    border-bottom-width: 1px;
}

.btn-success {
    background: #48a655;
    color: #ffffff;
    border: 2px solid #26160a;
    border-bottom: 5px solid #1a0f07;
    outline: 1.5px solid #26160a;
    box-shadow: 0 6px 16px rgba(28, 78, 35, 0.4);
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: clamp(0.9rem, 3.8vw, 1.15rem);
    white-space: nowrap;
    letter-spacing: 0.8px;
}

.btn-success:active {
    transform: translateY(4px);
    border-bottom-width: 1px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.btn-warning {
    background: #694528;
    color: #fef08a;
    border: 2px solid #3d2614;
    border-bottom: 5px solid #29180b;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: clamp(0.85rem, 3.5vw, 1.05rem);
    white-space: nowrap;
}

.btn-warning:active {
    transform: translateY(4px);
    border-bottom-width: 1px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.btn-block {
    width: 100%;
}

.btn-large {
    padding: clamp(10px, 3vw, 14px) clamp(16px, 4vw, 24px);
    font-size: clamp(0.9rem, 3.8vw, 1.15rem);
    white-space: nowrap;
}

/* --- GAME ARENA SCREEN (RETRO-PREMIUM STYLING) --- */
.arena-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: clamp(12px, 2vw, 20px);
    height: 100%;
    width: 100%;
    min-height: 0;
}

.arena-panel {
    background: #c68d56;
    border: 3px solid #2b1b0e;
    border-radius: 6px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), inset 0 1px 2px rgba(255, 255, 255, 0.25);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(12px, 2vh, 22px);
    align-items: center;
    position: relative;
    overflow: hidden;
    height: 100%;
}

.arena-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #4a301a;
    padding: clamp(8px, 1.4vh, 12px) clamp(12px, 1.8vw, 16px);
    border-radius: 4px;
    border: 2px solid #26160a;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
    margin-bottom: clamp(6px, 1vh, 12px);
}

.arena-header-left {
    display: flex;
    align-items: stretch;
    gap: clamp(8px, 1.5vw, 16px);
}

.arena-header-left .brand-logo-btn {
    min-width: clamp(150px, 16vw, 200px);
    justify-content: center;
    box-sizing: border-box;
}

.arena-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.attempts-indicator {
    font-family: var(--font-heading);
    font-size: clamp(0.82rem, 1.5vh, 1.02rem);
    color: #ffffff;
    font-weight: 900;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.85);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #c68d56;
    padding: 0 clamp(10px, 1.2vw, 16px);
    border: 2px solid #1a0f07;
    border-bottom: 4px solid #0d0703;
    outline: 1px solid rgba(0, 0, 0, 0.8);
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    min-width: clamp(150px, 16vw, 200px);
    white-space: nowrap;
    box-sizing: border-box;
}

.attempt-dots {
    display: flex;
    gap: 5px;
    align-items: center;
}

.attempt-dot {
    width: clamp(8px, 1.2vh, 11px);
    height: clamp(8px, 1.2vh, 11px);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #694528;
    transition: all 0.2s ease;
}

.attempt-dot.active {
    background: #48a655;
    border-color: #fcd34d;
    box-shadow: 0 0 8px rgba(72, 166, 85, 0.6);
}

.attempt-dot.used {
    background: #ef4444;
    border-color: #29180b;
    opacity: 0.4;
}

.highlight {
    color: #fef08a;
    font-weight: 900;
    font-size: clamp(0.9rem, 1.8vh, 1.1rem);
}

.game-msg-box {
    font-family: var(--font-heading);
    font-size: clamp(0.9rem, 1.8vh, 1.2rem);
    font-weight: 800;
    min-height: clamp(24px, 3vh, 32px);
    color: #fef08a;
    text-align: center;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* COMBINED UNIFIED GAMEPLAY BOARD BOX */
.arena-board-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: clamp(500px, 52vw, 700px);
    flex: 1;
    min-height: 0;
    background: #4a301a;
    padding: clamp(10px, 1.6vh, 18px) clamp(12px, 1.8vw, 20px);
    border-radius: 6px;
    border: 2px solid #26160a;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.5), 0 6px 16px rgba(0, 0, 0, 0.35);
    margin: clamp(4px, 1vh, 8px) 0;
    gap: clamp(8px, 1.2vh, 16px);
}

.mobile-hub-dock {
    display: none !important;
}

/* WORDLE GRID */
.wordle-grid-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 0;
}

.wordle-grid {
    display: flex;
    flex-direction: column;
    gap: clamp(4px, 0.8vh, 8px);
    justify-content: center;
    align-items: center;
}

.grid-row {
    display: flex;
    gap: clamp(4px, 0.8vh, 8px);
}

.grid-row.shake {
    animation: shake 0.5s ease-in-out;
}

.tile {
    width: clamp(38px, 6.2vh, 60px);
    height: clamp(38px, 6.2vh, 60px);
    background: #c68d56;
    border: 2px solid #1a0f07;
    border-bottom: 4px solid #0d0703;
    outline: 1px solid rgba(0, 0, 0, 0.8);
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: var(--font-heading);
    font-size: clamp(1.2rem, 3.4vh, 1.85rem);
    font-weight: 900;
    color: #000000;
    text-transform: uppercase;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.35);
    transition: transform 0.12s ease, border-color 0.12s ease, background-color 0.12s ease;
}

.tile.active {
    border-color: #fcd34d;
    border-bottom-color: #d97706;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.45);
    animation: pop 0.1s ease;
}

/* TILE COLOR STATES */
.tile.correct {
    background: #48a655;
    border: 2px solid #143d1a;
    border-bottom: 4px solid #0b240f;
    color: #ffffff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.tile.present {
    background: #f59e0b;
    border: 2px solid #1a0f07;
    border-bottom: 4px solid #0d0703;
    color: #ffffff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.tile.absent {
    background: #1e293b;
    border: 2px solid #0f172a;
    border-bottom: 4px solid #070a12;
    color: #94a3b8;
    opacity: 0.85;
}

.tile.flip {
    animation: flip 0.6s ease forwards;
}

/* VIRTUAL KEYBOARD */
.virtual-keyboard {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: clamp(3px, 0.6vh, 6px);
    margin: 0 auto;
    flex-shrink: 0;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: clamp(3px, 0.5vw, 6px);
    width: 100%;
}

.key {
    background: #c68d56;
    border: 1.5px solid #1a0f07;
    border-bottom: 3.5px solid #0d0703;
    outline: 1px solid rgba(0, 0, 0, 0.8);
    border-radius: 4px;
    color: #000000;
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: clamp(0.72rem, 1.5vh, 0.95rem);
    height: clamp(36px, 5.5vh, 50px);
    flex: 1;
    max-width: clamp(30px, 3.6vw, 46px);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.08s ease;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.35);
    user-select: none;
}

.key-wide {
    max-width: clamp(50px, 6.2vw, 74px);
    flex: 1.6;
    font-size: clamp(0.62rem, 1.2vh, 0.82rem);
}

.key:hover {
    color: #ffffff;
    background: #d99a62;
}

.key:active {
    transform: translateY(2px);
    border-bottom-width: 1px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.key.correct {
    background: #48a655 !important;
    border: 1.5px solid #143d1a !important;
    border-bottom: 3.5px solid #0b240f !important;
    color: #ffffff !important;
}

.key.present {
    background: #f59e0b !important;
    border: 1.5px solid #1a0f07 !important;
    border-bottom: 3.5px solid #0d0703 !important;
    color: #ffffff !important;
}

.key.absent {
    background: #1e293b !important;
    border: 1.5px solid #0f172a !important;
    border-bottom: 3.5px solid #070a12 !important;
    color: #475569 !important;
    opacity: 0.45;
}

/* OPPONENTS SIDEBAR */
.arena-sidebar {
    background: #c68d56;
    border: 3px solid #2b1b0e;
    border-radius: 6px;
    padding: clamp(12px, 2vh, 18px);
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    position: relative;
}

.sidebar-modal-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
    width: 100%;
    position: relative;
}

.sidebar-header {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: clamp(0.8rem, 1.5vh, 0.95rem);
    color: #fcd34d;
    background: #4a301a;
    padding: clamp(8px, 1.4vh, 12px) 14px;
    border-radius: 4px;
    border: 2px solid #26160a;
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
    flex-shrink: 0;
    letter-spacing: 0.5px;
}

.opponents-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
    flex: 1;
    min-height: 0;
}

.opponent-card {
    background: #4a301a;
    border: 2px solid #26160a;
    border-radius: 6px;
    padding: clamp(8px, 1.2vh, 12px) clamp(10px, 1.4vw, 14px);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 8px;
    flex: 1;
    min-height: 0;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.5), 0 4px 8px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.opponent-card.empty-slot {
    opacity: 0.6;
    justify-content: center;
    border: 2px dashed #3a2310;
    background: rgba(74, 48, 26, 0.45);
}

.empty-name {
    color: #fef08a;
    font-style: italic;
    font-size: 0.8rem;
    opacity: 0.7;
}

.empty-badge {
    opacity: 0.5;
}

.opponent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: clamp(0.75rem, 1.4vh, 0.88rem);
    font-family: var(--font-heading);
    font-weight: 800;
    color: #fef08a;
    width: 100%;
}

.opponent-name {
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.opponent-status-badge {
    font-size: 0.72rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 4px;
    background: rgba(252, 211, 77, 0.15);
    border: 1px solid rgba(252, 211, 77, 0.3);
    color: #fcd34d;
    white-space: nowrap;
}

.opponent-status-badge.won {
    background: rgba(72, 166, 85, 0.2);
    border-color: #48a655;
    color: #86efac;
}

.opponent-status-badge.lost {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #fca5a5;
}

.mini-grid {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 5px;
    flex: 1;
    overflow-y: auto;
}

.mini-row {
    display: flex;
    gap: 5px;
}

.mini-tile {
    width: 23px;
    height: 23px;
    border-radius: 4px;
    background: #c68d56;
    border: 1.5px solid #1a0f07;
    box-shadow: 0 1.5px 3px rgba(0, 0, 0, 0.35);
    flex-shrink: 0;
}

.mini-tile.correct { background: #48a655 !important; border-color: #143d1a !important; }
.mini-tile.present { background: #f59e0b !important; border-color: #1a0f07 !important; }
.mini-tile.absent { background: #1e293b !important; border-color: #0f172a !important; }

/* --- RETRO CUSTOM TOAST NOTIFICATION --- */
.retro-toast {
    position: fixed;
    top: clamp(16px, 3vh, 28px);
    left: 50%;
    transform: translateX(-50%) translateY(0);
    background: #29180b;
    border: 2px solid #f59e0b;
    border-bottom: 4px solid #b45309;
    border-radius: 6px;
    padding: 12px 22px;
    color: #fef08a;
    font-family: var(--font-heading);
    font-size: clamp(0.85rem, 1.6vh, 1.02rem);
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), inset 0 1px 1px rgba(255, 255, 255, 0.2);
    z-index: 1000000;
    transition: opacity 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    white-space: nowrap;
}

.retro-toast.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(-24px);
}

.toast-icon {
    color: #f59e0b;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
}

/* --- MODALS --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 16px;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    width: 100%;
    max-width: 500px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-height: 90vh;
    overflow-y: auto;
}


.example-box {
    margin: clamp(6px, 1.5vw, 10px) 0;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: clamp(8px, 2vw, 12px);
}

.example-box p {
    margin: clamp(4px, 1vw, 6px) 0 0 0;
    font-size: clamp(0.75rem, 2.3vw, 0.86rem);
    line-height: 1.45;
}

.example-row {
    display: flex;
    gap: clamp(4px, 1.2vw, 6px);
    margin-bottom: 6px;
    flex-wrap: nowrap;
    align-items: center;
}

.example-row .tile {
    width: clamp(26px, 6.8vw, 36px) !important;
    height: clamp(26px, 6.8vw, 36px) !important;
    font-size: clamp(0.85rem, 2.6vw, 1.15rem) !important;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-width: 1.5px;
    border-bottom-width: 3px;
}


/* RESULT SCOREBOARD MODAL (RETRO-PREMIUM STYLING) */
.result-modal-content {
    text-align: center;
    background: #c68d56;
    border: 3px solid #2b1b0e;
    border-radius: 6px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), inset 0 1px 2px rgba(255, 255, 255, 0.25);
    padding: clamp(20px, 3vh, 32px);
    position: relative;
}

.result-icon-badge {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #4a301a;
    border: 2px solid #26160a;
    color: #fcd34d;
    font-size: 1.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4), 0 4px 10px rgba(0, 0, 0, 0.3);
}

#result-title {
    font-family: var(--font-heading);
    font-size: clamp(1.4rem, 4vw, 1.8rem);
    font-weight: 900;
    color: #fef08a;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    letter-spacing: 0.5px;
}

#result-subtitle {
    font-size: 0.95rem;
    color: #ffffff;
    font-weight: 700;
    margin-top: 4px;
}

#winner-name-highlight {
    color: #fcd34d;
    font-weight: 900;
}

.secret-word-reveal {
    background: #2a180c;
    border: 2px solid #4a301a;
    border-radius: 8px;
    padding: 14px 18px;
    margin: 16px 0;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6), 0 2px 4px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.secret-word-reveal span {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    color: #d19a66;
    font-weight: 900;
    letter-spacing: 1.5px;
    display: block;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.revealed-word-box {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 4.5vw, 2.1rem);
    font-weight: 900;
    letter-spacing: 5px;
    color: #fcd34d;
    background: linear-gradient(180deg, #3d2312 0%, #241308 100%);
    border: 2px solid #c68d56;
    border-bottom: 4px solid #1a0d04;
    border-radius: 6px;
    padding: 8px 16px;
    margin-top: 4px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9), 0 0 10px rgba(252, 211, 77, 0.35);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.12);
    display: inline-block;
    max-width: 100%;
    word-break: break-all;
}

.scoreboard-section h3 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 900;
    color: #fcd34d;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
    margin-bottom: 10px;
    text-transform: uppercase;
}

.scoreboard-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0;
}

.score-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #321e0f;
    border: 1.5px solid #c68d56;
    border-radius: 4px;
    padding: 10px 14px;
    color: #fef08a;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.9rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.score-player-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rank-num {
    color: #fcd34d;
    font-weight: 900;
}

.winner-crown {
    color: #fcd34d;
    font-size: 0.95rem;
}

.score-row.winner-row {
    border: 2px solid #fcd34d;
    background: #4a301a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

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

.hidden {
    display: none !important;
}

/* --- KANZI STANDARDI FLOATING (i) BUTTON & MODAL (100% RESPONSIVE) --- */
.global-how-to-btn {
  position: fixed;
  bottom: calc(clamp(12px, 3vw, 20px) + env(safe-area-inset-bottom, 0px));
  left: calc(clamp(12px, 3vw, 20px) + env(safe-area-inset-left, 0px));
  width: clamp(42px, 9vw, 50px);
  height: clamp(42px, 9vw, 50px);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #3b165c 0%, #1b092b 70%, #0d0317 100%);
  border: 2px solid #a855f7;
  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(168, 85, 247, 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: #a855f7;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
  transition: color 0.25s ease, transform 0.25s ease;
}

.how-to-icon {
  width: clamp(20px, 4.5vw, 24px);
  height: clamp(20px, 4.5vw, 24px);
  stroke: #a855f7;
  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(168, 85, 247, 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);
}

.btn-glow-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1.5px solid rgba(168, 85, 247, 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;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  background: rgba(0, 0, 0, 0.84);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999999;
  padding: clamp(8px, 2.5vw, 18px);
  box-sizing: border-box;
  animation: fadeInHowToModal 0.25s ease-out forwards;
}

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

.global-how-to-box {
  background: linear-gradient(165deg, #1c0a30 0%, #0c0416 100%);
  border: 2px solid #a855f7;
  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(168, 85, 247, 0.25);
  color: #f8fafc;
  padding: clamp(16px, 3.8vw, 26px) clamp(12px, 3.2vw, 24px);
  border-radius: clamp(14px, 3vw, 20px);
  width: min(94vw, 530px);
  max-width: 530px;
  position: relative;
  max-height: calc(88vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  max-height: calc(88dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  font-family: var(--font-body);
  scrollbar-width: none;
  -ms-overflow-style: none;
  box-sizing: border-box;
}

.global-how-to-box::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.global-how-to-close {
  position: absolute;
  top: clamp(8px, 2vw, 14px);
  right: clamp(10px, 2.2vw, 16px);
  z-index: 10;
  width: clamp(32px, 7vw, 36px) !important;
  height: clamp(32px, 7vw, 36px) !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  color: #a855f7;
  font-size: clamp(1.4rem, 4.5vw, 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;
}

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

.global-how-to-title {
  font-family: var(--font-heading);
  font-size: clamp(1.05rem, 3.8vw, 1.45rem);
  font-weight: 900;
  color: #a855f7;
  text-align: center;
  margin-bottom: 4px;
  padding: 0 clamp(28px, 7vw, 42px);
  line-height: 1.25;
  letter-spacing: 0.5px;
  word-break: break-word;
}

.global-how-to-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: clamp(0.74rem, 2.4vw, 0.88rem);
  margin-bottom: clamp(10px, 2.5vw, 16px);
  line-height: 1.35;
}

.global-how-to-content {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 2.2vw, 14px);
}

.global-how-to-content .rules-section {
  background: rgba(14, 13, 17, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: clamp(8px, 2vw, 12px);
  padding: clamp(10px, 2.4vw, 14px) clamp(10px, 2.6vw, 16px);
  box-sizing: border-box;
}

.global-how-to-content h4 {
  font-family: var(--font-heading);
  font-size: clamp(0.85rem, 2.8vw, 1rem);
  font-weight: 800;
  color: #a855f7;
  margin-bottom: clamp(6px, 1.5vw, 8px);
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.3px;
}

.global-how-to-content p, 
.global-how-to-content li {
  font-size: clamp(0.76rem, 2.4vw, 0.88rem);
  line-height: 1.55;
  color: #e2e8f0;
  word-break: break-word;
  overflow-wrap: break-word;
}

.global-how-to-content ul {
  padding-left: clamp(14px, 3.5vw, 20px);
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 1.2vw, 6px);
  margin: 0;
}

/* --- KEYFRAME ANIMATIONS --- */
@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

@keyframes shake {
    10%, 90% { transform: translateX(-2px); }
    20%, 80% { transform: translateX(4px); }
    30%, 50%, 70% { transform: translateX(-6px); }
    40%, 60% { transform: translateX(6px); }
}

@keyframes flip {
    0% { transform: rotateX(0deg); }
    50% { transform: rotateX(90deg); }
    100% { transform: rotateX(0deg); }
}

@keyframes fadeInModal {
    0% { opacity: 0; transform: scale(0.96); }
    100% { opacity: 1; transform: scale(1); }
}

/* --- RESPONSIVE DESKTOP & MOBILE STYLES --- */

/* DESKTOP FLUID OPTIMIZATIONS (min-width: 900px) */
@media (min-width: 900px) {
    #app-container {
        padding: clamp(10px, 2.5vh, 24px);
        max-width: 1240px;
    }

    .arena-layout {
        grid-template-columns: 1fr clamp(240px, 24vw, 310px);
        gap: clamp(12px, 2vw, 22px);
    }

    .btn-mobile-opponents {
        display: none !important;
    }

    .sidebar-close-btn {
        display: none !important;
    }

    .arena-sidebar > .corner-pin {
        display: block !important;
    }

    .sidebar-modal-content > .corner-pin {
        display: none !important;
    }
}

/* TABLET & MOBILE COMPACT LAYOUT (max-width: 899px) */
@media (max-width: 899px) {
    /* MOBİLDE OYUN EKRANINDA LOGO VE NASIL OYNANIR BUTONUNU GİZLEME (LOBİDEKİLER KALIR) */
    #game-screen .brand-logo-btn {
        display: none !important;
    }

    body.in-game #globalHowToBtn,
    body:has(#game-screen.active) #globalHowToBtn,
    #app-container:has(#game-screen.active) ~ #globalHowToBtn {
        display: none !important;
    }

    /* MOBİL ÖZEL ARKAPLAN (LOBİ VE OYUN İÇİN DAMA DESENLİ KANZI GÖRSELİ) */
    body {
        background-image: url('images/mobile_bg.jpg') !important;
        background-size: cover !important;
        background-position: center top !important;
        background-repeat: no-repeat !important;
        background-attachment: fixed !important;
    }

    #app-container,
    .main-content,
    #lobby-screen,
    #game-screen {
        background: transparent !important;
    }

    #app-container {
        padding: 6px;
    }

    .arena-layout {
        grid-template-columns: 1fr;
        gap: 8px;
        overflow-y: auto;
    }

    .arena-header {
        padding: 8px 10px;
    }

    .arena-header-left {
        gap: 6px;
    }

    .btn-mobile-opponents {
        display: flex !important;
        width: clamp(36px, 8.5vw, 42px);
        height: clamp(36px, 8.5vw, 42px);
        border-radius: 50%;
        background: linear-gradient(180deg, #c68d56 0%, #a26a38 100%);
        border: 2px solid #26160a;
        border-bottom: 3.5px solid #1a0d04;
        color: #fcd34d;
        align-items: center;
        justify-content: center;
        font-size: clamp(0.95rem, 3.5vw, 1.15rem);
        cursor: pointer;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
        transition: transform 0.1s ease, filter 0.15s ease;
        flex-shrink: 0;
    }

    .btn-mobile-opponents:active {
        transform: translateY(2px);
        border-bottom-width: 1.5px;
    }

    .sidebar-close-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: rgba(0, 0, 0, 0.4);
        border: 1.5px solid #c68d56;
        border-radius: 50%;
        width: 30px;
        height: 30px;
        color: #fcd34d;
        cursor: pointer;
        font-size: 0.9rem;
        transition: transform 0.15s ease;
    }

    .sidebar-close-btn:hover {
        transform: scale(1.1);
        color: #ffffff;
    }

    .arena-header-left .brand-logo-btn,
    .attempts-indicator {
        min-width: 0;
        padding: 6px 10px;
        font-size: clamp(0.7rem, 2.6vw, 0.85rem);
    }

    /* MOBILE OPPONENTS OVERLAY POPUP */
    .arena-sidebar {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        z-index: 9500;
        background: rgba(0, 0, 0, 0.82);
        backdrop-filter: blur(6px);
        align-items: center;
        justify-content: center;
        padding: 16px;
        box-sizing: border-box;
        border: none;
        box-shadow: none;
        margin: 0;
        order: unset;
        max-height: none;
    }

    .arena-sidebar.mobile-open {
        display: flex !important;
        animation: fadeInModal 0.2s ease-out forwards;
    }

    .sidebar-modal-content {
        background: #c68d56;
        border: 3px solid #2b1b0e;
        border-radius: 8px;
        padding: 14px;
        display: flex;
        flex-direction: column;
        gap: 12px;
        width: min(92%, 340px);
        max-height: 85vh;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7);
        position: relative;
    }

    .arena-sidebar > .corner-pin {
        display: none !important;
    }

    .sidebar-modal-content > .corner-pin {
        display: block !important;
    }

    .sidebar-header {
        font-family: var(--font-heading);
        font-weight: 900;
        font-size: 0.9rem;
        color: #fcd34d;
        background: #4a301a;
        padding: 10px 12px;
        border-radius: 4px;
        border: 2px solid #26160a;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
        flex-shrink: 0;
        letter-spacing: 0.5px;
    }

    .opponents-container {
        display: flex;
        flex-direction: column !important; /* DİK / VERTICAL 3 KART */
        gap: 10px;
        width: 100%;
        flex: 1;
        overflow-y: auto;
        max-height: 80vh;
    }

    .opponent-card {
        background: #4a301a;
        border: 2px solid #26160a;
        border-radius: 6px;
        padding: clamp(6px, 1.2vh, 10px) clamp(8px, 2vw, 12px);
        display: flex;
        flex-direction: column !important;
        justify-content: flex-start !important;
        gap: clamp(4px, 1vh, 8px);
        width: 100%;
        min-height: clamp(85px, 15vh, 118px);
        flex: 1;
        box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.5), 0 4px 8px rgba(0, 0, 0, 0.3);
        overflow: hidden;
    }

    .opponent-header {
        font-size: clamp(0.72rem, 1.4vh, 0.8rem);
    }

    .mini-grid {
        gap: clamp(2px, 0.6vh, 4px);
        flex: 1;
        overflow-y: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .mini-grid::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    .mini-row {
        gap: clamp(2px, 0.8vw, 4px);
    }

    .mini-tile {
        width: clamp(14px, 4.2vw, 20px);
        height: clamp(14px, 4.2vw, 20px);
        border-radius: clamp(2px, 0.8vw, 4px);
        border-width: 1.5px;
    }

    .arena-panel {
        padding: 10px 8px;
    }

    .arena-board-box {
        position: relative;
        padding: 8px clamp(6px, 1.5vw, 12px);
        margin: 4px 0;
        gap: 8px;
        max-width: 100%;
    }

    .wordle-grid-container {
        padding-top: 14px;
    }

    /* MOBILE AÇIK KAHVERENGİ HUB İSTASYONU (ODADAN ÇIK & LOBİ) */
    .mobile-hub-dock {
        display: flex !important;
        position: absolute;
        top: 6px;
        right: 8px;
        z-index: 30;
        align-items: center;
        gap: 8px;
        background: linear-gradient(180deg, #c68d56 0%, #a26a38 100%);
        border: 2px solid #26160a;
        border-bottom: 3.5px solid #1a0d04;
        border-radius: 25px;
        padding: 4px 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.25);
    }

    .dock-btn {
        width: 36px;
        height: 36px;
        border-radius: 50% !important;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        font-size: 0.95rem;
        transition: transform 0.15s ease, filter 0.15s ease;
        padding: 0;
    }

    .dock-btn:active {
        transform: scale(0.92);
    }

    /* 1) GameHub Orijinal Lobi Butonu Tasarımı (Mor degrade, sarı kontur) */
    .dock-lobby-btn {
        background: linear-gradient(135deg, #d900ff 0%, #7209b7 100%) !important;
        color: #ffffff !important;
        border: 2.5px solid #ffde00 !important;
        box-shadow: 0 0 10px rgba(217, 0, 255, 0.5), 0 3px 8px rgba(0, 0, 0, 0.4) !important;
    }

    /* 1) GameHub Orijinal Odadan Çık Butonu Tasarımı (Kırmızı/pembe zemin, koyu kontur) */
    .dock-exit-btn {
        background: #ff4757 !important;
        color: #ffffff !important;
        border: 2.5px solid #2b1111 !important;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35) !important;
    }

    /* Rakiplerin durumu açıldığında butonları gizle */
    body.opponents-open .mobile-hub-dock,
    .arena-sidebar.mobile-open ~ * .mobile-hub-dock {
        display: none !important;
    }

    .tile {
        width: clamp(34px, 11vw, 48px);
        height: clamp(34px, 11vw, 48px);
        font-size: clamp(1.1rem, 4.5vw, 1.5rem);
    }

    .key {
        height: 44px;
        max-width: 32px;
        min-width: 0;
        font-size: 0.75rem;
    }

    .key-wide {
        max-width: 48px;
        font-size: 0.65rem;
    }

    .modal-content, .global-how-to-box {
        padding: 18px 14px;
    }
}

@media (max-width: 480px) {
    .corner-pin {
        width: 9px;
        height: 9px;
    }
    .corner-pin.top-left { top: 4px; left: 4px; }
    .corner-pin.bottom-right { bottom: 4px; right: 4px; }

    .lobby-card {
        padding: 16px 10px;
        gap: 12px;
    }

    .lobby-brand-box {
        padding: 8px 10px;
    }

    .brand-logo-btn, .brand-logo {
        padding: 6px 10px;
        font-size: clamp(0.95rem, 3.8vw, 1.3rem);
    }

    .mode-pills {
        gap: 6px;
    }

    .mode-pill {
        padding: 8px 3px;
        font-size: clamp(0.68rem, 2.7vw, 0.85rem);
    }

    .player-card-chip {
        height: 46px;
        min-height: 46px;
        max-height: 46px;
        padding: 6px 8px;
    }

    .player-card-name {
        font-size: clamp(0.7rem, 2.9vw, 0.88rem);
    }

    .btn {
        padding: 10px 12px;
    }


    .revealed-word-box {
        font-size: 1.5rem;
        letter-spacing: 2px;
    }

    .mini-tile {
        width: clamp(13px, 3.8vw, 17px);
        height: clamp(13px, 3.8vw, 17px);
    }
    .mini-row {
        gap: 3px;
    }
    .mini-grid {
        gap: 3px;
    }
    .opponent-card {
        padding: 7px 10px;
        gap: 5px;
    }
}

@media (max-width: 360px) {
    .lobby-card {
        padding: 12px 6px;
        gap: 10px;
    }

    .lobby-mode-box, .lobby-players-box {
        padding: 8px 6px;
        gap: 6px;
    }

    .mode-pill {
        font-size: 0.62rem;
        padding: 6px 2px;
    }

    .player-card-chip {
        padding: 4px 6px;
    }

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

    /* Ultra-small screens How-To Modal fine-tuning */
    .global-how-to-box {
        padding: 14px 10px !important;
        border-radius: 12px !important;
    }

    .global-how-to-close {
        top: 6px !important;
        right: 8px !important;
        font-size: 1.4rem !important;
    }

    .global-how-to-title {
        font-size: 1.05rem !important;
        padding: 0 24px !important;
    }

    .rules-section {
        padding: 8px 10px !important;
    }

    .example-box {
        padding: 6px 8px !important;
    }

    .example-row .tile {
        width: 24px !important;
        height: 24px !important;
        font-size: 0.78rem !important;
    }

    /* Ultra-small screens Opponents Modal scaling (no scrolling needed) */
    .sidebar-modal-content {
        padding: 10px 8px !important;
        width: min(96%, 310px) !important;
        gap: 6px !important;
    }

    .opponents-container {
        gap: 6px !important;
    }

    .opponent-card {
        padding: 5px 8px !important;
        gap: 4px !important;
        min-height: 70px !important;
    }

    .opponent-header {
        font-size: 0.7rem !important;
    }

    .opponent-status-badge {
        font-size: 0.62rem !important;
        padding: 1px 4px !important;
    }

    .mini-tile {
        width: 12px !important;
        height: 12px !important;
        border-radius: 2px !important;
        border-width: 1px !important;
    }

    .mini-row {
        gap: 2px !important;
    }

    .mini-grid {
        gap: 2px !important;
    }
}

/* KISA DİKEY EKRANLI MOBİLLER İÇİN (Low-height screens e.g. <= 650px) */
@media (max-height: 650px) and (max-width: 899px) {
    .sidebar-modal-content {
        padding: 8px 10px !important;
        gap: 6px !important;
        max-height: 92vh !important;
    }

    .opponents-container {
        gap: 6px !important;
    }

    .opponent-card {
        padding: 5px 8px !important;
        gap: 4px !important;
        min-height: 68px !important;
    }

    .mini-tile {
        width: clamp(11px, 2.3vh, 14px) !important;
        height: clamp(11px, 2.3vh, 14px) !important;
        border-radius: 2px !important;
        border-width: 1px !important;
    }

    .mini-row, .mini-grid {
        gap: 2px !important;
    }
}

/* ── 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: 550px),
       (hover: none) and (orientation: landscape) and (max-height: 550px) {
  #landscape-blocker {
    display: flex !important;
    position: fixed;
    inset: 0;
    width: 100vw;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background: rgba(13, 3, 23, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 99999999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
  }
  #landscape-blocker .rotate-icon {
    font-size: clamp(2.8rem, 8vw, 3.8rem);
    color: #a855f7;
    margin-bottom: 14px;
    animation: rotatePhone 2s infinite ease-in-out;
  }
  #landscape-blocker h2 {
    font-family: var(--font-heading);
    font-size: clamp(1.2rem, 4vw, 1.5rem);
    color: #fcd34d;
    margin-bottom: 6px;
    font-weight: 900;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  }
  #landscape-blocker p {
    font-size: clamp(0.85rem, 2.5vw, 0.98rem);
    color: #cbd5e1;
    margin: 0;
    line-height: 1.5;
    max-width: 420px;
  }
}

#landscape-blocker.force-show {
  display: flex !important;
  position: fixed;
  inset: 0;
  width: 100vw;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  background: rgba(13, 3, 23, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 99999999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  text-align: center;
  padding: 20px;
  box-sizing: border-box;
}

#landscape-blocker.force-show .rotate-icon {
  font-size: clamp(2.8rem, 8vw, 3.8rem);
  color: #a855f7;
  margin-bottom: 14px;
  animation: rotatePhone 2s infinite ease-in-out;
}

#landscape-blocker.force-show h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.2rem, 4vw, 1.5rem);
  color: #fcd34d;
  margin-bottom: 6px;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

#landscape-blocker.force-show p {
  font-size: clamp(0.85rem, 2.5vw, 0.98rem);
  color: #cbd5e1;
  margin: 0;
  line-height: 1.5;
  max-width: 420px;
}

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



