:root {
    --bg-dark: #0f172a;
    --bg-table: #14532d; /* Green felt */
    --text-light: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #0ea5e9; /* Turquoise/Blue */
    --accent-turquoise: #0ea5e9;
    --primary-hover: #0284c7;
    --secondary: #334155;
    --secondary-hover: #475569;
    --accent: #fbbf24; /* Gold */
    --accent-gold: #fbbf24;
    --danger: #ef4444;
    --glass-bg: rgba(15, 23, 42, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --card-bg: #ffffff;
    --card-text: #000000;
}

* { box-sizing: border-box; margin: 0; padding: 0; user-select: none; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    display: flex;
    justify-content: center;
}

#app {
    width: 100%;
    max-width: 600px;
    height: 100%;
    position: relative;
    background-color: var(--bg-dark);
    overflow: hidden;
}

.screen {
    display: none;
    flex-direction: column;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0; left: 0;
    padding: 16px;
    z-index: 10;
}

.screen.active { display: flex; }

.game-bg {
    background: radial-gradient(circle, #166534 0%, #064e3b 100%);
    padding: 10px;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.text-center { text-align: center; }

/* Typography */
h1, h2, h3 { margin-bottom: 15px; text-align: center; color: var(--accent); }

/* Buttons */
button {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
}
button:active { transform: scale(0.95); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--primary); color: white; padding: 12px 24px; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--secondary); color: white; padding: 12px 24px; }
.btn-secondary:hover { background: var(--secondary-hover); }
.btn-danger { background: var(--danger); color: white; padding: 8px 16px; }
.btn-large { width: 100%; padding: 16px; font-size: 1.1rem; margin-bottom: 12px; }
.btn-small { padding: 6px 12px; font-size: 0.9rem; }

/* Inputs */
input[type="text"] {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(255,255,255,0.1);
    color: white;
    margin-bottom: 20px;
    font-size: 1rem;
    outline: none;
}
input[type="text"]:focus { border-color: var(--primary); }

.form-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; font-weight: 600; }

/* Onboarding */
#onboarding-screen { justify-content: center; }
.avatar-selection { display: flex; justify-content: center; gap: 15px; margin-bottom: 20px; }
.avatar-option { width: 60px; height: 60px; border-radius: 50%; background: var(--glass-bg); display: flex; justify-content: center; align-items: center; font-size: 2rem; cursor: pointer; border: 2px solid transparent; }
.avatar-option.selected { border-color: var(--accent); transform: scale(1.1); }

/* Lobby */
.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; padding: 15px; gap: 12px; }
.user-info-mini { display: flex; align-items: center; gap: 10px; }
.avatar-small { width: 40px; height: 40px; border-radius: 50%; background: var(--glass-bg); display: flex; justify-content: center; align-items: center; font-size: 1.5rem; }
.user-details { display: flex; flex-direction: column; }
.username { font-weight: 600; font-size: 1.1rem; }
.level { font-size: 0.8rem; color: var(--accent); }
.user-stats { display: flex; gap: 15px; }
.stat { display: flex; align-items: center; gap: 5px; font-weight: 600; }

.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 16px;
    overflow-y: auto;
    min-height: 0;
    padding-bottom: 110px;
}

.lobby-action-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lobby-shortcuts {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lobby-room-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.room-panel,
.room-meta-panel,
.room-seat-panel {
    padding: 16px;
}

.panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.panel-heading h2 {
    margin-bottom: 6px;
    text-align: left;
}

.panel-subtitle,
.room-lobby-subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.45;
}

.lobby-form-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.room-mode-options,
.room-round-options {
    margin-bottom: 0;
}

.bottom-nav {
    display: flex;
    justify-content: space-around;
    padding: 10px;
    position: absolute;
    bottom: 16px;
    left: 16px;
    right: 16px;
    gap: 8px;
}
.nav-btn { background: transparent; color: var(--text-muted); padding: 10px; flex: 1; border-radius: 8px; }
.nav-btn.active { color: var(--primary); background: rgba(14, 165, 233, 0.1); }

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.header h2 {
    margin-bottom: 0;
    text-align: left;
}

.form-container {
    display: flex;
    flex-direction: column;
}

.lobby-list-container {
    margin-top: 0;
    max-height: 320px;
    padding-right: 4px;
}

.room-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 16px;
}

.room-card-main {
    flex: 1;
    min-width: 0;
}

.room-card-title {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.room-card-code {
    font-weight: 700;
}

.room-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.room-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.room-card-action {
    flex-shrink: 0;
    min-width: 96px;
}

.empty-list-state {
    padding: 20px 12px;
    text-align: center;
    color: var(--text-muted);
    border: 1px dashed rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
}

.room-lobby-topbar {
    align-items: flex-start;
}

.room-lobby-title-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.room-lobby-title-group h2 {
    margin-bottom: 0;
    text-align: left;
}

.room-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.room-meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.meta-label {
    color: var(--text-muted);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.seat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
}

.seat-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 168px;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.seat-card.occupied {
    background: linear-gradient(180deg, rgba(14, 165, 233, 0.1), rgba(15, 23, 42, 0.5));
    border-color: rgba(14, 165, 233, 0.22);
}

.seat-card.empty {
    background: rgba(255, 255, 255, 0.035);
    border-style: dashed;
}

.seat-card-host {
    box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.18), 0 10px 24px rgba(0, 0, 0, 0.18);
}

.seat-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.seat-label {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 700;
}

.seat-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.seat-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--text-muted);
}

.seat-status-ready .seat-status-dot {
    background: var(--accent-turquoise);
    box-shadow: 0 0 12px rgba(14, 165, 233, 0.5);
}

.seat-status-waiting .seat-status-dot {
    background: var(--accent-gold);
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.4);
}

.seat-avatar {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.seat-avatar.empty {
    font-size: 1.5rem;
    color: var(--text-muted);
}

.seat-user {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.seat-username {
    font-weight: 700;
    font-size: 0.96rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.seat-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.seat-waiting-text {
    color: var(--text-muted);
    font-size: 0.82rem;
}

/* Game Screen */
.game-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.game-info { font-weight: 600; color: var(--accent); display: flex; gap: 15px; }

.opponents-container { display: flex; justify-content: space-between; margin-bottom: 20px; }
.opponent-panel { flex: 1; margin: 0 5px; padding: 10px; display: flex; flex-direction: column; align-items: center; border-radius: 12px; }
.opponent-panel.active-turn { border-color: var(--accent); box-shadow: 0 0 15px rgba(251, 191, 36, 0.5); }
.opp-name { font-size: 0.8rem; font-weight: 600; margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.opp-stats { font-size: 0.7rem; color: var(--text-muted); }

.table-area { flex: 1; position: relative; display: flex; justify-content: center; align-items: center; }
.status-message { position: absolute; top: 10px; width: 100%; text-align: center; font-weight: 600; color: var(--accent); z-index: 5; text-shadow: 1px 1px 2px black; }

.played-cards-container { position: relative; width: 200px; height: 200px; }
.played-card { position: absolute; width: 60px; height: 90px; background: var(--card-bg); color: var(--card-text); border-radius: 8px; display: flex; flex-direction: column; justify-content: center; align-items: center; font-weight: 800; font-size: 1.2rem; box-shadow: 0 4px 10px rgba(0,0,0,0.3); }
.played-card.pos-0 { bottom: 0; left: 50%; transform: translateX(-50%); } /* Bottom */
.played-card.pos-1 { top: 50%; right: 0; transform: translateY(-50%); } /* Right */
.played-card.pos-2 { top: 0; left: 50%; transform: translateX(-50%); } /* Top */
.played-card.pos-3 { top: 50%; left: 0; transform: translateY(-50%); } /* Left */

.game-overlay { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 20; width: 90%; max-width: 300px; display: flex; flex-direction: column; align-items: center; }
.game-overlay.hidden { display: none !important; }

.bidding-options { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 15px; }
.btn-bid { width: 45px; height: 45px; border-radius: 50%; background: var(--secondary); color: white; font-weight: bold; font-size: 1.1rem; }
.btn-bid:hover { background: var(--primary); }

.trump-options { display: flex; gap: 15px; margin-bottom: 15px; }
.btn-trump { width: 50px; height: 50px; border-radius: 12px; background: white; font-size: 2rem; display: flex; justify-content: center; align-items: center; }

.player-area { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.player-info { display: flex; justify-content: space-around; padding: 10px; border-radius: 12px; font-size: 0.9rem; font-weight: 600; }

.hand-container {
    display: block;
    height: 130px;
    position: relative;
    width: 100%;
    overflow: visible;
}
.card {
    width: 70px;
    height: 100px;
    background: var(--card-bg);
    color: var(--card-text);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 5px;
    font-weight: 800;
    box-shadow: -2px 0 10px rgba(0,0,0,0.2);
    position: absolute;
    bottom: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    border: 1px solid #ccc;
    pointer-events: auto;
}
.card:hover {
    transform: translateY(-15px) !important;
    z-index: 200 !important;
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}
.card.selected {
    transform: translateY(-20px) !important;
    box-shadow: 0 0 15px var(--accent);
    border-color: var(--accent);
    z-index: 200 !important;
}
.card.play-enabled {
    opacity: 1;
    filter: none;
    pointer-events: auto;
    cursor: pointer;
}
.card.play-disabled {
    opacity: 0.25;
    filter: grayscale(100%) brightness(0.5);
    transform: scale(0.95) !important;
    pointer-events: none;
    cursor: default;
}
.card.auto-play-pending {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.35), 0 8px 24px rgba(251, 191, 36, 0.2);
    animation: autoPlayPulse 0.8s ease-in-out infinite alternate;
}
.card.auto-play-pending::after {
    content: '✓';
    position: absolute;
    top: 6px;
    right: 8px;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(251, 191, 36, 0.92);
    color: #111827;
    font-size: 0.78rem;
    font-weight: 900;
}
.card.red { color: #ef4444; }
.card.black { color: #000000; }
.card-top { font-size: 1.2rem; line-height: 1; }
.card-center { font-size: 2rem; align-self: center; }

@keyframes autoPlayPulse {
    from { box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.2), 0 8px 18px rgba(251, 191, 36, 0.16); }
    to { box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.4), 0 10px 28px rgba(251, 191, 36, 0.3); }
}

/* Toast */
#toast-container { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--danger); color: white; padding: 10px 20px; border-radius: 8px; font-weight: 600; box-shadow: 0 4px 15px rgba(0,0,0,0.3); animation: slideDown 0.3s ease-out forwards; }

@keyframes slideDown { from { transform: translateY(-100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Result Screen */
#result-screen { z-index: 50; justify-content: center; align-items: center; background: rgba(15, 23, 42, 0.95); }
#result-details { width: 100%; margin: 20px 0; display: flex; flex-direction: column; gap: 10px; }
.result-row { display: flex; justify-content: space-between; padding: 10px; background: rgba(255,255,255,0.05); border-radius: 8px; }

.list-container { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; overflow-y: auto; max-height: 70vh; }

/* Game Mode Selector */
.game-mode-selector { margin-bottom: 16px; padding: 15px; }
.mode-options { display: flex; gap: 10px; }
.mode-option {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 10px; border-radius: 12px; cursor: pointer;
    background: var(--secondary); border: 2px solid transparent;
    transition: all 0.25s ease; text-align: center;
}
.mode-option:hover { background: var(--secondary-hover); }
.mode-option.selected { border-color: var(--primary); background: rgba(14, 165, 233, 0.15); }
.mode-option input[type="radio"] { display: none; }
.mode-label { font-weight: 600; font-size: 0.9rem; pointer-events: none; }

/* Mode Badge (open tables list) */
.mode-badge {
    display: inline-block; padding: 3px 8px; border-radius: 6px; font-size: 0.7rem; font-weight: 700;
    background: rgba(14, 165, 233, 0.2); color: var(--primary); margin-top: 4px;
}

/* Round Selector (Segmented Pills) */
.round-options {
    display: flex;
    gap: 0;
    background: var(--secondary);
    border-radius: 12px;
    padding: 3px;
    overflow: hidden;
}
.round-option {
    flex: 1; display: flex; align-items: center; justify-content: center;
    padding: 10px 8px; border-radius: 10px; cursor: pointer;
    background: transparent; border: 2px solid transparent;
    transition: all 0.25s ease; text-align: center;
}
.round-option:hover { background: var(--secondary-hover); }
.round-option.selected {
    background: rgba(14, 165, 233, 0.2);
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(14, 165, 233, 0.15);
}
.round-option input[type="radio"] { display: none; }
.round-label { font-weight: 600; font-size: 0.85rem; pointer-events: none; color: var(--text-light); }

/* Round Progress Badge (Game Header) */
.round-progress-badge {
    display: inline-flex; align-items: center; gap: 4px;
    background: rgba(251, 191, 36, 0.15); border: 1px solid rgba(251, 191, 36, 0.3);
    color: var(--accent); font-weight: 700; font-size: 0.8rem;
    padding: 4px 10px; border-radius: 8px;
    letter-spacing: 0.5px;
    animation: roundBadgePulse 2s ease-in-out infinite;
}
.round-progress-badge:empty { display: none; }

@keyframes roundBadgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.1); }
    50% { box-shadow: 0 0 8px 2px rgba(251, 191, 36, 0.15); }
}

/* Round Badge in Open Tables */
.rounds-badge {
    display: inline-block; padding: 3px 8px; border-radius: 6px; font-size: 0.7rem; font-weight: 700;
    background: rgba(251, 191, 36, 0.15); color: var(--accent); margin-top: 4px; margin-left: 4px;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.85); backdrop-filter: blur(6px);
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    z-index: 9998; gap: 20px;
}
.loading-overlay.hidden { display: none !important; }
.loading-overlay p { font-weight: 600; color: var(--accent); font-size: 1.1rem; }

.loading-spinner {
    width: 48px; height: 48px; border: 4px solid var(--glass-border);
    border-top-color: var(--primary); border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════ Löve (Trick) Toplama Animasyonları ═══════ */
.played-card {
    will-change: transform, opacity;
    transition: none;
}

/* 4 pozisyon için toplama animasyonları */
@keyframes collectToBottom {
    0% { opacity: 1; }
    100% { transform: translate(0, 100px) scale(0.3); opacity: 0; }
}
@keyframes collectToRight {
    0% { opacity: 1; }
    100% { transform: translate(100px, 0) scale(0.3); opacity: 0; }
}
@keyframes collectToTop {
    0% { opacity: 1; }
    100% { transform: translate(0, -100px) scale(0.3); opacity: 0; }
}
@keyframes collectToLeft {
    0% { opacity: 1; }
    100% { transform: translate(-100px, 0) scale(0.3); opacity: 0; }
}

.played-card.collect-to-0 { animation: collectToBottom 0.5s ease-in forwards; }
.played-card.collect-to-1 { animation: collectToRight 0.5s ease-in forwards; }
.played-card.collect-to-2 { animation: collectToTop 0.5s ease-in forwards; }
.played-card.collect-to-3 { animation: collectToLeft 0.5s ease-in forwards; }

/* ═══════ İhale Geçmişi Paneli ═══════ */
.bid-history-panel {
    position: absolute;
    top: 35px;
    right: 5px;
    z-index: 15;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 8px 10px;
    min-width: 120px;
    max-width: 160px;
    pointer-events: none;
}
.bid-history-panel.hidden { display: none !important; }

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

.bid-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    padding: 3px 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    animation: bidSlideIn 0.25s ease-out forwards;
}
.bid-entry .bid-name {
    font-weight: 600;
    color: var(--text-light);
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bid-entry .bid-value {
    font-weight: 800;
    color: var(--accent);
}
.bid-entry .bid-pass {
    font-weight: 600;
    color: var(--text-muted);
    font-style: italic;
}

@keyframes bidSlideIn {
    from { transform: translateX(10px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ═══════ Tur Sonu Puan Özeti Modalı ═══════ */
.round-score-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    display: flex; justify-content: center; align-items: center;
    z-index: 9997;
    animation: fadeIn 0.3s ease-out forwards;
}
.round-score-modal.hidden { display: none !important; }

.round-score-panel {
    width: 90%; max-width: 380px;
    animation: scaleIn 0.35s ease-out forwards;
}

.round-score-table {
    width: 100%; margin-bottom: 16px;
}
.round-score-header, .round-score-row {
    display: grid; grid-template-columns: 2fr 1fr 1fr;
    gap: 8px; padding: 8px 10px; border-radius: 8px;
    font-size: 0.85rem; align-items: center;
}
.round-score-header {
    font-weight: 700; color: var(--accent); font-size: 0.75rem;
    text-transform: uppercase; letter-spacing: 0.5px;
    border-bottom: 1px solid var(--glass-border); margin-bottom: 4px;
}
.round-score-row {
    background: rgba(255, 255, 255, 0.05);
    margin-bottom: 4px;
    animation: fadeSlideUp 0.3s ease-out forwards;
}
.round-score-row .rs-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.round-score-row .rs-round { font-weight: 700; text-align: center; }
.round-score-row .rs-round.positive { color: #4ade80; }
.round-score-row .rs-round.negative { color: var(--danger); }
.round-score-row .rs-total { font-weight: 700; text-align: center; color: var(--accent); }
.round-score-row.penalty-score {
    border: 1px solid rgba(239, 68, 68, 0.45);
    background: linear-gradient(135deg, rgba(127, 29, 29, 0.5), rgba(69, 10, 10, 0.35));
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.15), 0 8px 24px rgba(69, 10, 10, 0.25);
}
.round-score-row.penalty-score .rs-name,
.round-score-row.penalty-score .rs-round.negative {
    color: #fecaca;
}

.round-score-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(251, 191, 36, 0.25);
    background: rgba(251, 191, 36, 0.08);
    color: var(--text-light);
    font-size: 0.8rem;
    line-height: 1.4;
}
.round-score-note.hidden { display: none !important; }
.round-score-note-icon {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 800;
    color: #1f2937;
    background: var(--accent);
}

/* ═══════ Oyun Sonu Şampiyon Overlay ═══════ */
.game-over-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    display: flex; justify-content: center; align-items: center;
    z-index: 9997;
    animation: fadeIn 0.5s ease-out forwards;
}
.game-over-overlay.hidden { display: none !important; }

.game-over-content {
    display: flex; flex-direction: column; align-items: center;
    width: 90%; max-width: 420px; text-align: center;
    padding: 20px;
}

.champion-name {
    font-size: 2.4rem; font-weight: 800;
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 50%, var(--accent) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: scaleGlow 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards, shimmer 3s ease-in-out infinite;
    will-change: transform, opacity;
    margin-bottom: 4px;
    text-shadow: none;
}

.champion-subtitle {
    font-size: 1.1rem; font-weight: 600; color: var(--text-muted);
    margin-bottom: 24px;
    animation: fadeSlideUp 0.5s 0.3s ease-out both;
}

.standings-list {
    width: 100%; display: flex; flex-direction: column; gap: 8px;
    margin-bottom: 24px;
}

.standing-row {
    display: grid; grid-template-columns: 32px 1fr auto;
    gap: 10px; padding: 10px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    align-items: center;
    animation: fadeSlideUp 0.4s ease-out both;
}
.standing-row:nth-child(1) { animation-delay: 0.4s; border-color: rgba(251, 191, 36, 0.4); }
.standing-row:nth-child(2) { animation-delay: 0.55s; }
.standing-row:nth-child(3) { animation-delay: 0.7s; }
.standing-row:nth-child(4) { animation-delay: 0.85s; }

.standing-place {
    font-weight: 800; font-size: 1.1rem; text-align: center;
}
.standing-place.gold { color: var(--accent); }
.standing-place.silver { color: #cbd5e1; }
.standing-place.bronze { color: #c2884a; }

.standing-info { display: flex; flex-direction: column; }
.standing-name { font-weight: 700; font-size: 0.95rem; }
.standing-rewards { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }

.standing-score { font-weight: 800; font-size: 1.1rem; color: var(--accent); }

/* ═══════ Paylaşılan Animasyonlar ═══════ */
@keyframes fadeIn {
    from { opacity: 0; } to { opacity: 1; }
}
@keyframes scaleIn {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
@keyframes scaleGlow {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes shimmer {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}
@keyframes fadeSlideUp {
    from { transform: translateY(16px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ═══════ Host Seat Management ═══════ */
.seat-card.host-interactive {
    cursor: pointer;
    position: relative;
}
.seat-card.host-interactive:hover {
    border-color: rgba(14, 165, 233, 0.45);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.seat-card.host-interactive.empty:hover {
    border-color: rgba(251, 191, 36, 0.45);
    background: rgba(251, 191, 36, 0.06);
}
.seat-card.host-interactive.empty:hover .seat-avatar {
    color: var(--accent);
    border-color: rgba(251, 191, 36, 0.3);
}
.seat-card.host-disabled {
    pointer-events: none;
}

/* Swap Mode */
.seat-card.swap-source {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.3), 0 8px 24px rgba(14, 165, 233, 0.15) !important;
    animation: swapPulse 1.2s ease-in-out infinite alternate;
}
.seat-card.swap-target-candidate {
    border-color: rgba(251, 191, 36, 0.5) !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    animation: swapTargetPulse 1s ease-in-out infinite alternate;
}
.seat-card.swap-target-candidate:hover {
    border-color: var(--accent) !important;
    transform: translateY(-3px);
    box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.4), 0 10px 30px rgba(251, 191, 36, 0.2) !important;
}

@keyframes swapPulse {
    from { box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2), 0 8px 18px rgba(14, 165, 233, 0.1); }
    to { box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.4), 0 10px 28px rgba(14, 165, 233, 0.25); }
}
@keyframes swapTargetPulse {
    from { box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.2); }
    to { box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.45), 0 6px 18px rgba(251, 191, 36, 0.15); }
}

/* Swap mode banner */
.swap-mode-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(14, 165, 233, 0.12);
    border: 1px solid rgba(14, 165, 233, 0.3);
    color: var(--primary);
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 12px;
    animation: fadeSlideUp 0.3s ease-out forwards;
}
.swap-mode-banner .btn-small {
    min-height: 36px;
    font-size: 0.8rem;
}

/* Seat Context Menu */
.seat-context-menu {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    z-index: 100;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    padding: 8px;
    min-width: 150px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.seat-context-menu.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.seat-context-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--text-light);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
    min-height: 44px;
    width: 100%;
    justify-content: flex-start;
}
.seat-context-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}
.seat-context-btn:active {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(0.97);
}
.seat-context-btn .ctx-icon {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}
.seat-context-btn.ctx-danger {
    color: var(--danger);
}
.seat-context-btn.ctx-danger:hover {
    background: rgba(239, 68, 68, 0.12);
}

/* Host seat actions: processing spinner */
.seat-card.seat-processing {
    pointer-events: none;
    opacity: 0.65;
}
.seat-card.seat-processing::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    z-index: 50;
}

/* Player Profile Modal (reused for host view_profile) */
.player-profile-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    display: flex; justify-content: center; align-items: center;
    z-index: 9997;
    animation: fadeIn 0.3s ease-out forwards;
}
.player-profile-modal.hidden { display: none !important; }
.player-profile-panel {
    width: 90%; max-width: 340px;
    animation: scaleIn 0.35s ease-out forwards;
    text-align: center;
}
.player-profile-avatar {
    font-size: 3.5rem;
    margin-bottom: 12px;
}
.player-profile-name {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 4px;
}
.player-profile-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 16px;
    margin-bottom: 16px;
}
.player-profile-stat {
    padding: 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
}
.player-profile-stat strong {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.player-profile-stat span {
    font-weight: 700;
    font-size: 1.05rem;
}

@media (min-width: 640px) {
    .screen {
        padding: 20px;
    }

    .main-area {
        gap: 18px;
        padding-bottom: 118px;
    }

    .lobby-shortcuts {
        flex-direction: row;
    }

    .lobby-shortcuts .btn-large {
        margin-bottom: 0;
    }

    .bottom-nav {
        bottom: 20px;
        left: 20px;
        right: 20px;
    }
}

@media (max-width: 520px) {
    .top-bar,
    .header,
    .room-lobby-topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .user-stats {
        justify-content: space-between;
    }

    .game-info {
        gap: 8px;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .room-meta-grid {
        grid-template-columns: 1fr;
    }

    .room-card {
        flex-direction: column;
        align-items: stretch;
    }

    .room-card-action {
        width: 100%;
    }
}
