/* 101 Okey - Stil */
:root {
    --bg-dark: #1a472a;
    --bg-table: #0d5c2e;
    --felt: #0d5c2e;
    --tile-bg: #f5e6c8;
    --tile-border: #8b6914;
    --text: #f0f0f0;
    --accent: #f4c430;
    --danger: #c0392b;
    --safe: #27ae60;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(180deg, #0d1f14 0%, var(--bg-dark) 40%, #122a1c 100%);
    color: var(--text);
    min-height: 100vh;
    /* PWA: çentikli ekranlarda güvenli alan */
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
    padding-top: env(safe-area-inset-top);
}

/* Lobby */
.lobby .container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    padding-left: max(2rem, env(safe-area-inset-left));
    padding-right: max(2rem, env(safe-area-inset-right));
}

/* Son oyunlarım (giriş yapmış kullanıcı) */
.my-games-section {
    margin-bottom: 1.5rem;
}
.my-games-section.hidden {
    display: none !important;
}
.my-games-title {
    font-size: 1rem;
    color: rgba(255,255,255,0.8);
    margin: 0 0 0.5rem;
    font-weight: 600;
}
.my-games-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.my-game-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s, border-color 0.2s;
}
.my-game-link:hover {
    background: rgba(255,255,255,0.18);
    border-color: var(--accent);
    color: #fff;
}
.my-game-code {
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--accent);
}
.my-game-status {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.7);
}
.my-games-empty {
    margin: 0;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.6);
}

.lobby header,
.lobby-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-link {
    display: inline-block;
    margin: 0 auto 0.5rem;
    line-height: 0;
}
.site-logo {
    display: block;
    max-width: 280px;
    width: 100%;
    height: auto;
    object-fit: contain;
}
@media (max-width: 400px) {
    .site-logo {
        max-width: 220px;
    }
}

.lobby header h1 {
    font-size: 2.5rem;
    color: var(--accent);
    margin: 0;
}

.lobby .subtitle {
    color: #aaa;
    margin-top: 0.5rem;
}

.lobby-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 600px) {
    .lobby-main { grid-template-columns: 1fr; }
}

.card {
    background: rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(255,255,255,0.1);
}

.card h2 {
    margin-top: 0;
    font-size: 1.25rem;
    color: var(--accent);
}

.card label {
    display: block;
    margin-top: 1rem;
    margin-bottom: 0.25rem;
    color: #bbb;
}

.card input {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    background: rgba(0,0,0,0.2);
    color: #fff;
    font-size: 1rem;
}

.card input.code-input {
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

.card button {
    width: 100%;
    margin-top: 1.25rem;
    padding: 0.75rem;
    background: var(--accent);
    color: #1a1a1a;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    font-size: 1rem;
}

.card button:hover {
    background: #ffd54f;
}

.result {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 6px;
}

.result.error { background: rgba(192,57,43,0.3); color: #ffcccc; }
.result.success { background: rgba(39,174,96,0.3); color: #a8f0c8; }
.hidden { display: none !important; }

/* Lobby: kullanıcı menüsü */
.lobby-header {
    position: relative;
}
.user-nav {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}
.user-name {
    color: rgba(255,255,255,0.9);
    font-size: 0.95rem;
}
.user-name strong {
    color: var(--accent);
}
.btn-logout,
.btn-auth {
    padding: 0.45rem 0.9rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}
.btn-logout {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
}
.btn-logout:hover {
    background: rgba(255,255,255,0.25);
}
.btn-auth {
    background: transparent;
    color: rgba(255,255,255,0.9);
    border: 1px solid rgba(255,255,255,0.4);
}
.btn-auth:hover {
    background: rgba(255,255,255,0.1);
    color: var(--accent);
}
.btn-auth.btn-register {
    background: var(--accent);
    color: #1a1a1a;
    border-color: var(--accent);
}
.btn-auth.btn-register:hover {
    background: #f5c84d;
}
.field-hint {
    margin: 0.35rem 0 0;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.6);
}

/* Giriş / Kayıt sayfaları */
.auth-page .lobby-main {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
}
.auth-card-wrap {
    max-width: 400px;
    margin: 0 auto;
}
.auth-card {
    padding: 1.75rem;
}
.auth-card h2 {
    margin-bottom: 1rem;
}
.auth-card .auth-error {
    margin: 0 0 1rem;
    padding: 0.6rem 0.75rem;
    background: rgba(192,57,43,0.25);
    color: #ffcccc;
    border-radius: 8px;
    font-size: 0.9rem;
}
.auth-card .auth-footer {
    margin-top: 1.25rem;
    text-align: center;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.7);
}
.auth-card .auth-footer a {
    color: var(--accent);
    text-decoration: none;
}
.auth-card .auth-footer a:hover {
    text-decoration: underline;
}

/* Game page */
.game-page {
    padding: 0.5rem;
    min-height: 100vh;
    padding-left: max(0.5rem, env(safe-area-inset-left));
    padding-right: max(0.5rem, env(safe-area-inset-right));
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
    padding-top: max(0.5rem, env(safe-area-inset-top));
}

.game-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Lobi bekleme alanı */
.lobby-waiting {
    display: block;
    min-height: 70vh;
    padding: 2rem 1rem;
}

.lobby-waiting.hidden {
    display: none !important;
}

.lobby-card {
    max-width: 420px;
    margin: 0 auto;
    background: rgba(0,0,0,0.35);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid rgba(255,255,255,0.15);
    text-align: center;
}

.lobby-card h2 {
    margin: 0 0 0.5rem;
    color: var(--accent);
    font-size: 1.75rem;
}

.lobby-subtitle {
    color: rgba(255,255,255,0.8);
    margin: 0 0 1.5rem;
    font-size: 0.95rem;
}

.lobby-code-box {
    margin-bottom: 1rem;
}

.lobby-code-box label {
    display: block;
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.lobby-code {
    font-size: 1.75rem;
    font-weight: bold;
    letter-spacing: 0.35em;
    color: #fff;
    padding: 0.75rem;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    transition: background 0.2s;
}

.lobby-code:hover {
    background: rgba(0,0,0,0.45);
}

.lobby-code-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.lobby-settings-summary {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.55);
    margin: 0 0 1rem;
}

.lobby-settings-summary.hidden {
    display: none !important;
}

.lobby-toolbar {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.lobby-toolbar .btn-lobby-link {
    text-decoration: none;
    color: inherit;
    display: inline-flex;
    align-items: center;
}

.lobby-toolbar .btn-lobby-link:hover {
    text-decoration: underline;
}

.lobby-progress {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.lobby-progress-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.35);
    transition: background 0.2s, border-color 0.2s;
}

.lobby-progress-dot.filled {
    background: var(--accent);
    border-color: var(--accent);
}

.btn-copy {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
    color: #fff;
    cursor: pointer;
}

.btn-copy:hover {
    background: var(--accent);
    color: #1a1a1a;
    border-color: var(--accent);
}

.lobby-share {
    color: rgba(255,255,255,0.5);
    font-size: 0.8rem;
    margin-bottom: 1.5rem;
}

.btn-lobby-options {
    display: inline-block;
    margin-bottom: 1rem;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.95);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.btn-lobby-options:hover {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.5);
}

.btn-lobby-options.hidden {
    display: none !important;
}

.lobby-options-row {
    margin-bottom: 0.6rem;
}

.lobby-options-row:last-child {
    margin-bottom: 0;
}

.lobby-options-row label {
    display: block;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.7);
    margin-bottom: 0.25rem;
}

.lobby-input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0.5rem 0.6rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.08);
    color: #fff;
    font-size: 0.95rem;
}

.lobby-input::placeholder {
    color: rgba(255,255,255,0.4);
}

.lobby-input-num {
    max-width: 8rem;
}

.lobby-finished .lobby-options-title {
    color: var(--accent);
}

/* Lobi ayarları modal */
.modal.lobby-options-modal {
    background: linear-gradient(145deg, #2a2a2e 0%, #1e1e22 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 1.25rem;
    max-width: 22rem;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.lobby-options-modal .modal-title {
    margin: 0 0 1rem;
    font-size: 1.15rem;
    color: #fff;
}

.lobby-options-form {
    margin-bottom: 1.25rem;
}

.lobby-options-modal .modal-actions-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.lobby-options-modal .modal-actions-footer .btn-tap {
    min-height: 44px;
    padding: 0.6rem 1rem;
}

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

.lobby-player-slot {
    position: relative;
    background: rgba(0,0,0,0.25);
    border-radius: 12px;
    padding: 1rem;
    border: 2px dashed rgba(255,255,255,0.2);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.lobby-player-slot.filled {
    border-style: solid;
    border-color: rgba(244, 196, 48, 0.4);
}

.lobby-player-slot.is-me {
    border-color: rgba(244, 196, 48, 0.6);
    box-shadow: 0 0 0 1px rgba(244, 196, 48, 0.3);
}

.lobby-player-slot.is-me.filled {
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(244, 196, 48, 0.25);
}

.lobby-badge-me {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.45rem;
    border-radius: 6px;
    background: var(--accent);
    color: #1a1a1a;
}

.lobby-badge-me.hidden {
    display: none !important;
}

.lobby-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.2);
    margin: 0 auto 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.25rem;
    color: rgba(255,255,255,0.6);
}

.lobby-player-slot.filled .lobby-avatar {
    background: rgba(244, 196, 48, 0.2);
    border-color: var(--accent);
    color: #fff;
}

.lobby-name {
    display: block;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.85);
}

.lobby-player-slot:not(.filled) .lobby-name {
    color: rgba(255,255,255,0.4);
}

.lobby-teams-label {
    margin: 0 0 0.5rem;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.75);
}

.lobby-slot-teams {
    display: flex;
    gap: 0.35rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.lobby-team-btn {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 6px;
    background: rgba(0,0,0,0.2);
    color: rgba(255,255,255,0.85);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.lobby-team-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.5);
}

.lobby-team-btn.active {
    background: rgba(244, 196, 48, 0.3);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}

.lobby-count {
    font-weight: bold;
    color: var(--accent);
    margin-bottom: 1rem;
}

.btn-start-lobby {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    background: var(--accent);
    color: #1a1a1a;
    cursor: pointer;
}

.btn-start-lobby:hover {
    background: #ffd54f;
}

.lobby-hint {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
}

.lobby-footer {
    margin: 1.5rem 0 0;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.lobby-leave-link {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    transition: color 0.2s;
}

.lobby-leave-link:hover {
    color: var(--accent);
}

.btn-share {
    min-width: 4rem;
}

.game-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}
.team-scores {
    display: flex;
    gap: 1rem;
    align-items: center;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.85);
}
.team-score-item {
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    background: rgba(0,0,0,0.2);
}
.team-score-item.my-team {
    background: rgba(244, 196, 48, 0.25);
    color: var(--accent);
    font-weight: 600;
}
.team-score-item strong {
    margin-left: 0.15rem;
}

.btn-tea-wrap {
    position: relative;
}

.btn-tea {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.6rem;
    font-size: 0.85rem;
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.95);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.btn-tea:hover {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.5);
}

.btn-tea-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.btn-tea-label {
    font-weight: 500;
}

.tea-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.35rem;
    min-width: 12rem;
    padding: 0.35rem 0;
    background: linear-gradient(145deg, #2a2a2e 0%, #1e1e22 100%);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
    z-index: 100;
}

.tea-dropdown.hidden {
    display: none !important;
}

.tea-dropdown-item {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    text-align: left;
    border: none;
    background: none;
    color: rgba(255,255,255,0.9);
    cursor: pointer;
    transition: background 0.15s;
}

.tea-dropdown-item:hover {
    background: rgba(255,255,255,0.1);
}

.tea-dropdown-item[data-to-position="table"] {
    font-weight: 600;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 0.25rem;
}

/* players-bottom içinde Çayla dropdown yukarı açılsın */
.players-bottom .btn-tea-wrap .tea-dropdown {
    top: auto;
    bottom: 100%;
    margin-top: 0;
    margin-bottom: 0.35rem;
}

.partner-info {
    margin: 0.15rem 0 0;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
}
.partner-info[aria-hidden="true"] {
    display: none;
}
.logo-in-header {
    display: block;
    line-height: 0;
    flex-shrink: 0;
}
.site-logo-header {
    height: 36px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
}
.logo-in-card {
    display: block;
    margin-bottom: 0.5rem;
    line-height: 0;
}
.site-logo-card {
    max-width: 200px;
    margin: 0 auto;
}

.game-header .game-code,
.game-header .round-info {
    color: #bbb;
}

.turn-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    background: rgba(244, 196, 48, 0.25);
    border: 2px solid var(--accent);
    border-radius: 8px;
    font-weight: bold;
    color: var(--accent);
    box-shadow: 0 0 12px rgba(244, 196, 48, 0.3);
}

.turn-indicator.hidden {
    display: none !important;
}

.turn-indicator .turn-label {
    color: rgba(255,255,255,0.9);
}

.turn-indicator .turn-player {
    color: #fff;
}

.turn-indicator .turn-hint {
    margin-left: 0.5rem;
    font-size: 0.8rem;
    font-weight: normal;
    color: rgba(255, 255, 255, 0.85);
}

.game-code-copy {
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}
.game-code-copy:hover {
    background: rgba(244, 196, 48, 0.25);
    color: var(--accent);
}

.loading-indicator {
    position: fixed;
    top: 0.75rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.4rem 1rem;
    background: rgba(0, 0, 0, 0.7);
    color: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    font-size: 0.85rem;
    z-index: 99;
}
.loading-indicator.hidden {
    display: none !important;
}

#btn-start {
    padding: 0.5rem 1rem;
    background: var(--accent);
    color: #1a1a1a;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
}

/* Masa – gerçekçi yeşil çuha ve ahşap çerçeve */
.table {
    background:
        radial-gradient(ellipse 80% 60% at 50% 50%, rgba(255,255,255,0.04) 0%, transparent 50%),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 40px,
            rgba(0,0,0,0.03) 40px,
            rgba(0,0,0,0.03) 41px
        ),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 40px,
            rgba(0,0,0,0.03) 40px,
            rgba(0,0,0,0.03) 41px
        ),
        linear-gradient(160deg, #0f6b38 0%, #0d5c2e 30%, #0a4d25 70%, #083d1e 100%);
    border-radius: 20px;
    padding: 1.25rem;
    min-height: 70vh;
    border: 12px solid #3d2817;
    box-shadow:
        inset 0 0 80px rgba(0,0,0,0.25),
        inset 0 2px 0 rgba(255,255,255,0.06),
        0 8px 24px rgba(0,0,0,0.5);
    position: relative;
}

.table::before {
    content: '';
    position: absolute;
    top: -12px;
    left: -12px;
    right: -12px;
    bottom: -12px;
    border-radius: 24px;
    border: 3px solid #5d3a1f;
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(139, 90, 43, 0.5);
    z-index: 0;
}

.table > * {
    position: relative;
    z-index: 1;
}

/* Oyuncu kutuları */
.player-box {
    padding: 0.5rem;
    background: rgba(0,0,0,0.25);
    border-radius: 10px;
    text-align: center;
    border: 2px solid transparent;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.player-box.current-turn,
.player-other.current-turn,
.players-top.current-turn {
    border-color: var(--accent);
    background: rgba(244, 196, 48, 0.15);
    box-shadow: 0 0 20px rgba(244, 196, 48, 0.4);
}

.player-box.me.current-turn {
    box-shadow: 0 0 24px rgba(244, 196, 48, 0.5);
}

.player-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
    color: rgba(255,255,255,0.9);
    margin-bottom: 4px;
}

.player-box.me .player-avatar {
    background: rgba(244, 196, 48, 0.3);
    border-color: var(--accent);
    color: #fff;
}

.player-box.current-turn .player-avatar {
    border-color: var(--accent);
    background: rgba(244, 196, 48, 0.25);
}

.player-box .player-name {
    font-weight: bold;
    font-size: 0.95rem;
}

.player-box .player-score {
    color: var(--accent);
    font-size: 0.9rem;
}

/* Diğer oyuncular – temsili görünüm */
.player-other {
    background: rgba(0,0,0,0.35);
    border-radius: 10px;
    padding: 0.5rem;
    border: 2px solid rgba(255,255,255,0.1);
}

.player-other .player-name {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.85);
}

.player-other .player-score {
    font-size: 0.85rem;
    color: rgba(244, 196, 48, 0.9);
}

.players-top.player-other {
    padding: 0.5rem;
    background: rgba(0,0,0,0.35);
    border-radius: 10px;
    border: 2px solid rgba(255,255,255,0.1);
}

.players-top.player-other .player-avatar {
    margin: 0 auto 4px;
}

/* Diğer oyuncuların eli gösterilmez – sadece “El kapalı” metni */
.opponent-hand-hidden {
    margin: 6px 0 0;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.4);
    font-style: italic;
}

.player-tiles {
    min-height: 36px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px;
    margin-top: 4px;
}

.players-top {
    text-align: center;
    margin-bottom: 0.5rem;
}

.middle {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    min-height: 140px;
}

.players-side {
    flex: 0 0 120px;
    display: flex;
    align-items: center;
}

.players-side .player-tiles {
    flex-direction: column;
}

.board-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.okey-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.deck-area, .discard-area {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.okey-tile-container {
    display: inline-block;
}

/* Deste – taş ile aynı boyut ve stil, kapalı (sırt) görünümü */
.deck {
    width: 46px;
    height: 64px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    border: none;
    /* Taşla aynı 3D his: açık kahve sırt rengi */
    background: linear-gradient(145deg, #b8a078 0%, #9a8558 40%, #7a6a48 60%, #5a4a28 100%);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.35),
        inset 0 -1px 0 rgba(0,0,0,0.2),
        0 2px 4px rgba(0,0,0,0.2),
        0 3px 8px rgba(0,0,0,0.25);
    color: rgba(255,255,255,0.5);
    font-size: 0.65rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.deck::before {
    content: '';
    position: absolute;
    inset: 6px;
    border-radius: 4px;
    background: repeating-linear-gradient(
        90deg,
        transparent 0,
        transparent 3px,
        rgba(0,0,0,0.08) 3px,
        rgba(0,0,0,0.08) 4px
    );
    pointer-events: none;
    z-index: 0;
}
.deck.deck-draggable {
    cursor: grab;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.4),
        inset 0 -1px 0 rgba(0,0,0,0.2),
        0 0 0 2px var(--accent),
        0 4px 12px rgba(244, 196, 48, 0.3);
}
.deck.deck-draggable:active {
    cursor: grabbing;
}
.hand-area.hand-area-deck-drop .empty-slot,
.hand-area.hand-area-deck-drop .tile.tile-in-rack,
.hand-area.hand-area-discard-drop .empty-slot,
.hand-area.hand-area-discard-drop .tile.tile-in-rack,
.empty-slot.deck-drop,
.tile.deck-drop,
.empty-slot.discard-drop,
.tile.discard-drop {
    outline: 2px dashed var(--accent);
    outline-offset: 2px;
    background: rgba(244, 196, 48, 0.15);
}

.deck-area {
    min-height: 64px;
}
.discard-stack {
    min-width: 46px;
    min-height: 64px;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    cursor: default;
}
.discard-stack.discard-draggable {
    cursor: grab;
}
.discard-stack.discard-draggable:active {
    cursor: grabbing;
}
.discard-stack.discard-draggable .tile {
    cursor: grab;
    pointer-events: none;
}
.discard-stack.discard-draggable .tile:active {
    cursor: grabbing;
}
.discard-stack.discard-drop-target {
    outline: 2px dashed var(--accent);
    outline-offset: 4px;
    background: rgba(244, 196, 48, 0.2);
    border-radius: 8px;
}

.melds-area {
    min-height: 60px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
}

.players-bottom {
    margin-top: 0.5rem;
}

.players-bottom .player-box {
    max-width: 100%;
}

/* Istaka – örnek: 2 ayrı tahta sıra, ahşap ayırıcı, açık kahve dokulu */
.istaka-wrapper {
    margin: 12px 0;
    width: 100%;
}

.istaka {
    display: block;
    width: 100%;
    padding: 14px 12px 18px;
    /* Açık kahverengi ahşap, belirgin damar dokusu */
    background:
        repeating-linear-gradient(
            105deg,
            transparent 0,
            transparent 1px,
            rgba(0,0,0,0.04) 1px,
            rgba(0,0,0,0.04) 2px
        ),
        repeating-linear-gradient(
            75deg,
            transparent 0,
            transparent 2px,
            rgba(255,255,255,0.03) 2px,
            rgba(255,255,255,0.03) 3px
        ),
        linear-gradient(180deg, #c4a574 0%, #b8956a 15%, #a67c52 45%, #8b6340 75%, #6b4a2b 100%);
    border-radius: 8px;
    box-shadow:
        inset 0 2px 4px rgba(255,255,255,0.2),
        inset 0 -2px 4px rgba(0,0,0,0.2),
        0 4px 12px rgba(0,0,0,0.4);
    border: 1px solid #8b6b42;
    position: relative;
}

/* Üst kenar – ince tahta şerit */
.istaka::before {
    content: '';
    position: absolute;
    top: 0;
    left: 8px;
    right: 8px;
    height: 6px;
    background: linear-gradient(180deg, #d4b882 0%, #b8956a 100%);
    border-radius: 6px 6px 0 0;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.4);
    pointer-events: none;
    z-index: 0;
}

/* Alttaki dudak – taşların dayandığı kenar */
.istaka-lip {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 12px;
    background: linear-gradient(180deg, #8b6340 0%, #6b4a2b 50%, #5a3d22 100%);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.35);
    pointer-events: none;
    z-index: 0;
}

/* Taş yuvası – 2 sıra, ortada ayırıcı için boşluk */
.istaka-slot {
    position: relative;
    z-index: 2;
    padding: 10px 8px 12px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.istaka-other .istaka-slot {
    transform: none;
    min-height: 80px;
    padding: 4px;
    max-width: 320px;
}

.istaka-other.istaka-horizontal .istaka-slot {
    flex-direction: row;
    flex-wrap: wrap;
    max-width: 320px;
}

.istaka-other.istaka-vertical .istaka-slot {
    flex-direction: column;
    flex-wrap: wrap;
    max-height: 90px;
    align-content: center;
}

.istaka-other {
    padding: 8px 12px 10px;
}

/* El alanı – 18×2 = 36 yuva (12 ekstra boş alan), tam genişlik, iyileştirilmiş tasarım */
.hand-area {
    position: relative;
    display: grid;
    grid-template-columns: repeat(18, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 6px;
    padding: 8px 6px;
    width: 100%;
    min-height: 152px;
    box-sizing: border-box;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.08);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
}

/* İki sıra arasında tahta ayırıcı – örnek ıstakadaki gibi */
.hand-area::before {
    content: '';
    position: absolute;
    left: -8px;
    right: -8px;
    top: 50%;
    margin-top: -6px;
    height: 12px;
    background: linear-gradient(180deg, #9a7355 0%, #7b5a3d 35%, #6b4a2b 70%, #5a3d22 100%);
    border-radius: 6px;
    box-shadow:
        inset 0 2px 0 rgba(255,255,255,0.2),
        0 2px 4px rgba(0,0,0,0.35);
    pointer-events: none;
    z-index: 1;
    border: 1px solid rgba(0,0,0,0.15);
}

/* Boş yuva – hücreyi doldurur, sürüklenen taş bırakılabilir, iyileştirilmiş görünüm */
.hand-area .empty-slot {
    width: 100%;
    height: 100%;
    min-height: 48px;
}
.empty-slot {
    border: 2px dashed rgba(255, 255, 255, 0.4);
    border-radius: 10px;
    background: linear-gradient(145deg, rgba(0, 0, 0, 0.12) 0%, rgba(0, 0, 0, 0.22) 100%);
    box-sizing: border-box;
    cursor: default;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.empty-slot:hover {
    border-color: rgba(255, 255, 255, 0.5);
    background: linear-gradient(145deg, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.25) 100%);
}

.empty-slot.drag-over {
    border-color: var(--accent);
    border-style: solid;
    background: linear-gradient(145deg, rgba(244, 196, 48, 0.25) 0%, rgba(244, 196, 48, 0.15) 100%);
    box-shadow: inset 0 0 0 2px rgba(244, 196, 48, 0.4), 0 0 12px rgba(244, 196, 48, 0.2);
}

/* Istaka kilitli: sıra sizde değil veya taş çekmediniz */
/* Kilitliyken sadece boş yuva tıklanamaz; taşlar seçim için tıklanabilir kalır */
.istaka-locked .empty-slot {
    pointer-events: none;
}

.tile.tile-locked {
    opacity: 0.65;
}

.istaka-locked .empty-slot {
    opacity: 0.6;
}

/* Geçerli/geçersiz dizilim (masa grupları) */
.meld-valid {
    outline: 2px solid var(--safe);
    outline-offset: 2px;
    border-radius: 6px;
}

.meld-invalid {
    outline: 2px solid var(--danger);
    outline-offset: 2px;
    border-radius: 6px;
}

.players-top .player-tiles,
.players-side .player-tiles {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: center;
    gap: 2px;
    min-height: 76px;
}

.players-top .player-tiles { max-width: 320px; }
.players-side .player-tiles { max-height: 90px; }

.istaka-hint {
    margin: 6px 0 0;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.6);
    text-align: center;
}

.btn-gap {
    margin-left: 8px;
    padding: 4px 10px;
    font-size: 0.8rem;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
    color: #fff;
    cursor: pointer;
}

.btn-gap:hover:not(:disabled) {
    background: rgba(244, 196, 48, 0.3);
    border-color: var(--accent);
}

.btn-gap:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.players-bottom-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.actions button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    background: rgba(255,255,255,0.2);
    color: #fff;
}

.actions button:hover:not(:disabled) {
    background: var(--accent);
    color: #1a1a1a;
}

.actions button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.actions button.primary {
    background: var(--accent);
    color: #1a1a1a;
}

.turn-badge {
    background: var(--accent);
    color: #1a1a1a;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 4px;
}

/* Taş – örnek ıstakadaki gibi: sayı üstte, renk sembolü altta */
.tile {
    width: 46px;
    height: 64px;
    border-radius: 6px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0 6px;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    position: relative;
    border: none;
    background: linear-gradient(145deg, #faf6ed 0%, #f0e8d8 40%, #e5dcc8 100%);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.95),
        inset 0 -1px 0 rgba(0,0,0,0.06),
        0 2px 4px rgba(0,0,0,0.2);
    color: #1a1a1a;
}

.tile-inner {
    font-weight: bold;
    font-size: 1.35rem;
    line-height: 1;
    z-index: 1;
    text-shadow: 0 1px 0 rgba(255,255,255,0.6);
    flex-shrink: 0;
}

/* Renk göstergesi – taşın alt yarısında (örnek ıstakadaki gibi) */
.tile::before {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), 0 1px 2px rgba(0,0,0,0.2);
    pointer-events: none;
}

.tile.color-s::before { background: radial-gradient(circle at 30% 30%, #4a4a4a, #1a1a1a); }
.tile.color-m::before { background: radial-gradient(circle at 30% 30%, #5b8fd4, #2563eb); }
.tile.color-k::before { background: radial-gradient(circle at 30% 30%, #dc4a4a, #b91c1c); }
.tile.color-y::before { background: radial-gradient(circle at 30% 30%, #eab308, #ca8a04); }

.tile.color-s .tile-inner { color: #1a1a1a; }
.tile.color-m .tile-inner { color: #1e40af; }
.tile.color-k .tile-inner { color: #991b1b; }
.tile.color-y .tile-inner { color: #a16207; }

/* Joker taşı */
.tile.joker {
    background: linear-gradient(145deg, #f5e6ff 0%, #e9d5ff 40%, #d8b4fe 100%);
}

.tile.joker::before {
    width: 14px;
    height: 14px;
    bottom: 6px;
    background: radial-gradient(circle at 30% 30%, #c084fc, #7c3aed);
}

.tile.joker .tile-inner {
    color: #5b21b6;
    font-size: 1.1rem;
}

.tile.small {
    width: 34px;
    height: 46px;
}

.tile.small .tile-inner { font-size: 0.95rem; }
.tile.small::before { width: 10px; height: 10px; bottom: 4px; }

/* Istakadaki taş – hücreyi doldurur, tam genişlik deneyimi */
.hand-area .tile.tile-in-rack {
    width: 100%;
    height: 100%;
    min-width: 32px;
    min-height: 48px;
}
.tile.tile-in-rack {
    border-radius: 8px;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.85),
        inset 0 -1px 0 rgba(0,0,0,0.08),
        0 3px 6px rgba(0,0,0,0.25);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.tile.tile-in-rack.selected {
    transform: translateY(-8px);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.9),
        0 8px 16px rgba(0,0,0,0.35);
    z-index: 10;
}

.tile.tile-in-rack.dragging {
    opacity: 0.6;
    cursor: grabbing;
    z-index: 20;
}

.tile.tile-in-rack.drag-over {
    outline: 2px dashed var(--accent);
    outline-offset: 2px;
}

.tile.selected:not(.tile-in-rack) {
    transform: translateY(-6px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.3);
}

/* Diğer oyuncu taşları (kapalı) */
.tile.other-player {
    width: 26px;
    height: 36px;
    background: linear-gradient(145deg, #3d3d3d 0%, #2d2d2d 50%, #1f1f1f 100%);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.1),
        0 2px 4px rgba(0,0,0,0.4);
}

.tile.other-player::before {
    display: none;
}

.tile.other-player .tile-inner {
    color: #666;
    font-size: 0.75rem;
}

.message {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    z-index: 100;
    max-width: 90%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    animation: messageIn 0.3s ease;
}
.message.hidden {
    animation: messageOut 0.25s ease forwards;
}
@keyframes messageIn {
    from { opacity: 0; transform: translateX(-50%) translateY(1rem); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes messageOut {
    from { opacity: 1; transform: translateX(-50%) translateY(0); }
    to { opacity: 0; transform: translateX(-50%) translateY(-0.5rem); }
}

.message.error { background: var(--danger); color: #fff; }
.message.success { background: var(--safe); color: #fff; }
.message.info { background: #3498db; color: #fff; }

/* El Aç (101) modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 1rem;
}
.modal-overlay.hidden {
    display: none !important;
}
.open-modal-box {
    background: linear-gradient(145deg, #2a2a2e 0%, #1e1e22 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
.open-modal-box .modal-title {
    margin: 0 0 0.5rem;
    font-size: 1.15rem;
    color: #fff;
}
.open-modal-box .modal-help {
    margin: 0 0 1rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.4;
}
/* Mobil: tek dokunuşla el aç, klavye gerektirmez */
.open-modal-box .modal-actions-primary {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}
.open-modal-box .modal-actions-primary .btn-tap {
    min-height: 44px;
    padding: 0.65rem 1rem;
    font-size: 1rem;
    width: 100%;
    -webkit-tap-highlight-color: transparent;
}
.open-modal-box .modal-preview {
    margin-bottom: 1rem;
}
.open-modal-box .modal-preview.hidden {
    display: none !important;
}
.open-modal-box .open-melds-tiles {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0.5rem 0 0.75rem;
}
.open-modal-box .open-meld-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    justify-content: flex-start;
}
.open-modal-box .open-meld-row .tile.small {
    flex-shrink: 0;
}
.open-modal-box .modal-preview .btn-full {
    width: 100%;
    min-height: 44px;
    margin-top: 0.25rem;
}
.open-modal-box .modal-body-toggle {
    margin-bottom: 0.5rem;
}
.open-modal-box .btn-link {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 0.35rem 0;
    -webkit-tap-highlight-color: transparent;
}
.open-modal-box .btn-link:hover {
    color: var(--accent);
}
.open-modal-box .modal-actions-footer {
    justify-content: stretch;
}
.open-modal-box .modal-actions-footer .btn-tap {
    min-height: 44px;
    padding: 0.65rem 1rem;
    flex: 1;
    -webkit-tap-highlight-color: transparent;
}
.open-modal-box .modal-body {
    margin-bottom: 1rem;
}
.open-modal-box .modal-body label {
    display: block;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.35rem;
}
.open-modal-box .modal-body textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 0.6rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 80px;
}
.open-modal-box .modal-body textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(244, 196, 48, 0.25);
}
.open-modal-box .open-modal-points {
    margin: 0.5rem 0 0;
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: 600;
}
.open-modal-box .modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: flex-end;
}
.open-modal-box .modal-actions button {
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
}
.open-modal-box .btn-suggest {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}
.open-modal-box .btn-suggest:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}
.open-modal-box .btn-suggest:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}
.open-modal-box .btn-primary {
    background: var(--accent);
    color: #1a1a1a;
}
.open-modal-box .btn-primary:hover {
    background: #f5c84d;
    box-shadow: 0 2px 8px rgba(244, 196, 48, 0.4);
}
.open-modal-box .btn-secondary {
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
}
.open-modal-box .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Kurallar modal */
.modal.rules-modal {
    background: linear-gradient(145deg, #2a2a2e 0%, #1e1e22 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    max-width: 480px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
.modal.rules-modal .modal-title {
    margin: 0 0 1rem;
    font-size: 1.15rem;
    color: var(--accent);
}
.rules-content {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.9);
}
.rules-content p {
    margin: 0 0 0.6rem;
}
.rules-content p:last-child {
    margin-bottom: 0;
}
.modal.rules-modal .btn-primary {
    width: 100%;
    min-height: 44px;
}

/* Kurallar butonu (lobby) */
.btn-rules {
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.35);
}
.btn-rules:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent);
}
/* Kurallar linki (oyun header) */
.btn-rules-inline {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}
.btn-rules-inline:hover {
    color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
}

/* ========== Mobil arayüz ========== */
@media (max-width: 768px) {
    .game-page {
        overflow-x: hidden;
    }

    .game-page .game-container {
        padding-left: max(0.25rem, env(safe-area-inset-left));
        padding-right: max(0.25rem, env(safe-area-inset-right));
    }

    .game-header {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.5rem 0.25rem;
    }

    .game-header .site-logo-header {
        height: 28px;
        max-width: 90px;
    }

    .game-header .game-code,
    .game-header .round-info {
        font-size: 0.8rem;
    }

    .game-header .team-scores {
        font-size: 0.8rem;
        gap: 0.5rem;
    }

    .game-header .btn-rules-inline {
        padding: 0.4rem 0.5rem;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    .btn-tea-wrap {
        flex: 0 0 auto;
    }

    .btn-tea {
        min-height: 38px;
        padding: 0.35rem 0.5rem;
        gap: 0.3rem;
        font-size: 0.8rem;
        -webkit-tap-highlight-color: transparent;
    }

    .btn-tea .btn-tea-icon {
        width: 18px;
        height: 18px;
    }

    .btn-tea .btn-tea-label {
        font-size: 0.8rem;
    }

    .tea-dropdown {
        min-width: 14rem;
        right: 0;
        left: auto;
    }

    .tea-dropdown-item {
        min-height: 44px;
        padding: 0.6rem 1rem;
    }

    .turn-indicator {
        display: none;
    }

    .turn-indicator .turn-hint {
        font-size: 0.75rem;
    }

    #btn-start {
        min-height: 44px;
        padding: 0.6rem 1.25rem;
    }

    .table {
        padding: 0.75rem;
        border-width: 8px;
        min-height: 60vh;
        border-radius: 14px;
    }

    .table::before {
        border-width: 2px;
        top: -8px;
        left: -8px;
        right: -8px;
        bottom: -8px;
        border-radius: 18px;
    }

    .middle {
        min-height: 100px;
        gap: 0.35rem;
    }

    .players-side {
        flex: 0 0 72px;
    }

    .players-side .player-box {
        padding: 0.35rem;
    }

    .player-avatar {
        width: 36px;
        height: 36px;
        font-size: 0.95rem;
    }

    .player-box .player-name,
    .player-other .player-name {
        font-size: 0.8rem;
    }

    .player-box .player-score,
    .player-other .player-score {
        font-size: 0.8rem;
    }

    .players-top {
        margin-bottom: 0.35rem;
        max-width: 100%;
        padding-left: 0.25rem;
        padding-right: 0.25rem;
        box-sizing: border-box;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
        text-align: left;
    }

    .players-top.player-other {
        padding: 0.35rem 0.25rem;
    }

    .players-top.player-other .player-avatar {
        margin: 0;
        flex-shrink: 0;
    }

    .players-top .player-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
        flex-shrink: 0;
    }

    .players-top-info {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .players-top .player-name {
        font-size: 0.8rem;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        padding: 0;
    }

    .players-top .player-score {
        font-size: 0.8rem;
    }

    .players-top .opponent-hand-hidden {
        font-size: 0.7rem;
        margin-top: 0;
    }

    .players-top .player-tiles {
        max-width: 100%;
        min-height: 48px;
    }

    .board-center {
        gap: 0.35rem;
    }

    .okey-indicator {
        font-size: 0.85rem;
    }

    .deck {
        width: 42px;
        height: 58px;
        min-width: 42px;
        min-height: 58px;
    }

    .discard-stack {
        min-width: 42px;
        min-height: 58px;
    }

    .hand-area {
        grid-template-columns: repeat(18, minmax(0, 1fr));
        gap: 3px;
        padding: 6px 4px;
        min-height: 120px;
    }

    .hand-area .empty-slot {
        min-width: 0;
        min-height: 38px;
    }

    .hand-area .tile.tile-in-rack {
        min-width: 0;
        min-height: 38px;
    }

    .tile.tile-in-rack.selected {
        transform: translateY(-4px);
    }

    .istaka-wrapper {
        margin: 8px 0;
    }

    .istaka {
        padding: 10px 8px 14px;
    }

    .istaka-slot {
        padding: 8px 6px 10px;
    }

    .istaka-hint {
        font-size: 0.75rem;
        margin-top: 4px;
    }

    .players-bottom .player-box.me {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.5rem;
        text-align: left;
    }

    .players-bottom .player-box.me .player-avatar {
        flex-shrink: 0;
        margin: 0;
    }

    .players-bottom .player-box.me .players-bottom-info {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .players-bottom .player-box.me .turn-badge,
    .players-bottom .player-box.me .istaka-wrapper,
    .players-bottom .player-box.me .players-bottom-buttons {
        width: 100%;
    }

    .players-bottom .player-box.me .player-name,
    .players-bottom .player-box.me .player-score {
        font-size: 0.9rem;
    }

    .actions button,
    #btn-open {
        min-height: 44px;
        padding: 0.6rem 1rem;
        font-size: 0.95rem;
        -webkit-tap-highlight-color: transparent;
    }

    .message {
        bottom: max(1rem, env(safe-area-inset-bottom));
        left: 50%;
        transform: translateX(-50%);
        max-width: calc(100% - 2rem);
    }

    .modal-overlay {
        padding: max(0.5rem, env(safe-area-inset-top)) max(0.5rem, env(safe-area-inset-right)) max(0.5rem, env(safe-area-inset-bottom)) max(0.5rem, env(safe-area-inset-left));
        align-items: flex-end;
    }

    .open-modal-box,
    .modal.rules-modal,
    .modal.lobby-options-modal {
        width: 100%;
        max-width: none;
        border-radius: 16px 16px 0 0;
        max-height: 88vh;
        margin-bottom: 0;
    }

    .open-modal-box .modal-actions-primary .btn-tap,
    .open-modal-box .modal-actions-footer .btn-tap,
    .modal.rules-modal .btn-primary {
        min-height: 48px;
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 480px) {
    .game-header .game-code {
        max-width: 5.5em;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .game-header .round-info {
        font-size: 0.75rem;
    }

    .table {
        padding: 0.5rem;
        border-width: 6px;
        min-height: 55vh;
        border-radius: 12px;
    }

    .table::before {
        top: -6px;
        left: -6px;
        right: -6px;
        bottom: -6px;
        border-radius: 14px;
    }

    .middle {
        min-height: 88px;
    }

    .players-side {
        flex: 0 0 56px;
    }

    .player-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }

    .players-top .player-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .players-top .player-name {
        font-size: 0.75rem;
    }

    .player-box .player-name,
    .player-other .player-name {
        font-size: 0.75rem;
    }

    .hand-area {
        gap: 2px;
        padding: 5px 3px;
        min-height: 100px;
    }

    .hand-area .empty-slot {
        min-height: 34px;
    }

    .hand-area .tile.tile-in-rack {
        min-height: 34px;
    }

    .deck {
        width: 38px;
        height: 52px;
        min-width: 38px;
        min-height: 52px;
    }

    .discard-stack {
        min-width: 38px;
        min-height: 52px;
    }

    .lobby-waiting {
        padding: 1rem 0.5rem;
    }

    .lobby-card {
        padding: 1.25rem;
        margin-left: 0.25rem;
        margin-right: 0.25rem;
    }

    .lobby-code {
        font-size: 1.4rem;
        letter-spacing: 0.2em;
        padding: 0.6rem;
    }

    .lobby-code-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .lobby-code-actions .btn-copy,
    .lobby-code-actions .btn-share {
        width: 100%;
        min-height: 44px;
    }

    .lobby-toolbar .btn-lobby-options,
    .btn-lobby-options {
        min-height: 44px;
        width: 100%;
    }

    .lobby-players {
        gap: 0.75rem;
    }

    .lobby-player-slot {
        padding: 0.75rem;
    }

    .lobby-team-btn {
        min-height: 40px;
        padding: 0.4rem 0.6rem;
    }

    .btn-start-lobby {
        width: 100%;
        min-height: 48px;
        padding: 0.85rem 1.5rem;
    }

    .modal.lobby-options-modal {
        padding: 1rem;
    }

    .loading-indicator {
        top: max(0.5rem, env(safe-area-inset-top));
    }
}

/* Dokunmatik: gereksiz mavi vurguyu kaldır */
@media (hover: none) {
    .btn-tea,
    .btn-copy,
    .btn-lobby-options,
    .btn-rules-inline,
    #btn-open,
    .tea-dropdown-item,
    .lobby-team-btn,
    .game-code-copy,
    .tile {
        -webkit-tap-highlight-color: transparent;
    }
}
