/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --ice-50: #f0f9ff;
    --ice-100: #e0f2fe;
    --ice-200: #bae6fd;
    --ice-300: #7dd3fc;
    --ice-400: #38bdf8;
    --ice-500: #0ea5e9;
    --ice-600: #0284c7;
    --ice-700: #0369a1;
    --ice-800: #075985;
    --ice-900: #0c4a6e;

    --dark-900: #0a0e1a;
    --dark-800: #111827;
    --dark-700: #1a2236;
    --dark-600: #243049;
    --dark-500: #334155;

    --red-team: #ef4444;
    --red-glow: #dc26264d;
    --yellow-team: #eab308;
    --yellow-glow: #ca8a044d;

    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);

    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius: 16px;
    --radius-sm: 10px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: var(--font);
    background: var(--dark-900);
    color: #e2e8f0;
    min-height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    touch-action: none;
}

/* ===== SCREENS ===== */
.screen {
    display: none;
    width: 100vw;
    height: 100vh;
}

.screen.active {
    display: flex;
}

/* ===== NICKNAME & WAITING SCREENS ===== */
#nicknameScreen,
#waitingRoom {
    align-items: center;
    justify-content: center;
    position: relative;
}

.lobby-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(14, 165, 233, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(56, 189, 248, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(3, 105, 161, 0.12) 0%, transparent 50%);
    animation: bgPulse 8s ease-in-out infinite alternate;
}

@keyframes bgPulse {
    0% {
        opacity: 0.8;
    }

    100% {
        opacity: 1;
    }
}

.lobby-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.logo-icon {
    font-size: 64px;
    margin-bottom: 8px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.lobby-header h1 {
    font-size: 56px;
    font-weight: 900;
    letter-spacing: -2px;
    background: linear-gradient(135deg, var(--ice-200), var(--ice-400), var(--ice-300));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
}

.subtitle {
    font-size: 16px;
    color: var(--ice-400);
    font-weight: 400;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-top: 4px;
}

.lobby-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 36px 40px;
    width: 420px;
    max-width: 90vw;
    box-shadow: var(--glass-shadow);
}

.lobby-card h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--ice-100);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #94a3b8;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: #e2e8f0;
    font-family: var(--font);
    font-size: 15px;
    transition: var(--transition);
    outline: none;
}

.form-group input:focus {
    border-color: var(--ice-400);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.btn-start {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--ice-600), var(--ice-500));
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-family: var(--font);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition);
    margin-top: 8px;
}

.btn-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(14, 165, 233, 0.3);
}

.btn-start:active {
    transform: translateY(0);
}

.btn-start:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===== FLAG PICKER ===== */
.flag-picker {
    margin-bottom: 20px;
}

.flag-picker h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--ice-200);
    margin-bottom: 12px;
}

.flag-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.flag-btn {
    font-size: 26px;
    padding: 8px 4px;
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
}

.flag-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
}

.flag-btn.selected {
    background: rgba(56, 189, 248, 0.15);
    border-color: var(--ice-400);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
    transform: scale(1.15);
}

.flag-hint {
    font-size: 12px;
    color: #64748b;
    margin-top: 8px;
    text-align: center;
    transition: var(--transition);
}

.flag-hint.selected {
    color: var(--ice-400);
}

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

.lobby-footer p {
    font-size: 13px;
    color: #64748b;
}

/* ===== ROOM BROWSER ===== */
#roomBrowser {
    flex-direction: column;
    background: var(--dark-900);
}

.room-browser-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.room-browser-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.room-icon {
    font-size: 24px;
}

.room-browser-title h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--ice-100);
}

.room-browser-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.player-badge {
    padding: 6px 14px;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ice-300);
}

.online-count {
    font-size: 13px;
    color: #64748b;
}

.version-badge {
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    padding: 3px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    letter-spacing: 0.5px;
}

.room-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    padding: 20px 24px;
    overflow-y: auto;
    align-content: start;
}

.room-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 16px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.room-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--ice-600);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.15);
}

.room-card.full {
    opacity: 0.5;
    cursor: not-allowed;
}

.room-card.full:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--glass-border);
}

.room-card.playing {
    border-color: rgba(234, 179, 8, 0.3);
}

.room-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.room-number {
    font-size: 15px;
    font-weight: 700;
    color: var(--ice-200);
}

.room-status {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 8px;
}

.room-status.empty {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
}

.room-status.waiting {
    color: #eab308;
    background: rgba(234, 179, 8, 0.1);
}

.room-status.playing {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.room-players {
    font-size: 12px;
    color: #64748b;
}

.room-player-names {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}

/* ===== WAITING ROOM ===== */
.waiting-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 48px 56px;
    text-align: center;
    box-shadow: var(--glass-shadow);
    min-width: 400px;
}

.waiting-icon {
    font-size: 56px;
    margin-bottom: 16px;
    animation: float 3s ease-in-out infinite;
}

.waiting-card h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--ice-100);
    margin-bottom: 8px;
}

.waiting-text {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 24px;
}

.waiting-players {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 24px;
}

.waiting-player {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
}

.team-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.team-dot.red {
    background: var(--red-team);
}

.team-dot.yellow {
    background: var(--yellow-team);
}

.waiting-vs {
    font-size: 16px;
    color: #475569;
    font-weight: 300;
}

.waiting-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--ice-400);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.btn-leave {
    padding: 10px 24px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-sm);
    color: #ef4444;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-leave:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* ===== GAME SCREEN ===== */
#gameScreen {
    flex-direction: column;
    background: var(--dark-900);
}

.game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    z-index: 10;
    flex-shrink: 0;
}

.team-score {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 200px;
}

.team1-score {
    justify-content: flex-start;
}

.team2-score {
    justify-content: flex-end;
}

.team-name {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.team1-score .team-name {
    color: var(--red-team);
}

.team2-score .team-name {
    color: var(--yellow-team);
}

.team-score .score {
    font-size: 36px;
    font-weight: 900;
    line-height: 1;
    min-width: 40px;
    text-align: center;
}

.team1-score .score {
    color: var(--red-team);
}

.team2-score .score {
    color: var(--yellow-team);
}

.game-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.end-info {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.end-label {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 2px;
}

.end-number {
    font-size: 28px;
    font-weight: 800;
    color: var(--ice-300);
}

.end-total {
    font-size: 14px;
    color: #475569;
}

.stones-left {
    font-size: 12px;
    color: #64748b;
}

.turn-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    margin-top: 2px;
}

.turn-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--red-team);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }
}

#turnText {
    font-size: 12px;
    font-weight: 500;
}

.sweep-hint {
    font-size: 11px;
    color: #7dd3fc;
    padding: 3px 12px;
    background: rgba(56, 189, 248, 0.08);
    border-radius: 12px;
    opacity: 0;
    transition: opacity 0.4s;
    animation: sweepPulse 2s ease-in-out infinite;
}

.sweep-hint.visible {
    opacity: 1;
}

@keyframes sweepPulse {

    0%,
    100% {
        color: #7dd3fc;
    }

    50% {
        color: #bae6fd;
    }
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    color: #64748b;
    margin-top: 2px;
}

.conn-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.conn-dot.connected {
    background: #22c55e;
}

.conn-dot.disconnected {
    background: #ef4444;
}

/* ===== GAME AREA ===== */
.game-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(ellipse at center, rgba(14, 165, 233, 0.06) 0%, transparent 70%);
}

#gameCanvas {
    display: block;
    cursor: crosshair;
}

/* ===== FORCE PANEL ===== */
.force-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(10, 14, 26, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px 20px 20px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 20;
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.force-panel.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.force-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.force-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #64748b;
}

.force-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--ice-200);
    min-width: 60px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.force-slider-track {
    position: relative;
    width: 100%;
    height: 20px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: visible;
    cursor: pointer;
    touch-action: none;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.force-slider-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 50%;
    border-radius: 10px;
    background: linear-gradient(90deg, #22c55e, #84cc16, #eab308, #f97316, #ef4444);
    background-size: 200% 100%;
    transition: width 0.05s linear;
}

.force-slider-thumb {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 48px;
    height: 48px;
    margin-left: -24px;
    margin-top: -24px;
    background: radial-gradient(circle at 40% 35%, #f0f9ff, var(--ice-300));
    border-radius: 50%;
    box-shadow:
        0 0 0 4px rgba(56, 189, 248, 0.3),
        0 4px 16px rgba(0, 0, 0, 0.4),
        inset 0 2px 4px rgba(255, 255, 255, 0.4);
    cursor: grab;
    touch-action: none;
    transition: box-shadow 0.2s;
    z-index: 2;
}

.force-slider-thumb:active {
    cursor: grabbing;
    box-shadow:
        0 0 0 6px rgba(56, 189, 248, 0.5),
        0 2px 12px rgba(0, 0, 0, 0.5),
        inset 0 2px 4px rgba(255, 255, 255, 0.4);
}

.force-panel-actions {
    display: flex;
    gap: 12px;
}

.btn-cancel-aim {
    flex: 1;
    padding: 14px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: var(--radius-sm);
    color: #fca5a5;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    touch-action: manipulation;
}

.btn-cancel-aim:hover {
    background: rgba(239, 68, 68, 0.2);
}

.btn-cancel-aim:active {
    transform: scale(0.97);
}

.btn-launch {
    flex: 2;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--ice-600), var(--ice-500));
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-family: var(--font);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    touch-action: manipulation;
    letter-spacing: 0.5px;
}

.btn-launch:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.35);
}

.btn-launch:active {
    transform: scale(0.97);
}


/* ===== MODALS ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-overlay.visible {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-card {
    background: var(--dark-700);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 40px 48px;
    text-align: center;
    min-width: 380px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    animation: modalSlideUp 0.4s ease-out;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-card h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 28px;
    color: var(--ice-100);
}

.modal-scores {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 24px;
}

.modal-team {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.modal-team-name {
    font-size: 13px;
    color: #94a3b8;
}

.modal-team-points {
    font-size: 48px;
    font-weight: 900;
    line-height: 1;
}

.modal-scores .modal-team:first-child .modal-team-points {
    color: var(--red-team);
}

.modal-scores .modal-team:last-child .modal-team-points {
    color: var(--yellow-team);
}

.modal-vs {
    font-size: 20px;
    color: #475569;
    font-weight: 300;
}

.modal-totals {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 12px 0 24px;
    font-size: 14px;
    color: #64748b;
}

.modal-totals span:first-child {
    font-size: 20px;
    font-weight: 800;
    color: var(--red-team);
}

.modal-totals span:last-child {
    font-size: 20px;
    font-weight: 800;
    color: var(--yellow-team);
}

.game-over-card .trophy {
    font-size: 64px;
    margin-bottom: 12px;
    animation: float 3s ease-in-out infinite;
}

.final-score {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 32px;
}

.final-score span:first-child {
    font-size: 56px;
    font-weight: 900;
    color: var(--red-team);
}

.final-score span:last-child {
    font-size: 56px;
    font-weight: 900;
    color: var(--yellow-team);
}

.final-vs {
    font-size: 24px;
    color: #475569;
    font-weight: 300;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {

    .lobby-card,
    .waiting-card {
        padding: 28px 24px;
    }

    .lobby-header h1 {
        font-size: 42px;
    }

    .team-score {
        min-width: auto;
    }

    .team-name {
        display: none;
    }

    .game-header {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        /* Full height */
        width: 80px;
        flex-direction: column;
        justify-content: center;
        padding: 20px 0;
        gap: 16px;
        background: linear-gradient(to left, rgba(0, 0, 0, 0.4), transparent);
        pointer-events: none;
        z-index: 15;
    }

    .game-header>* {
        pointer-events: auto;
    }

    .team-score {
        min-width: auto;
        flex-direction: column-reverse;
        /* Score above label */
        gap: 4px;
    }

    .team-score .score {
        font-size: 32px;
    }

    .team-name {
        display: none;
    }

    .game-info {
        flex-direction: column;
        gap: 12px;
        order: 0;
    }

    .end-info {
        flex-direction: column;
        gap: 2px;
        font-size: 10px;
        text-align: center;
    }

    .end-number {
        font-size: 16px;
    }

    .stones-left {
        display: none;
    }

    .turn-indicator {
        flex-direction: column;
        gap: 4px;
    }

    .turn-dot {
        width: 14px;
        height: 14px;
    }

    #turnText {
        display: none;
    }

    .connection-status {
        display: none;
    }

    .hammer-indicator {
        font-size: 20px;
        margin: 4px 0;
    }

    .modal-card {
        min-width: auto;
        margin: 16px;
        padding: 28px 24px;
    }

    .room-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 8px;
        padding: 12px;
    }

    .waiting-card {
        min-width: auto;
        padding: 32px 24px;
    }

    /* ===== MOBILE VERTICAL FORCE PANEL ===== */
    .force-panel {
        top: 0;
        bottom: 0;
        left: 0;
        right: auto;
        width: 60px;
        /* Reduced from 90px */
        border-top: none;
        border-right: 1px solid rgba(255, 255, 255, 0.1);
        transform: translateX(-100%);
        padding: 12px 4px;
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
        align-items: center;
        justify-content: space-between;
    }

    .force-panel.visible {
        transform: translateX(0);
    }

    .force-panel-header {
        flex-direction: column;
        gap: 8px;
        text-align: center;
        width: 100%;
    }

    .force-label {
        font-size: 10px;
        writing-mode: vertical-rl;
        transform: rotate(180deg);
        letter-spacing: 2px;
    }

    .force-value {
        width: 100%;
        text-align: center;
        font-size: 16px;
        /* Reduced from 20px */
    }

    .force-slider-track {
        width: 16px;
        height: 100%;
        flex-grow: 1;
        margin: 10px 0;
        background: rgba(255, 255, 255, 0.1);
    }

    .force-slider-fill {
        width: 100%;
        height: 50%;
        top: auto;
        bottom: 0;
        left: 0;
        background: linear-gradient(to top, #22c55e, #84cc16, #eab308, #f97316, #ef4444);
        background-size: 100% 200%;
        transition: height 0.05s linear;
    }

    .force-slider-thumb {
        left: 50%;
        top: auto;
        margin-left: -18px;
        /* Thinner thumb */
        width: 36px;
        height: 36px;
        margin-top: 0;
        transform: translateY(50%);
    }

    .force-actions {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }

    .btn-action {
        width: 100%;
        height: 34px;
        /* Reduced from 44px */
        font-size: 0;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .btn-action span {
        display: none;
        /* Hide text labels on mobile sidebar to save space? Or specific class */
    }

    /* Make buttons icon-only or vertical text */
    #btnLaunch::after {
        content: '🚀';
        font-size: 20px;
    }

    #btnCancelAim::after {
        content: '✕';
        font-size: 20px;
    }

    /* Hide original text for buttons in this specific layout */
    .btn-action {
        font-size: 0 !important;
    }
}

/* Hammer Indicator */
.hammer-indicator {
    font-size: 24px;
    margin: 0 8px;
    opacity: 0.1;
    filter: grayscale(100%);
    transition: all 0.3s ease;
    cursor: help;
}

.hammer-indicator.active {
    opacity: 1;
    filter: grayscale(0%);
    transform: scale(1.1);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
    animation: hammerPulse 2s infinite;
}

@keyframes hammerPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }

    100% {
        transform: scale(1);
    }
}

/* ===== SCROLLBAR ===== */
.room-grid::-webkit-scrollbar {
    width: 6px;
}

.room-grid::-webkit-scrollbar-track {
    background: transparent;
}

.room-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.room-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ===== LIVE SCORE TABLE ===== */
.live-score-table {
    padding: 0 12px 6px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.live-score-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    font-family: 'Inter', sans-serif;
}

.live-score-table th,
.live-score-table td {
    padding: 3px 4px;
    text-align: center;
    min-width: 22px;
}

.live-score-table thead th {
    color: #64748b;
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.live-score-table .team-col {
    text-align: left;
    min-width: 70px;
    font-weight: 600;
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90px;
}

.live-score-table .team1-row .team-col {
    color: #fca5a5;
}

.live-score-table .team2-row .team-col {
    color: #fde68a;
}

.live-score-table .team1-row td {
    color: #e2e8f0;
}

.live-score-table .team2-row td {
    color: #e2e8f0;
}

.live-score-table .live-col {
    background: rgba(239, 68, 68, 0.08);
    color: #fbbf24 !important;
    font-weight: 700;
    position: relative;
    min-width: 28px;
}

.live-score-table thead .live-col {
    font-size: 12px;
}

.live-score-table .total-col {
    font-weight: 800;
    color: #f0f9ff !important;
    background: rgba(255, 255, 255, 0.04);
    min-width: 34px;
}

.live-score-table .end-active {
    background: rgba(56, 189, 248, 0.1);
    color: var(--ice-300) !important;
    font-weight: 700;
}

.live-score-table .end-scored {
    color: #22c55e !important;
    font-weight: 700;
}

/* ===== MOBILE IMPROVEMENTS ===== */
@media (max-width: 768px) {
    .lobby-card {
        width: 95vw;
        max-width: none;
    }

    .flag-grid {
        gap: 6px;
    }

    .flag-btn {
        font-size: 22px;
        padding: 6px 2px;
    }

    .team-score .score {
        font-size: 28px;
    }

    .game-info {
        gap: 2px;
    }

    .end-number {
        font-size: 20px;
    }

    .turn-indicator {
        padding: 2px 8px;
        font-size: 10px;
    }

    /* Make modals fit better */
    .modal-card {
        width: 95vw;
        padding: 24px 16px;
    }

    .modal-team-points {
        font-size: 36px;
    }

    .final-score span:first-child,
    .final-score span:last-child {
        font-size: 42px;
    }

    /* Adjust live score table for mobile */
    .live-score-table th,
    .live-score-table td {
        padding: 2px;
        min-width: 18px;
        font-size: 10px;
    }

    .live-score-table .team-col {
        min-width: 50px;
        max-width: 60px;
    }
}