:root {
    --bg: #0f1720;
    --bg-2: #16202c;
    --panel: rgba(18, 29, 41, 0.9);
    --panel-2: rgba(24, 37, 51, 0.95);
    --border: rgba(255, 255, 255, 0.09);
    --text: #e8eef5;
    --muted: #9eb0c3;
    --accent: #4f9cff;
    --accent-2: #2f7fe6;
    --success: #22a06b;
    --danger: #d25555;
    --warning: #d8a129;
    --shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(79, 156, 255, 0.18), transparent 25%),
        radial-gradient(circle at top right, rgba(34, 160, 107, 0.12), transparent 20%),
        linear-gradient(180deg, #0e1620 0%, #0a1118 100%);
    min-height: 100vh;
}

.page-shell {
    max-width: 1500px;
    margin: 0 auto;
    padding: 24px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 22px;
}

.eyebrow {
    margin: 0 0 6px 0;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 12px;
}

h1 {
    margin: 0;
    font-size: clamp(32px, 4vw, 44px);
    line-height: 1;
}

h2,
h3,
p {
    margin-top: 0;
}

.topbar-status {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.status-pill {
    min-width: 220px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

.status-label {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.layout {
    display: grid;
    grid-template-columns: 1.55fr 0.95fr;
    gap: 22px;
    align-items: start;
}

.main-column,
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    backdrop-filter: blur(10px);
}

.hero-panel {
    background:
        linear-gradient(180deg, rgba(25, 39, 54, 0.98), rgba(15, 25, 35, 0.96));
}

.hero-top,
.panel-header-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.panel-subtitle {
    color: var(--muted);
    margin-bottom: 0;
}

.hero-actions,
.mus-actions,
.button-row,
.mano-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

button {
    border: none;
    border-radius: 12px;
    padding: 11px 14px;
    background: var(--accent);
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

button:hover:not(:disabled) {
    transform: translateY(-1px);
    background: var(--accent-2);
}

button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.danger-btn {
    background: var(--danger);
}

.danger-btn:hover:not(:disabled) {
    background: #b94343;
}

input {
    width: 100%;
    padding: 13px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    outline: none;
    margin-bottom: 10px;
}

input::placeholder {
    color: #90a0b0;
}

.info-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

#statusText,
#mySeatText,
#musStatusText {
    margin: 0;
    color: var(--text);
}

.muted-text {
    color: var(--muted);
}

.mano-banner {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0 14px 0;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(34, 160, 107, 0.12);
    border: 1px solid rgba(34, 160, 107, 0.35);
}

.mano-badge {
    font-size: 12px;
    font-weight: 700;
    color: #9be2bf;
    letter-spacing: 0.08em;
}

.seats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.seat-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    background: var(--panel-2);
    min-height: 120px;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.seat-card.occupied {
    border-color: rgba(255, 255, 255, 0.16);
}

.seat-card.mine {
    border-color: rgba(79, 156, 255, 0.9);
    box-shadow: 0 0 0 2px rgba(79, 156, 255, 0.15);
}

.seat-card.mano {
    border-color: rgba(34, 160, 107, 0.9);
    box-shadow: 0 0 0 2px rgba(34, 160, 107, 0.15);
}

.seat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.seat-card h3 {
    margin: 0;
    font-size: 18px;
}

.seat-card p {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

.team-tag {
    font-size: 12px;
    color: var(--muted);
    padding: 6px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
}

.hand-container {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 16px;
}

.card {
    width: 118px;
    min-height: 170px;
    padding: 6px;
    border-radius: 16px;
    background: white;
    border: 2px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.card:hover {
    transform: translateY(-2px);
}

.card.selected {
    transform: translateY(-8px);
    border-color: var(--warning);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.32);
}

.card-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
}

.card-fallback-text {
    font-size: 14px;
    color: #1c2733;
    text-align: center;
    padding: 8px;
    font-weight: 700;
}

.vote-list {
    padding-left: 18px;
    margin-bottom: 0;
    color: var(--muted);
}

.vote-list li+li {
    margin-top: 6px;
}

.join-panel button,
.join-panel input {
    width: 100%;
}

.scoreboard-panel {
    background:
        linear-gradient(180deg, rgba(22, 34, 46, 0.98), rgba(14, 22, 31, 0.96));
}

.teams-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.team-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.04);
}

.team-label {
    margin-bottom: 8px;
    color: var(--muted);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.1em;
}

.team-score {
    font-size: 52px;
    line-height: 1;
    font-weight: 700;
    margin: 0 0 14px 0;
}

.scoreboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.bet-section {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.035);
}

.bet-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.bet-head h3 {
    margin: 0;
}

.section-counter {
    min-width: 52px;
    text-align: center;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(79, 156, 255, 0.14);
    color: #b8d8ff;
    font-weight: 700;
    font-size: 22px;
}

@media (max-width: 1100px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        order: -1;
    }
}

@media (max-width: 760px) {
    .page-shell {
        padding: 14px;
    }

    .topbar {
        flex-direction: column;
    }

    .topbar-status {
        width: 100%;
        justify-content: stretch;
    }

    .status-pill {
        min-width: 0;
        flex: 1;
    }

    .seats-grid,
    .scoreboard-grid,
    .teams-grid {
        grid-template-columns: 1fr;
    }

    .card {
        width: 92px;
        min-height: 136px;
    }

    .team-score {
        font-size: 42px;
    }
}