﻿@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;900&family=Orbitron:wght@500;700;900&display=swap');

:root {
    --accent: #00e5ff;
    --accent-glow: rgba(0, 229, 255, 0.35);
    --accent-dim: rgba(0, 229, 255, 0.12);
    --surface: rgba(12, 14, 20, 0.82);
    --surface-solid: #0c0e14;
    --surface-raised: rgba(18, 22, 32, 0.92);
    --border: rgba(0, 229, 255, 0.18);
    --border-hover: rgba(0, 229, 255, 0.5);
    --text-primary: #eaf0f6;
    --text-secondary: #8a94a6;
    --danger: #ff4d6a;
    --success: #00e676;
    --warning: #ffab00;
    --radius: 12px;
    --radius-sm: 8px;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --font-display: 'Orbitron', 'Inter', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-body);
    background: #06080c;
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    position: fixed;
    width: 100%;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        0deg, transparent, transparent 2px,
        rgba(0, 0, 0, 0.03) 2px, rgba(0, 0, 0, 0.03) 4px
    );
    pointer-events: none;
    z-index: 9999;
}

/* ══════ CANVAS ══════ */
#gameContainer {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}
#game-canvas {
    flex: 1;
    display: block;
    touch-action: none;
    background: #06080c;
}

/* ══════ UI OVERLAY ══════ */
#ui {
    position: absolute;
    inset: 0;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 120px 20px 16px;
}

/* ══════ HEADER ══════ */
.header {
    pointer-events: auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    z-index: 2000;
    position: fixed;
    top: 0; left: 0; right: 0;
    background: linear-gradient(180deg, rgba(6, 8, 12, 0.85) 0%, transparent 100%);
    padding: 4px 20px 20px 20px;
    gap: 8px;
    width: 100%;
}
.title {
    height: 60px;
    display: flex;
    align-items: center;
    cursor: pointer;
}
.logo-img {
    height: 44px;
    width: auto;
    object-fit: contain;
    transition: filter 0.2s, transform 0.15s;
    filter: drop-shadow(0 0 8px var(--accent-glow));
}
.title:hover .logo-img {
    filter: drop-shadow(0 0 14px var(--accent-glow)) brightness(1.1);
}
.title:active .logo-img { transform: scale(0.96); }

.logo-img-large {
    height: 80px;
    width: auto;
    object-fit: contain;
    margin-bottom: 12px;
    filter: drop-shadow(0 0 12px var(--accent-glow));
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.game-status { text-align: right; font-size: 14px; }
.phase-indicator {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 13px;
    color: var(--accent);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-shadow: 0 0 8px var(--accent-glow);
}
.player-turn {
    margin-top: 4px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* ══════ AUTH BAR ══════ */
.auth-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}
.login-button {
    font-family: var(--font-body);
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.15), rgba(0, 229, 255, 0.06));
    color: var(--accent);
    border: 1px solid var(--border);
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    backdrop-filter: blur(8px);
    letter-spacing: 0.3px;
}
.login-button:hover {
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.25), rgba(0, 229, 255, 0.12));
    border-color: var(--border-hover);
    box-shadow: 0 0 16px var(--accent-glow), inset 0 0 16px rgba(0, 229, 255, 0.05);
    transform: translateY(-1px);
}
#guestLabel {
    font-size: 12px;
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 0.5px;
    font-family: var(--font-display);
    display: flex;
    align-items: center;
    gap: 8px;
}
.guest-create-btn {
    background: none;
    border: 1px solid var(--accent);
    color: var(--accent);
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-display);
    letter-spacing: 0.5px;
    transition: all 0.2s;
}
.guest-create-btn:hover { background: var(--accent-dim); }

.user-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    position: relative;
}
.user-name-display {
    font-size: 14px;
    color: #fff;
    font-weight: 600;
}
.dropdown-toggle {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}
.dropdown-toggle:hover { color: var(--text-primary); }

.user-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: visible;
    z-index: 9998;
    backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
}
.user-menu button {
    display: block;
    width: 100%;
    padding: 12px 16px;
    text-align: left;
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}
.user-menu button:hover { background: var(--accent-dim); }

.user-menu-link {
    display: block;
    width: 100%;
    padding: 12px 16px;
    text-align: left;
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    box-sizing: border-box;
}
.user-menu-link:hover { background: var(--accent-dim); }

.user-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s;
}
.user-menu-toggle:hover { background: var(--accent-dim); }
.user-menu-toggle input { display: none; }
.toggle-slider {
    width: 36px;
    height: 20px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    position: relative;
    transition: background 0.2s;
    flex-shrink: 0;
}
.toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}
.user-menu-toggle input:checked + .toggle-slider {
    background: var(--accent);
}
.user-menu-toggle input:checked + .toggle-slider::after {
    transform: translateX(16px);
}

/* Player name links in header */
.player-name-link {
    transition: color 0.2s, text-shadow 0.2s;
}
.player-name-link:hover {
    color: #fff;
    text-shadow: 0 0 12px var(--accent-glow);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.vs-separator {
    color: var(--text-secondary);
    font-weight: 400;
}

/* Player Profile Modal */
.profile-info {
    margin-top: 16px;
}
.profile-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.profile-row:last-child { border-bottom: none; }
.profile-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.profile-value {
    font-size: 13px;
    color: var(--text-primary);
}
.profile-discord {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #5865F2;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: color 0.2s;
}
.profile-discord:hover {
    color: #7289da;
    text-decoration: underline;
}
.discord-icon { font-size: 16px; }

/* ══════ CONTROL PANEL ══════ */
.control-panel-area {
    pointer-events: none;
    position: fixed;
    bottom: 16px;
    left: 20px;
    z-index: 500;
}
.control-panel {
    pointer-events: auto;
    background: var(--surface);
    padding: 16px 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    max-width: 340px;
    backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.player-names-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 6px;
}
.pname {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    transition: all 0.25s;
}
.pname.active-turn {
    color: var(--accent);
    text-shadow: 0 0 8px var(--accent-glow);
}
.pname-vs {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.instruction {
    font-size: 13px;
    line-height: 1.55;
    margin-bottom: 6px;
    color: var(--text-secondary);
}
.control-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.control-section.hidden { display: none; }

.help-text {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}
.rules-help {
    background: rgba(0, 229, 255, 0.04);
    border: 1px solid rgba(0, 229, 255, 0.1);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 10px;
}
.help-toggle {
    display: none; /* shown on mobile via media query */
    background: none;
    border: none;
    color: var(--accent);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    align-items: center;
    gap: 4px;
}
.help-toggle:hover { color: var(--text-primary); }
.help-toggle-icon {
    display: inline-block;
    transition: transform 0.2s ease;
    font-size: 12px;
}
.rules-help.collapsed .help-toggle-icon {
    transform: rotate(-90deg);
}
.rules-help.collapsed .help-body {
    display: none;
}
.help-step {
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.4;
}
.help-tips {
    list-style: none;
    padding: 0;
    margin: 0;
}
.help-tips li {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.6;
    padding-left: 14px;
    position: relative;
}
.help-tips li::before {
    content: '›';
    position: absolute;
    left: 2px;
    color: var(--accent);
    font-weight: 700;
}
.segment-counter {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
    text-shadow: 0 0 8px var(--accent-glow);
}

/* Piece Selector */
.piece-selector {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
    margin: 6px 0;
}
.piece-btn {
    padding: 8px 6px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-body);
    text-align: center;
}
.piece-btn:hover:not(.placed) {
    background: var(--accent-dim);
    border-color: var(--border);
}
.piece-btn.selected {
    border-color: var(--accent);
    background: var(--accent-dim);
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.15);
}
.piece-btn.placed { opacity: 0.4; cursor: not-allowed; }
.piece-btn .piece-icon {
    font-size: 22px;
    display: block;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.7));
}
.piece-btn .piece-count {
    font-family: var(--font-display);
    font-size: 9px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Captured Pieces */
.captured-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}
.captured-row {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.captured-label {
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 1px;
    text-transform: uppercase;
}
.captured-pieces {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    min-height: 24px;
}
.captured-piece {
    font-size: 18px;
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
    opacity: 0.8;
}

/* Bottom Room Code + Invite */
.bottom-room-code-area {
    position: fixed;
    bottom: 12px;
    right: 12px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}
.bottom-room-code {
    font-family: var(--font-display);
    font-size: 12px;
    letter-spacing: 2px;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 8px var(--accent-glow);
}
.invite-row {
    display: flex;
    gap: 4px;
}
.invite-input {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 4px 8px;
    font-size: 0.75rem;
    width: 160px;
    outline: none;
}
.invite-input:focus {
    border-color: var(--accent);
}
.btn-small {
    background: var(--accent);
    color: #0a0e17;
    border: none;
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}
.btn-small:hover {
    filter: brightness(1.15);
}

/* ══════ MODALS ══════ */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(6, 8, 12, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    pointer-events: none;
    backdrop-filter: blur(6px);
}
.modal.visible { pointer-events: auto; }

.modal-content {
    background: var(--surface-raised);
    padding: 36px 40px;
    border-radius: var(--radius);
    text-align: center;
    max-width: 500px;
    border: 1px solid var(--border);
    pointer-events: auto;
    box-shadow: 0 0 40px rgba(0, 229, 255, 0.08), 0 24px 64px rgba(0, 0, 0, 0.5);
}
.modal h2 {
    font-family: var(--font-display);
    font-size: 22px;
    margin-bottom: 16px;
    color: var(--accent);
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 0 12px var(--accent-glow);
}
.modal p {
    font-size: 14px;
    margin-bottom: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}
.button-group {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* Auth Tabs */
.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
}
.tab-btn {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 10px;
    cursor: pointer;
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    border-bottom: 2px solid transparent;
    transition: all 0.25s;
    text-transform: uppercase;
}
.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    text-shadow: 0 0 8px var(--accent-glow);
}
.tab-btn:hover { color: var(--text-primary); }

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
}

/* Magic Link */
.magic-link-desc {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 4px;
}
.magic-link-check {
    font-size: 48px;
    text-align: center;
    margin-bottom: 8px;
}
#magic-link-sent h3 {
    color: var(--accent);
    text-align: center;
    font-family: var(--font-display);
    font-size: 16px;
    margin-bottom: 8px;
}
#magic-link-sent p {
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}
.magic-link-hint {
    margin-top: 4px;
    font-size: 12px !important;
    color: var(--text-secondary) !important;
}

.modal-error {
    color: var(--danger);
    font-size: 12px;
    margin-top: 10px;
}

/* Lobby */
.lobby-info { color: var(--accent); font-size: 13px; margin-bottom: 6px; }
.lobby-room-code {
    font-family: var(--font-display);
    font-size: 32px;
    letter-spacing: 8px;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 16px var(--accent-glow);
}
.lobby-subtext { color: var(--text-secondary); font-size: 12px; margin-top: 8px; }

/* ══════ BUTTONS ══════ */
button {
    font-family: var(--font-body);
    font-size: 14px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.25s ease;
    font-weight: 600;
    pointer-events: auto;
    letter-spacing: 0.3px;
}
.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, #00b8d4 100%);
    color: #06080c;
    padding: 10px 24px;
    box-shadow: 0 2px 12px var(--accent-glow);
}
.btn-primary:hover {
    box-shadow: 0 4px 20px var(--accent-glow), 0 0 30px rgba(0, 229, 255, 0.15);
    transform: translateY(-2px);
    filter: brightness(1.1);
}
.btn-primary:disabled {
    background: rgba(255, 255, 255, 0.06);
    color: #555;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    filter: none;
}
.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 10px 24px;
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}
.btn-discord {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #5865F2;
    color: #fff;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}
.btn-discord:hover {
    background: #4752C4;
    transform: translateY(-1px);
}
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}
.btn-danger {
    background: linear-gradient(135deg, #ff4d6a, #e6003a);
    color: #fff;
    padding: 10px 24px;
    box-shadow: 0 2px 12px rgba(255, 77, 106, 0.3);
}
.btn-danger:hover {
    box-shadow: 0 4px 20px rgba(255, 77, 106, 0.5);
    transform: translateY(-1px);
}
.btn-link {
    background: none;
    border: none;
    color: var(--accent);
    text-decoration: underline;
    cursor: pointer;
    font-size: inherit;
    padding: 0;
}
.btn-link:hover { color: #fff; }
.btn-wide { width: 100%; }

/* ══════ INPUTS ══════ */
input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(6, 8, 12, 0.6);
    color: var(--text-primary);
    outline: none;
    font-family: var(--font-body);
    transition: border-color 0.2s;
}
input:focus {
    border-color: var(--border-hover);
    box-shadow: 0 0 16px var(--accent-glow), inset 0 0 16px rgba(0, 229, 255, 0.05);
}
input::placeholder { color: rgba(138, 148, 166, 0.6); }

input[type="color"] {
    width: 60px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(6, 8, 12, 0.6);
    cursor: pointer;
    padding: 4px;
}
.form-group { margin-bottom: 16px; text-align: left; }
.form-group label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}
.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px !important;
    color: var(--text-primary) !important;
}
.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}

/* ══════ MATCH DASHBOARD ══════ */
.match-dashboard-modal {
    position: fixed;
    inset: 0;
    background: rgba(6, 8, 12, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    pointer-events: auto;
    backdrop-filter: blur(8px);
}
.match-dashboard-content {
    background: var(--surface-raised);
    padding: 36px 40px;
    border-radius: var(--radius);
    text-align: center;
    max-width: 680px;
    width: 100%;
    border: 1px solid var(--border);
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 0 60px rgba(0, 229, 255, 0.06), 0 24px 64px rgba(0, 0, 0, 0.5);
}
.match-dashboard-content h2 {
    font-family: var(--font-display);
    font-size: 22px;
    margin-bottom: 24px;
    color: var(--accent);
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 0 12px var(--accent-glow);
}
.match-dashboard-content h3 {
    font-family: var(--font-display);
    font-size: 12px;
    color: var(--accent);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-shadow: 0 0 6px var(--accent-glow);
    margin: 24px 0 12px;
    text-align: left;
}
.match-dashboard-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
}
.join-code-group {
    display: flex;
    gap: 6px;
    align-items: center;
}
.join-code-group input {
    width: 100px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-family: var(--font-display);
}
.upgrade-banner {
    background: rgba(255, 171, 0, 0.08);
    border: 1px solid rgba(255, 171, 0, 0.3);
    border-radius: var(--radius-sm);
    padding: 12px 18px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--warning);
}
.matches-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
}
.match-item {
    background: rgba(0, 229, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.25s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.match-item:hover {
    background: var(--accent-dim);
    border-color: var(--border-hover);
    transform: translateX(3px);
    box-shadow: 0 0 16px rgba(0, 229, 255, 0.06);
}
.match-info { flex: 1; }
.match-code {
    font-size: 15px;
    font-weight: 600;
    color: var(--accent);
    font-family: var(--font-display);
    letter-spacing: 2px;
    margin-bottom: 3px;
}
.match-status { font-size: 11px; color: var(--text-secondary); }
.match-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}
.match-resume-btn {
    background: linear-gradient(135deg, var(--accent) 0%, #00b8d4 100%);
    color: #06080c;
    border: none;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    font-family: var(--font-body);
}
.match-resume-btn:hover {
    box-shadow: 0 2px 16px var(--accent-glow);
    transform: translateY(-1px);
}
.match-leave-btn {
    background: none;
    border: 1px solid rgba(255, 77, 106, 0.3);
    color: var(--danger);
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    font-family: var(--font-body);
}
.match-leave-btn:hover {
    background: rgba(255, 77, 106, 0.1);
    border-color: var(--danger);
}
.empty-matches {
    color: var(--text-secondary);
    font-size: 14px;
    padding: 28px 0;
    text-align: center;
}

/* ══════ TURN BANNER ══════ */
#turnBanner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-display);
    font-size: 64px;
    font-weight: 900;
    letter-spacing: 8px;
    color: #fff;
    text-shadow: 0 0 40px var(--accent-glow), 0 0 80px rgba(0, 229, 255, 0.3), 2px 4px 8px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    z-index: 900;
    opacity: 0;
    transition: opacity 0.4s ease;
    text-transform: uppercase;
}
#turnBanner.visible { opacity: 1; }

/* ══════ CHECK BANNER ══════ */
#checkBanner {
    position: fixed;
    top: calc(50% + 60px);
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-display);
    font-size: 52px;
    font-weight: 900;
    letter-spacing: 6px;
    color: #ff2222;
    text-shadow: 0 0 40px rgba(255, 0, 0, 0.8), 0 0 80px rgba(255, 0, 0, 0.3), 2px 4px 8px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    z-index: 900;
    opacity: 0;
    transition: opacity 0.4s ease;
    text-transform: uppercase;
}
#checkBanner.visible { opacity: 1; }

/* ══════ NOTIFICATION ══════ */
.game-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-80px);
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    z-index: 950;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s ease, transform 0.35s ease;
    backdrop-filter: blur(12px);
    font-family: var(--font-body);
}
.game-notification.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.game-notification.info {
    background: rgba(0, 229, 255, 0.12);
    border: 1px solid var(--border);
    color: var(--accent);
}

/* ══════ SCROLLBAR ══════ */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: rgba(6, 8, 12, 0.5); }
::-webkit-scrollbar-thumb { background: rgba(0, 229, 255, 0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 229, 255, 0.5); }

::selection { background: rgba(0, 229, 255, 0.3); color: #fff; }

.hidden { display: none !important; }

/* ══════ RESPONSIVE ══════ */
@media (max-width: 768px) {
    #turnBanner { font-size: 36px; letter-spacing: 3px; }
    #checkBanner { font-size: 28px; letter-spacing: 2px; top: calc(50% + 40px); }
    .header { padding: 6px 0 12px 0; gap: 4px; }
    .title { height: 40px; }
    .logo-text { font-size: 16px; }
    .game-status { font-size: 11px; }
    .phase-indicator { font-size: 11px; letter-spacing: 1px; }
    .control-panel-area { bottom: 8px; left: 8px; right: 8px; }
    .control-panel { max-width: 100%; padding: 10px 12px; gap: 6px; }
    .modal-content { padding: 28px; max-width: 90%; }
    button { font-size: 13px; }
    .match-dashboard-content { padding: 24px; max-width: 95%; }
    .login-button { padding: 7px 12px; font-size: 12px; }
    /* Show help toggle on mobile */
    .help-toggle { display: flex; }
    /* Condense helper text */
    .rules-help { padding: 6px 10px; margin-bottom: 6px; }
    .help-step { font-size: 11px; margin-bottom: 4px; }
    .help-tips li { font-size: 10px; line-height: 1.5; }
    .instruction { font-size: 11px; margin-bottom: 4px; }
    .segment-counter { font-size: 11px; }
}
