/* ============================================
   101 Okey - Ultra Premium Design
   ============================================ */

:root {
    /* Masa Renkleri */
    --table-bg: #2c5e4f;
    /* Klasik Okey Yeşili */
    --table-gradient: radial-gradient(circle at center, #3a7d68 0%, #1e4539 100%);

    /* Istaka Ahşap Tonları */
    --wood-dark: #3e2723;
    --wood-light: #5d4037;
    --wood-border: #281a16;

    /* UI Renkleri */
    --ui-glass: rgba(0, 0, 0, 0.6);
    --ui-border: rgba(255, 255, 255, 0.15);
    --text-primary: #ffffff;
    --text-secondary: #d1d5db;

    /* Vurgu Renkleri */
    --accent: #fbbf24;
    /* Altın */
    --danger: #ef4444;
    --success: #10b981;

    /* Taş Boyutları (Sabit - Pixel Perfect için) */
    --tile-width: 70px;
    --tile-height: 100px;

    /* Responsive Scale Factors */
    --scale-desktop: 0.85;
    /* Taşlar büyüdüğü için biraz küçült */
    --scale-laptop: 0.75;
    --scale-mobile: 0.45;

    /* Istaka Boyutları - 2 satır taş için yeterli */
    --cue-height: 180px;
    --cue-depth: 20px;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
}
.hidden {
    display: none !important;
}

html, body {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
html::-webkit-scrollbar, body::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

body {
    font-family: 'Plus Jakarta Sans', 'Outfit', sans-serif;
    color: var(--text-primary);
    min-height: 100vh;
    background: #080808;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Site Navigation Header */
.site-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 24px;
    background: rgba(8, 8, 8, 0.9);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    position: relative;
    top: 0;
    z-index: 1500;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 28px;
}

.brand {
    font-size: 16px;
    font-weight: 800;
    color: #ffffff;
    text-decoration: none;
    letter-spacing: -0.6px;
}

.top-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-link {
    color: #888888;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link:hover, .nav-link.active {
    color: #ffffff;
}

.badge-v2 {
    background: #22c55e;
    color: #000000;
    font-size: 9px;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 4px;
    text-transform: uppercase;
}

.header-home-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 14px;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s;
}
.header-home-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* App Viewport & Responsive Proportions */
.app-viewport {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.container {
    width: 100%;
    max-width: 560px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    z-index: 10;
}

.header-title-box {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.8px;
    color: #ffffff;
}

.logo-icon { font-size: 36px; }
.logo-text {
    background: linear-gradient(135deg, #ffffff 40%, #a1a1aa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tagline {
    font-size: 14px;
    color: #888888;
    font-weight: 500;
}

/* Card */
.card {
    background: #141414;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 28px;
    padding: 32px;
    width: 100%;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65);
    display: flex;
    flex-direction: column;
    gap: 18px;
    animation: cardIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.card-head-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card h2 {
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.4px;
}

.badge-pill {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 8px;
}

.welcome-text {
    font-size: 13px;
    color: #888888;
    margin-top: -10px;
}

.name-input-container { width: 100%; }
.input-label {
    font-size: 11px;
    font-weight: 700;
    color: #888888;
    margin-bottom: 5px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.name-input {
    width: 100%;
    background: #1c1c1c;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    padding: 14px 18px;
    border-radius: 14px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s;

    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s;
}
.name-input:focus {
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.section-label {
    font-size: 12px;
    font-weight: 700;
    color: #a1a1aa;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Avatars */
.avatar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    width: 100%;
}

.avatar-option {
    aspect-ratio: 1;
    border-radius: 16px;
    background: #181818;
    border: 2px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
}

.avatar-option:hover {
    transform: translateY(-3px) scale(1.05);
    border-color: rgba(255, 255, 255, 0.3);
}

.avatar-option.selected {
    border-color: #22c55e;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.4);
    transform: scale(1.04);
}

/* Istaka */
.istaka-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
}

.istaka-option {
    height: 54px;
    border-radius: 14px;
    border: 2px solid rgba(255, 255, 255, 0.08);
    background: #181818;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.istaka-option img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.85;
}

.istaka-label {
    position: relative;
    z-index: 2;
    font-size: 12px;
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
    background: rgba(0, 0, 0, 0.4);
    padding: 3px 10px;
    border-radius: 6px;
}

.istaka-option.selected {
    border-color: #22c55e;
    box-shadow: 0 0 18px rgba(34, 197, 94, 0.35);
}

/* Toggles */
.team-mode-toggle {
    background: #181818;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toggle-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    width: 100%;
}

.toggle-label input { display: none; }

.toggle-text {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    order: 1;
}

.toggle-slider {
    width: 44px;
    height: 24px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 100px;
    position: relative;
    transition: background 0.25s;
    order: 2;
    flex-shrink: 0;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    top: 3px;
    left: 3px;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.toggle-label input:checked + .toggle-slider {
    background: #22c55e;
}

.toggle-label input:checked + .toggle-slider::after {
    transform: translateX(20px);
}

.toggle-info {
    font-size: 11px;
    color: #71717a;
}

/* Button */
.btn-primary.btn-large {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #ffffff;
    font-size: 15px;
    font-weight: 800;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.35);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    margin-top: 6px;
}

.btn-primary.btn-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(34, 197, 94, 0.5);
}

.btn-primary.btn-large:active {
    transform: translateY(0);
}

/* Room List & Lobby Items */
.rooms-list-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-height: 240px;
    overflow-y: auto;
}

.room-item-card {
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.room-item-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: #202020;
}

.room-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.room-item-icon {
    font-size: 24px;
}

.room-item-name {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
}

.room-item-details {
    font-size: 11px;
    color: #888888;
    margin-top: 2px;
}

.room-item-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.room-item-badge {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    font-size: 12px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
}

.room-join-btn {
    background: #22c55e;
    color: #000000;
    font-size: 12px;
    font-weight: 800;
    border: none;
    border-radius: 8px;
    padding: 6px 14px;
    cursor: pointer;
    transition: transform 0.15s, background 0.15s;
}

.room-join-btn:hover {
    background: #16a34a;
    transform: scale(1.05);
}

/* Modals */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px;
}

.modal.hidden {
    display: none !important;
}

/* Toast Bildirim (Modern Floating Pill) */
.toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.94);
    color: #f8fafc;
    padding: 10px 24px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 9999;
    border: 1px solid rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55), 0 0 1px rgba(255, 255, 255, 0.4);
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: -0.2px;
    cursor: pointer;
    max-width: 90vw;
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    animation: toastSlideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toastSlideDown {
    from {
        opacity: 0;
        transform: translate(-50%, -14px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0) scale(1);
    }
}

.toast.hidden {
    display: none !important;
    opacity: 0;
    pointer-events: none;
}

/* Arka Plan Animasyonu (Opsiyonel, masa dışında kalabilir) */
.background-animation {
    display: none;
    /* Masaya odaklanmak için kapattık */
}

/* ============================================
   Masa Düzeni (Game Board)
   ============================================ */

.game-board {
    width: 100vw;
    height: 100vh;
    background: var(--table-gradient);
    position: relative;
    box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.8);
    /* Vignette etkisi */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Masa Dokusu (Felt Texture) */
.game-board::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='4' height='4' viewBox='0 0 4 4' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 3h1v1H1V3zm2-2h1v1H3V1z' fill='%23ffffff' fill-opacity='0.03' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.5;
    pointer-events: none;
}

/* ============================================
   Orta Alan (Masa Merkezi)
   ============================================ */

.table-center {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 960px;
    max-width: 90vw;
    height: 480px;
    max-height: 56vh;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    pointer-events: none;
    /* Masadaki boşluklar tıklamayı engellemesin */
}

.center-content {
    pointer-events: auto;
    /* İçerik tıklanabilir olsun */
    display: flex;
    gap: 28px;
    align-items: center;
    z-index: 8;
    transform: scale(0.92);
}

/* Alan Etiketleri */
.area-label {
    display: block;
    text-align: center;
    margin-top: 10px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Yığın (Draw Pile) */
.pile-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pile-stack {
    position: relative;
    width: var(--tile-width);
    height: var(--tile-height);
    cursor: pointer;
    transition: transform 0.2s;
}

.pile-stack:hover {
    transform: translateY(-5px);
}

.pile-tile-back {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    border: 1px solid #94a3b8;
    border-radius: 6px;
    box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.3);
}

/* Yığın görünümü (Stack effect) */
.pile-tile-back:nth-child(1) {
    top: -6px;
    left: -1px;
    z-index: 3;
}

.pile-tile-back:nth-child(2) {
    top: -3px;
    left: 0px;
    z-index: 2;
}

.pile-tile-back:nth-child(3) {
    top: 0px;
    left: 1px;
    z-index: 1;
}

.pile-count-badge {
    position: absolute;
    top: -15px;
    right: -15px;
    background: var(--accent);
    color: #000;
    font-weight: bold;
    font-size: 0.8rem;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* Gösterge ve Okey */
/* Gösterge ve Okey Alanı (Revize Edilmiş Premium Stil) */
.indicator-section {
    display: flex;
    gap: 30px;
    background: rgba(255, 255, 255, 0.03);
    padding: 20px 30px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.4),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    /* Inner border */
    backdrop-filter: blur(8px);
    position: relative;
    transition: transform 0.3s;
}

.indicator-section:hover {
    transform: scale(1.02);
    background: rgba(255, 255, 255, 0.05);
}

/* Altın Parlama Efekti */
.indicator-section::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 15px;
    background: radial-gradient(ellipse at center, rgba(251, 191, 36, 0.2) 0%, transparent 70%);
    filter: blur(15px);
    pointer-events: none;
}

/* === Parçacık Efekti (Floating Particles) === */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* KRİTİK: Tıklamaları engellememeli */
    z-index: 1;
}

.particle {
    position: absolute;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    animation: float 20s infinite linear;
}

@keyframes float {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    80% {
        opacity: 1;
    }

    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Okey Taşı Özel Vurgusu */
#okeyTile .tile-sprite,
#okeyTile .tile-placeholder {
    box-shadow:
        0 0 20px rgba(251, 191, 36, 0.3),
        inset 0 0 10px rgba(255, 255, 0, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.6);
}

/* === UI KATMANI (HUD) === */
.ui-layer {
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    height: auto;
    pointer-events: none;
    z-index: 2500;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    box-sizing: border-box;
}

.ui-layer button,
.ui-layer .glass-panel,
.ui-layer .game-status-panel,
.ui-layer > div,
#inGameLeaveBtn,
#okeyChatToggleBtn,
#leaveGameBtn {
    pointer-events: auto !important;
    cursor: pointer !important;
    position: relative;
    z-index: 2600 !important;
}

/* ============================================
   🀄 GERÇEK KLASİK OKEY 3D TAŞ TASARIMI (101 Okey)
   ============================================ */
.okey-tile {
    width: 34px;
    height: 48px;
    background: linear-gradient(160deg, #fffdf8 0%, #f0e9dc 70%, #e0d5c4 100%);
    border-radius: 7px;
    box-shadow: -1px 2px 3px rgba(0,0,0,0.25), inset 1px 1px 2px rgba(255,255,255,0.9), 0 5px 0 #b8a898, 0 5px 5px rgba(0,0,0,0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 900;
    font-size: 17px;
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
    position: relative;
    box-sizing: border-box;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.okey-tile.tile-kirmizi,
.okey-tile.tile-red {
    color: #b91c1c;
    text-shadow: 0 1px 0 rgba(255,255,255,0.5);
}

.okey-tile.tile-mavi,
.okey-tile.tile-blue {
    color: #1d4ed8;
    text-shadow: 0 1px 0 rgba(255,255,255,0.5);
}

.okey-tile.tile-siyah,
.okey-tile.tile-black {
    color: #111827;
    text-shadow: 0 1px 0 rgba(255,255,255,0.3);
}

.okey-tile.tile-sari,
.okey-tile.tile-yellow {
    color: #eab308 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7), 0 0 1px #a16207 !important;
    -webkit-text-stroke: 0.6px #713f12;
    font-weight: 900;
}

.okey-tile.tile-joker {
    background: linear-gradient(135deg, #fbbf24, #f59e0b, #d97706);
    color: #7c2d12;
    font-size: 14px;
    font-weight: 900;
    box-shadow: -1px 2px 3px rgba(0,0,0,0.3), inset 1px 1px 2px rgba(255,255,255,0.6), 0 5px 0 #92400e, 0 5px 5px rgba(0,0,0,0.3);
}

.okey-tile.is-okey-tile {
    box-shadow: 0 0 12px rgba(234, 179, 8, 0.9), inset 0 0 4px rgba(234, 179, 8, 0.7), 0 5px 0 #b8a898 !important;
    border: 2px solid #eab308 !important;
}

.okey-tile.is-okey-tile::after {
    content: '★';
    position: absolute;
    top: 2px;
    right: 3px;
    font-size: 11px;
    color: #eab308;
    text-shadow: 0 1px 2px #000;
}

/* Atık alanlarında gerçek taş gösterimi */
.player-discard .discard-tiles.has-tile::before,
.player-discard .discard-tiles:has(.okey-tile)::before {
    display: none !important;
}

.opponent-discard-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: absolute;
    z-index: 25;
}

.opponent-area.right .opponent-discard-box {
    top: 50%;
    left: -70px;
    transform: translateY(-50%);
}

.opponent-area.top .opponent-discard-box {
    bottom: -68px;
    left: 50%;
    transform: translateX(-50%);
}

.opponent-discard-box .discard-tiles {
    width: 44px;
    height: 60px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-tile-count {
    display: inline-block;
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: 4px;
    padding: 1px 6px;
    margin-top: 2px;
    letter-spacing: 0.5px;
}


/* Cam Paneller (Glassmorphism) */
.glass-panel {
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 16px 20px;
    color: #fff;
    pointer-events: auto;
    /* Panel içi tıklanabilsin */
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

.glass-panel:hover {
    background: rgba(15, 23, 42, 0.8);
    transform: translateY(2px);
    border-color: rgba(255, 255, 255, 0.2);
}

/* İstatistik Paneli (Ceza Tablosu) - Orantılı & Kompakt */
.stats-panel {
    width: 165px;
    min-width: 150px;
    padding: 8px 10px;
    border-radius: 10px;
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding-bottom: 6px;
    margin-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stats-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    padding: 2px 4px;
    border-radius: 4px;
}

.stat-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

.stat-score {
    font-weight: 700;
    color: var(--accent);
    font-family: monospace;
    /* Sayılar hizalı olsun */
    font-size: 0.85rem;
}

/* Sağ Üst Durum Paneli (Sıra & Tur Tablosu) - Orantılı & Kompakt */
.game-status-panel {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 5px 12px;
    border-radius: 10px;
}

.status-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 44px;
}

.status-item .label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 2px;
}

.status-item .value {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.divider {
    width: 1px;
    height: 24px;
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.2), transparent);
}


.indicator-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.slot-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.tile-placeholder {
    width: var(--tile-width);
    height: var(--tile-height);
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Atılan Taşlar */
.discard-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.discard-stack {
    width: var(--tile-width);
    height: var(--tile-height);
    position: relative;
    cursor: pointer;
}

.discard-placeholder {
    width: 100%;
    height: 100%;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.3);
}

/* ============================================
   Açık Taşlar Masası (Opened Tiles Table)
   ============================================ */

.opened-tiles-table {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 22;
}

.opened-player-area {
    position: absolute;
    display: flex;
    gap: 8px;
    padding: 6px;
    pointer-events: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.opened-player-area::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

.opened-player-area::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 4px;
}

.opened-player-area.top {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 82%;
    max-width: 760px;
    max-height: 125px;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 25;
}

.opened-player-area.bottom {
    bottom: 35px;
    left: 50%;
    transform: translateX(-50%);
    width: 88%;
    max-width: 860px;
    min-height: 48px;
    max-height: 125px;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    overflow-x: hidden;
    background: rgba(15, 23, 42, 0.75);
    border: 1.5px solid rgba(56, 189, 248, 0.5);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), inset 0 0 10px rgba(56, 189, 248, 0.1);
    border-radius: 12px;
    padding: 6px 12px;
    z-index: 2100;
    pointer-events: auto !important;
}

.opened-player-area.bottom:empty {
    display: none !important;
}

.opened-player-area.left {
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    max-height: 360px;
    max-width: 240px;
    flex-direction: column;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    overflow-y: auto;
    overflow-x: hidden;
}

.opened-player-area.right {
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    max-height: 360px;
    max-width: 240px;
    flex-direction: column;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-end;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Açık Grup Stili */
.opened-group {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px 5px;
    background: rgba(15, 23, 42, 0.88);
    border-radius: 6px;
    border: 1.5px solid rgba(16, 185, 129, 0.65);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
    position: relative;
    backdrop-filter: blur(4px);
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
    user-select: none;
    -webkit-user-drag: none;
}

.opened-group.pairs {
    border-color: rgba(139, 92, 246, 0.7);
    gap: 6px;
}

.opened-group .mini-tile {
    width: 26px;
    height: 38px;
    background: linear-gradient(180deg, #fdfbf7 0%, #fae8c8 25%, #ebd5aa 70%, #d5be91 100%);
    border: 1px solid #c2a773;
    border-bottom: 2.5px solid #8e6c38;
    border-right: 1.5px solid #a38148;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 0.8rem;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.35);
    user-select: none;
    -webkit-user-drag: none;
}

.opened-group .mini-tile .mini-tile-inner {
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
    user-select: none;
}

.opened-group .mini-tile .mini-tile-inner.kirmizi { color: #dc2626; text-shadow: 0 1px 1px rgba(0,0,0,0.15); }
.opened-group .mini-tile .mini-tile-inner.sari { color: #d97706; text-shadow: 0 1px 1px rgba(0,0,0,0.15); }
.opened-group .mini-tile .mini-tile-inner.mavi { color: #2563eb; text-shadow: 0 1px 1px rgba(0,0,0,0.15); }
.opened-group .mini-tile .mini-tile-inner.siyah { color: #1e293b; text-shadow: 0 1px 1px rgba(0,0,0,0.15); }
.opened-group .mini-tile .mini-tile-inner.is-okey-tile {
    color: #f59e0b;
    text-shadow: 0 0 6px rgba(245, 158, 11, 0.7);
    font-weight: 900;
}
.opened-group .mini-tile .mini-tile-inner.is-fake-okey {
    color: #a855f7;
    text-shadow: 0 0 4px rgba(168, 85, 247, 0.6);
    font-weight: 900;
}
.opened-group .mini-tile.has-okey {
    border: 2px solid #f59e0b !important;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.8) !important;
    animation: okeyPulse 2s infinite ease-in-out;
}
@keyframes okeyPulse {
    0%, 100% { box-shadow: 0 0 6px rgba(245, 158, 11, 0.6); }
    50% { box-shadow: 0 0 12px rgba(245, 158, 11, 0.95); }
}

/* Drop Zone (taş ekleme alanı) */
.opened-group .drop-zone {
    width: 20px;
    height: 36px;
    border: 2px dashed rgba(255, 255, 255, 0.35);
    border-radius: 4px;
    opacity: 0.35;
    transition: all 0.2s ease;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-user-drag: none;
}

.opened-group .drop-zone::after {
    content: '+';
    font-size: 12px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.6);
}

.opened-group .drop-zone.eligible {
    opacity: 1 !important;
    border: 2px solid #38bdf8 !important;
    background: rgba(56, 189, 248, 0.4) !important;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.7) !important;
    cursor: pointer !important;
}

.opened-group .drop-zone.eligible::after {
    color: #ffffff !important;
    font-size: 14px !important;
    font-weight: 900 !important;
}

.opened-group:hover .drop-zone,
.opened-group.drag-over .drop-zone {
    opacity: 1;
    border-color: #34d399;
    background: rgba(52, 211, 153, 0.3);
}

.opened-group.drag-over {
    border-color: #10b981;
    box-shadow: 0 0 18px rgba(16, 185, 129, 0.7);
    transform: scale(1.02);
}

.opened-group.can-accept-tile {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.6) !important;
    cursor: pointer !important;
    animation: canAcceptPulse 1.5s infinite alternate ease-in-out;
}

@keyframes canAcceptPulse {
    0% { transform: scale(1); box-shadow: 0 0 10px rgba(56, 189, 248, 0.4); }
    100% { transform: scale(1.02); box-shadow: 0 0 20px rgba(56, 189, 248, 0.8); }
}

.opened-player-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(56, 189, 248, 0.5);
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 4px;
    backdrop-filter: blur(6px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    width: 100%;
}

.opened-player-badge .badge-icon {
    font-size: 0.85rem;
}

.opened-player-badge .badge-count {
    color: #38bdf8;
    font-weight: 800;
}

.opened-player-badge.is-self {
    background: rgba(16, 185, 129, 0.85);
    border-color: #34d399;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.opened-group.can-accept-tile {
    border-color: #10b981 !important;
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.7) !important;
    animation: pulseLayoffGroup 1.3s infinite ease-in-out;
    cursor: pointer;
}

@keyframes pulseLayoffGroup {
    0%, 100% { border-color: rgba(16, 185, 129, 0.8); box-shadow: 0 0 8px rgba(16, 185, 129, 0.5); }
    50% { border-color: rgba(52, 211, 153, 1); box-shadow: 0 0 20px rgba(52, 211, 153, 0.85); transform: translateY(-1px); }
}

.opened-group .drop-zone.eligible {
    opacity: 1 !important;
    border-color: #10b981 !important;
    background: rgba(16, 185, 129, 0.25) !important;
    cursor: pointer;
    min-width: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.opened-group .drop-zone .zone-plus {
    color: #34d399;
    font-weight: 900;
    font-size: 1rem;
    line-height: 1;
    pointer-events: none;
}

/* ============================================
   Oyuncu Alanları (Player Areas)
   ============================================ */

.opponent-area {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    z-index: 5;
}

/* Puan kartı ve Avatar */
.player-info {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--ui-glass);
    padding: 8px 16px;
    border-radius: 50px;
    border: 1px solid var(--ui-border);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.player-info.current-turn {
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.3);
    transform: scale(1.05);
}

.avatar-wrapper {
    position: relative;
    width: 40px;
    height: 40px;
}

.player-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #fff;
    object-fit: cover;
}

.turn-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50%;
    border: 2px solid #1f2937;
    display: none;
}

.player-info.current-turn .turn-badge {
    display: block;
}

.player-details {
    display: flex;
    flex-direction: column;
}

.player-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
}

.player-score {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Kapalı Eller (Opponent Hands) */
.opponent-hand {
    display: flex;
    gap: 2px;
}

.opponent-tile-back {
    width: 24px;
    height: 34px;
    background: #e2e8f0;
    border: 1px solid #94a3b8;
    border-radius: 4px;
    box-shadow: -1px 1px 2px rgba(0, 0, 0, 0.3);
    display: block !important;
    z-index: 10;
    opacity: 1 !important;
}

/* Konumlandırmalar */

/* TOP */
.opponent-area.top {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    flex-direction: column-reverse;
    /* El masaya yakın olsun */
}

/* LEFT */
.opponent-area.left {
    left: 20px;
    top: 45%;
    transform: translateY(-50%);
    flex-direction: row-reverse;
}

.opponent-hand.vertical {
    flex-direction: column;
}

.opponent-tile-back.vertical {
    width: 34px;
    height: 24px;
}

/* RIGHT */
.opponent-area.right {
    right: 20px;
    top: 45%;
    transform: translateY(-50%);
    flex-direction: row;
}

/* BOTTOM (Kullanıcı) */
.player-area.bottom {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    justify-content: center;
    gap: 15px;
    z-index: 20;
    padding: 0 20px;
}

/* Oyuncu Atık Alanları */
.player-discard {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    min-width: 80px;
    max-width: 120px;
}

.discard-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.discard-tiles {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    min-height: 80px;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.left-discard .discard-tiles {
    border-color: rgba(16, 185, 129, 0.4);
    cursor: pointer;
}

.left-discard .discard-tiles:hover {
    border-color: rgba(16, 185, 129, 0.8);
    background: rgba(16, 185, 129, 0.1);
}

.right-discard .discard-tiles {
    border-color: rgba(239, 68, 68, 0.4);
}

/* Atık alandaki mini taşlar */
.discard-tiles .mini-tile {
    width: 35px;
    height: 50px;
    transform: scale(0.5);
    transform-origin: center;
    margin: -12px 0;
}

.player-info.self {
    position: absolute;
    bottom: 195px;
    right: 20px;
    transform: none;
    background: rgba(0, 0, 0, 0.8);
}

/* ============================================
   Istaka (CUE)
   ============================================ */

.cue-container {
    width: 100%;
    max-width: 1050px;
    min-height: auto;
    position: relative;
}

.cue-wood {
    width: 100%;
    height: auto;
    min-height: 172px;
    background-image: url('../asset/istaka.jpg');
    background-size: cover;
    background-position: center;
    border-radius: 12px 12px 0 0;
    box-shadow:
        0 -5px 18px rgba(0, 0, 0, 0.6),
        inset 0 2px 4px rgba(255, 255, 255, 0.15),
        0 8px 24px rgba(0, 0, 0, 0.5);
    border-top: 2px solid rgba(255, 255, 255, 0.15);
    border-bottom: 6px solid #16181b;
    position: relative;
    padding: 8px 16px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 6px;
}

/* Istaka Rafları */
.cue-row {
    position: relative;
    min-height: 75px;
    display: flex;
    align-items: flex-end;
    gap: 3px;
    padding-left: 8px;
    padding-right: 8px;
    padding-bottom: 8px;
    /* Raf derinliği çizgisi */
    border-bottom: 3px solid rgba(0, 0, 0, 0.25);
    pointer-events: auto !important;
    z-index: 900 !important;
}

.cue-row.top-row {
    margin-bottom: 10px;
}

.cue-row.bottom-row {
    border-bottom: none;
}

/* ============================================
   Taş (Tile) Stilleri
   ============================================ */

.tile-sprite {
    width: 50px;
    height: 70px;
    background-image: url('../asset/Taslar.png');
    background-size: 650px 350px;
    border-radius: 3px;
    position: relative;
    flex-shrink: 0;
    cursor: grab;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    /* Taşın 3D görünümü */
    box-shadow:
        1px 1px 0px #bbb,
        2px 2px 0px #999,
        2px 2px 4px rgba(0, 0, 0, 0.4);
    /* Hafif dikey eğim - İPTAL */
    /* transform: rotateX(-5deg); */
    transform-origin: bottom center;

    /* Kritik Düzeltmeler - Tıklama ve Sürükleme İçin */
    pointer-events: auto !important;
    z-index: 1000 !important;
    /* UI layer (90) üzerinde olmalı */
    touch-action: none;
    /* Mobilde sayfa kaydırmayı engelle */
    user-select: none;
    -webkit-user-drag: none;
}

.tile-sprite:hover {
    transform: rotateX(-5deg) translateY(-5px);
    z-index: 10;
}

.tile-sprite.dragging {
    opacity: 0.8;
    cursor: grabbing;
    z-index: 100;
    transform: scale(1.1);
}

.tile-sprite.selected {
    transform: rotateX(-5deg) translateY(-10px);
    box-shadow:
        0 0 10px var(--accent),
        0 0 20px rgba(251, 191, 36, 0.4),
        1px 1px 0px #bbb;
    border: 2px solid var(--accent);
}

.mini-tile-inner {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 1.2rem;
    background: #fff;
    border-radius: 4px;
}

.mini-tile-inner.kirmizi {
    color: #d32f2f;
}

.mini-tile-inner.sari,
.mini-tile-inner.yesil {
    color: #eab308 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7), 0 0 1px #a16207 !important;
    font-weight: 900;
}

.mini-tile-inner.mavi {
    color: #1976d2;
}

.mini-tile-inner.siyah {
    color: #212121;
}

.tile-sprite.okey {
    box-shadow:
        0 0 0 2px #f59e0b,
        0 0 12px rgba(245, 158, 11, 0.7),
        2px 2px 4px rgba(0, 0, 0, 0.5) !important;
}

.tile-sprite.okey::after {
    content: '★';
    position: absolute;
    top: 1px;
    right: 2px;
    color: #fbbf24;
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 0 4px rgba(245, 158, 11, 0.8);
    z-index: 10;
    pointer-events: none;
}

.tile-sprite.is-sahte-okey {
    /* Sahte okey doğrudan orijinal yıldızlı taş grafiğiyle gösterilir, altında etiket olmaz */
}

.okey::after {
    content: '★';
    position: absolute;
    top: 1px;
    right: 2px;
    color: #fbbf24;
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 0 4px rgba(245, 158, 11, 0.8);
    z-index: 10;
    pointer-events: none;
}

/* ============================================
   Aksiyon Butonları
   ============================================ */

/* Aksiyon Butonları (Istaka Üstünde Merkezi HUD) */
.action-buttons {
    position: absolute;
    bottom: 198px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    z-index: 2200;
    pointer-events: auto !important;
}

/* Mobilde Aksiyon Butonları */
@media (max-width: 768px) {
    .action-buttons {
        bottom: 145px;
        transform: translateX(-50%) scale(0.85);
        gap: 6px;
    }
}


.action-btn {
    width: auto;
    min-height: 38px;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: white;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    user-select: none;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
    border-color: rgba(255, 255, 255, 0.35);
}

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

/* Specific variants for 101 Okey HUD */
.action-btn.hud-sort {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.85), rgba(109, 40, 217, 0.9));
    border-color: rgba(196, 181, 253, 0.4);
}
.action-btn.hud-sort:hover {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    box-shadow: 0 0 16px rgba(139, 92, 246, 0.6);
}

.action-btn.hud-discard {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.85), rgba(29, 78, 216, 0.9));
    border-color: rgba(147, 197, 253, 0.4);
}
.action-btn.hud-discard:hover {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.6);
}

.action-btn.hud-open {
    background: rgba(255, 255, 255, 0.08);
    color: #94a3af;
    border-color: rgba(255, 255, 255, 0.15);
}
.action-btn.hud-open.ready {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.9), rgba(5, 150, 105, 0.95)) !important;
    color: #fff !important;
    border-color: rgba(110, 231, 183, 0.5) !important;
    box-shadow: 0 0 18px rgba(16, 185, 129, 0.55) !important;
}
.action-btn.hud-open.opened {
    background: rgba(16, 185, 129, 0.25) !important;
    color: #34d399 !important;
    border-color: rgba(52, 211, 153, 0.4) !important;
}

.action-btn.hud-return {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    color: #fff !important;
    border-color: #fbbf24 !important;
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.5) !important;
    animation: pulse-hud-return 1.8s infinite;
}
.action-btn.hud-return:hover {
    background: linear-gradient(135deg, #fbbf24, #f59e0b) !important;
    box-shadow: 0 0 22px rgba(245, 158, 11, 0.8) !important;
    transform: translateY(-2px) scale(1.05);
}
@keyframes pulse-hud-return {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.6); }
    50% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
}

.action-btn.hud-finish {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    border-color: rgba(254, 202, 202, 0.4);
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.4);
}
.action-btn.hud-finish:not(:disabled):hover {
    background: linear-gradient(135deg, #f87171, #ef4444);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.7);
}
.action-btn.hud-finish:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Modallar */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: #1e293b;
    padding: 30px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 800px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    color: white;
}

.modal.hidden {
    display: none;
}

/* ====== OYUN SONU EL GÖSTERİMİ ====== */
.end-hands-section {
    margin-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 16px;
}

.end-hands-title {
    font-size: 14px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 14px;
    text-align: center;
}

.end-hand-player {
    background: rgba(0,0,0,0.25);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 12px;
    border: 1px solid rgba(255,255,255,0.07);
    transition: border-color 0.2s;
}

.end-hand-player.end-hand-winner {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.5);
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.15);
}

.end-hand-player-name {
    font-size: 13px;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.winner-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #1a1a1a;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.opened-badge {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.not-opened-badge {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.end-hand-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    min-height: 50px;
    align-items: center;
}

.end-hand-tile-sprite {
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
    transform: scale(0.85);
    transform-origin: top left;
    margin-right: -8px;
}

.end-hand-player.end-hand-winner .end-hand-tile-sprite {
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

/* El Açma Modalı - Özel Stiller */
.open-hand-modal {
    max-width: 900px !important;
    width: 95% !important;
    max-height: 90vh;
    overflow-y: auto;
}

.open-hand-info {
    color: #9ca3af;
    margin-bottom: 15px;
}

.open-hand-score {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
}

.score-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    margin-top: 10px;
    overflow: hidden;
}

.score-progress {
    height: 100%;
    background: linear-gradient(90deg, #ef4444, #fbbf24, #10b981);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.open-hand-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    margin-bottom: 20px;
    max-height: 300px;
    overflow-y: auto;
}

/* Modal içindeki taşlar - scale ile küçült (sprite pozisyonlarını korur) */
.open-hand-tiles .tile-sprite {
    transform: scale(0.6);
    transform-origin: top left;
    margin-right: -28px;
    /* 70px * 0.4 = 28px overlap düzeltmesi */
    margin-bottom: -40px;
    /* 100px * 0.4 = 40px overlap düzeltmesi */
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.open-hand-tiles .tile-sprite:hover {
    transform: scale(0.65);
    z-index: 10;
}

.open-hand-tiles .tile-sprite.selected-for-group {
    border: 2px solid #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.open-hand-tiles .tile-sprite.used {
    opacity: 0.3;
    pointer-events: none;
}

.selected-groups-display {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    justify-content: center;
}

/* Seçilen grup (yatay dizilim) */
.selected-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 3px;
    padding: 8px 12px;
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid #10b981;
    border-radius: 8px;
    position: relative;
}

.selected-group .mini-tile {
    width: 30px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.selected-group .group-score {
    background: #10b981;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-left: 5px;
}

.selected-group .remove-group {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: #ef4444;
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.group-display {
    display: flex;
    gap: 3px;
    padding: 10px;
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid #10b981;
    border-radius: 8px;
    position: relative;
}

.group-display .remove-group {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: #ef4444;
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.open-hand-instructions {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #93c5fd;
}

.open-hand-instructions p {
    margin: 5px 0;
}

.open-hand-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Modern Kompakt 2-Kolonlu Lobi Stilleri */
.container.lobby-dashboard {
    max-width: 960px;
    height: auto;
    min-height: 100vh;
    padding: 18px 20px 40px;
    display: flex;
    flex-direction: column;
}

.badge-v2-pill {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: #a5b4fc;
    font-size: 11.5px;
    font-weight: 800;
    border-radius: 9999px;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.header-title-box {
    text-align: center;
    margin-bottom: 20px;
}

.header-title-box .logo {
    font-size: 2.6rem;
    margin-bottom: 2px;
}

.header-title-box .tagline {
    font-size: 0.95rem;
    margin-top: 4px;
    color: #94a3b8;
}

.lobby-columns-grid {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 18px;
    width: 100%;
    align-items: start;
}

.compact-card {
    padding: 20px 22px;
    border-radius: 20px;
    text-align: left;
}

.compact-card h2 {
    font-size: 1.25rem;
    margin: 0;
}

.card-head-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.badge-pill {
    padding: 3px 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
}

.name-input.compact {
    padding: 11px 16px;
    font-size: 0.95rem;
    text-align: left;
}

.avatar-grid.compact {
    gap: 10px;
    margin-bottom: 14px;
}

.istaka-grid.compact {
    margin-bottom: 12px;
}

.rules-toggles-box.compact {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
}

.team-mode-toggle.compact {
    margin: 0;
    padding: 9px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}

.team-mode-toggle.compact .toggle-text {
    font-size: 12px;
    font-weight: 700;
}

.quick-actions-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.quick-action-btn {
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 13.5px;
    font-weight: 800;
    border-radius: 14px;
}

.btn-subtext {
    font-size: 11px;
    font-weight: 500;
    opacity: 0.85;
}

.btn-create-room {
    background: #22c55e;
    color: #052e16;
    font-weight: 800;
    font-size: 12px;
    border: none;
    border-radius: 10px;
    padding: 8px 14px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
    transition: transform 0.15s;
}

.btn-create-room:hover {
    transform: translateY(-1px);
}

.round-pills-selector {
    display: flex;
    gap: 8px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.round-pill-btn {
    flex: 1;
    min-width: 60px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: #cbd5e1;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.round-pill-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.round-pill-btn.active {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    border-color: #22c55e;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.35);
}

.round-info-hint {
    font-size: 11.5px;
    color: #94a3b8;
    margin-top: 6px;
    line-height: 1.4;
}

.custom-modal-content {
    max-width: 420px;
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.modal-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-body-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

@media (max-width: 768px) {
    .lobby-columns-grid {
        grid-template-columns: 1fr;
    }
    .rules-toggles-box.compact {
        grid-template-columns: 1fr;
    }
    .quick-actions-row {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Lobi / Ana Menü Stilleri (Index.html)
   ============================================ */

.container {
    width: 100%;
    max-width: 600px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 10;
    position: relative;
    margin: 0 auto;
    /* Ortalamak için */
    /* Masa dokusunu engellememesi için arka plan yok */
}

/* Header & Logo */
.header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.8s ease;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    font-size: 3.5rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.logo-icon {
    font-size: 4rem;
    animation: bounce 2s infinite;
}

.tagline {
    color: var(--accent);
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 2px;
    margin-top: 10px;
    opacity: 0.9;
}

/* Kartlar (Card) */
.card {
    background: var(--ui-glass);
    backdrop-filter: blur(16px);
    border: 1px solid var(--ui-border);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.8s ease 0.2s backwards;
}

.card h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    background: linear-gradient(to right, #fff, #cbd5e1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.welcome-text {
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 1.1rem;
}

/* İsim Girişi */
.name-input-container {
    margin-bottom: 25px;
}

.name-input {
    width: 100%;
    padding: 16px 20px;
    font-size: 1.1rem;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: #fff;
    text-align: center;
    transition: all 0.3s ease;
}

.name-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.name-input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.2);
}

.section-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 12px;
    text-align: left;
}

/* Avatar Seçimi */
.avatar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.avatar-option {
    position: relative;
    aspect-ratio: 1;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.avatar-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.avatar-option:hover {
    transform: translateY(-5px);
}

.avatar-option.selected {
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
}

.avatar-option.selected img {
    transform: scale(1.1);
}

/* Istaka Renk Seçimi */
.istaka-selection {
    margin-bottom: 15px;
}

.istaka-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.istaka-option {
    position: relative;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.istaka-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.istaka-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.istaka-option.selected {
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.4);
}

.istaka-option.selected img {
    transform: scale(1.02);
}

.istaka-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    text-align: center;
    padding: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Butonlar */
.btn {
    border: none;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-large {
    width: 100%;
    padding: 16px;
    font-size: 1.2rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, #d97706 100%);
    color: #0f172a;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(251, 191, 36, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Toggle Switch (Takım Modu) */
.team-mode-toggle {
    margin: 25px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.toggle-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
}

.toggle-label input {
    display: none;
}

.toggle-slider {
    width: 48px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    position: relative;
    transition: 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toggle-label input:checked+.toggle-slider {
    background: var(--accent);
}

.toggle-label input:checked+.toggle-slider::before {
    transform: translateX(24px);
    background: #0f172a;
}

.toggle-text {
    font-size: 1.1rem;
    font-weight: 500;
}

.toggle-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 5px;
}

/* Animasyonlar */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

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

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

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

@keyframes bounce {

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

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

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

.hidden {
    display: none !important;
}

/* ============================================
   RESPONSIVE DESIGN (Media Queries)
   ============================================ */

/* Tablet ve Küçük Laptoplar (max-width: 1024px) */
@media (max-width: 1024px) {
    /* Scale tabanlı sistem */
    /* Root değişkenleri değiştirmeyi bırakıyoruz */

    .game-board {
        overflow: hidden;
    }

    .table-center {
        transform: translate(-50%, -50%) scale(0.85);
    }

    /* Istakayı küçült */
    .cue-container {
        transform: scale(0.85);
        transform-origin: bottom center;
        margin-bottom: -20px;
    }

    .opponent-area {
        transform: scale(0.85);
    }

    .opponent-area.left {
        transform-origin: left center;
        left: 0;
    }

    .opponent-area.right {
        transform-origin: right center;
        right: 0;
    }

    .opponent-area.top {
        transform-origin: top center;
        top: 0;
    }
}

/* Mobil Cihazlar (max-width: 768px) */
@media (max-width: 768px) {

    /* === LOBİ MOBİL === */
    .container {
        padding: 10px;
    }

    .logo {
        font-size: 2.5rem;
    }

    .logo-icon {
        font-size: 3rem;
    }

    .card {
        padding: 20px;
        border-radius: 16px;
    }

    .avatar-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

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

    /* === OYUN MASASI MOBİL === */
    /* Her şeyi scale ile küçültüyoruz */

    .table-center {
        transform: translate(-50%, -60%) scale(0.6);
    }

    .cue-container {
        transform: scale(0.55);
        transform-origin: bottom center;
        width: 120%;
        margin-bottom: -40px;
    }

    /* Rakipler */
    .opponent-area {
        gap: 5px;
    }

    .player-info {
        padding: 4px 10px;
        font-size: 0.9rem;
    }

    .avatar-wrapper {
        width: 35px;
        height: 35px;
    }

    /* Yan Rakipler - Scale ve Konum */
    .opponent-area.left {
        transform: scale(0.6);
        transform-origin: left center;
        left: -10px;
    }

    .opponent-area.right {
        transform: scale(0.6);
        transform-origin: right center;
        right: -10px;
    }

    .opponent-area.top {
        transform: translateX(-50%) scale(0.6);
        transform-origin: top center;
        top: 5px;
    }

    .action-buttons {
        transform: scale(0.6);
        transform-origin: bottom right;
        bottom: 125px;
    }

    /* HUD Mobil */
    .ui-layer {
        padding: 8px;
    }

    .stats-panel {
        transform: scale(0.75);
        transform-origin: top left;
        min-width: 160px;
    }

    .game-status-panel {
        transform: scale(0.75);
        transform-origin: top right;
        gap: 8px;
    }

    .status-item {
        min-width: 40px;
    }

    .status-item .value {
        font-size: 1.1rem;
    }
}



/* ============================================================
   101 OKEY YATAY EKRAN YÖNLENDİRME (ORIENTATION OVERLAY)
============================================================ */
.okey-orientation-overlay {
    position: fixed; inset: 0; z-index: 99999;
    background: rgba(8, 11, 20, 0.96);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    display: flex; justify-content: center; align-items: center;
    padding: 24px; box-sizing: border-box; text-align: center;
    animation: fadeInOverlay 0.3s ease forwards;
}
.okey-orientation-overlay.hidden { display: none !important; }

.orientation-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 28px; padding: 32px 24px;
    max-width: 380px; width: 100%;
    box-shadow: 0 20px 50px rgba(0,0,0,0.7), inset 0 1px 1px rgba(255,255,255,0.2);
    display: flex; flex-direction: column; align-items: center; gap: 14px;
}

.phone-rotate-anim {
    position: relative; width: 80px; height: 80px;
    display: flex; justify-content: center; align-items: center;
    margin-bottom: 6px;
}
.phone-frame {
    width: 44px; height: 72px;
    border: 3.5px solid #22c55e;
    border-radius: 12px;
    background: rgba(0,0,0,0.6);
    display: flex; justify-content: center; align-items: center;
    box-shadow: 0 0 24px rgba(34,197,94,0.4);
    animation: phoneTiltRotate 2.4s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}
.phone-screen {
    font-size: 20px; font-weight: 900; color: #22c55e;
}
.rotate-arrow {
    position: absolute; right: 0; bottom: 0;
    font-size: 26px; color: #22c55e;
    filter: drop-shadow(0 0 6px rgba(34,197,94,0.8));
    animation: rotatePulse 2.4s ease infinite;
}

@keyframes phoneTiltRotate {
    0%, 15%   { transform: rotate(0deg); }
    45%, 75%  { transform: rotate(90deg) scale(1.05); }
    90%, 100% { transform: rotate(0deg); }
}
@keyframes rotatePulse {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.7; }
    50%      { transform: scale(1.2) rotate(45deg); opacity: 1; }
}
@keyframes fadeInOverlay {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.orientation-card h2 {
    font-size: 20px; font-weight: 800; color: #fff;
    letter-spacing: -0.4px; line-height: 1.3;
}
.orientation-card p {
    font-size: 13px; color: #94a3b8; line-height: 1.5; margin: 0;
}
.orientation-actions {
    display: flex; flex-direction: column; width: 100%; gap: 10px; margin-top: 8px;
}
.orientation-btn-primary {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #fff; font-weight: 800; font-size: 14px;
    padding: 13px 20px; border-radius: 14px; border: none;
    cursor: pointer; box-shadow: 0 6px 18px rgba(34,197,94,0.35);
    transition: transform 0.15s, box-shadow 0.15s;
}
.orientation-btn-primary:active { transform: scale(0.97); }
.orientation-btn-secondary {
    background: transparent; color: #64748b; font-size: 12px; font-weight: 600;
    border: none; cursor: pointer; padding: 6px;
    transition: color 0.2s;
}
.orientation-btn-secondary:hover { color: #94a3b8; }

/* 101 Mobil Sohbet Butonu & Çekmece */
.okey-mobile-chat-btn {
    display: none; position: fixed; right: 14px; bottom: 14px;
    width: 48px; height: 48px; border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #fff; font-size: 20px; border: 2px solid rgba(255,255,255,0.25);
    box-shadow: 0 8px 24px rgba(0,0,0,0.5); z-index: 4500;
    cursor: pointer; align-items: center; justify-content: center;
    transition: transform 0.2s;
}
.okey-mobile-chat-btn:active { transform: scale(0.92); }
.chat-badge {
    position: absolute; top: -3px; right: -3px;
    background: #ef4444; color: #fff; font-size: 10px; font-weight: 800;
    padding: 2px 6px; border-radius: 10px; border: 2px solid #000;
}
.okey-chat-backdrop {
    display: none !important;
    pointer-events: none !important;
}

/* ============================================================
   101 OKEY YATAY MOBİL MOD (LANDSCAPE MOBILE)
============================================================ */
@media (orientation: landscape) and (max-height: 520px) {
    .site-header {
        display: none !important;
    }
    body {
        padding: 0 !important; margin: 0 !important;
        overflow: hidden !important;
    }
    .game-container {
        height: 100vh !important; height: 100dvh !important;
        max-height: 100dvh !important;
        padding: max(2px, env(safe-area-inset-top)) max(6px, env(safe-area-inset-right)) max(2px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left)) !important;
        gap: 2px !important;
    }
    .game-board {
        flex: 1 !important; min-height: 0 !important;
        border-radius: 12px !important;
    }

    /* Üst HUD & Skor Tablosu - Kompakt Mikro Tipografi */
    .ui-layer {
        margin-top: 0 !important;
        top: 2px !important; left: 6px !important; right: 6px !important;
        height: 28px !important; padding: 0 !important;
        display: flex !important; justify-content: space-between !important;
        align-items: center !important; pointer-events: none !important;
    }
    .ui-layer > * {
        pointer-events: auto !important;
    }
    .stats-panel {
        transform: scale(0.65) !important;
        transform-origin: top left !important;
        min-width: 130px !important; padding: 3px 6px !important;
        border-radius: 8px !important;
    }
    .panel-header { font-size: 9px !important; margin-bottom: 2px !important; }
    .stats-list { font-size: 8px !important; gap: 2px !important; }
    .game-status-panel {
        transform: scale(0.7) !important;
        transform-origin: top right !important;
        padding: 2px 7px !important; border-radius: 8px !important;
    }
    .status-item { font-size: 8.5px !important; gap: 2px !important; }
    #okeyChatToggleBtn {
        padding: 2px 8px !important; font-size: 9.5px !important;
        height: 24px !important; border-radius: 8px !important;
    }
    #inGameLeaveBtn, #leaveGameBtn, .lobby-leave-btn {
        padding: 2px 8px !important; font-size: 9.5px !important;
        height: 24px !important; border-radius: 8px !important;
    }

    /* Masa Ortası (Yığın, Gösterge, Atılan) */
    .table-center {
        transform: translate(-50%, -52%) scale(0.62) !important;
    }
    .area-label, .slot-label { font-size: 7.5px !important; }
    .pile-count-badge { font-size: 8px !important; padding: 1px 4px !important; }
    .opened-tiles-table { max-height: 95px !important; gap: 4px !important; }

    /* Rakipler */
    .opponent-area.left {
        transform: scale(0.62) !important;
        transform-origin: left center !important;
        left: 2px !important; top: 38% !important;
    }
    .opponent-area.right {
        transform: scale(0.62) !important;
        transform-origin: right center !important;
        right: 2px !important; top: 38% !important;
    }
    .opponent-area.top {
        transform: translateX(-50%) scale(0.62) !important;
        transform-origin: top center !important;
        top: 2px !important;
    }
    .player-info {
        padding: 2px 5px !important; border-radius: 7px !important;
    }
    .player-name { font-size: 8.5px !important; }
    .player-score { font-size: 7.5px !important; }
    .avatar-wrapper { width: 24px !important; height: 24px !important; }

    /* Alt Oyuncu Alanı & Istaka */
    .player-area.bottom {
        bottom: 2px !important; gap: 5px !important;
        padding: 0 4px !important; max-width: 100vw !important;
        align-items: flex-end !important;
    }
    .cue-container {
        transform: scale(0.65) !important;
        transform-origin: bottom center !important;
        margin-bottom: -18px !important;
    }
    .cue-wood { padding: 6px 12px !important; }
    .cue-row { min-height: 52px !important; padding-bottom: 4px !important; gap: 2px !important; }
    .cue-row.top-row { margin-bottom: 4px !important; }

    /* Atık Alanları */
    .player-discard {
        min-width: 46px !important; max-width: 66px !important; gap: 2px !important;
    }
    .discard-label {
        font-size: 7.5px !important; padding: 1px 4px !important;
        background: rgba(0, 0, 0, 0.6) !important; border-radius: 4px !important;
        letter-spacing: 0.5px !important;
    }
    .discard-tiles {
        min-height: 46px !important; max-height: 82px !important;
        padding: 3px !important; border-radius: 7px !important;
    }

    /* Kendi Oyuncu Bilgim (Sol altta zarif rozet) */
    .player-info.self {
        position: absolute !important; bottom: 6px !important;
        left: 6px !important; right: auto !important;
        transform: scale(0.7) !important; transform-origin: bottom left !important;
        z-index: 1050 !important;
    }

    /* Istaka Üstündeki Aksiyon Butonları (Diz, Taş At, El Aç, Bitir) - Zarif HUD */
    .action-buttons {
        position: absolute !important;
        top: auto !important;
        bottom: 122px !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        flex-direction: row !important;
        gap: 4px !important;
        z-index: 1200 !important;
    }
    .action-buttons .action-btn {
        padding: 2.5px 8px !important;
        font-size: 9.5px !important;
        min-height: 22px !important;
        height: 22px !important;
        gap: 3px !important;
        border-radius: 999px !important;
    }

    /* Domates Butonu */
    .tomato-btn {
        width: 30px !important; height: 30px !important;
        font-size: 14px !important; bottom: 6px !important;
        right: 6px !important; left: auto !important;
        z-index: 1050 !important;
    }
    .tomato-counter {
        width: 13px !important; height: 13px !important;
        font-size: 7.5px !important; top: -3px !important; right: -3px !important;
    }

    /* Sohbet Drawer */
    .okey-chat-sidebar {
        position: fixed !important; top: 0 !important; right: 0 !important; bottom: 0 !important;
        width: 320px !important; max-width: 85vw !important; height: 100% !important;
        z-index: 5000 !important;
        transform: translateX(105%); transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        border-radius: 0 !important; border-left: 1px solid rgba(255,255,255,0.15) !important;
        box-shadow: -10px 0 40px rgba(0,0,0,0.8) !important;
    }
    .okey-chat-sidebar.drawer-open {
        transform: translateX(0) !important;
    }
    .okey-mobile-chat-btn {
        display: flex !important;
    }
}

/* ============================================
   LOBİ OVERLAY STİLLERİ
   ============================================ */

.lobby-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(8, 8, 8, 0.95);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.lobby-container {
    background: #141414;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 28px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
}

.lobby-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 8px;
    background: linear-gradient(to right, #ffffff, #a1a1aa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.lobby-header p {
    color: #888888;
    font-size: 1rem;
}

.lobby-room-code {
    margin: 22px 0;
    padding: 18px;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 18px;
}

.lobby-room-code-label {
    font-size: 0.75rem;
    color: #888888;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 6px;
    font-weight: 700;
}

.lobby-room-code-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: #22c55e;
    font-family: monospace;
    letter-spacing: 4px;
}

.lobby-room-code-copy {
    margin-top: 12px;
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.lobby-room-code-copy:hover {
    background: rgba(255, 255, 255, 0.16);
}

.lobby-team-badge {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.lobby-players {
    margin: 20px 0;
}

.lobby-players h3 {
    margin-bottom: 12px;
    font-size: 1rem;
    font-weight: 700;
}

.lobby-players-count {
    color: #22c55e;
    font-weight: 800;
}

.lobby-players-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.lobby-player-slot {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #181818;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    min-height: 58px;
}

.lobby-player-slot.filled {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.35);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.lobby-player-slot.empty {
    opacity: 0.45;
    background: rgba(255, 255, 255, 0.03);
    border-style: dashed;
}

.lobby-slot-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.lobby-avatar-thumb {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #22c55e;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.3);
    flex-shrink: 0;
}

.lobby-slot-text {
    display: flex;
    flex-direction: column;
    text-align: left;
    overflow: hidden;
}

.lobby-player-slot .position-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.lobby-player-slot .player-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lobby-player-slot .player-sub {
    font-size: 0.72rem;
    color: #888888;
    font-weight: 600;
}

.lobby-waiting {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 25px 0;
    color: var(--text-secondary);
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.lobby-leave-btn {
    width: 100%;
    padding: 14px;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 12px;
    color: #ef4444;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.lobby-leave-btn:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* ============================================
   🍅 Domates Fırlatma Sistemi
   ============================================ */

.tomato-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(145deg, #ef4444, #dc2626);
    border: none;
    font-size: 2rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tomato-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.6);
}

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

.tomato-counter {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #fbbf24;
    color: #000;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tomato-select-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.tomato-select-overlay.hidden {
    display: none;
}

.tomato-select-panel {
    background: #1e293b;
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    color: white;
    max-width: 400px;
}

.tomato-select-panel h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.target-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
}

.target-btn {
    padding: 15px 25px;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.target-btn:hover {
    background: rgba(239, 68, 68, 0.4);
    transform: scale(1.02);
}

.cancel-throw-btn {
    padding: 12px 30px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.cancel-throw-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Flying Tomato Animation */
.flying-tomato {
    position: fixed;
    font-size: 3rem;
    pointer-events: none;
    z-index: 3000;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

/* Tomato Splat */
.tomato-splat {
    position: fixed;
    font-size: 4rem;
    pointer-events: none;
    z-index: 2999;
    animation: splatFade 1s forwards;
}

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

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

/* Tomato Hit Effect */
.player-info.tomato-hit {
    animation: shake 0.5s;
}

@keyframes shake {

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

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

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

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

/* Tomato Notification */
.tomato-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(239, 68, 68, 0.9);
    color: white;
    padding: 20px 40px;
    border-radius: 16px;
    font-size: 1.5rem;
    font-weight: bold;
    z-index: 3001;
    animation: notifPop 2s forwards;
}

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

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

    30% {
        transform: translate(-50%, -50%) scale(1);
    }

    80% {
        opacity: 1;
    }

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

/* === Slot Sistemi === */
.tile-slot {
    width: 48px;
    height: 68px;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    transition: background-color 0.2s, border-color 0.2s;
    pointer-events: auto !important;
    z-index: 5;
}

@media (max-width: 1024px) {
    .tile-slot {
        width: 42px;
        height: 60px;
    }
    .tile-slot .tile-sprite {
        transform: translate(-50%, -50%) scale(0.84) !important;
    }
}

@media (max-width: 860px) {
    .tile-slot {
        width: 36px;
        height: 52px;
    }
    .tile-slot .tile-sprite {
        transform: translate(-50%, -50%) scale(0.72) !important;
    }
}

.tile-slot.drag-over {
    background: linear-gradient(to bottom, rgba(251, 191, 36, 0.2), rgba(251, 191, 36, 0.05));
    border: 1px solid #f59e0b;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
}

/* Slotların içindeki taşlar */
.tile-slot .tile-sprite {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
}

/* ============================================
/* ============================================
   🗑️ 4 KÖŞE ÇAPRAZ TAŞ ATMA VE ÇEKME İSTASYONLARI (Diagonal Discard Stations)
   ============================================ */

/* Eski orta discard alanını gizle */
.discard-section {
    display: none !important;
}

.discard-station {
    width: 74px;
    background: linear-gradient(145deg, #3d241d, #251511);
    border: 2px solid #5a372c;
    border-radius: 12px;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6), 0 8px 20px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 4px;
    z-index: 35;
    user-select: none;
    -webkit-user-select: none;
    box-sizing: border-box;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s;
}

.discard-station:hover {
    transform: translateY(-2px);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.5), 0 12px 26px rgba(0, 0, 0, 0.65);
}

.discard-station .discard-label {
    font-size: 10px;
    font-weight: 800;
    color: #e2e8f0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
    white-space: nowrap;
}

.discard-station .discard-tiles {
    width: 52px;
    height: 74px;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 8px;
    border: 1.5px dashed rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.discard-station .discard-tiles.has-tile {
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: transparent;
    box-shadow: none;
}

/* Klasik Okey Tarzı Nizami Konumlandırma */
/* Alt Oyuncu: Istakanın Sağında ve Solunda (Flex Elemanı Olarak Asla Istaka Üstüne Binmez) */
.discard-station.bottom-left,
.discard-station.bottom-right {
    position: relative;
    height: 106px;
    flex-shrink: 0;
    margin-bottom: 4px;
}

.discard-station.bottom-left {
    border-bottom: 3.5px solid #10b981;
}

.discard-station.bottom-right {
    border-bottom: 3.5px solid #ef4444;
    cursor: pointer;
}

.discard-station.bottom-right:hover {
    border-color: #f59e0b;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.5), 0 0 16px rgba(245, 158, 11, 0.4);
}

/* Üst Çaprazlar: Üst Rakibin Sağında ve Solunda (Yazısız, Masayla Orantılı ve Tablolara Asla Çarpmaz) */
.discard-station.top-left {
    position: absolute;
    top: 25px;
    left: calc(50% - 225px);
    width: 64px;
    height: 82px;
    border-top: 3.5px solid #f59e0b;
    z-index: 20;
}

.discard-station.top-right {
    position: absolute;
    top: 25px;
    right: calc(50% - 225px);
    width: 64px;
    height: 82px;
    border-top: 3.5px solid #3b82f6;
    z-index: 20;
}

/* Çekilebilir Sol Atık Animasyonu & Vurgusu */
.discard-station.bottom-left.drawable,
.discard-station.bottom-left .drawable {
    cursor: pointer;
    border-color: #22c55e !important;
    animation: pulseDrawable 1.8s infinite;
}

@keyframes pulseDrawable {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7), 0 8px 24px rgba(0, 0, 0, 0.5);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(34, 197, 94, 0), 0 8px 28px rgba(34, 197, 94, 0.35);
    }
}

/* Responsive Düzenlemeler */
@media (max-width: 1100px) {
    .discard-station.top-left {
        left: calc(50% - 200px);
        top: 20px;
    }
    .discard-station.top-right {
        right: calc(50% - 200px);
        top: 20px;
    }
}

@media (max-width: 768px) {
    .player-area.bottom {
        gap: 6px !important;
        padding: 0 4px !important;
    }
    .discard-station.bottom-left,
    .discard-station.bottom-right {
        width: 56px;
        height: 90px;
    }
    .discard-station.bottom-left .discard-tiles,
    .discard-station.bottom-right .discard-tiles {
        width: 44px;
        height: 64px;
    }
    .discard-station.bottom-left .discard-label,
    .discard-station.bottom-right .discard-label {
        font-size: 8px;
    }
    .discard-station.top-left {
        left: calc(50% - 150px);
        top: 15px;
        width: 52px;
        height: 72px;
    }
    .discard-station.top-right {
        right: calc(50% - 150px);
        top: 15px;
        width: 52px;
        height: 72px;
    }
    .discard-station.top-left .discard-tiles,
    .discard-station.top-right .discard-tiles {
        width: 44px;
        height: 64px;
    }
}

/* ============================================================
   101 OKEY MASA SOHBETİ (Klasik Okey ile Birebir Aynı Tasarım)
   ============================================================ */
.rplace-right-chat.okey-chat-sidebar {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 320px;
    max-width: calc(100vw - 40px);
    height: 460px;
    max-height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
    background: rgba(18, 18, 20, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    overflow: hidden;
    z-index: 3000;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.05);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

.rplace-right-chat.okey-chat-sidebar.hidden {
    display: none !important;
}

.rplace-chat-header {
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chat-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.chat-close-btn:hover {
    background: rgba(239, 68, 68, 0.8);
}

.rplace-chat-messages {
    flex: 1;
    padding: 12px 14px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}
.rplace-chat-messages::-webkit-scrollbar {
    width: 5px;
}
.rplace-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.rplace-chat-msg {
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 12px;
    line-height: 1.4;
    word-break: break-word;
}
.rplace-chat-msg.me {
    background: rgba(79, 70, 229, 0.25);
    border-left: 3px solid #6366f1;
    align-self: flex-end;
    max-width: 88%;
}
.rplace-chat-msg.other {
    background: rgba(255, 255, 255, 0.06);
    border-left: 3px solid rgba(255, 255, 255, 0.2);
    align-self: flex-start;
    max-width: 88%;
}
.rplace-chat-msg .author {
    font-weight: 700;
    font-size: 11px;
    margin-bottom: 4px;
    opacity: 0.85;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.okey-msg-del-btn {
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.6;
    font-size: 11px;
    padding: 0 4px;
    transition: opacity 0.2s;
}
.okey-msg-del-btn:hover {
    opacity: 1;
}

/* Admin Kral Tacı & Cooldown */
.chat-admin-crown {
    display: inline-block;
    font-size: 14px;
    line-height: 1;
    margin-left: 4px;
    vertical-align: middle;
    filter: drop-shadow(0 0 6px rgba(250, 204, 21, 0.9)) drop-shadow(0 0 12px rgba(234, 179, 8, 0.6));
    animation: adminCrownGlow 2.2s infinite alternate ease-in-out;
    cursor: default;
    user-select: none;
}
@keyframes adminCrownGlow {
    0% {
        transform: scale(1) rotate(0deg);
        filter: drop-shadow(0 0 5px rgba(250, 204, 21, 0.7));
    }
    100% {
        transform: scale(1.15) rotate(-3deg);
        filter: drop-shadow(0 0 10px rgba(250, 204, 21, 1)) drop-shadow(0 0 18px rgba(234, 179, 8, 0.85));
    }
}
.chat-btn-cooldown {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

.rplace-chat-form {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    gap: 8px;
}
.rplace-chat-form input {
    flex: 1;
    height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 13px !important;
    outline: none;
    transition: border-color 0.2s;
}
.rplace-chat-form input:focus {
    border-color: #6366f1;
    background: rgba(255, 255, 255, 0.09);
}
.rplace-chat-form button {
    height: 36px;
    padding: 0 14px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    cursor: pointer;
    font-weight: 800;
    font-size: 14px;
    transition: transform 0.15s, opacity 0.15s;
}
.rplace-chat-form button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Sıra Efekti & Parlama */
.player-info.current-turn {
    box-shadow: 0 0 25px rgba(34, 197, 94, 0.8), inset 0 0 15px rgba(34, 197, 94, 0.3) !important;
    border-color: #22c55e !important;
    transform: scale(1.05);
}
.player-info.current-turn .turn-badge {
    background: #22c55e !important;
    box-shadow: 0 0 10px #22c55e;
}
.player-discard.drawable {
    cursor: pointer;
    box-shadow: 0 0 18px rgba(59, 130, 246, 0.8) !important;
    border-color: #3b82f6 !important;
}
.player-discard.right-discard {
    cursor: pointer;
}
.player-discard.right-discard:hover {
    border-color: #eab308;
    box-shadow: 0 0 15px rgba(234, 179, 8, 0.5);
}
