:root {
    --primary: #0095FF;
    --primary-dark: #0066CC;
    --primary-darker: #0f4780;
    --background: #050607;
    --surface: #0A0C0E;
    --surface-dark: #070809;
    --text: #FFFFFF;
    --text-secondary: #7788AA;
    --text-secondary-alt: #a7b4cf;
    --accent: #111518;
    --danger: #FF4655;
    --gradient: linear-gradient(135deg, #0095FF 0%, #0066CC 100%);
    --shadow: 0 2px 16px rgba(0, 0, 0, 0.7);
    --card-hover: 0 8px 32px rgba(0, 0, 0, 0.8);
    --team-a: #0095FF;  /* Blue for Team A */
    --team-b: #00FF95;  /* Green for Team B */
    --team-both: #FFD700;  /* Gold for both teams */
    --third-phase: #00d4ff;
    --fourth-phase: #b084ff;
    --ban-overlay: rgba(0, 0, 0, 0.7);  /* Darker overlay for banned agents */
    --team-a-gradient: linear-gradient(transparent, rgba(255, 0, 0, 0.5));
    --team-b-gradient: linear-gradient(transparent, rgba(255, 0, 0, 0.5));
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--background);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: -0.02em;
    line-height: 1.5;
}

body::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    z-index: -1;
    background-image: url('/assets/how-to-draft.png');
}

.main-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    gap: 20px;
    padding: 20px;
    background: var(--surface-dark);
    box-shadow: var(--shadow);
    aspect-ratio: 16/9;
    max-height: 100vh;
    max-width: calc(100vh * 16/9);
    margin: auto;
}

.role-banner {
    display: none;
    text-align: center;
    margin: 5px 0;
    padding: 6px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 4px;
    color: var(--text);
    background: var(--primary-darker);
}

/* Team Panels */
.team-panel {
    width: 280px;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-radius: 6px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
}

.team-panel.active::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 8px;
    pointer-events: none;
}

.team-panel.team-a.active::before {
    border: 2px solid var(--team-a);
    box-shadow: 0 0 15px rgba(0, 149, 255, 0.2);
}

.team-panel.team-b.active::before {
    border: 2px solid var(--team-b);
    box-shadow: 0 0 15px rgba(0, 255, 149, 0.2);
}

.team-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.team-logo {
    display: none;
}

.team-name {
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    width: 100%;
    padding: 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
}
.team-name:focus {
    background: var(--accent);
    outline: none;
}

/* Draft Sequence */
.draft-sequence {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.action {
    height: 85px;
    background: var(--accent);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    position: relative;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    background-size: cover;
    background-position: center;
}

.action.current {
    background: var(--surface-dark);
    border: 1px solid var(--primary);
    color: var(--primary);
}

.action.filled {
    color: transparent;
}

.action.filled::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

/* Team A styles */
.team-a .action.ban.filled::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(to bottom, transparent, var(--danger));
    border-radius: 4px;
    opacity: 0.7;
}
.team-a .action.pick.filled {
    border: 2px solid var(--team-a);
}

/* Team B styles */
.team-b .action.ban.filled::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(to bottom, transparent, var(--danger));
    border-radius: 4px;
    opacity: 0.7;
}
.team-b .action.pick.filled {
    border: 2px solid var(--team-b);
}

.center-panel {
    flex: 1;
    background: var(--surface);
    border-radius: 6px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
}

.map-picker-container {
    margin-top: 16px;
}

.maps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.map-item {
    background: var(--accent);
    padding: 10px;
    text-align: center;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    font-weight: 500;
}

.map-item:hover {
    background: var(--surface-dark);
}

.map-item.selected {
    background: var(--primary);
    color: var(--text);
    box-shadow: 0 0 5px rgba(0, 149, 255, 0.3);
}

.draft-status {
    text-align: center;
    padding: 10px;
    border-radius: 4px;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    position: relative;
}

.draft-status::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 0;
}

.draft-status > * {
    position: relative;
    z-index: 1;
}

.timer {
    font-size: 42px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
    letter-spacing: -0.03em;
    transition: color 0.5s ease;
}

.timer.warning {
    color: var(--danger);
}

.current-action {
    font-size: 18px;
    color: var(--text-secondary-alt);
    font-weight: 500;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.current-action .status {
    color: var(--primary);
    font-weight: 600;
}

.phase-counter {
    font-size: 13px;
    color: var(--text-secondary-alt);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    padding: 10px;
    overflow-y: auto;
    background: var(--surface-dark);
    border-radius: 4px;
}

.agent-card {
    aspect-ratio: 2/3;
    border-radius: 4px;
    border: 2px solid transparent;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
    background: var(--accent);
    height: fit-content;
    margin: 3px;
}

.agent-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
    opacity: 0.85;
}
.agent-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-hover);
}
.agent-card:hover img {
    opacity: 1;
    transform: scale(1.05);
}
.agent-card.disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    pointer-events: none;
}
.agent-card.disabled:hover {
    transform: none;
    box-shadow: none;
}
.agent-card.disabled:hover img {
    opacity: 0.85;
    transform: none;
}
.agent-card.selected {
    border: 2px solid var(--primary);
    box-shadow: 0 0 15px rgba(0, 149, 255, 0.2);
}
.agent-card.selected-b {
    border: 2px solid var(--team-b);
}
.agent-card.banned {
    opacity: 0.3;
    pointer-events: none;
}
.agent-card::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 100%; height: 50%;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
    pointer-events: none;
}

/* Additional states */
.agent-card.picked-a::after,
.agent-card.picked-b::after,
.agent-card.banned::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
}
.agent-card.picked-a::after {
    background: linear-gradient(transparent, rgba(0, 149, 255, 0.3));
}
.agent-card.picked-b::after {
    background: linear-gradient(transparent, rgba(86, 255, 70, 0.3));
}
.agent-card.banned::after {
    content: 'BANNED BY TEAM ' attr(data-banned-by);
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 1.2em;
    text-shadow: 0 0 4px black;
    z-index: 2;
    text-align: center;
    width: 100%;
    padding: 5px 0;
    background: linear-gradient(transparent, rgba(255, 70, 85, 0.5));
}

.agent-card.picked-a {
    border: 2px solid var(--team-a);
}
.agent-card.picked-b {
    border: 2px solid var(--team-b);
}
.agent-card.picked-both {
    border: 2px solid var(--team-both);
}
.agent-card.banned-a::after {
    background: linear-gradient(transparent, rgba(255, 70, 85, 0.5));
}
.agent-card.banned-b::after {
    background: linear-gradient(transparent, rgba(255, 70, 85, 0.5));
}

.restricted {
    opacity: 0.3;
    pointer-events: none;
}

/* Controls */
.controls {
    display: flex;
    gap: 12px;
    padding: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.how-to-btn-container {
    width: 100%;
    display: flex;
    justify-content: center;
    padding-top: 8px;
}

.control-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--accent);
    color: var(--text);
    letter-spacing: 0.02em;
}
.control-btn:hover {
    transform: translateY(-1px);
    background: var(--surface);
}
.control-btn.primary {
    background: var(--primary);
    color: var(--background);
}
.control-btn.primary:hover {
    background: var(--primary-dark);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--surface-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

@media (max-width: 768px) {
    .agents-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    }
    h1 {
        font-size: 3rem;
    }
    .team-name {
        width: 150px;
        font-size: 1.5rem;
    }
}

/* Lobby */
.lobby-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--background);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.lobby-container {
    background: var(--surface);
    padding: 40px;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    min-height: 500px;
}
.lobby-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 24px;
    background: var(--accent);
    padding: 4px;
    border-radius: 6px;
}
.tab-btn {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}
.tab-btn.active {
    background: var(--primary);
    color: var(--text);
}
.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
}
.lobby-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.lobby-input {
    padding: 14px;
    background: var(--accent);
    border: none;
    border-radius: 6px;
    color: var(--text);
    font-size: 15px;
    transition: all 0.2s ease;
}
.lobby-input:focus {
    outline: none;
    background: var(--surface-dark);
    box-shadow: 0 0 0 2px var(--primary);
}
.lobby-btn {
    padding: 14px;
    background: var(--primary);
    color: var(--text);
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}
.lobby-btn:hover {
    background: var(--primary-dark);
}

/* Waiting Screen */
.waiting-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--background);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}
.waiting-container {
    background: var(--surface);
    padding: 40px;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}
.lobby-info {
    margin: 24px 0;
    padding: 20px;
    background: var(--accent);
    border-radius: 6px;
}
.lobby-code {
    margin-top: 20px;
}
.code-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
}
#lobbyCodeDisplay {
    font-size: 24px;
    font-weight: 600;
    color: var(--primary);
    letter-spacing: 2px;
}
.copy-btn {
    padding: 8px 16px;
    background: var(--accent);
    border: none;
    border-radius: 4px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease;
}
.copy-btn:hover {
    background: var(--surface-dark);
}
.loader {
    margin-top: 24px;
    width: 40px;
    height: 40px;
    border: 3px solid var(--accent);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: auto;
    margin-right: auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Final draft screen */
.final-draft-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--background);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.final-draft-container {
    display: flex;
    gap: 40px;
    padding: 40px;
    background: var(--surface);
    border-radius: 8px;
    box-shadow: var(--shadow);
}
.final-team-comp {
    text-align: center;
}
.final-team-name {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
}
.final-agents {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.final-agent-card {
    width: 120px;
    aspect-ratio: 2/3;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}
.final-agent-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.team-a .final-agent-card {
    border: 2px solid var(--team-a);
}
.team-b .final-agent-card {
    border: 2px solid var(--team-b);
}

/* CURRENT PHASE – Blinking in team color */
.team-a .current-phase {
    border: 2px solid var(--team-a);
    position: relative;
    animation: fadeBlink 1.5s infinite alternate;
}
.team-b .current-phase {
    border: 2px solid var(--team-b);
    position: relative;
    animation: fadeBlink 1.5s infinite alternate;
}
.team-a .current-phase::after {
    background: var(--team-a);
}
.team-b .current-phase::after {
    background: var(--team-b);
}
/* The "CURRENT" label in the corner */
.current-phase::after {
    content: "CURRENT";
    position: absolute;
    top: 4px; right: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0.9;
    color: #000;
}

/* NEXT PHASE – Solid border (less opaque) with gold label */
.next-phase {
    position: relative;
    border: 2px solid var(--team-both);
    opacity: 0.75; /* differentiate from current */
}
.next-phase::after {
    content: "NEXT";
    position: absolute;
    top: 4px; right: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--team-both);
    padding: 2px 6px;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0.9;
    color: #000;
}

.third-phase {
    position: relative;
    border: 2px solid var(--third-phase);
    opacity: 0.75; /* differentiate from current */
}

.third-phase::after {
    content: "THIRD";
    position: absolute;
    top: 4px; right: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--third-phase);
    padding: 2px 6px;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0.9;
    color: #000;
}

.fourth-phase {
    position: relative;
    border: 2px solid var(--fourth-phase);
    opacity: 0.75; /* differentiate from current */
}

.fourth-phase::after {
    content: "FOURTH";
    position: absolute;
    top: 4px; right: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--fourth-phase);
    padding: 2px 6px;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0.9;
    color: #000;
}

/* Blinking animation for the current-phase border */
@keyframes fadeBlink {
    0%   { opacity: 1; }
    100% { opacity: 0.4; }
}

/* Game Completion Overlay */
.game-confirmation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 6, 7, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

/* Series Completion Overlay */
.series-completion-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 6, 7, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

/* Container styles for Game Completion */
.confirmation-container {
    background: var(--surface);
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    width: 90%;
    max-width: 1200px;
}

/* Container styles for Series Completion */
.series-summary-container {
    background: var(--surface);
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    width: 90%;
    max-width: 1200px;
}

.game-summary {
    margin-bottom: 20px;
}

.game-summary h3 {
    color: var(--primary);
    text-align: center;
    margin-bottom: 20px;
    font-size: 24px;
}

.teams-container {
    display: flex;
    gap: 40px;
    justify-content: center;
}

.team-summary {
    flex: 1;
}

.team-summary h4 {
    color: var(--text);
    margin-bottom: 15px;
    font-size: 18px;
}

/* Inline picks and bans (for both Game & Series Completion) */
.selections-container {
    display: flex;
    flex-direction: row;
    gap: 15px;
    align-items: flex-start;
}

.selection-group h5 {
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.agents-row {
    display: flex;
    gap: 8px;
    background: var(--surface-dark);
    padding: 10px;
    border-radius: 4px;
}

.summary-agent-card {
    width: 40px;
    height: 60px;
    border-radius: 4px;
    background-size: cover;
    background-position: center;
    position: relative;
    flex-shrink: 0;
}

/* Team-specific styles: Picks use team colors; bans use red (danger) */
.pick-a {
    border: 2px solid var(--team-a);
}
.pick-b {
    border: 2px solid var(--team-b);
}
.ban-a, .ban-b {
    border: 2px solid var(--danger);
}

.ban-a::after,
.ban-b::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(to bottom, transparent, rgba(255,70,85,0.5));
}

/* Button styles */
.confirm-btn,
.return-btn {
    background: var(--primary);
    color: var(--text);
    border: none;
    border-radius: 4px;
    padding: 12px 30px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.confirm-btn:hover,
.return-btn:hover {
    background: var(--primary-dark);
}

/* Series container */
.series-games-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Increase agent portraits for Game Completion (significantly larger) */
.game-confirmation-overlay .summary-agent-card {
    width: 80px;
    height: 120px;
}

/* Increase agent pictures a bit for Series Completion (ensuring all content fits without scrolling) */
.series-completion-overlay .summary-agent-card {
    width: 50px;
    height: 75px;
}

/* Add responsive scaling */
@media (max-aspect-ratio: 16/9) {
    .main-container {
        width: 100vw;
        height: calc(100vw * 9/16);
    }
}

@media (min-aspect-ratio: 16/9) {
    .main-container {
        height: 100vh;
        width: calc(100vh * 16/9);
    }
}

/* Notifications container */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.notification {
    background: var(--surface);
    color: var(--text);
    padding: 12px 24px;
    border-radius: 6px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
    max-width: 300px;
    opacity: 1;
}
.notification.fade-out {
    animation: fadeOut 0.3s ease forwards;
}
.notification.error {
    border-left: 4px solid var(--danger);
}
.notification.info {
    border-left: 4px solid var(--primary);
}
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
@keyframes fadeOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Additional classes for agent states */
.agent-card.picked-both::after {
    background: linear-gradient(transparent, rgba(255, 215, 0, 0.3));
}
.agent-card.picked-both {
    border: 2px solid var(--team-both);
}
.agent-card.selected-picked {
    border: 2px solid var(--team-both) !important;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

/* URL display and code display in waiting screen */
.url-display {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
#lobbyUrlDisplay {
    font-size: 14px;
    color: var(--text-secondary);
    word-break: break-all;
    max-width: 250px;
}
.code-display, .url-display {
    background: var(--surface-dark);
    padding: 8px;
    border-radius: 4px;
    margin-top: 8px;
}

/* Warning overlay */
.warning-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}
.warning-container {
    background: var(--surface);
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    text-align: center;
}
.warning-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}
.warning-btn {
    padding: 12px 24px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: 600;
}
.warning-btn.stay {
    background: var(--primary);
    color: var(--text);
}
.warning-btn.leave {
    background: var(--danger);
    color: var(--text);
}
.draft-state-container {
    max-height: 70vh;
    overflow-y: auto;
    margin-top: 20px;
    padding: 16px;
    background: var(--surface-dark);
    border-radius: 4px;
    white-space: pre-wrap;
    font-family: monospace;
}
.copy-state-btn {
    margin-top: 12px;
    background: var(--primary);
    color: var(--text);
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    cursor: pointer;
}

.how-to-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 8px 16px;
    background: var(--primary);
    color: var(--text);
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.2s ease;
    z-index: 9999;
}

.how-to-btn:hover {
    background: var(--primary-dark);
}

/* Hide the button in the main container */
.main-container .how-to-btn,
.main-container .how-to-btn-container {
    display: none !important;
}

/* Only show the button in the lobby container */
.lobby-container .how-to-btn {
    display: block;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    margin: 2% auto;
    padding: 20px;
    width: 95%;
    max-width: 1400px;
    background: var(--surface);
    border-radius: 8px;
    box-shadow: var(--shadow);
    max-height: 95vh;
    overflow-y: auto;
}

.modal-image {
    width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
    margin: 0 auto;
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 10px;
    color: var(--text);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1;
    background: var(--surface-dark);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-modal:hover {
    background: var(--accent);
}

/* Ensure modal scrolls properly on mobile */
@media (max-width: 768px) {
    .modal-content {
        margin: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
}

.image-container {
    position: relative;
    width: 100%;
    min-height: 200px;
    background: var(--surface-dark);
    border-radius: 4px;
    overflow: hidden;
}

.image-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid var(--accent);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.image-container.loaded .image-loader {
    display: none;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}