@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap');

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

:root {
    --red: #E63946;
    --yellow: #FFB703;
    --blue: #219EBC;
    --black: #2D3436;
    --bg-dark: #1a1a2e;
    --bg-card: #16213e;
    --bg-light: #0f3460;
    --accent: #e94560;
    --text: #eaeaea;
    --text-dim: #a0a0a0;
    --gold: #ffd700;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Nunito', sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    touch-action: manipulation;
}

/* Global scrollbar stilleri */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 215, 0, 0.4) rgba(0, 0, 0, 0.2);
}

*::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

*::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

*::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, 
        rgba(255, 215, 0, 0.5) 0%, 
        rgba(255, 152, 0, 0.4) 100%);
    border-radius: 6px;
    border: 2px solid rgba(0, 0, 0, 0.2);
    box-shadow: 
        inset 0 1px 2px rgba(255, 255, 255, 0.2),
        0 1px 3px rgba(0, 0, 0, 0.3);
}

*::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, 
        rgba(255, 215, 0, 0.7) 0%, 
        rgba(255, 152, 0, 0.6) 100%);
    box-shadow: 
        inset 0 1px 2px rgba(255, 255, 255, 0.3),
        0 2px 5px rgba(0, 0, 0, 0.4);
}

*::-webkit-scrollbar-thumb:active {
    background: linear-gradient(180deg, 
        rgba(255, 215, 0, 0.8) 0%, 
        rgba(255, 152, 0, 0.7) 100%);
}

*::-webkit-scrollbar-corner {
    background: rgba(0, 0, 0, 0.3);
}

/* Ana ekran ve oyun ekranı için özel scrollbar */
.screen::-webkit-scrollbar {
    width: 14px;
}

.screen::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.4);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.screen::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, 
        rgba(255, 215, 0, 0.6) 0%, 
        rgba(255, 152, 0, 0.5) 100%);
    border-left: 2px solid rgba(0, 0, 0, 0.3);
    box-shadow: 
        inset 0 1px 3px rgba(255, 255, 255, 0.3),
        0 2px 6px rgba(0, 0, 0, 0.4);
}

.screen::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, 
        rgba(255, 215, 0, 0.8) 0%, 
        rgba(255, 152, 0, 0.7) 100%);
}

#app {
    width: 100%;
    height: 100%;
    position: relative;
}

.screen {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

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

/* Ana Menü */
#menu {
    background: 
        radial-gradient(ellipse at top, rgba(30, 60, 100, 0.8) 0%, rgba(10, 20, 40, 1) 100%),
        linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    justify-content: flex-start;
    align-items: center;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 0;
}

.menu-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.3;
    z-index: 0;
}

.menu-tiles-decoration {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(45deg, transparent, transparent 50px, rgba(255, 215, 0, 0.03) 50px, rgba(255, 215, 0, 0.03) 100px),
        repeating-linear-gradient(-45deg, transparent, transparent 50px, rgba(233, 69, 96, 0.03) 50px, rgba(233, 69, 96, 0.03) 100px);
    animation: menuBackgroundMove 20s linear infinite;
}

@keyframes menuBackgroundMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.menu-container {
    text-align: center;
    padding: 30px 20px;
    max-width: 450px;
    width: 90%;
    position: relative;
    z-index: 1;
    margin: auto;
    min-height: min-content;
}

.menu-header {
    margin-bottom: 30px;
    position: relative;
}

.game-title {
    font-size: 4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--gold), var(--yellow), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 40px rgba(255, 215, 0, 0.3);
    margin-bottom: 10px;
    letter-spacing: 4px;
    animation: titleGlow 3s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% { filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5)); }
    50% { filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.8)); }
}

.subtitle {
    color: var(--text-dim);
    font-size: 1.1rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.menu-icon {
    font-size: 3rem;
    margin-top: 10px;
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.btn-menu-main {
    padding: 18px 40px;
    font-size: 1.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), #c23a4f);
    color: white;
    box-shadow: 0 6px 25px rgba(233, 69, 96, 0.5);
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.btn-menu-main:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(233, 69, 96, 0.7);
}

.btn-menu-main:active {
    transform: translateY(-1px);
}

.btn-menu-secondary {
    padding: 14px 30px;
    font-size: 1rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-menu-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 215, 0, 0.5);
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2);
}

.btn-icon {
    font-size: 1.3rem;
}

/* El Sayısı Seçici */
.game-mode-selector {
    margin: 20px 0;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.game-mode-selector h3 {
    color: var(--gold);
    font-size: 0.9rem;
    margin-bottom: 12px;
    text-align: center;
    font-weight: 700;
}

.mode-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-mode {
    flex: 1;
    max-width: 120px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.btn-mode.active {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(255, 152, 0, 0.3));
    border-color: var(--gold);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.btn-mode:hover {
    transform: translateY(-2px);
    border-color: var(--gold);
}

.mode-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--gold);
    line-height: 1;
}

.mode-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.rules-box, .stats-box, .about-box {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 25px;
    margin-top: 20px;
    text-align: left;
    animation: boxAppear 0.5s ease-out;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

@keyframes boxAppear {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.rules-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(255, 215, 0, 0.3);
}

.rules-header h3 {
    color: var(--gold);
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
}

.close-rules {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    color: var(--text);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-rules:hover {
    background: rgba(233, 69, 96, 0.3);
    border-color: var(--accent);
    transform: rotate(90deg);
}

.rules-box ul {
    list-style: none;
    font-size: 0.95rem;
    color: var(--text);
    margin: 0;
    padding: 0;
}

.rules-box li {
    padding: 10px 0;
    padding-left: 35px;
    position: relative;
    line-height: 1.6;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.rules-box li:last-child {
    border-bottom: none;
}

.rule-icon {
    position: absolute;
    left: 0;
    font-size: 1.2rem;
    width: 25px;
    text-align: center;
}

.stats-content, .about-content {
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.8;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    color: var(--text-dim);
    font-weight: 600;
}

.stat-value {
    color: var(--gold);
    font-weight: 700;
    font-size: 1.1rem;
}

.about-content p {
    margin-bottom: 15px;
    color: var(--text);
    line-height: 1.8;
}

.version {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-dim);
    font-size: 0.85rem;
    text-align: center;
}

/* Butonlar */
.btn {
    padding: 16px 40px;
    font-size: 1.1rem;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #c23a4f);
    color: white;
    box-shadow: 0 4px 20px rgba(233, 69, 96, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

.btn-action {
    padding: 12px 16px;
    font-size: 0.85rem;
    background: var(--bg-light);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex: 1;
    max-width: 90px;
}

.btn-action:disabled {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
    pointer-events: none;
}

/* Görsel olarak disabled ama tıklanabilir */
.btn-disabled-visual {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
}

.btn-action:not(:disabled) {
    opacity: 1;
    cursor: pointer;
}

.btn-action:not(:disabled):active {
    background: var(--accent);
    transform: scale(0.95);
}

#sortBtn {
    background: rgba(255, 215, 0, 0.2);
    border-color: var(--gold);
    color: var(--gold);
}

#clearBtn {
    background: rgba(150, 150, 150, 0.2);
    border-color: #888;
    color: #aaa;
}

.btn-open:not(:disabled) {
    background: linear-gradient(135deg, #4CAF50, #388E3C) !important;
    border-color: #2E7D32 !important;
    color: white !important;
}

.btn-discard:not(:disabled) {
    background: linear-gradient(135deg, #f44336, #d32f2f) !important;
    border-color: #c62828 !important;
    color: white !important;
}

.btn-islek:not(:disabled) {
    background: linear-gradient(135deg, #FF9800, #F57C00) !important;
    border-color: #E65100 !important;
    color: white !important;
}

.btn-islek.active {
    background: linear-gradient(135deg, #FFB74D, #FF9800) !important;
    box-shadow: 0 0 15px rgba(255, 152, 0, 0.6);
    transform: scale(1.05);
}

/* Seçili Taş Önizleme */
.selected-preview {
    display: flex;
    gap: 4px;
    justify-content: center;
    align-items: center;
    min-height: 40px;
    padding: 6px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    margin-top: 6px;
}

.selected-preview:empty::before {
    content: 'Taş seçin...';
    color: var(--text-dim);
    font-size: 0.8rem;
}

.selected-preview .tile {
    width: 28px;
    height: 38px;
    font-size: 0.9rem;
}

.selected-preview .preview-info {
    font-size: 0.75rem;
    color: var(--gold);
    margin-left: 10px;
    padding: 4px 8px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 4px;
}

.selected-preview .preview-invalid {
    color: var(--accent);
    background: rgba(233, 69, 96, 0.1);
}

/* Oyun Ekranı - Masa Stili */
#game {
    background: 
        radial-gradient(ellipse at center, #1e5f74 0%, #133b5c 50%, #0a1929 100%),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(255, 255, 255, 0.02) 2px,
            rgba(255, 255, 255, 0.02) 4px
        );
    padding: 8px;
    gap: 6px;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 100%;
}

#game::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255, 215, 0, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(21, 101, 192, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

#game > * {
    position: relative;
    z-index: 1;
}

.game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: 
        linear-gradient(135deg, 
            rgba(0, 0, 0, 0.4) 0%, 
            rgba(0, 0, 0, 0.3) 100%);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        inset 0 1px 3px rgba(0, 0, 0, 0.3),
        0 2px 8px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(4px);
}

.indicator-box, .okey-box, .round-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.round-info {
    padding: 6px 14px;
    background: 
        linear-gradient(135deg, 
            rgba(255, 215, 0, 0.15) 0%, 
            rgba(255, 152, 0, 0.1) 100%);
    border-radius: 10px;
    border: 1px solid rgba(255, 215, 0, 0.4);
    box-shadow: 
        inset 0 1px 2px rgba(255, 255, 255, 0.2),
        0 2px 6px rgba(255, 215, 0, 0.2);
    backdrop-filter: blur(4px);
}

.round-text {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--gold);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
}

.label {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
}

/* Taşlar - Okey Stili */
.tile {
    width: 36px;
    height: 50px;
    background: linear-gradient(180deg, #ffffff 0%, #f8f8f8 40%, #e8e8e8 100%);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.4rem;
    box-shadow: 
        0 3px 6px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 1),
        inset 0 -2px 0 rgba(0, 0, 0, 0.08);
    border: 1px solid #bbb;
    position: relative;
    user-select: none;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    font-family: 'Arial Black', 'Nunito', sans-serif;
}

.tile.empty {
    background: rgba(255, 255, 255, 0.15);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    box-shadow: none;
}

.tile.selected {
    transform: translateY(-12px) scale(1.08);
    box-shadow: 0 12px 25px rgba(233, 69, 96, 0.7);
    border-color: var(--accent);
    z-index: 10;
}

.tile.okey-tile {
    border-color: var(--gold);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4), 0 0 12px rgba(255, 215, 0, 0.6);
}

.tile.okey-tile::after {
    content: "★";
    position: absolute;
    top: 1px;
    right: 2px;
    font-size: 0.5rem;
    color: var(--gold);
}

.tile.joker-tile {
    background: linear-gradient(135deg, #fff9c4 0%, #ffd700 50%, #ffb300 100%);
    border-color: #ffa000;
    color: #333 !important;
    font-size: 1.2rem;
}

.tile.drop-target {
    border-color: var(--gold);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

.tile.dragging {
    opacity: 0.5;
    transform: scale(1.1);
}

.tile[draggable="true"] {
    cursor: grab;
}

.tile[draggable="true"]:active {
    cursor: grabbing;
}

/* Boşluk (Spacer) - Istaka ayırıcı */
.spacer {
    width: 8px;
    height: 50px;
    background: transparent;
    border-radius: 2px;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    position: relative;
}

.spacer::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 30px;
    background: rgba(255, 215, 0, 0.4);
    border-radius: 1px;
}

.spacer:hover::before {
    background: rgba(255, 215, 0, 0.8);
    width: 4px;
}

/* Taş Renkleri - Okey Renkleri */
.tile[data-color="red"] { color: #C62828; }
.tile[data-color="yellow"] { color: #EF6C00; }
.tile[data-color="blue"] { color: #1565C0; }
.tile[data-color="black"] { color: #212121; }

/* Bot Alanı - Küçültülmüş */
.bots-area {
    display: flex;
    justify-content: space-around;
    padding: 8px 12px;
    background: 
        linear-gradient(135deg, 
            rgba(0, 0, 0, 0.3) 0%, 
            rgba(0, 0, 0, 0.2) 100%);
    border-radius: 12px;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        inset 0 1px 3px rgba(0, 0, 0, 0.3),
        0 2px 6px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(4px);
}

.bot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    background: 
        linear-gradient(135deg, 
            rgba(255, 255, 255, 0.08) 0%, 
            rgba(255, 255, 255, 0.05) 100%);
    border-radius: 10px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        inset 0 1px 2px rgba(255, 255, 255, 0.1),
        0 1px 3px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

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

.bot:hover::before {
    left: 100%;
}

.bot.active {
    background: 
        linear-gradient(135deg, 
            rgba(233, 69, 96, 0.4) 0%, 
            rgba(233, 69, 96, 0.3) 100%);
    border-color: rgba(233, 69, 96, 0.6);
    box-shadow: 
        0 0 20px rgba(233, 69, 96, 0.6),
        inset 0 1px 2px rgba(255, 255, 255, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.3);
    animation: botPulse 1s ease-in-out;
    transform: scale(1.05);
}

.bot.opening {
    background: 
        linear-gradient(135deg, 
            rgba(255, 215, 0, 0.5) 0%, 
            rgba(255, 152, 0, 0.4) 100%);
    border-color: rgba(255, 215, 0, 0.8);
    box-shadow: 
        0 0 25px rgba(255, 215, 0, 0.8),
        inset 0 1px 2px rgba(255, 255, 255, 0.3),
        0 2px 10px rgba(0, 0, 0, 0.3);
    animation: botOpen 0.8s ease-in-out;
    transform: scale(1.08);
}

@keyframes botPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes botOpen {
    0% { transform: scale(1); }
    25% { transform: scale(1.1); }
    50% { transform: scale(1.05); }
    75% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

.bot-name {
    font-size: 0.65rem;
    color: var(--text-dim);
}

.bot-tiles {
    font-size: 0.75rem;
    font-weight: 700;
}

/* Masa Alanı */
.table-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    overflow: hidden;
}

.deck-area {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 6px;
    flex-shrink: 0;
}

.deck {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.closed-deck {
    width: 38px;
    height: 50px;
    background: 
        linear-gradient(135deg, #1565C0 0%, #0D47A1 50%, #0a3d91 100%);
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 
        0 3px 10px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255,255,255,0.2);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    border: 2px solid #1976D2;
}

.closed-deck:hover {
    box-shadow: 0 6px 20px rgba(21, 101, 192, 0.5);
}

.closed-deck:active {
    transform: scale(0.95);
}

.deck-count {
    font-size: 0.95rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.deck-label {
    font-size: 0.65rem;
    color: var(--text-dim);
}

.discard-pile {
    min-width: 50px;
    transition: all 0.2s ease;
}

.discard-pile.drop-target {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(233, 69, 96, 0.6);
}

.discard-pile.drop-target .tile {
    border-color: var(--accent);
}

/* Tüm Açılan Taşlar Alanı - Grid Düzeni (2x2) - Büyütülmüş */
.all-opened-areas {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 12px;
    padding: 12px;
    min-height: 280px;
    max-height: 500px;
    overflow: auto;
    flex: 1;
    flex-shrink: 0;
    background: 
        linear-gradient(135deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.1) 100%);
    border-radius: 16px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        inset 0 2px 10px rgba(0, 0, 0, 0.3),
        0 4px 20px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(2px);
}

/* Scrollbar stilleri */
.all-opened-areas::-webkit-scrollbar {
    width: 8px;
}

.all-opened-areas::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.all-opened-areas::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.4);
    border-radius: 4px;
}

.all-opened-areas::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 215, 0, 0.6);
}

/* Her Oyuncu Açılan Taşlar Alanı - Büyütülmüş */
.player-opened-area {
    background: 
        linear-gradient(180deg, 
            rgba(0, 50, 80, 0.85) 0%, 
            rgba(0, 30, 50, 0.95) 50%,
            rgba(0, 20, 40, 1) 100%);
    border-radius: 14px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    min-height: 130px;
    max-height: 240px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.15);
    box-shadow: 
        inset 0 2px 10px rgba(0, 0, 0, 0.4),
        0 4px 12px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.player-opened-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%,
        rgba(255, 215, 0, 0.3) 50%,
        transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.player-opened-area:has(.opened-set)::before {
    opacity: 1;
}

/* Oyuncu (Siz) alanı - özel vurgu */
#player0Opened {
    border-color: rgba(255, 215, 0, 0.6);
    background: 
        linear-gradient(180deg, 
            rgba(0, 60, 100, 0.9) 0%, 
            rgba(0, 40, 70, 0.95) 50%,
            rgba(0, 30, 60, 1) 100%);
    box-shadow: 
        inset 0 2px 10px rgba(0, 0, 0, 0.4),
        0 4px 16px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(255, 215, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Açılan taşları olan alanlar */
.player-opened-area:has(.opened-set) {
    border-color: rgba(255, 215, 0, 0.5);
    background: 
        linear-gradient(180deg, 
            rgba(0, 70, 120, 0.9) 0%, 
            rgba(0, 50, 90, 0.95) 50%,
            rgba(0, 40, 80, 1) 100%);
    box-shadow: 
        inset 0 2px 10px rgba(0, 0, 0, 0.4),
        0 4px 16px rgba(0, 0, 0, 0.3),
        0 0 15px rgba(255, 215, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.opened-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text);
    margin-bottom: 10px;
    padding: 8px 12px;
    background: 
        linear-gradient(135deg, 
            rgba(255, 255, 255, 0.12) 0%, 
            rgba(255, 255, 255, 0.08) 100%);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        inset 0 1px 2px rgba(255, 255, 255, 0.1),
        0 1px 3px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(4px);
}

.opened-header span:first-child {
    font-weight: 800;
    color: var(--gold);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.opened-score {
    color: var(--gold);
    font-weight: 800;
    font-size: 0.75rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    padding: 2px 8px;
    background: rgba(255, 215, 0, 0.15);
    border-radius: 6px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.opened-sets {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
    align-content: flex-start;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    padding: 8px;
}

/* Opened sets scrollbar */
.opened-sets::-webkit-scrollbar {
    width: 6px;
}

.opened-sets::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.opened-sets::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.3);
    border-radius: 3px;
}

.opened-sets::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 215, 0, 0.5);
}

/* Tüm oyuncular için açılan setler - büyütülmüş */
.player-opened-area .opened-set {
    display: flex;
    gap: 4px;
    padding: 8px;
    background: 
        linear-gradient(135deg, 
            rgba(255, 255, 255, 0.18) 0%, 
            rgba(255, 255, 255, 0.12) 100%);
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 
        0 3px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(4px);
}

/* Yeni açılan set animasyonu */
.player-opened-area .opened-set.new-set {
    animation: newSetAppear 0.6s ease-out;
}

@keyframes newSetAppear {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(-10px);
        box-shadow: 0 0 0 rgba(255, 215, 0, 0);
    }
    50% {
        transform: scale(1.05) translateY(0);
        box-shadow: 0 0 25px rgba(255, 215, 0, 0.6);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
        box-shadow: 
            0 3px 8px rgba(0, 0, 0, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.2),
            inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    }
}

.player-opened-area .opened-set::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, 
        rgba(255, 215, 0, 0.3) 0%, 
        rgba(255, 152, 0, 0.2) 50%,
        rgba(255, 215, 0, 0.3) 100%);
    border-radius: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.player-opened-area .opened-set:hover::before {
    opacity: 1;
}

/* Tüm oyuncular için açılan taşlar - büyütülmüş */
.player-opened-area .opened-set .tile {
    width: 38px;
    height: 52px;
    font-size: 1.35rem;
    border-radius: 6px;
    box-shadow: 
        0 3px 8px rgba(0, 0, 0, 0.5),
        inset 0 2px 0 rgba(255, 255, 255, 0.9),
        inset 0 -3px 0 rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
    border-width: 2px;
}

.player-opened-area .opened-set .tile:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 5px 12px rgba(0, 0, 0, 0.6),
        inset 0 2px 0 rgba(255, 255, 255, 0.9),
        inset 0 -3px 0 rgba(0, 0, 0, 0.15),
        0 0 15px rgba(255, 215, 0, 0.4);
    z-index: 10;
}

.player-opened-area .opened-set .tile .tile-number {
    font-size: 1.3rem;
    font-weight: 900;
}

.player-opened-area .opened-set .tile .tile-color {
    width: 6px;
    height: 6px;
}

/* İşlek taş vurgusu */
.tile.islek {
    border: 2px solid #FF9800 !important;
    box-shadow: 0 0 10px rgba(255, 152, 0, 0.8) !important;
    animation: islekPulse 1.5s ease-in-out infinite;
}

@keyframes islekPulse {
    0%, 100% { 
        box-shadow: 0 0 10px rgba(255, 152, 0, 0.8);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 18px rgba(255, 152, 0, 1);
        transform: scale(1.05);
    }
}

/* Oyuncu açılan set hover efekti */
.player-opened-area .opened-set:hover {
    border-color: rgba(255, 215, 0, 0.7);
    background: 
        linear-gradient(135deg, 
            rgba(255, 255, 255, 0.25) 0%, 
            rgba(255, 255, 255, 0.18) 100%);
    box-shadow: 
        0 5px 15px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(255, 215, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    transform: translateY(-3px) scale(1.02);
}

.player-opened-area .opened-set.drop-target {
    border-color: var(--accent);
    background: 
        linear-gradient(135deg, 
            rgba(233, 69, 96, 0.2) 0%, 
            rgba(233, 69, 96, 0.15) 100%);
    box-shadow: 
        0 0 25px rgba(233, 69, 96, 0.8),
        0 5px 15px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
    animation: dropTargetPulse 1s ease-in-out infinite;
}

@keyframes dropTargetPulse {
    0%, 100% {
        box-shadow: 
            0 0 25px rgba(233, 69, 96, 0.8),
            0 5px 15px rgba(0, 0, 0, 0.4);
    }
    50% {
        box-shadow: 
            0 0 35px rgba(233, 69, 96, 1),
            0 5px 20px rgba(0, 0, 0, 0.5);
    }
}

/* Genel açılan set (botlar için) */
.opened-set {
    display: flex;
    gap: 1px;
    padding: 3px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.2s ease;
    position: relative;
}

/* Çekilebilir taş (4 renkli per'den) */
.takeable-tile {
    position: relative;
    animation: takeablePulse 2s ease-in-out infinite;
    border: 2px solid var(--gold) !important;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.6) !important;
}

.takeable-tile:hover {
    transform: scale(1.1);
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.8) !important;
}

.takeable-tile::after {
    content: '↑';
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--gold);
    color: var(--bg-dark);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

@keyframes takeablePulse {
    0%, 100% { 
        box-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
    }
    50% { 
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.9);
    }
}

/* Değiştirilebilir okey (yerine taş koyulabilir) */
.replaceable-okey {
    position: relative;
    animation: replaceablePulse 2s ease-in-out infinite;
    border: 2px solid #4CAF50 !important;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.7) !important;
}

.replaceable-okey:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.9) !important;
}

.replaceable-okey::after {
    content: '↔';
    position: absolute;
    top: -8px;
    right: -8px;
    background: #4CAF50;
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

@keyframes replaceablePulse {
    0%, 100% { 
        box-shadow: 0 0 10px rgba(76, 175, 80, 0.7);
    }
    50% { 
        box-shadow: 0 0 18px rgba(76, 175, 80, 1);
    }
}

.opened-set:hover {
    border-color: rgba(255, 215, 0, 0.5);
    background: rgba(255, 255, 255, 0.12);
}

.opened-set.drop-target {
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(233, 69, 96, 0.5);
}

/* Oyuncu açılan set animasyonu */
.player-opened-area .opened-set.new-set {
    animation: playerSetAppear 0.8s ease-out;
    border-color: rgba(255, 215, 0, 0.9);
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.7);
}

@keyframes playerSetAppear {
    0% {
        opacity: 0;
        transform: scale(0.7) translateY(-15px) rotate(-5deg);
    }
    50% {
        transform: scale(1.15) translateY(0) rotate(2deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0) rotate(0deg);
    }
}

.opened-set.new-set {
    animation: setAppear 0.6s ease-out;
    border-color: rgba(255, 215, 0, 0.8);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

@keyframes setAppear {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(-10px);
    }
    50% {
        transform: scale(1.1) translateY(0);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.opened-set .tile {
    width: 22px;
    height: 30px;
    font-size: 0.75rem;
    border-radius: 3px;
}

/* Oyuncu Eli - Istaka Stili */
.player-area {
    padding: 8px 6px;
    background: linear-gradient(180deg, #8B4513 0%, #654321 50%, #4a3218 100%);
    border-radius: 10px;
    border: 2px solid #5c3d2e;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.5), 0 3px 12px rgba(0,0,0,0.3);
    flex-shrink: 0;
}

.hand-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    padding: 0 6px;
}

.tile-count {
    font-size: 0.75rem;
    color: var(--gold);
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.player-score {
    font-size: 0.75rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.player-hand {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    justify-content: flex-start;
    align-content: flex-start;
    min-height: 80px;
    max-height: 160px;
    padding: 6px;
    background: linear-gradient(180deg, #6d4c2a 0%, #5a3d22 100%);
    border-radius: 6px;
    border: 2px solid #4a3218;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.4);
    overflow-y: auto;
    position: relative;
    /* 2 katlı görünüm için - yaklaşık 2 sıra taş sığacak genişlik */
    max-width: 100%;
}

/* Taşların 2 sıra halinde görünmesi için - her taş sabit genişlik */
.player-hand .tile,
.player-hand .spacer {
    width: 28px;
    flex-shrink: 0;
}

/* 2 katlı görünüm için ayırıcı çizgi */
.player-hand::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 5%;
    right: 5%;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 215, 0, 0.3) 20%, 
        rgba(255, 215, 0, 0.5) 50%, 
        rgba(255, 215, 0, 0.3) 80%, 
        transparent 100%);
    z-index: 0;
    pointer-events: none;
    border-radius: 1px;
}

/* Boş alan drop target */
.player-hand.drop-target {
    background: linear-gradient(180deg, #7d5c3a 0%, #6a4d32 100%);
    border-color: rgba(255, 215, 0, 0.5);
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.4), 0 0 15px rgba(255, 215, 0, 0.3);
}

.player-hand .tile {
    width: 26px;
    height: 36px;
    font-size: 0.85rem;
    margin: 0.5px;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.player-hand .spacer {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

/* Aksiyon Butonları */
.action-buttons {
    display: flex;
    gap: 8px;
    padding: 8px;
}

/* Mesaj */
.message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    font-weight: 600;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.message.show {
    opacity: 1;
}

.turn-indicator {
    text-align: center;
    font-size: 0.85rem;
    color: var(--gold);
    font-weight: 600;
    padding: 6px;
}

/* Oyun Sonu */
#gameOver {
    background: rgba(0, 0, 0, 0.95);
    justify-content: center;
    align-items: center;
}

.game-over-container {
    text-align: center;
    padding: 40px;
    max-width: 500px;
    width: 90%;
}

.game-over-container h2 {
    font-size: 2rem;
    color: var(--gold);
    margin-bottom: 15px;
}

.round-info-text {
    color: var(--gold);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.game-over-container p {
    color: var(--text-dim);
    margin-bottom: 20px;
}

.total-scores {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.total-scores h3 {
    color: var(--gold);
    font-size: 1.2rem;
    margin-bottom: 15px;
    font-weight: 700;
}

.total-score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 1rem;
}

.total-score-item:last-child {
    border-bottom: none;
}

.total-score-item.winner {
    color: var(--gold);
    font-weight: 700;
    font-size: 1.1rem;
}

.total-score-name {
    color: var(--text);
}

.total-score-value {
    color: var(--gold);
    font-weight: 700;
}

.remaining-tiles {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    margin: 15px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.remaining-tiles h4 {
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.remaining-tile-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.9rem;
    color: var(--text);
}

.remaining-tile-item.winner {
    color: var(--gold);
    font-weight: 700;
}

.game-over-container .btn {
    display: block;
    width: 100%;
    margin-bottom: 12px;
}

/* Responsive */
@media (max-width: 380px) {
    .game-title {
        font-size: 2.5rem;
    }
    
    .player-hand .tile {
        width: 28px;
        height: 40px;
        font-size: 0.9rem;
    }
    
    .btn-action {
        padding: 10px 12px;
        font-size: 0.75rem;
    }
}

@media (min-height: 700px) {
    .table-area {
        gap: 15px;
    }
    
    .player-hand .tile {
        width: 36px;
        height: 48px;
    }
}


