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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f0f2f5;
    color: #1c1e21;
    line-height: 1.4;
    padding: 16px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Header */
header:not(.tavern-header) {
    background: #fff;
    padding: 14px 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

header:not(.tavern-header) h1 {
    font-size: 1.4rem;
    color: #333;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
}

/* Language Switcher */
.lang-switch-container {
    display: inline-flex;
    align-items: center;
    background: #e9ecef;
    border-radius: 20px;
    padding: 2px;
    border: 1px solid #ced4da;
    user-select: none;
}

.lang-switch-btn {
    background: transparent;
    border: none;
    padding: 4px 10px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #495057;
    border-radius: 16px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    line-height: 1.2;
}

.lang-switch-btn:hover {
    color: #212529;
}

.lang-switch-btn.active {
    background: #1b8a5a;
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.8rem;
}

.badge-online { background: #d4edda; color: #155724; }
.badge-offline { background: #f8d7da; color: #721c24; }
.badge-turn { background: #fff3cd; color: #856404; }
.badge-active { background: #cce5ff; color: #004085; }
.badge-direction-cw { background: #e2e3e5; color: #383d41; border: 1px solid #ced4da; }
.badge-direction-ccw { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }

/* Setup Box */
.card-panel {
    background: #fff;
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #4b4f56;
}

.form-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 160px;
}

input[type="text"],
input[type="number"],
select,
textarea {
    padding: 8px 12px;
    border: 1px solid #ccd0d5;
    border-radius: 4px;
    font-size: 0.95rem;
    outline: none;
    box-sizing: border-box;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    border-color: #1877f2;
}

input[type="text"].input-invalid {
    border-color: #dc3545 !important;
    background-color: #fff8f8;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15) !important;
}

.name-requirement-note {
    font-size: 0.82rem;
    color: #664d03;
    background-color: #fff3cd;
    border: 1px solid #ffe69c;
    border-radius: 6px;
    padding: 7px 11px;
    margin-top: 5px;
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.name-error-alert {
    font-size: 0.84rem;
    color: #842029;
    background-color: #f8d7da;
    border: 1px solid #f5c2c7;
    border-radius: 6px;
    padding: 8px 12px;
    margin-top: 6px;
    font-weight: 600;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

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

.btn-primary { background: #1877f2; color: #fff; }
.btn-primary:hover:not(:disabled) { background: #166fe5; }
.btn-danger { background: #dc3545; color: #fff; }
.btn-danger:hover:not(:disabled) { background: #bd2130; }
.btn-warning { background: #ffc107; color: #212529; }
.btn-warning:hover:not(:disabled) { background: #e0a800; }
.btn-success { background: #28a745; color: #fff; }
.btn-success:hover:not(:disabled) { background: #218838; }
.btn-secondary { background: #6c757d; color: #fff; }
.btn-secondary:hover:not(:disabled) { background: #5a6268; }
.btn-kak { background: #6f42c1; color: #fff; }
.btn-kak:hover:not(:disabled) { background: #59359a; }
.btn-sm { padding: 4px 8px; font-size: 0.8rem; }

/* Turn Banner */
.turn-banner {
    padding: 12px 16px;
    border-radius: 6px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.turn-banner.my-turn {
    background: #d4edda;
    border: 2px solid #28a745;
    color: #155724;
    animation: pulse 1.5s infinite;
}

.turn-banner.other-turn {
    background: #e2e3e5;
    border: 1px solid #d6d8db;
    color: #383d41;
}

.turn-banner.card-swapping {
    background: #e3f2fd;
    border: 2px solid #1976d2;
    color: #0d47a1;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.4); }
    70% { box-shadow: 0 0 0 8px rgba(40, 167, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); }
}

/* Grid Layout for Game */
.game-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 16px;
}

@media (max-width: 900px) {
    .game-grid {
        grid-template-columns: 1fr;
    }
}

.main-board {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Opponents Zone */
.opponents-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.opponents-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.opponent-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.opponent-card.current-turn {
    border: 2px solid #ffc107;
    background: #fffdf5;
}

.opponent-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-weight: bold;
    font-size: 0.95rem;
}

.opponent-stats {
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 8px;
}

/* Table Piles Zone */
.table-piles {
    background: #e8f4f8;
    border: 2px dashed #90caf9;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-around;
    gap: 16px;
}

.pile-box {
    text-align: center;
    min-width: 120px;
}

.pile-title {
    font-size: 0.8rem;
    font-weight: bold;
    color: #455a64;
    text-transform: uppercase;
    margin-bottom: 6px;
}

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

/* Card representation */
.playing-card {
    width: 58px;
    height: 82px;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #b0bec5;
    box-shadow: 0 2px 4px rgba(0,0,0,0.12);
    display: inline-flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 5px 6px;
    font-weight: bold;
    font-size: 0.95rem;
    user-select: none;
    cursor: pointer;
    transition: transform 0.1s ease, border-color 0.1s ease, box-shadow 0.1s ease;
}

.playing-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.playing-card.card-selected {
    border: 2px solid #28a745;
    background: #e8f5e9;
    transform: translateY(-6px);
    box-shadow: 0 6px 12px rgba(40, 167, 69, 0.3);
}

button.playing-card {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid #b0bec5;
    background: #fff;
    padding: 5px 6px;
    margin: 0;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: bold;
    text-align: left;
    box-sizing: border-box;
    display: inline-flex;
    vertical-align: middle;
}

.table-view button.playing-card {
    border: 1px solid #fff;
    background: #f3ece4;
    padding: 0;
    display: block;
}

button.playing-card:focus-visible {
    outline: 3px solid #38bdf8 !important;
    outline-offset: 3px !important;
    z-index: 50 !important;
}

.hand button.playing-card:focus-visible {
    z-index: 100 !important;
}

.playing-card:disabled,
.playing-card.card-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.hand .playing-card:disabled,
.hand .playing-card.card-disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.hand .playing-card:disabled:hover,
.hand .playing-card.card-disabled:hover {
    transform: rotate(var(--rot, 0deg)) translateY(var(--lift, 0px)) !important;
    z-index: auto !important;
    box-shadow: 0 8px 14px rgba(0,0,0,0.35) !important;
}

.playing-card .card-corner {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
}

.playing-card .card-rank {
    font-size: clamp(12px, 1.3vw, 16px);
    font-weight: 800;
    font-family: Georgia, serif;
    line-height: 1;
    text-align: center;
}

.playing-card .card-suit {
    font-size: clamp(10px, 1.0vw, 13px);
    line-height: 1;
    margin-top: 1px;
    text-align: center;
}

.playing-card .card-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.card-red { color: #d32f2f; }
.card-black { color: #212121; }

.card-back {
    background: repeating-linear-gradient(
        45deg,
        #1565c0,
        #1565c0 8px,
        #0d47a1 8px,
        #0d47a1 16px
    );
    border: 2px solid #fff;
    cursor: default;
}

.card-back.card-clickable {
    cursor: pointer;
}

.card-back.card-clickable:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* My Zone */
.my-zone {
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cards-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    min-height: 90px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px dashed #dee2e6;
}

.zone-title {
    font-size: 0.85rem;
    font-weight: bold;
    color: #495057;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Event Log Sidebar */
.log-sidebar {
    background: #fff;
    border-radius: 8px;
    padding: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    height: 650px;
}

.log-sidebar h3 {
    font-size: 1rem;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.log-container {
    flex: 1;
    overflow-y: auto;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 4px;
}

.log-item {
    padding: 4px 6px;
    border-radius: 4px;
    background: #f8f9fa;
    border-left: 3px solid #ccc;
    word-break: break-word;
}

.log-item.log-play { border-left-color: #28a745; }
.log-item.log-burn { border-left-color: #fd7e14; background: #fff8f0; font-weight: bold; }
.log-item.log-skip { border-left-color: #e83e8c; background: #fdf0f5; font-weight: bold; }
.log-item.log-pickup { border-left-color: #ffc107; }
.log-item.log-error { border-left-color: #dc3545; background: #fdf2f2; color: #721c24; }
.log-item.log-system { border-left-color: #17a2b8; }

.log-time {
    color: #888;
    margin-right: 4px;
}

/* Clickable Pile */
.pile-card-wrapper.pile-clickable {
    cursor: pointer;
    position: relative;
    border-radius: 6px;
    transition: transform 0.15s ease, filter 0.15s ease;
}

.pile-card-wrapper.pile-clickable:hover {
    transform: translateY(-3px) scale(1.03);
    filter: drop-shadow(0 4px 10px rgba(24, 119, 242, 0.35));
}

.pile-card-wrapper.pile-clickable:hover::after {
    content: "🔍 Klikni pro obsah";
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    background: #1c1e21;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 10;
}

/* Burned Pile Card */
.burned-pile-card {
    border: 1px solid #ffab91 !important;
    background: #fff8f6 !important;
    box-shadow: 0 2px 6px rgba(211, 47, 47, 0.15);
    cursor: default !important;
    position: relative;
}

.burned-pile-card::before {
    content: "🔥";
    position: absolute;
    top: -8px;
    right: -6px;
    font-size: 0.85rem;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 16px;
}

.modal-dialog {
    background: #ffffff;
    border-radius: 12px;
    width: 100%;
    max-width: 860px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 35px rgba(0, 0, 0, 0.3);
    border: 1px solid #e2e8f0;
    animation: modalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 14px 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    background: #fdfdfd;
}

.modal-subtitle {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 3px;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
    flex: 1;
}

.modal-cards-flow {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
    justify-content: flex-start;
    min-height: 120px;
}

.modal-card-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: transform 0.15s ease;
}

.modal-card-item:hover {
    transform: translateY(-4px);
}

.modal-card-item .card-order-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    background: #e9ecef;
    color: #495057;
}

.modal-card-item.is-top-card .card-order-badge {
    background: #28a745;
    color: #ffffff;
    box-shadow: 0 1px 4px rgba(40, 167, 69, 0.3);
}

.modal-card-item.is-bottom-card .card-order-badge {
    background: #17a2b8;
    color: #ffffff;
}

.modal-card-item.is-top-card .playing-card {
    border: 2px solid #28a745;
    box-shadow: 0 4px 10px rgba(40, 167, 69, 0.35);
}

.modal-footer {
    padding: 12px 20px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
}

/* Tabs Navigation */
.setup-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.tab-navigation {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid #e4e6eb;
    margin-bottom: 16px;
}

.tab-btn {
    padding: 10px 18px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 0.95rem;
    font-weight: 600;
    color: #65676b;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: #1877f2;
}

.tab-btn.active {
    color: #1877f2;
    border-bottom-color: #1877f2;
}

/* Lobby Screen */
.lobby-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.lobby-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid var(--wood-border, #442b1b);
    padding-bottom: 12px;
}

.lobby-header h2 {
    font-size: 1.25rem;
    color: var(--text-main, #f5ede4);
    margin: 0;
    font-family: var(--font-serif);
}

.lobby-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted, #bfa99b);
    margin-top: 4px;
}

.lobby-invite-box {
    background: var(--parchment-card, #281e16);
    border: 1px solid var(--wood-border, #442b1b);
    border-radius: 8px;
    padding: 14px 18px;
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3);
}

.lobby-invite-box label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-main, #f5ede4);
    display: block;
    margin-bottom: 6px;
}

.invite-input-row {
    display: flex;
    gap: 8px;
}

.invite-input-row input {
    flex: 1;
    font-family: monospace;
    font-size: 0.9rem;
    background: #140d07;
    color: var(--text-main, #f5ede4);
    border: 1px solid var(--wood-border, #442b1b);
    border-radius: 6px;
    padding: 8px 12px;
    cursor: text;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.invite-input-row input:focus {
    border-color: var(--gold-accent, #f59e0b);
    outline: none;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.copy-feedback {
    margin-top: 8px;
    font-size: 0.82rem;
    color: #4ade80;
    font-weight: 600;
}

.lobby-players-section {
    background: var(--parchment-card, #281e16);
    border: 1px solid var(--wood-border, #442b1b);
    border-radius: 8px;
    padding: 14px 18px;
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3);
}

.lobby-players-section h3 {
    font-size: 1rem;
    color: var(--text-main, #f5ede4);
    margin: 0;
}

.lobby-min-notice {
    font-size: 0.8rem;
    color: var(--text-muted, #bfa99b);
}

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

.lobby-player-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid var(--wood-border, #442b1b);
    border-radius: 8px;
    background: #19100a;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    transition: all 0.2s ease;
}

.lobby-player-card:hover {
    border-color: rgba(245, 158, 11, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.lobby-player-card.is-me {
    border-color: var(--gold-accent, #f59e0b);
    background: linear-gradient(135deg, #2a1b11, #21150d);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.25);
}

.lobby-player-card.is-host {
    border-color: var(--amber-glow, #d97706);
}

.lobby-player-avatar {
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: #25170d;
    border: 1px solid var(--wood-border, #442b1b);
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
}

.lobby-player-card.is-me .lobby-player-avatar {
    border-color: rgba(245, 158, 11, 0.4);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.2);
}

.lobby-player-info {
    flex: 1;
    overflow: hidden;
}

.lobby-player-name {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text-main, #f5ede4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lobby-player-badges {
    display: flex;
    gap: 4px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.lobby-role-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
    display: inline-block;
    letter-spacing: 0.02em;
}

.badge-host {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.badge-player {
    background: rgba(255, 255, 255, 0.08);
    color: #d6d3d1;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.badge-bot {
    background: rgba(168, 85, 247, 0.18);
    color: #d8b4fe;
    border: 1px solid rgba(168, 85, 247, 0.35);
}

.badge-you {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.4);
}

.lobby-actions-bar {
    padding-top: 12px;
    border-top: 1px solid var(--wood-border, #442b1b);
}

.bot-controls-group {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.bot-difficulty-group {
    display: inline-flex;
    align-items: stretch;
    background: #140d07;
    border: 1px solid var(--wood-border, #442b1b);
    border-radius: 8px;
    padding: 3px;
    gap: 3px;
    user-select: none;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

.bot-difficulty-group .btn-diff {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-muted, #bfa99b);
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    white-space: nowrap;
    line-height: 1.3;
}

.bot-difficulty-group .btn-diff:hover {
    color: var(--text-main, #f5ede4);
    background: rgba(255, 255, 255, 0.05);
}

.bot-difficulty-group .btn-diff:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--gold-accent, #f59e0b);
}

.bot-difficulty-group .btn-diff.active {
    background: #2a1a0f;
    border-color: rgba(245, 158, 11, 0.5);
    color: var(--gold-accent, #f59e0b);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.25);
    font-weight: 700;
}

@media (max-width: 480px) {
    .bot-difficulty-group {
        width: 100%;
        display: flex;
    }
    .bot-difficulty-group .btn-diff {
        flex: 1;
        text-align: center;
        padding: 6px 4px;
        font-size: 0.8rem;
    }
}

.lobby-start-tooltip {
    font-size: 0.85rem;
    color: var(--text-muted, #bfa99b);
}

.guest-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(217, 119, 6, 0.08);
    border: 1px solid var(--wood-border, #442b1b);
    padding: 12px 16px;
    border-radius: 6px;
    color: var(--text-main, #f5ede4);
}

.guest-notice-text {
    font-size: 0.85rem;
    color: var(--text-muted, #bfa99b);
    margin-top: 2px;
}

.spinner-pulse {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--gold-accent, #f59e0b);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
    animation: spinnerPulse 1.2s infinite ease-in-out;
}

@keyframes spinnerPulse {
    0% { transform: scale(0.8); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.8); opacity: 0.5; }
}

/* Reconnect & Resume Card Styles */
.reconnect-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #e7f3ff;
    border: 1px solid #1877f2;
    border-radius: 6px;
    padding: 10px 16px;
    margin-bottom: 16px;
    color: #004085;
    font-weight: 500;
}

.session-replaced-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 10px 16px;
    margin-bottom: 16px;
    color: #664d03;
    font-weight: 600;
}

.session-replaced-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.reconnect-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #1877f2;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.resume-game-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 6px;
    padding: 14px 16px;
    margin-bottom: 16px;
    gap: 16px;
    flex-wrap: wrap;
}

.resume-card-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.resume-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.resume-badge {
    background: #22c55e;
    color: #fff;
    font-weight: 700;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.resume-card-details {
    font-size: 0.9rem;
    color: #1f2937;
}

.resume-card-details code {
    background: #e5e7eb;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.85rem;
}

.resume-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.resume-feedback,
.create-feedback,
.join-feedback {
    font-size: 0.85rem;
    color: #dc3545;
    margin-top: 8px;
    padding: 6px 10px;
    background: #fdf2f2;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    line-height: 1.4;
}

/* =====================================================
   MOBILE RESPONSIVE STYLES (≤ 768px)
   ===================================================== */

/* --- Hamburger Menu (hidden on desktop) --- */
.mobile-hamburger {
    display: none;
    background: none;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1.3rem;
    padding: 4px 10px;
    cursor: pointer;
    color: #333;
    line-height: 1;
}

/* --- Header Menu Dropdown (inline on desktop, dropdown on mobile) --- */
.header-menu-dropdown {
    display: contents; /* On desktop, children flow as if the wrapper doesn't exist */
}

/* --- Table Cards Accordion (always open on desktop) --- */
.table-cards-toggle {
    display: none; /* hidden on desktop */
    width: 100%;
    background: #f0f2f5;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #495057;
    cursor: pointer;
    text-align: left;
    margin-top: 8px;
}

.table-cards-content {
    /* always visible on desktop */
}

/* --- Mobile Log Toggle (hidden on desktop) --- */
.mobile-log-toggle {
    display: none; /* hidden on desktop, display:flex on mobile via @media */
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 1000;
    background: #1877f2;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 52px;
    height: 52px;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    align-items: center;
    justify-content: center;
}

.mobile-log-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #dc3545;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 10px;
    padding: 1px 5px;
    min-width: 16px;
    text-align: center;
}

.mobile-log-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(0,0,0,0.4);
    z-index: 8000;
}

.mobile-log-close {
    display: none; /* hidden on desktop */
}

/* --- Landscape Hint --- */
.landscape-hint {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff3cd;
    color: #856404;
    border-top: 1px solid #ffeeba;
    padding: 10px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    z-index: 9000;
    display: none;
}

.landscape-hint-dismiss {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    margin-left: 12px;
    color: #856404;
    vertical-align: middle;
}

/* --- Mini playing card variant for opponent mobile display --- */
.playing-card-mini {
    width: 32px;
    height: 44px;
    border-radius: 4px;
    background: #fff;
    border: 1px solid #b0bec5;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2px;
    font-weight: bold;
    font-size: 0.6rem;
    user-select: none;
    line-height: 1;
    gap: 0;
}

.playing-card-mini .mini-rank {
    font-size: 0.65rem;
    line-height: 1;
}

.playing-card-mini .mini-suit {
    font-size: 0.6rem;
    line-height: 1;
}

/* =====================================================
   MOBILE MEDIA QUERY
   Portrait phones/tablets (≤768px width) + Landscape phones (≤1000px width & ≤600px height)
   ===================================================== */
@media (max-width: 768px), (max-width: 1000px) and (max-height: 600px) and (orientation: landscape) {

    /* --- Body & Container --- */
    body {
        padding: 6px;
    }

    .container {
        gap: 10px;
    }

    /* --- Header --- */
    header:not(.tavern-header) {
        padding: 10px 14px;
        gap: 8px;
    }

    header:not(.tavern-header) h1 {
        font-size: 1.1rem;
    }

    header:not(.tavern-header) > div:first-child > div {
        /* subtitle */
        display: none;
    }

    .mobile-hamburger {
        display: inline-flex;
        align-items: center;
    }

    .header-menu-dropdown {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        background: #fff;
        border: 1px solid #dee2e6;
        border-radius: 6px;
        box-shadow: 0 8px 24px rgba(0,0,0,0.15);
        padding: 10px;
        flex-direction: column;
        gap: 8px;
        z-index: 5000;
        min-width: 200px;
    }

    .header-menu-dropdown.open {
        display: flex;
    }

    .header-status {
        position: relative;
    }

    /* --- Game Grid --- */
    .game-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    /* --- Turn Banner --- */
    .turn-banner {
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    .turn-banner > div:first-child {
        font-size: 0.9rem;
    }

    #turnPlayerName {
        font-size: 0.95rem !important;
    }

    #turnTimerBox {
        font-size: 0.8rem;
    }

    /* --- Opponents Zone (Compact) --- */
    .opponents-section > div:first-child {
        font-size: 0.8rem;
        margin-bottom: 2px;
    }

    .opponents-list {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .opponent-card {
        padding: 8px 10px;
    }

    .opponent-header {
        font-size: 0.82rem;
        margin-bottom: 3px;
    }

    .opponent-stats {
        font-size: 0.75rem;
        margin-bottom: 4px;
    }

    .opponent-card .cards-container {
        min-height: 46px !important;
        padding: 4px;
        gap: 3px;
    }

    /* Hide full-size cards in opponent section, use mini cards instead */
    .opponent-card .cards-container .playing-card {
        width: 32px;
        height: 44px;
        padding: 2px 3px;
        font-size: 0.65rem;
        border-radius: 4px;
    }

    .opponent-card .cards-container .playing-card .card-corner {
        display: flex;
        flex-direction: row;
        gap: 1px;
    }

    .opponent-card .cards-container .playing-card .card-rank {
        font-size: 0.6rem;
    }

    .opponent-card .cards-container .playing-card .card-suit {
        font-size: 0.55rem;
    }

    .opponent-card .cards-container .playing-card .card-center {
        display: none;
    }

    .opponent-card .cards-container .playing-card .card-corner:last-child {
        display: none;
    }

    /* --- Table Piles (Compact Row) --- */
    .table-piles {
        padding: 8px;
        gap: 6px;
        flex-wrap: nowrap;
        justify-content: space-between;
        align-items: flex-start;
    }

    .pile-box {
        min-width: unset;
        flex: 1;
    }

    .pile-title {
        font-size: 0.65rem;
        margin-bottom: 3px;
    }

    .pile-content {
        gap: 3px;
    }

    .pile-content .playing-card {
        width: 44px;
        height: 62px;
        padding: 3px 4px;
        font-size: 0.8rem;
    }

    .pile-content .playing-card .card-rank {
        font-size: 0.75rem;
    }

    .pile-content .playing-card .card-suit {
        font-size: 0.7rem;
    }

    .pile-content .playing-card .card-center {
        font-size: 1rem;
    }

    .pile-box > .pile-content > div {
        font-size: 0.72rem;
    }

    #btnInspectPile {
        font-size: 0.68rem !important;
        padding: 2px 5px !important;
    }

    #btnPickUpPile {
        font-size: 0.8rem;
        padding: 6px 10px;
    }

    #sevenRestrictionNotice {
        font-size: 0.7rem !important;
    }

    /* Discard pile compact: stack info vertically */
    .pile-box:nth-child(2) .pile-content > div:first-child {
        flex-direction: column;
        gap: 6px;
        align-items: center;
    }

    .pile-box:nth-child(2) .pile-content > div:first-child > div:last-child {
        text-align: center;
        font-size: 0.72rem;
    }

    /* --- My Zone --- */
    .my-zone {
        padding: 10px;
        gap: 8px;
    }

    .zone-title {
        font-size: 0.78rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    /* Playing cards in hand – smaller on mobile */
    .my-zone > .cards-container .playing-card,
    #myHandContainer .playing-card {
        width: 48px;
        height: 68px;
        padding: 3px 4px;
        font-size: 0.8rem;
    }

    #myHandContainer .playing-card .card-rank {
        font-size: 0.8rem;
    }

    #myHandContainer .playing-card .card-suit {
        font-size: 0.75rem;
    }

    #myHandContainer .playing-card .card-center {
        font-size: 1.1rem;
    }

    .cards-container {
        min-height: 60px;
        padding: 6px;
        gap: 4px;
    }

    /* Back cards (face-down) also smaller */
    .playing-card.card-back {
        width: 48px;
        height: 68px;
    }

    /* --- Table Cards Accordion (show toggle on mobile) --- */
    .table-cards-toggle {
        display: block;
    }

    .my-table-cards-accordion.table-cards-collapsed .table-cards-content {
        display: none;
    }

    .my-table-cards-accordion.table-cards-collapsed .table-cards-toggle {
        border-color: #90caf9;
        background: #e8f4f8;
    }

    /* Face-up/Face-down containers on mobile - single column */
    .table-cards-content > div {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }

    .table-cards-content .cards-container {
        min-height: 50px !important;
    }

    .table-cards-content .playing-card {
        width: 44px;
        height: 62px;
        padding: 2px 3px;
    }

    .table-cards-content .playing-card .card-rank {
        font-size: 0.75rem;
    }

    .table-cards-content .playing-card .card-suit {
        font-size: 0.7rem;
    }

    .table-cards-content .playing-card .card-center {
        font-size: 1rem;
    }

    /* --- Log Sidebar (hidden, used as slide-in overlay) --- */
    .log-sidebar {
        display: none;
        position: fixed;
        top: 0;
        right: 0;
        width: 85vw;
        max-width: 360px;
        height: 100vh;
        height: 100dvh;
        z-index: 8500;
        border-radius: 0;
        box-shadow: -4px 0 20px rgba(0,0,0,0.3);
        transform: translateX(100%);
        transition: transform 0.25s ease;
    }

    .log-sidebar.log-sidebar-open {
        display: flex;
        transform: translateX(0);
    }

    .mobile-log-toggle {
        display: flex;
    }

    .mobile-log-close {
        display: inline-flex;
    }

    .mobile-log-overlay.active {
        display: block;
    }

    /* --- Action Buttons (larger touch targets) --- */
    .btn {
        min-height: 40px;
        padding: 8px 14px;
    }

    .btn-sm {
        min-height: 34px;
        padding: 5px 10px;
    }

    #btnPlaySelected,
    #btnPickUpPile {
        min-height: 44px;
        font-size: 0.9rem;
    }

    #playActionsContainer,
    #swapActionsContainer {
        width: 100%;
    }

    #playActionsContainer .btn,
    #swapActionsContainer .btn {
        flex: 1;
    }

    /* --- Modals (full-width on mobile) --- */
    .modal-overlay {
        padding: 8px;
        align-items: flex-end;
    }

    .modal-dialog {
        max-width: 100%;
        max-height: 90vh;
        border-radius: 12px 12px 0 0;
    }

    .modal-header {
        padding: 10px 14px;
    }

    .modal-body {
        padding: 12px;
    }

    .modal-footer {
        padding: 10px 14px;
    }

    .modal-cards-flow {
        gap: 8px;
    }

    .modal-cards-flow .playing-card {
        width: 48px;
        height: 68px;
    }

    /* --- Setup & Lobby (compact) --- */
    .card-panel {
        padding: 12px 14px;
    }

    .lobby-header {
        flex-direction: column;
        gap: 8px;
    }

    .invite-input-row {
        flex-direction: column;
    }

    .lobby-players-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Landscape hint: only show in portrait on narrow screens --- */
@media (max-width: 768px) and (orientation: portrait) {
    .landscape-hint.visible {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Ensure landscape hint is always hidden in landscape */
@media (orientation: landscape) {
    .landscape-hint {
        display: none !important;
    }
}

/* =====================================================
   DEDICATED LANDSCAPE MOBILE LAYOUT (≤ 1000px width & ≤ 600px height)
   Places Piles on left and Player Zone on right so everything fits on one screen!
   ===================================================== */
@media (orientation: landscape) and (max-height: 600px) and (max-width: 1000px) {
    body {
        padding: 4px 6px;
    }

    .container {
        gap: 4px;
        max-width: 100%;
    }

    /* Ultra-compact header */
    header:not(.tavern-header) {
        padding: 4px 10px;
        border-radius: 6px;
    }

    header:not(.tavern-header) h1 {
        font-size: 0.95rem;
    }

    .header-status {
        gap: 6px;
    }

    .mobile-hamburger {
        padding: 2px 8px;
        font-size: 1.1rem;
    }

    /* Turn Banner */
    .turn-banner {
        padding: 4px 10px;
        font-size: 0.82rem;
        border-radius: 4px;
    }

    #turnPlayerName {
        font-size: 0.85rem !important;
    }

    #turnTimerBox {
        font-size: 0.75rem;
    }

    /* Main Board: 2-column landscape grid */
    .main-board {
        display: grid;
        grid-template-areas:
            "turn turn"
            "opponents opponents"
            "piles myzone";
        grid-template-columns: minmax(240px, 310px) 1fr;
        gap: 6px;
        align-items: start;
    }

    #turnBanner {
        grid-area: turn;
    }

    /* Opponents row: all opponents side-by-side */
    .opponents-section {
        grid-area: opponents;
        gap: 2px;
    }

    .opponents-section > div:first-child {
        display: none; /* hide "Soupeři na stole:" title to save space */
    }

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

    .opponent-card {
        padding: 4px 6px;
        border-radius: 4px;
    }

    .opponent-header {
        font-size: 0.75rem;
        margin-bottom: 2px;
    }

    .opponent-stats {
        font-size: 0.7rem;
        margin-bottom: 2px;
    }

    .opponent-card .cards-container {
        min-height: 38px !important;
        padding: 2px;
        gap: 2px;
    }

    .opponent-card .cards-container .playing-card {
        width: 26px;
        height: 36px;
        padding: 1px 2px;
        font-size: 0.55rem;
        border-radius: 3px;
    }

    .opponent-card .cards-container .playing-card .card-rank {
        font-size: 0.55rem;
    }

    .opponent-card .cards-container .playing-card .card-suit {
        font-size: 0.5rem;
    }

    /* Table Piles: Left Column - ultra-compact & top-aligned */
    .table-piles {
        grid-area: piles;
        padding: 4px 6px;
        gap: 4px;
        border-radius: 6px;
        align-items: flex-start; /* Move draw deck and burned cards to the top! */
        justify-content: space-between;
    }

    .pile-box {
        min-width: unset;
        flex: 1;
    }

    /* Dobírací balíček: align top, shrink */
    .pile-box:first-child {
        flex: 0 0 auto;
    }

    .pile-box:first-child .pile-content > span {
        display: none; /* Hide "zbývá karet" to eliminate dead space below card */
    }

    /* Spálené karty: align top, shrink */
    #burnedPileBox {
        flex: 0 0 auto;
    }

    #burnedPileBox .pile-content > div:nth-child(2) {
        display: none; /* Hide redundant "Spáleno: X" text since count is on the card */
    }

    #burnedPileTopLabel {
        font-size: 0.58rem !important;
        margin-top: 1px;
    }

    /* Discard Pile: horizontal card + info layout to stay compact */
    .pile-box:nth-child(2) {
        flex: 1;
        max-width: unset !important;
    }

    .pile-box:nth-child(2) .pile-content > div:first-child {
        flex-direction: row !important; /* Card next to info, not on top! */
        gap: 6px !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .pile-box:nth-child(2) .pile-content > div:first-child > div:last-child {
        text-align: left !important;
        font-size: 0.65rem !important;
        line-height: 1.25;
    }

    .pile-box:nth-child(2) .pile-content > div:last-child {
        margin-top: 3px !important;
        width: 100%;
    }

    .pile-title {
        font-size: 0.6rem;
        margin-bottom: 2px;
    }

    .pile-content {
        gap: 2px;
    }

    .pile-content .playing-card {
        width: 36px;
        height: 50px;
        padding: 2px 3px;
        font-size: 0.72rem;
    }

    .pile-content .playing-card .card-center {
        font-size: 0.85rem;
    }

    #btnInspectPile {
        font-size: 0.6rem !important;
        padding: 1px 4px !important;
        margin-top: 2px !important;
    }

    #btnPickUpPile {
        font-size: 0.72rem;
        padding: 3px 6px;
        min-height: 28px;
    }

    #sevenRestrictionNotice {
        font-size: 0.62rem !important;
        line-height: 1.1;
    }

    /* My Zone: Right Column */
    .my-zone {
        grid-area: myzone;
        padding: 6px 8px;
        gap: 4px;
        border-radius: 6px;
    }

    .zone-title {
        font-size: 0.75rem;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 2px;
    }

    .zone-title #myHandZoneTitle {
        font-size: 0.75rem;
    }

    #playActionsContainer .btn,
    #swapActionsContainer .btn {
        min-height: 32px;
        font-size: 0.78rem;
        padding: 4px 10px;
    }

    #myHandContainer {
        min-height: 54px;
        max-height: 120px;
        overflow-y: auto;
        padding: 4px;
        gap: 4px;
    }

    #myHandContainer .playing-card {
        width: 40px;
        height: 56px;
        padding: 2px 3px;
        font-size: 0.75rem;
    }

    #myHandContainer .playing-card .card-center {
        font-size: 0.95rem;
    }

    .table-cards-toggle {
        padding: 4px 8px;
        font-size: 0.75rem;
        margin-top: 4px;
    }

    .table-cards-content .cards-container {
        min-height: 42px !important;
        padding: 2px 4px;
    }

    .table-cards-content .playing-card {
        width: 34px;
        height: 48px;
        font-size: 0.65rem;
        padding: 1px 2px;
    }

    .table-cards-content .playing-card .card-center {
        font-size: 0.8rem;
    }

    /* Floating log button in landscape */
    .mobile-log-toggle {
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
        bottom: 8px;
        right: 8px;
    }
}

/* ==========================================================================
   INITIAL SPLASH SCREEN OVERLAY FOR INDEX.HTML
   ========================================================================== */
.splash-container-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #181926 0%, #090a0f 85%, #030305 100%);
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    cursor: pointer;
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.6s ease;
}

.splash-container-overlay.splash-fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: scale(1.03);
}

.splash-backdrop-glow {
    position: absolute;
    width: min(520px, 90vw);
    height: min(680px, 90vh);
    background: radial-gradient(circle, rgba(239, 68, 68, 0.28) 0%, rgba(220, 38, 38, 0.08) 45%, transparent 70%);
    filter: blur(45px);
    pointer-events: none;
    animation: splashPulse 3.2s ease-in-out infinite alternate;
}

@keyframes splashPulse {
    0% {
        transform: scale(0.92);
        opacity: 0.55;
    }
    100% {
        transform: scale(1.18);
        opacity: 0.95;
    }
}

.splash-card-wrapper {
    position: relative;
    width: min(320px, 74vw);
    aspect-ratio: 724 / 1024;
    border-radius: 26px;
    box-shadow: 
        0 25px 65px -15px rgba(0, 0, 0, 0.95),
        0 0 40px rgba(220, 38, 38, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: cardFloat 4.2s ease-in-out infinite alternate;
    z-index: 2;
}

@keyframes cardFloat {
    0% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-9px) rotate(0.45deg);
    }
    100% {
        transform: translateY(4px) rotate(-0.45deg);
    }
}

.splash-card-img {
    width: 100%;
    height: 100%;
    object-fit: fill;
    border-radius: 24px;
    display: block;
    background: #ffffff;
}

.splash-svg-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}

.splash-border-track {
    fill: none;
    stroke: rgba(239, 68, 68, 0.16);
    stroke-width: 12;
}

.splash-border-loader {
    fill: none;
    stroke: #ff1e38;
    stroke-width: 18;
    stroke-linecap: round;
    stroke-dasharray: 450 2608;
    stroke-dashoffset: 0;
    filter: drop-shadow(0 0 10px #ff1744) drop-shadow(0 0 24px #ff1744) drop-shadow(0 0 2px #ffffff);
    animation: runAroundCard 2.4s linear infinite;
}

.splash-border-loader-core {
    fill: none;
    stroke: #ffffff;
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 260 2798;
    stroke-dashoffset: 0;
    filter: drop-shadow(0 0 8px #ffffff);
    animation: runAroundCard 2.4s linear infinite;
}

@keyframes runAroundCard {
    0% {
        stroke-dashoffset: 0;
    }
    100% {
        stroke-dashoffset: -3058;
    }
}

.splash-info {
    margin-top: 1.8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    z-index: 2;
    text-align: center;
}

.splash-title {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #f8fafc;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-shadow: 0 0 20px rgba(255, 30, 56, 0.4);
}

.splash-title span.flame {
    filter: drop-shadow(0 0 8px #ff4d4d);
}

.splash-title span.gradient-text {
    background: linear-gradient(90deg, #ffffff 0%, #ff4d4d 50%, #ff9999 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.splash-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.42rem 1.2rem;
    border-radius: 999px;
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}

.splash-status-badge.ready {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.35);
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.16);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.pulse-dot.ready {
    background: #22c55e;
    box-shadow: 0 0 8px #22c55e, 0 0 16px #22c55e;
    animation: dotBlinkReady 1.8s ease-in-out infinite;
}

@keyframes dotBlinkReady {
    0%, 100% {
        opacity: 0.4;
        transform: scale(0.85);
    }
    50% {
        opacity: 1;
        transform: scale(1.25);
    }
}

.splash-status-text {
    font-family: 'Space Grotesk', ui-monospace, monospace;
    font-size: 0.88rem;
    font-weight: 700;
    color: #e2e8f0;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.splash-status-sub {
    font-size: 0.82rem;
    color: #94a3b8;
    letter-spacing: 0.05em;
    animation: subFade 2.4s ease-in-out infinite alternate;
}

@keyframes subFade {
    0% {
        opacity: 0.7;
    }
    100% {
        opacity: 1;
    }
}

.splash-dismiss-hint {
    margin-top: 0.25rem;
    font-size: 0.72rem;
    color: #64748b;
    letter-spacing: 0.04em;
    opacity: 0.85;
}

@media (max-height: 520px) {
    .splash-card-wrapper {
        width: min(150px, 35vw);
    }
    .splash-info {
        margin-top: 0.8rem;
        gap: 0.4rem;
    }
    .splash-title {
        font-size: 1.1rem;
    }
}

/* =====================================================
   GAME OVER / RESULTS MODAL
   ===================================================== */
.modal-dialog.modal-game-over {
    max-width: 620px;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.game-over-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #f8fafc;
    border-bottom: 1px solid #334155;
    padding: 16px 24px;
}

.game-over-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #f8fafc;
}

.game-over-header .modal-subtitle {
    color: #94a3b8;
    font-size: 0.85rem;
}

.game-over-body {
    padding: 24px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.game-over-banner {
    padding: 16px 20px;
    border-radius: 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    animation: bannerPop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bannerPop {
    0% { transform: scale(0.92); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.game-over-banner.banner-winner {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #f59e0b;
    color: #92400e;
}

.game-over-banner.banner-podium {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    border: 2px solid #0284c7;
    color: #0369a1;
}

.game-over-banner.banner-shithead {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border: 2px solid #ef4444;
    color: #991b1b;
}

.game-over-banner.banner-draw {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border: 2px solid #9ca3af;
    color: #374151;
}

.banner-badge-title {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.banner-badge-desc {
    font-size: 0.95rem;
    font-weight: 500;
    opacity: 0.92;
}

.results-table-container {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.results-table th {
    background: #f1f5f9;
    color: #475569;
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 10px 14px;
    border-bottom: 1px solid #e2e8f0;
}

.results-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
    vertical-align: middle;
}

.results-table tr:last-child td {
    border-bottom: none;
}

.results-table tr.is-me-row {
    background: #eff6ff;
    font-weight: 700;
}

.results-table tr.is-winner-row td:first-child {
    color: #d97706;
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: 800;
    font-size: 0.95rem;
}

.rank-badge.rank-1 {
    background: #fef3c7;
    color: #b45309;
    border: 2px solid #f59e0b;
}

.rank-badge.rank-2 {
    background: #f1f5f9;
    color: #475569;
    border: 2px solid #94a3b8;
}

.rank-badge.rank-3 {
    background: #ffedd5;
    color: #c2410c;
    border: 2px solid #fb923c;
}

.rank-badge.rank-other {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #cbd5e1;
}

.rank-badge.rank-shithead {
    background: #fee2e2;
    color: #b91c1c;
    border: 2px solid #ef4444;
}

.game-over-footer {
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    gap: 12px;
}

/* ==========================================================================
   DESIGN DRAFT PLAYING TABLE STYLES (KAKHEAD POKER-STYLE TABLE)
   ========================================================================== */

:root {
    --glass: rgba(5, 14, 23, 0.82);
    --glass2: rgba(8, 18, 28, 0.92);
    --line: rgba(151, 190, 219, 0.2);
    --muted: #a8b7c8;
    --text: #f4f7fb;
    --gold: #efbd72;
    --green: #19a878;
    --blue: #6bb9f2;
    --card-w: clamp(54px, 6.2vw, 94px);
    --card-h: calc(var(--card-w) * 1.43);
}

body.in-game {
    margin: 0 !important;
    padding: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    overflow: hidden !important;
    background: #17120f !important;
    color: var(--text, #f4f7fb) !important;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif !important;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

body.in-game .container {
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    gap: 0 !important;
    overflow: hidden !important;
}

body.in-game header,
body.in-game .tavern-header,
body.in-game footer,
body.in-game #reconnectBanner,
body.in-game #setupPanel,
body.in-game #lobbyPanel {
    display: none !important;
}

body.in-game .tavern-main {
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    overflow: hidden !important;
}

body.in-game .tab-panel#tab-lobby {
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    animation: none !important;
}

#gameArea.table-view {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
    isolation: isolate;
    background: #201710;
    overflow: hidden;
}

#table-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
}

#shade {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(ellipse at 50% 47%, transparent 35%, rgba(0, 0, 0, 0.24) 100%),
                linear-gradient(90deg, rgba(0, 0, 0, 0.45), transparent 26%, transparent 75%, rgba(0, 0, 0, 0.2));
}

.table-view .panel {
    background: var(--glass);
    border: 1px solid var(--line);
    box-shadow: 0 12px 35px rgba(0,0,0,0.35), inset 0 1px rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(13px);
    border-radius: 22px;
}

/* Top Left Brand & Stats */
.top-left {
    position: absolute;
    left: clamp(14px, 2.2vw, 36px);
    top: clamp(14px, 2.3vh, 26px);
    width: 250px;
    max-width: calc(100vw - 28px);
    z-index: 5;
}

.brand {
    display: flex;
    gap: 13px;
    align-items: center;
    padding: 0 0 16px;
    border-bottom: 1px solid var(--line);
}

.brand-icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 22px;
    background: linear-gradient(145deg, #172b3c, #07111b);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 34px;
    color: var(--gold);
}

.brand h1 {
    font-size: clamp(25px, 2.5vw, 38px);
    line-height: 1;
    margin: 0;
    font-weight: 750;
    letter-spacing: -1px;
    color: #fff;
}

.round-info {
    padding: 15px 0 12px;
    color: var(--muted);
    font-size: 14px;
}

.round-info strong {
    color: #fff;
    font-weight: 600;
    margin-right: 8px;
}

.stats {
    padding: 13px 15px;
    display: grid;
    gap: 12px;
    border-radius: 21px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 11px;
    color: var(--muted);
    font-size: 13px;
}

.stat svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
}

.stat b {
    margin-left: auto;
    color: #fff;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Top Right Toolbar */
.toolbar {
    position: absolute;
    right: clamp(14px, 2vw, 30px);
    top: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 6px;
    border-radius: 27px;
    z-index: 10;
}

.icon-btn {
    width: 54px;
    height: 54px;
    border: 0;
    border-radius: 20px;
    background: rgba(17, 27, 38, 0.7);
    display: grid;
    place-items: center;
    color: #d7e0e9;
    cursor: pointer;
    position: relative;
    transition: background 0.15s, transform 0.1s;
}

.icon-btn:hover {
    background: #263746;
    color: #fff;
    transform: scale(1.04);
}

.icon-btn svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.toolbar-unread-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    border-radius: 10px;
    padding: 1px 6px;
    min-width: 18px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.4);
}

.icon-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none !important;
    pointer-events: none;
}

.toolbar-draw-icon {
    font-size: 22px;
    line-height: 1;
}

.toolbar-leave-icon {
    font-size: 20px;
    line-height: 1;
}

.icon-btn.icon-btn-danger:hover {
    background: #e02424;
    color: #fff;
    box-shadow: 0 0 12px rgba(224, 36, 36, 0.4);
}

/* Action button aria-busy and is-busy loading state (UI-02) */
button[aria-busy="true"],
.action-btn-main[aria-busy="true"],
.icon-btn[aria-busy="true"],
button.is-busy,
.btn.is-busy,
.action-btn-main.is-busy,
.btn-panel-footer.is-busy,
.btn-panel-action.is-busy {
    position: relative;
    pointer-events: none !important;
    cursor: wait !important;
    opacity: 0.75 !important;
}

button.is-busy::after,
.btn.is-busy::after,
.action-btn-main.is-busy::after,
.btn-panel-footer.is-busy::after,
.btn-panel-action.is-busy::after {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 8px;
    vertical-align: middle;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: busy-spinner 0.6s linear infinite;
}

@keyframes busy-spinner {
    to { transform: rotate(360deg); }
}

/* Connect Overlay (UI-02) */
.connect-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(5, 10, 18, 0.84);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.connect-overlay-card {
    background: linear-gradient(145deg, #161f30, #0d1522);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 32px 28px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 25px rgba(56, 189, 248, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.connect-overlay-spinner {
    width: 44px;
    height: 44px;
    border: 3.5px solid rgba(56, 189, 248, 0.2);
    border-top-color: #38bdf8;
    border-radius: 50%;
    animation: busy-spinner 0.8s linear infinite;
}

.connect-overlay-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

.connect-overlay-message {
    font-size: 0.95rem;
    color: #94a3b8;
    line-height: 1.5;
    margin: 0;
}

.connect-overlay-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.log-icon {
    display: inline-block;
    margin-right: 4px;
    font-size: 12px;
}

/* Draw Offer Banner */
.draw-offer-banner {
    position: absolute;
    top: clamp(14px, 2.5vh, 26px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid #eab308;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 15px rgba(234, 179, 8, 0.25);
    border-radius: 20px;
    padding: 8px 18px;
    color: #fef08a;
    font-weight: 600;
    font-size: 0.92rem;
    z-index: 100;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: drawBannerSlideDown 0.3s ease-out;
}

@keyframes drawBannerSlideDown {
    from {
        opacity: 0;
        transform: translate(-50%, -10px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.draw-offer-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.draw-offer-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.draw-offer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Opponent Seats & Public Table Cards */
.seat-wrapper {
    position: absolute;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    z-index: 3;
    pointer-events: auto;
}

.seat {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 60px;
    background: rgba(3, 12, 20, 0.88);
    box-shadow: 0 10px 24px rgba(0,0,0,0.4);
    min-width: 160px;
    backdrop-filter: blur(8px);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.seat.active {
    border-color: #4da8e9 !important;
    box-shadow: 0 0 0 2px rgba(77, 168, 233, 0.4), 0 12px 28px rgba(0,0,0,0.5) !important;
}

.avatar-emoji {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 24px;
    background: linear-gradient(140deg, #34546b, #101923);
    border: 2px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.seat-details {
    min-width: 0;
    flex: 1;
}

.seat-name {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 650;
    white-space: nowrap;
    color: #fff;
    font-size: 13px;
}

.seat-bot-chip {
    font-size: 10px;
    font-weight: 700;
    background: #6366f1;
    color: #fff;
    padding: 1px 5px;
    border-radius: 6px;
}

.online {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    display: inline-block;
}

.offline {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #64748b;
    display: inline-block;
}

.seat-status-container {
    margin-top: 3px;
    display: flex;
    gap: 4px;
    align-items: center;
}

.seat-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 8px;
    display: inline-block;
}

.seat-badge.turn { background: #fef3c7; color: #92400e; }
.seat-badge.ready { background: #dcfce7; color: #166534; }
.seat-badge.swapping { background: #e0f2fe; color: #075985; }
.seat-badge.shithead { background: #fee2e2; color: #991b1b; }
.seat-badge.finished { background: #fef3c7; color: #b45309; }
.seat-badge.winner {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    border: 1px solid #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.seat.seat-winner {
    border-color: #f59e0b !important;
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.5), 0 10px 24px rgba(0,0,0,0.4) !important;
}

.seat.seat-shithead {
    border-color: #ef4444 !important;
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.5), 0 10px 24px rgba(0,0,0,0.4) !important;
}

.seat.seat-finished {
    opacity: 0.85;
}

.seat-count {
    position: absolute;
    right: -4px;
    top: -6px;
    background: #172330;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 13px;
    color: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

/* Opponent Public Table Cards */
.seat-table-cards {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
    background: rgba(4, 12, 19, 0.75);
    padding: 4px 7px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

.seat-table-slot {
    position: relative;
    width: clamp(34px, 3.8vw, 46px);
    height: calc(clamp(34px, 3.8vw, 46px) * 1.43);
    border-radius: 6px;
}

.seat-table-slot.empty {
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 6px;
}

.seat-blind-under {
    position: absolute;
    inset: 2px -2px -2px 2px;
    border-radius: 6px;
    background: #1e293b;
    border: 1px solid #475569;
    z-index: 1;
}

.seat-card-faceup {
    position: absolute;
    inset: 0;
    border-radius: 6px;
    background: #f3ece4;
    color: #151b22;
    border: 1px solid #fff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.35);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.seat-card-faceup.red { color: #d42d25; }

.mini-corner {
    position: absolute;
    left: 3px;
    top: 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: Georgia, serif;
    font-size: 11px;
    line-height: 0.85;
    font-weight: 700;
}

.mini-suit {
    font-size: 16px;
    font-family: Georgia, serif;
}

.seat-card-facedown {
    position: absolute;
    inset: 0;
    border-radius: 6px;
    border: 1px solid #94a3b8;
    background: repeating-linear-gradient(135deg, #172b43 0 3px, #1b304a 3px 5px);
    box-shadow: inset 0 0 0 2px #c6cbd0, inset 0 0 0 3px #243b56;
    display: grid;
    place-items: center;
    color: #7f95ad;
    z-index: 2;
}

.seat-card-facedown svg {
    width: 60%;
    height: 50%;
    fill: none;
    stroke: #6e8298;
    stroke-width: 1.2;
}

/* Center Piles */
.center-piles {
    position: absolute;
    left: 50%;
    top: 38%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: clamp(24px, 5vw, 70px);
    z-index: 3;
}

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

.deck, .discard, .burned-pile {
    width: clamp(74px, 8.5vw, 120px);
    height: calc(clamp(74px, 8.5vw, 120px) * 1.43);
    border-radius: 12px;
    position: relative;
    box-shadow: 0 15px 24px rgba(0,0,0,0.45);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.deck {
    background: linear-gradient(135deg, #e8e5e0, #9e9d9b);
    padding: 5px;
    transform: rotate(1deg);
    border: 0;
    cursor: default;
}

.deck:before, .deck:after {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 9px;
    background: #ddd;
    z-index: -1;
    transform: translateY(3px);
}

.deck:after {
    transform: translateY(6px);
    z-index: -2;
    background: #aaa;
}

.card-back {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    border: 1px solid #d7d9dc;
    background: repeating-linear-gradient(135deg, #172b43 0 4px, #1b304a 4px 6px);
    box-shadow: inset 0 0 0 3px #c6cbd0, inset 0 0 0 5px #243b56;
    display: grid;
    place-items: center;
    color: #7f95ad;
}

.card-back svg {
    width: 60%;
    height: 45%;
    fill: none;
    stroke: #6e8298;
    stroke-width: 1.2;
}

.discard {
    background: #f2e9de;
    color: #151b22;
    padding: 8px;
    transform: rotate(-1deg);
    border: 1px solid #fff;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.discard.red { color: #d42d25; }

.discard:hover {
    transform: rotate(0) scale(1.03);
    box-shadow: 0 18px 30px rgba(0,0,0,0.5);
}

.discard.empty {
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    color: #888;
    transform: none;
}

.burned-pile {
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(239, 68, 68, 0.3);
    color: #fff;
    transform: rotate(2deg);
    padding: 8px;
}

.burned-pile.has-cards {
    background: #f3ece4;
    color: #151b22;
    border: 1px solid #fff;
}

.burned-pile.has-cards.red { color: #d42d25; }

.burned-card-back {
    background: repeating-linear-gradient(135deg, #3d1c1c 0 4px, #4d2323 4px 6px);
    box-shadow: inset 0 0 0 3px #ef444455, inset 0 0 0 5px #7f1d1d;
    border-color: #ef444466;
}

.pile-label {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(7, 13, 20, 0.85);
    color: #b9c7d4;
    font-size: 12px;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.pile-label b {
    color: #fff;
    background: #1d2935;
    padding: 3px 8px;
    border-radius: 12px;
}

.discard-effective-rank {
    font-size: 11px;
    font-weight: 600;
    color: #e2e8f0;
    background: rgba(15, 23, 42, 0.85);
    padding: 3px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    text-align: center;
    white-space: nowrap;
    margin-top: -2px;
}

.discard-effective-rank strong {
    color: #38bdf8;
    font-weight: 750;
}

.discard-effect-notice {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 8px;
    text-align: center;
    margin-top: -2px;
}

.discard-effect-notice.restriction {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #ef4444;
}

.discard-effect-notice.skip {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}

.discard-effect-notice.transparent-three {
    background: #e0e7ff;
    color: #3730a3;
    border: 1px solid #6366f1;
}

.btn-pickup-table {
    margin-top: 4px;
    padding: 6px 14px;
    border-radius: 14px;
    background: linear-gradient(145deg, #f59e0b, #d97706);
    color: #1a1208;
    border: 1px solid #fbbf24;
    font-size: 12px;
    font-weight: 750;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    transition: all 0.15s;
    white-space: nowrap;
}

.btn-pickup-table:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.45);
}

.btn-pickup-table:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: #334155;
    border-color: #475569;
    color: #94a3b8;
    box-shadow: none;
}

.burned-top-label {
    font-size: 10px;
    color: #ef4444;
    font-weight: 700;
    white-space: nowrap;
}

/* Playing Card Base Styles (Draft Theme) */
.table-view .playing-card {
    position: relative;
    width: var(--card-w);
    height: var(--card-h);
    border-radius: 9px;
    background: #f3ece4;
    color: #151b22;
    border: 1px solid #fff;
    box-shadow: 0 8px 14px rgba(0,0,0,0.35);
    flex-shrink: 0;
    transition: transform 0.15s, box-shadow 0.15s, outline 0.15s;
    user-select: none;
    display: block;
    padding: 0;
}

.table-view .playing-card.red,
.table-view .playing-card.card-red,
.discard.red {
    color: #d42d25;
}

.table-view .playing-card .corner,
.discard .corner {
    position: absolute;
    left: 5px;
    top: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
    font-weight: 700;
    pointer-events: none;
    user-select: none;
    z-index: 2;
}

.table-view .playing-card .corner.bottom,
.discard .corner.bottom {
    left: auto;
    top: auto;
    right: 5px;
    bottom: 4px;
    transform: rotate(180deg);
}

.table-view .playing-card .corner .card-rank,
.table-view .playing-card .card-rank,
.discard .corner > span:first-child {
    font-size: clamp(12px, 1.3vw, 16px);
    font-weight: 800;
    font-family: Georgia, serif;
    line-height: 1;
    text-align: center;
}

.table-view .playing-card .corner .card-suit,
.table-view .playing-card .card-suit,
.discard .corner > span:last-child {
    font-size: clamp(10px, 1.0vw, 13px);
    line-height: 1;
    margin-top: 1px;
    text-align: center;
}

.table-view .playing-card .card-center,
.table-view .playing-card .suit,
.discard .card-center,
.discard .suit {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    user-select: none;
    line-height: 1;
    z-index: 1;
}

.table-view .playing-card .card-center .center-rank,
.discard .card-center .center-rank {
    font-size: clamp(20px, 2.6vw, 32px);
    font-weight: 800;
    font-family: Georgia, serif;
    line-height: 1;
    text-align: center;
}

.table-view .playing-card .card-center .center-suit,
.discard .card-center .center-suit {
    font-size: clamp(12px, 1.5vw, 18px);
    line-height: 1;
    margin-top: 2px;
    text-align: center;
}

/* Unified Player Zone Container */
.player-zone-wrapper {
    position: absolute;
    left: 50%;
    bottom: 8px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 6;
    pointer-events: none;
    max-width: 95vw;
}

.player-zone-wrapper > * {
    pointer-events: auto;
}

/* Hand Container */
.hand {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 7;
    padding: 8px 24px 0;
    margin-top: 6px;
    border-radius: 100px 100px 20px 20px;
    background: radial-gradient(ellipse at 50% 100%, rgba(8, 14, 21, 0.85), transparent 70%);
    min-width: min(480px, 90vw);
    min-height: calc(var(--card-h) + 6px);
}

.hand .playing-card {
    margin-left: calc(var(--card-w) * -0.25);
    cursor: pointer;
    transform: rotate(var(--rot, 0deg)) translateY(var(--lift, 0px));
}

.hand .playing-card:first-child {
    margin-left: 0;
}

.hand .playing-card:hover {
    transform: rotate(0) translateY(-20px) !important;
    z-index: 9;
    box-shadow: 0 18px 25px rgba(0,0,0,0.5);
}

.hand .playing-card.selected,
.table-view .playing-card.card-selected {
    transform: rotate(0) translateY(-26px) !important;
    outline: 2px solid var(--gold);
    outline-offset: 2px;
    z-index: 8;
    box-shadow: 0 20px 30px rgba(0,0,0,0.6);
}

/* Player's Table Zone (Identity + Table Cards) */
.my-table-cards-zone {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 7px 18px;
    border-radius: 20px;
    background: rgba(5, 14, 23, 0.9);
    border: 1px solid var(--line);
    z-index: 6;
    backdrop-filter: blur(14px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.45);
}

.hand-header {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.hand-header .avatar-emoji {
    width: 38px;
    height: 38px;
    font-size: 20px;
}

.hand-header small {
    display: block;
    color: #aab8c7;
    margin-top: 1px;
    font-size: 11px;
}

.my-table-cards-divider {
    width: 1px;
    height: 48px;
    background: var(--line);
}

.my-table-slots-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.my-table-cards-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
}

.my-table-slots {
    display: flex;
    gap: 10px;
    align-items: center;
}

.my-table-slot {
    position: relative;
    width: clamp(44px, 4.8vw, 68px);
    height: calc(clamp(44px, 4.8vw, 68px) * 1.43);
    border-radius: 8px;
}

.my-table-slot.empty {
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 8px;
}

.my-table-card-under {
    position: absolute;
    inset: 3px -3px -3px 3px;
    border-radius: 7px;
    background: #1e293b;
    border: 1px solid #475569;
    z-index: 1;
}

.table-card {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    z-index: 2;
}

.table-card.clickable {
    cursor: pointer;
}

.table-card.clickable:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}

.table-card.selected {
    transform: translateY(-8px) !important;
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

.table-card.playable-blind {
    border-color: var(--gold) !important;
    box-shadow: 0 0 0 2px rgba(239, 189, 114, 0.5), 0 8px 18px rgba(0,0,0,0.5);
    animation: blindPulse 1.8s infinite;
    cursor: pointer;
}

@keyframes blindPulse {
    0%, 100% { box-shadow: 0 0 0 2px rgba(239, 189, 114, 0.5), 0 8px 18px rgba(0,0,0,0.5); }
    50% { box-shadow: 0 0 0 5px rgba(239, 189, 114, 0.8), 0 10px 24px rgba(239, 189, 114, 0.4); }
}

.blind-play-badge {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    background: #ef4444;
    color: #fff;
    font-size: 9px;
    font-weight: 850;
    padding: 1px 5px;
    border-radius: 6px;
    letter-spacing: 0.05em;
}

/* Action Buttons Bar */
.table-action-bar {
    position: relative;
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    z-index: 8;
    white-space: nowrap;
    margin-bottom: 4px;
}

.action-btn-main {
    padding: 8px 18px;
    border-radius: 14px;
    font-weight: 750;
    font-size: 13px;
    border: 1px solid var(--line);
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0,0,0,0.3);
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.action-btn-main.primary {
    background: linear-gradient(145deg, #16a34a, #15803d);
    color: #fff;
    border-color: #22c55e;
}

.action-btn-main.primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(34, 197, 94, 0.4);
}

.action-btn-main.kak {
    background: linear-gradient(135deg, #f59e0b, #b45309);
    color: #fff;
    border-color: #fbbf24;
}

.action-btn-main.success {
    background: linear-gradient(145deg, #2563eb, #1d4ed8);
    color: #fff;
    border-color: #3b82f6;
}

.action-btn-main:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #1e293b;
    border-color: #334155;
    color: #94a3b8;
    box-shadow: none;
    transform: none !important;
}

/* Turn Hint Panel */
.turn-hint {
    position: absolute;
    left: clamp(14px, 2.2vw, 36px);
    bottom: clamp(14px, 2.5vh, 28px);
    padding: 13px 18px;
    display: flex;
    align-items: center;
    gap: 13px;
    width: 340px;
    max-width: calc(100vw - 28px);
    z-index: 5;
}

.turn-hint .bulb {
    font-size: 26px;
    color: var(--gold);
}

.turn-hint strong {
    display: block;
    font-size: 14px;
    margin-bottom: 3px;
    color: #fff;
}

.turn-hint span {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.35;
    display: block;
}

/* Toast */
.toast {
    position: absolute;
    left: 50%;
    top: 18px;
    transform: translate(-50%, -12px);
    opacity: 0;
    pointer-events: none;
    padding: 11px 18px;
    border: 1px solid var(--line);
    background: rgba(7, 19, 31, 0.94);
    border-radius: 16px;
    z-index: 50;
    transition: all 0.2s ease-out;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* Side Panel (Log) */
.side-panel {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: min(390px, 90vw);
    background: var(--glass2);
    border-left: 1px solid var(--line);
    box-shadow: -10px 0 35px rgba(0,0,0,0.6);
    backdrop-filter: blur(16px);
    z-index: 40;
    display: flex;
    flex-direction: column;
    transform: translateX(105%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.side-panel.open {
    transform: translateX(0);
}

.side-panel-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 35;
    display: none;
    backdrop-filter: blur(2px);
}

.side-panel-backdrop.open {
    display: block;
}

.side-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
}

.btn-panel-action {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--line);
    color: #cbd5e1;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 11px;
    cursor: pointer;
}

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

.btn-panel-close {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--line);
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

.btn-panel-close:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: #ef4444;
}

.side-panel .log-container {
    padding: 14px 16px;
    gap: 8px;
}

.side-panel .log-item {
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 3px solid #64748b;
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 12px;
    line-height: 1.45;
}

.side-panel .log-item.log-play { border-left-color: #22c55e; background: rgba(34, 197, 94, 0.09); }
.side-panel .log-item.log-burn { border-left-color: #f97316; background: rgba(249, 115, 22, 0.12); font-weight: 600; color: #fdba74; }
.side-panel .log-item.log-skip { border-left-color: #ec4899; background: rgba(236, 72, 153, 0.1); font-weight: 600; }
.side-panel .log-item.log-pickup { border-left-color: #eab308; background: rgba(234, 179, 8, 0.09); }
.side-panel .log-item.log-error { border-left-color: #ef4444; background: rgba(239, 68, 68, 0.15); color: #fca5a5; }
.side-panel .log-item.log-system { border-left-color: #38bdf8; background: rgba(56, 189, 248, 0.08); }

.side-panel .log-time {
    color: #94a3b8;
    font-size: 11px;
}

.side-panel-footer {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--line);
    background: rgba(4, 10, 16, 0.6);
}

.btn-panel-footer {
    flex: 1;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid var(--line);
    cursor: pointer;
    text-align: center;
}

.btn-panel-footer.warning { background: #d97706; color: #fff; border-color: #f59e0b; }
.btn-panel-footer.secondary { background: #334155; color: #e2e8f0; border-color: #475569; }
.btn-panel-footer.danger { background: #dc2626; color: #fff; border-color: #ef4444; }

/* Modals in Draft Theme */
.modal-backdrop {
    position: absolute;
    inset: 0;
    display: none;
    place-items: center;
    background: rgba(0, 0, 0, 0.65);
    z-index: 50;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal-backdrop.open {
    display: grid;
}

.modal {
    width: min(440px, 100%);
    padding: 22px;
    background: #0b1723;
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: 0 25px 70px rgba(0,0,0,0.7);
    color: #fff;
}

.modal h2 {
    margin: 0 0 16px;
    font-size: 20px;
    color: #fff;
}

.modal label {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin: 14px 0 7px;
}

.modal input, .modal select {
    width: 100%;
    padding: 10px 12px;
    color: white;
    background: #152534;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 22px;
}

.action {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #142433;
    padding: 9px 16px;
    color: #fff;
    cursor: pointer;
}

.action.primary {
    background: #dca75b;
    color: #1a1208;
    border-color: #dca75b;
    font-weight: 700;
}

/* =====================================================
   LANDSCAPE ENFORCER OVERLAY (Portrait Blocker)
   Active strictly during in-game state when phone is held vertically.
   ===================================================== */
.landscape-blocker {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: radial-gradient(ellipse at 50% 40%, #1c2b3e, #080e16 90%);
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    color: #fff;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

body.in-game .landscape-blocker {
    display: none;
}

@media (orientation: portrait) {
    body.in-game .landscape-blocker {
        display: flex !important;
    }
}

.landscape-blocker-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 380px;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    padding: 32px 24px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6);
}

.phone-rotate-anim {
    color: var(--gold, #efbd72);
    margin-bottom: 18px;
    animation: phoneRotatePulse 2.4s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes phoneRotatePulse {
    0% { transform: rotate(0deg); }
    30% { transform: rotate(-90deg); }
    70% { transform: rotate(-90deg); }
    100% { transform: rotate(0deg); }
}

.landscape-blocker-content h2 {
    font-size: 1.35rem;
    font-weight: 750;
    margin: 0 0 10px;
    color: #fff;
}

.landscape-blocker-content p {
    font-size: 0.9rem;
    color: #94a3b8;
    line-height: 1.45;
    margin: 0 0 20px;
}

.landscape-blocker-actions .btn {
    padding: 10px 20px;
    font-size: 0.95rem;
    border-radius: 12px;
}

/* =====================================================
   DEDICATED POKER TABLE MOBILE LANDSCAPE LAYOUT
   Applies when in landscape with constrained height (≤ 620px)
   or small width (≤ 950px in landscape).
   ===================================================== */
@media (orientation: landscape) and (max-height: 620px), (orientation: landscape) and (max-width: 950px) {

    /* --- Top-Left HUD: Two-row ultra-compact stack (prevents collision with left seat) --- */
    .top-left {
        top: max(4px, env(safe-area-inset-top)) !important;
        left: max(6px, env(safe-area-inset-left)) !important;
        width: auto !important;
        max-width: 160px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 3px !important;
        z-index: 10 !important;
    }

    .top-left-row {
        display: flex !important;
        align-items: center !important;
        gap: 5px !important;
    }

    .brand {
        display: flex !important;
        align-items: center !important;
        gap: 5px !important;
        padding: 0 !important;
        border-bottom: 0 !important;
    }

    .brand-icon {
        width: 22px !important;
        height: 22px !important;
        font-size: 12px !important;
        border-radius: 6px !important;
    }

    .brand h1 {
        font-size: 12px !important;
        letter-spacing: -0.3px !important;
    }

    .round-info {
        padding: 1px 6px !important;
        font-size: 9.5px !important;
        background: rgba(4, 12, 19, 0.75) !important;
        border: 1px solid var(--line) !important;
        border-radius: 8px !important;
        white-space: nowrap !important;
    }

    .round-info strong {
        margin-right: 2px !important;
    }

    .stats.panel {
        padding: 2px 7px !important;
        border-radius: 10px !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 7px !important;
        background: rgba(4, 12, 19, 0.8) !important;
        border: 1px solid var(--line) !important;
        white-space: nowrap !important;
    }

    .stat {
        font-size: 9.5px !important;
        gap: 3px !important;
    }

    .stat svg {
        width: 11px !important;
        height: 11px !important;
    }

    /* Redundant player count hidden in landscape */
    .stat:has(#player-count) {
        display: none !important;
    }

    /* --- Top-Right Toolbar: VERTICAL STACK (as requested) --- */
    .toolbar {
        top: max(4px, env(safe-area-inset-top)) !important;
        right: max(6px, env(safe-area-inset-right)) !important;
        flex-direction: column !important;
        gap: 3px !important;
        padding: 3px !important;
        border-radius: 14px !important;
        background: rgba(4, 12, 19, 0.8) !important;
        z-index: 10 !important;
        width: auto !important;
    }

    .icon-btn {
        width: 28px !important;
        height: 28px !important;
        border-radius: 8px !important;
    }

    .icon-btn svg {
        width: 15px !important;
        height: 15px !important;
    }

    .toolbar-draw-icon {
        font-size: 15px !important;
    }

    .draw-offer-banner {
        top: max(38px, calc(env(safe-area-inset-top) + 34px)) !important;
        padding: 5px 12px !important;
        font-size: 0.8rem !important;
        gap: 10px !important;
        border-radius: 14px !important;
    }

    .draw-offer-icon {
        font-size: 1rem !important;
    }

    .draw-offer-actions .btn {
        padding: 4px 10px !important;
        font-size: 0.8rem !important;
    }

    /* --- Opponent Seats around Table --- */
    .seat-wrapper {
        gap: 2px !important;
    }

    .seat {
        padding: 3px 8px !important;
        min-width: 95px !important;
        border-radius: 20px !important;
        gap: 5px !important;
    }

    .avatar-emoji {
        width: 24px !important;
        height: 24px !important;
        font-size: 13px !important;
    }

    .seat-name {
        font-size: 10px !important;
        gap: 3px !important;
    }

    .seat-bot-chip {
        font-size: 8px !important;
        padding: 0 3px !important;
    }

    .seat-status-container {
        margin-top: 1px !important;
    }

    .seat-badge {
        font-size: 8px !important;
        padding: 0 4px !important;
    }

    .seat-count {
        width: 19px !important;
        height: 19px !important;
        font-size: 9px !important;
        top: -3px !important;
        right: -3px !important;
    }

    .seat-table-cards {
        padding: 2px 4px !important;
        gap: 3px !important;
        border-radius: 6px !important;
    }

    .seat-table-slot {
        width: 22px !important;
        height: 31px !important;
        border-radius: 4px !important;
    }

    .mini-corner {
        font-size: 8px !important;
        left: 2px !important;
        top: 1px !important;
    }

    .mini-suit {
        font-size: 9px !important;
    }

    /* --- Center Piles --- */
    .center-piles {
        top: 36% !important;
        gap: clamp(10px, 3.5vw, 24px) !important;
    }

    .pile-wrap {
        gap: 3px !important;
    }

    .deck, .discard, .burned-pile {
        width: clamp(46px, 12vh, 64px) !important;
        height: calc(clamp(46px, 12vh, 64px) * 1.42) !important;
        border-radius: 8px !important;
        box-shadow: 0 6px 14px rgba(0,0,0,0.4) !important;
    }

    .pile-label {
        padding: 2px 5px !important;
        font-size: 8px !important;
        gap: 3px !important;
        border-radius: 8px !important;
    }

    .pile-label b {
        padding: 1px 4px !important;
        border-radius: 6px !important;
        font-size: 8px !important;
    }

    .discard-effective-rank {
        font-size: 8px !important;
        padding: 1px 4px !important;
        border-radius: 5px !important;
    }

    .discard-effect-notice {
        font-size: 8px !important;
        padding: 1px 4px !important;
        border-radius: 4px !important;
    }

    .btn-pickup-table {
        padding: 3px 7px !important;
        font-size: 9px !important;
        border-radius: 8px !important;
        margin-top: 1px !important;
    }

    .burned-top-label {
        font-size: 8px !important;
    }

    /* --- Player Zone: Thumb-Friendly Tripartite Ergonomics --- */
    .player-zone-wrapper {
        position: absolute !important;
        inset: 0 !important;
        transform: none !important;
        max-width: 100vw !important;
        height: 100% !important;
        display: block !important;
        pointer-events: none !important;
        z-index: 8 !important;
    }

    /* 1. Left thumb: Table cards and avatar */
    .my-table-cards-zone {
        position: absolute !important;
        left: max(6px, env(safe-area-inset-left)) !important;
        bottom: max(4px, env(safe-area-inset-bottom)) !important;
        padding: 3px 7px !important;
        gap: 6px !important;
        border-radius: 12px !important;
        z-index: 9 !important;
        pointer-events: auto !important;
        background: rgba(3, 12, 20, 0.9) !important;
        box-shadow: 0 4px 14px rgba(0,0,0,0.5) !important;
    }

    .hand-header .avatar-emoji {
        width: 22px !important;
        height: 22px !important;
        font-size: 12px !important;
    }

    .hand-header strong {
        font-size: 10px !important;
    }

    .hand-header small {
        display: none !important;
    }

    .my-table-cards-divider {
        display: none !important;
    }

    .my-table-cards-label {
        display: none !important;
    }

    .my-table-slots {
        gap: 3px !important;
    }

    .my-table-slot {
        width: 26px !important;
        height: 37px !important;
        border-radius: 4px !important;
    }

    /* 2. Right thumb: Action Buttons */
    .table-action-bar {
        position: absolute !important;
        right: max(6px, env(safe-area-inset-right)) !important;
        bottom: max(4px, env(safe-area-inset-bottom)) !important;
        margin-bottom: 0 !important;
        gap: 4px !important;
        z-index: 10 !important;
        pointer-events: auto !important;
        display: flex !important;
        flex-direction: column-reverse !important;
        align-items: flex-end !important;
    }

    .action-btn-main {
        padding: 6px 12px !important;
        font-size: 10.5px !important;
        border-radius: 10px !important;
        box-shadow: 0 3px 10px rgba(0,0,0,0.5) !important;
    }

    /* 3. Center bottom: Hand cards (clean, crisp, linear scroll/drag carousel) */
    .hand {
        position: absolute !important;
        left: calc(max(6px, env(safe-area-inset-left)) + 140px) !important;
        right: calc(max(6px, env(safe-area-inset-right)) + 148px) !important;
        bottom: max(4px, env(safe-area-inset-bottom)) !important;
        transform: none !important;
        min-width: 0 !important;
        width: auto !important;
        max-width: none !important;
        min-height: 0 !important;
        padding: 18px 8px 2px !important;
        margin: 0 !important;
        background: none !important;
        border-radius: 0 !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        scroll-behavior: smooth !important;
        overscroll-behavior-x: contain !important;
        touch-action: pan-x !important;
        clip-path: none !important;
        -webkit-clip-path: none !important;
        mask: none !important;
        -webkit-mask: none !important;
        pointer-events: auto !important;
        z-index: 8 !important;
        display: flex !important;
        align-items: flex-end !important;
        justify-content: flex-start !important;
        scrollbar-width: none !important; /* Hide scrollbar Firefox */
        user-select: none !important;
        -webkit-user-select: none !important;
    }

    .hand::-webkit-scrollbar {
        display: none !important; /* Hide scrollbar Chrome/Safari */
    }

    .table-view .playing-card {
        width: clamp(40px, 12vh, 56px) !important;
        height: calc(clamp(40px, 12vh, 56px) * 1.42) !important;
        border-radius: 6px !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.45) !important;
    }

    .table-view .playing-card .corner,
    .discard .corner {
        left: 2px !important;
        top: 2px !important;
    }

    .table-view .playing-card .corner.bottom,
    .discard .corner.bottom {
        right: 2px !important;
        bottom: 2px !important;
    }

    .table-view .playing-card .corner .card-rank,
    .table-view .playing-card .card-rank,
    .discard .corner > span:first-child {
        font-size: 11px !important;
    }

    .table-view .playing-card .corner .card-suit,
    .table-view .playing-card .card-suit,
    .discard .corner > span:last-child {
        font-size: 9px !important;
    }

    .table-view .playing-card .card-center .center-rank,
    .discard .card-center .center-rank {
        font-size: 17px !important;
    }

    .table-view .playing-card .card-center .center-suit,
    .discard .card-center .center-suit {
        font-size: 11px !important;
    }

    .hand .playing-card {
        margin-left: -12px !important;
        flex-shrink: 0 !important;
        transform: none !important; /* Rovné karty bez vějířovitého naklánění */
        transition: transform 0.15s ease, box-shadow 0.15s ease !important;
    }

    .hand .playing-card:first-child {
        margin-left: 0 !important;
    }

    .hand .playing-card:hover {
        transform: translateY(-12px) !important;
        z-index: 9 !important;
    }

    .hand .playing-card.selected,
    .table-view .playing-card.card-selected {
        transform: translateY(-16px) !important;
    }

    /* --- Turn Hint Panel (Info box: "Jsi na tahu" / "Na tahu: <hráč>") --- */
    .turn-hint {
        position: absolute !important;
        top: max(4px, env(safe-area-inset-top)) !important;
        left: 50% !important;
        bottom: auto !important;
        transform: translateX(-50%) !important;
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        padding: 3px 12px !important;
        border-radius: 20px !important;
        background: rgba(15, 23, 42, 0.9) !important;
        border: 1px solid rgba(255, 255, 255, 0.15) !important;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5) !important;
        z-index: 12 !important;
        pointer-events: auto !important;
        backdrop-filter: blur(12px) !important;
        -webkit-backdrop-filter: blur(12px) !important;
        width: auto !important;
        max-width: 48vw !important;
        white-space: nowrap !important;
        transition: all 0.25s ease !important;
    }

    .turn-hint.is-my-turn {
        background: linear-gradient(135deg, rgba(22, 163, 74, 0.95), rgba(15, 23, 42, 0.95)) !important;
        border-color: #22c55e !important;
        box-shadow: 0 0 16px rgba(34, 197, 94, 0.6), 0 4px 12px rgba(0, 0, 0, 0.5) !important;
        animation: turnHintPulse 1.8s infinite ease-in-out !important;
    }

    @keyframes turnHintPulse {
        0%, 100% { box-shadow: 0 0 12px rgba(34, 197, 94, 0.4); transform: translateX(-50%) scale(1); }
        50% { box-shadow: 0 0 20px rgba(34, 197, 94, 0.85); transform: translateX(-50%) scale(1.025); }
    }

    .turn-hint .bulb {
        font-size: 13px !important;
        width: 20px !important;
        height: 20px !important;
        border-radius: 50% !important;
        background: rgba(255, 255, 255, 0.1) !important;
        display: grid !important;
        place-items: center !important;
        flex-shrink: 0 !important;
    }

    .turn-hint #hint-title {
        font-size: 11px !important;
        font-weight: 750 !important;
        color: #fff !important;
    }

    .turn-hint #hint-text {
        font-size: 9.5px !important;
        color: #cbd5e1 !important;
        max-width: 22vw !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        display: inline-block !important;
    }
}

/* --- Animations for Card Turns & Table Actions (Prompt 13 / FLIP) --- */
@media (prefers-reduced-motion: no-preference) {
    .playing-card.card-enter {
        animation: cardEnterAnim 220ms ease-out forwards;
    }

    @keyframes cardEnterAnim {
        from {
            opacity: 0;
            transform: translateY(22px) scale(0.92);
        }
        to {
            opacity: 1;
            transform: translateY(var(--lift, 0px)) rotate(var(--rot, 0deg)) scale(1);
        }
    }

    .burn-flash {
        animation: burnFlashAnim 400ms ease-out forwards !important;
    }

    @keyframes burnFlashAnim {
        0% {
            transform: scale(1);
            filter: drop-shadow(0 0 0 rgba(255, 69, 0, 0));
        }
        30% {
            transform: scale(1.18);
            filter: drop-shadow(0 0 25px rgba(255, 69, 0, 0.95)) brightness(1.35);
        }
        70% {
            transform: scale(0.92);
            opacity: 0.8;
            filter: drop-shadow(0 0 15px rgba(255, 140, 0, 0.6));
        }
        100% {
            transform: scale(1);
            opacity: 1;
            filter: none;
        }
    }

    .card-flying-pickup {
        pointer-events: none;
        user-select: none;
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
    }
}

/* Global Prefers Reduced Motion rule (UI-06) */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}




/* ==========================================================================
   RUSTIC TAVERN & WOODEN HEARTH THEME
   Warm dark walnut wood, amber lantern light, felt green inlays, brass & parchment
   ========================================================================== */

:root {
  --wood-dark: #120c08;
  --wood-panel: #20140c;
  --wood-border: #442b1b;
  --felt-green: #113620;
  --felt-border: #1c5232;
  --amber-glow: #d97706;
  --gold-accent: #f59e0b;
  --parchment-bg: #1e1711;
  --parchment-card: #281e16;
  --text-main: #f5ede4;
  --text-muted: #bfa99b;
  --font-serif: 'Cinzel', Georgia, serif;
  --font-body: 'Lora', Garamond, serif;
}

body.theme-tavern {
  background-color: var(--wood-dark);
  background-image: 
    radial-gradient(circle at 50% 10%, rgba(217, 119, 6, 0.12) 0%, transparent 60%),
    radial-gradient(circle at 10% 80%, rgba(17, 54, 32, 0.25) 0%, transparent 50%),
    linear-gradient(180deg, #18100a 0%, #0d0805 100%);
  color: var(--text-main);
  font-family: var(--font-body);
  min-height: 100vh;
  padding: 0;
}

/* Tavern Header */
.tavern-header {
  background: rgba(22, 14, 9, 0.96);
  border-bottom: 2px solid var(--wood-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(8px);
}

.tavern-header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
}

.tavern-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  cursor: pointer;
  user-select: none;
}

.tavern-crest {
  font-size: 1.5rem;
  color: var(--gold-accent);
  background: #2b1c11;
  border: 1px solid var(--gold-accent);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
  transition: transform 0.2s ease;
}

.tavern-brand:hover .tavern-crest {
  transform: scale(1.08) rotate(-5deg);
}

.tavern-titles {
  display: flex;
  flex-direction: column;
}

.tavern-title {
  font-family: var(--font-serif);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.08em;
  color: #fff;
  line-height: 1.1;
}

.tavern-motto {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--amber-glow);
  font-family: var(--font-serif);
}

/* Nav Tabs */
.tavern-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #170e08;
  border: 1px solid var(--wood-border);
  border-radius: 8px;
  padding: 0.25rem;
  gap: 0.25rem;
  max-width: 100%;
}

.t-nav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-serif);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.45rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.t-nav-btn:hover {
  color: #fff;
  border-color: rgba(245, 158, 11, 0.2);
}

.t-nav-btn.active {
  background: #311e12;
  color: var(--gold-accent);
  border-color: var(--gold-accent);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}

/* Tavern Actions */
.tavern-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  position: relative;
}

/* Tavern Language Switcher & Controls */
.tavern-header .lang-switch-container {
  background: #170e08;
  border: 1px solid var(--wood-border);
  flex-shrink: 0;
}

.tavern-header .lang-switch-btn {
  color: var(--text-muted);
}

.tavern-header .lang-switch-btn:hover {
  color: #fff;
}

.tavern-header .lang-switch-btn.active {
  background: #311e12;
  color: var(--gold-accent);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.25);
}

.tavern-header .mobile-hamburger {
  background: #170e08;
  border-color: var(--wood-border);
  color: var(--gold-accent);
}

.tavern-header .mobile-hamburger:hover {
  background: #311e12;
  border-color: var(--gold-accent);
}

.tavern-header .header-menu-dropdown {
  background: #1a1009;
  border: 1px solid var(--wood-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
}

.btn-tavern-play {
  background: linear-gradient(135deg, #d97706, #92400e);
  border: 1px solid var(--gold-accent);
  color: #fff;
  font-family: var(--font-serif);
  font-size: 0.88rem;
  font-weight: 800;
  padding: 0.55rem 1.3rem;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(217, 119, 6, 0.4);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-tavern-play:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
  background: linear-gradient(135deg, #f59e0b, #b45309);
}

/* Main Layout */
.tavern-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3.5rem;
}

.tab-panel {
  display: none;
  animation: tFadeIn 0.35s ease forwards;
}

.tab-panel.active {
  display: block;
}

@keyframes tFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hero */
.tavern-hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3rem;
  align-items: center;
  padding-bottom: 3.5rem;
}

.wood-badge {
  display: inline-block;
  font-family: var(--font-serif);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: var(--gold-accent);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 0.35rem 0.8rem;
  border-radius: 4px;
  margin-bottom: 1.2rem;
}

.tavern-hero-heading {
  font-family: var(--font-serif);
  font-size: 3rem;
  line-height: 1.15;
  font-weight: 800;
  margin-bottom: 1.2rem;
  color: #fff;
}

.accent-gold {
  color: var(--gold-accent);
  text-shadow: 0 0 20px rgba(245, 158, 11, 0.4);
}

.tavern-hero-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 580px;
  margin-bottom: 2rem;
}

.tavern-cta-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.btn-wood-primary {
  background: linear-gradient(135deg, #d97706, #92400e);
  color: #fff;
  text-decoration: none;
  font-family: var(--font-serif);
  font-weight: 800;
  font-size: 1rem;
  padding: 0.85rem 1.8rem;
  border-radius: 6px;
  border: 1px solid var(--gold-accent);
  box-shadow: 0 6px 20px rgba(217, 119, 6, 0.35);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-wood-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.5);
  background: linear-gradient(135deg, #f59e0b, #b45309);
}

.tavern-features {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border-top: 1px solid var(--wood-border);
  padding-top: 1.5rem;
}

.t-feat {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.t-feat-icon {
  font-size: 1.4rem;
  width: 42px;
  height: 42px;
  background: #25170d;
  border: 1px solid var(--wood-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.t-feat div {
  display: flex;
  flex-direction: column;
}

.t-feat strong {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: #fff;
}

.t-feat span {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Tavern Hero Logo Frame (Replaces card image mockup) */
.tavern-hero-logo-box {
  display: flex;
  justify-content: center;
  align-items: center;
}

.tavern-hero-logo-frame {
  position: relative;
  width: min(320px, 82vw);
  aspect-ratio: 724 / 1024;
  border-radius: 24px;
  background: #18100a;
  padding: 10px;
  border: 4px solid #3d2417;
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.95),
    0 0 40px rgba(217, 119, 6, 0.25);
  animation: tavernLogoFloat 4s ease-in-out infinite alternate;
}

@keyframes tavernLogoFloat {
  0% { transform: translateY(0); }
  100% { transform: translateY(-8px); }
}

.tavern-hero-logo-img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  border-radius: 16px;
  display: block;
  background: #fff;
}

/* PARCHMENT RULES SCROLL */
.parchment-scroll {
  max-width: 1040px;
  margin: 0 auto;
  background: var(--parchment-bg);
  border: 2px solid var(--wood-border);
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
}

.scroll-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.parchment-seal {
  font-size: 2.4rem;
  display: block;
  margin-bottom: 0.5rem;
}

.scroll-header h2 {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  color: #fff;
  margin-bottom: 0.5rem;
}

.scroll-header p {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 650px;
  margin: 0 auto;
}

.scroll-rules-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.law-item {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  background: var(--parchment-card);
  border: 1px solid var(--wood-border);
  padding: 1.5rem;
  border-radius: 10px;
}

.law-card-badge {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 900;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  min-width: 75px;
  text-align: center;
  flex-shrink: 0;
}

.law-card-badge.red { background: #7f1d1d; color: #fecaca; border: 1px solid #ef4444; }
.law-card-badge.blue { background: #1e3a8a; color: #bfdbfe; border: 1px solid #3b82f6; }
.law-card-badge.amber { background: #78350f; color: #fde68a; border: 1px solid #f59e0b; }
.law-card-badge.gold { background: #3f2607; color: #fef08a; border: 1px solid var(--gold-accent); }
.law-card-badge.purple { background: #3b0764; color: #e9d5ff; border: 1px solid #a855f7; }

.law-body h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  margin-bottom: 0.4rem;
  color: #fff;
}

.law-body p {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.ritual-section h3 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  margin-bottom: 1.2rem;
  text-align: center;
  color: #fff;
}

.ritual-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.ritual-box {
  background: var(--parchment-card);
  border: 1px solid var(--wood-border);
  border-radius: 10px;
  padding: 1.4rem;
}

.ritual-box h4 {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--gold-accent);
  margin-bottom: 0.5rem;
}

.ritual-box p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.ritual-box.warning {
  border-color: #7f1d1d;
}

.rules-cta-footer {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--wood-border);
}

/* Tavern theme adaptations for setupPanel */
body.theme-tavern .card-panel {
  background: #1e150f;
  border: 2px solid var(--wood-border);
  color: var(--text-main);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
}

body.theme-tavern .form-group label {
  color: #f5ede4;
}

body.theme-tavern input[type="text"],
body.theme-tavern select {
  background: #140d07;
  border: 1px solid var(--wood-border);
  color: #f5ede4;
}

body.theme-tavern input[type="text"]:focus,
body.theme-tavern select:focus {
  border-color: var(--gold-accent);
  outline: none;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

body.theme-tavern .tab-navigation {
  border-bottom: 2px solid var(--wood-border);
}

body.theme-tavern .tab-btn {
  background: #170e08;
  color: var(--text-muted);
  border: 1px solid var(--wood-border);
}

body.theme-tavern .tab-btn.active {
  background: #311e12;
  color: var(--gold-accent);
  border-color: var(--gold-accent);
}

body.theme-tavern .badge-active {
  background: rgba(245, 158, 11, 0.18);
  color: #fde68a;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

body.theme-tavern .badge-online {
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

body.theme-tavern .badge-offline {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

/* ========================================================
   PROJECT CHRONICLES TIMELINE STYLES
   ======================================================== */
.chronicles-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem 0 3rem;
}

.chronicles-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.chronicles-title {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  font-weight: 800;
  color: #fff;
  margin: 0.6rem 0 0.8rem;
  line-height: 1.2;
}

.chronicles-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 1.8rem;
  line-height: 1.6;
}

.chronicles-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.chronicles-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid var(--wood-border);
  padding: 0.55rem 1.1rem;
  border-radius: 20px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.chronicles-count-badge strong {
  color: var(--gold-accent);
  font-family: var(--font-serif);
  font-size: 1.05rem;
}

.btn-chronicles-sort {
  background: linear-gradient(135deg, #2b1b11, #1a0f08);
  border: 1px solid var(--gold-accent);
  color: var(--gold-accent);
  font-family: var(--font-serif);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.6rem 1.3rem;
  border-radius: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
  user-select: none;
}

.btn-chronicles-sort:hover {
  background: linear-gradient(135deg, #3d2516, #24140a);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.25);
  color: #fff;
}

.btn-chronicles-sort .sort-icon {
  font-size: 1.05rem;
}

/* Timeline Layout */
.chronicles-timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
  margin-top: 2rem;
  padding-left: 1rem;
}

.c-timeline-item {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 1.2rem;
  position: relative;
}

.c-timeline-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.c-marker-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #3d2417, #190e07);
  border: 2px solid var(--gold-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.35);
  z-index: 2;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.c-timeline-item:hover .c-marker-icon {
  transform: scale(1.1);
  box-shadow: 0 0 22px rgba(245, 158, 11, 0.55);
}

.c-marker-line {
  width: 2px;
  flex: 1;
  background: linear-gradient(180deg, var(--wood-border), rgba(245, 158, 11, 0.25), transparent);
  margin-top: 6px;
}

.c-timeline-content {
  background: var(--parchment-card);
  border: 1px solid var(--wood-border);
  border-radius: 12px;
  padding: 1.4rem 1.6rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.c-timeline-item:hover .c-timeline-content {
  transform: translateX(4px);
  border-color: rgba(245, 158, 11, 0.6);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.6), 0 0 16px rgba(245, 158, 11, 0.15);
}

.c-milestone-header {
  margin-bottom: 0.5rem;
}

.c-milestone-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.c-milestone-date {
  font-family: var(--font-serif);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gold-accent);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.c-milestone-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
  letter-spacing: 0.03em;
}

.c-milestone-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  margin: 0.3rem 0 0.6rem;
  line-height: 1.3;
}

.c-milestone-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 0.8rem;
}

.c-milestone-commits {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 0.7rem;
  border-top: 1px dashed rgba(245, 158, 11, 0.2);
  font-size: 0.78rem;
}

.c-commit-label {
  color: #887a6d;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.c-commit-hash {
  background: #140d07;
  color: #e5d7c3;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: Consolas, monospace;
  font-size: 0.76rem;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

@media (max-width: 680px) {
  .chronicles-title {
    font-size: 1.8rem;
  }
  .chronicles-timeline {
    padding-left: 0;
  }
  .c-timeline-item {
    grid-template-columns: 44px 1fr;
    gap: 0.8rem;
  }
  .c-marker-icon {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
  }
  .c-timeline-content {
    padding: 1.1rem 1.2rem;
  }
  .c-milestone-title {
    font-size: 1.1rem;
  }
}

@media (max-width: 900px) {
  .tavern-hero {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .tavern-hero-desc {
    margin: 0 auto 2rem;
  }
  .tavern-cta-row {
    justify-content: center;
  }
  .tavern-header-inner {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem;
  }
  .tavern-hero-heading {
    font-size: 2.2rem;
  }
}

@media (max-width: 768px) {
  .tavern-header-inner {
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.8rem;
  }
  .tavern-brand {
    justify-content: center;
  }
  .tavern-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tavern-nav::-webkit-scrollbar {
    display: none;
  }
  .t-nav-btn {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .tavern-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
  }
}

@media (max-width: 480px) {
  .tavern-header-inner {
    gap: 0.45rem;
    padding: 0.4rem 0.5rem;
  }
  .tavern-crest {
    width: 34px;
    height: 34px;
    font-size: 1.15rem;
  }
  .tavern-title {
    font-size: 1.05rem;
  }
  .tavern-motto {
    font-size: 0.62rem;
  }
  .tavern-nav {
    padding: 0.2rem;
    gap: 0.2rem;
  }
  .t-nav-btn {
    padding: 0.3rem 0.55rem;
    font-size: 0.74rem;
  }
  .tavern-actions {
    gap: 0.45rem;
  }
  .lang-switch-btn {
    padding: 3px 8px;
    font-size: 0.75rem;
  }
  .btn-tavern-play {
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
  }
  .badge {
    padding: 3px 6px;
    font-size: 0.75rem;
  }
}
