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

:root {
    /* Maya Blue */
    --maya-blue: #60BFF5;
    --maya-blue-dark: #4da8db;
    
    /* Lapis Lazuli */
    --lapis: #2E63A4;
    --lapis-dark: #1e4470;
    
    /* Dirty Brown */
    --brown: #AF6528;
    --brown-dark: #8b4f1e;
    
    /* Tangerine Yellow */
    --tangerine: #FFCE00;
    --tangerine-dark: #d4a900;
    
    /* Red */
    --red: #D70000;
    --red-dark: #a80000;
    
    /* Theme colors - Light Mode */
    --bg-primary: #ffffff;
    --bg-secondary: #f9f9f9;
    --bg-tertiary: #f5f5f5;
    --bg-gradient-start: var(--maya-blue);
    --bg-gradient-end: var(--lapis);
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --border-color: #ddd;
    --shadow: rgba(0, 0, 0, 0.2);
    --shadow-heavy: rgba(0, 0, 0, 0.3);
}

body.dark-mode {
    /* Theme colors - Dark Mode */
    --bg-primary: #1a1a1a;
    --bg-secondary: #2a2a2a;
    --bg-tertiary: #333333;
    --bg-gradient-start: var(--lapis-dark);
    --bg-gradient-end: #000000;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-tertiary: #808080;
    --border-color: #444;
    --shadow: rgba(0, 0, 0, 0.5);
    --shadow-heavy: rgba(0, 0, 0, 0.7);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    color: var(--text-primary);
    transition: background 0.3s ease, color 0.3s ease;
}

.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 10px 20px;
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(var(--bg-secondary-rgb), 0.9);
}

.site-footer p {
    margin: 3px 0;
    line-height: 1.4;
}

#version-info {
    font-weight: 600;
    color: var(--maya-blue);
    font-size: 11px;
}

.site-footer .credits {
    font-size: 11px;
    opacity: 0.8;
}

/* Footer details open state styling */
details[open] > summary {
    color: var(--text-primary) !important;
}

body.dark-mode details[open] > summary {
    color: var(--maya-blue) !important;
}

/* Footer details scrollable content */
.site-footer details > div {
    max-height: 50vh;
    overflow-y: auto;
    padding-right: 10px;
}

/* Custom scrollbar for footer (optional) */
.site-footer details > div::-webkit-scrollbar {
    width: 8px;
}

.site-footer details > div::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.site-footer details > div::-webkit-scrollbar-thumb {
    background: var(--maya-blue);
    border-radius: 4px;
}

.site-footer details > div::-webkit-scrollbar-thumb:hover {
    background: var(--maya-blue-dark);
}

/* For Firefox */
.site-footer details > div {
    scrollbar-width: thin;
    scrollbar-color: var(--maya-blue) rgba(0, 0, 0, 0.1);
}

.screen {
    display: none;
    padding: 20px;
    min-height: 80vh;
}

.screen.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    background: linear-gradient(180deg, var(--bg-primary) 0%, rgba(46,99,164, 0) 70%);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px var(--shadow-heavy);
    max-width: 1200px;
    width: 100%;
    transition: background 0.3s ease;
}

.container .dark-mode {
    background: black;
}

#collection-screen .container,
#gameover-screen .container {
    max-width: 1400px;
}

#collection-screen .container {
    max-width: 1400px;
    width: 95%;
}

#collection-screen.screen.active {
    align-items: flex-start;
    padding-top: 40px;
}

h1 {
    text-align: center;
    color: var(--maya-blue);
    margin-bottom: 30px;
    font-size: 2.5em;
}

h2 {
    color: var(--maya-blue);
    margin-bottom: 20px;
}

h3 {
    color: var(--brown);
    margin-bottom: 15px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.btn-primary {
    background: var(--maya-blue);
    color: white;
}

.btn-primary:hover {
    background: var(--maya-blue-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(96, 191, 245, 0.4);
}

.btn-secondary {
    background: var(--tangerine);
    color: var(--bg-primary);
}

.btn-secondary:hover {
    background: var(--tangerine-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 206, 0, 0.4);
}

.btn-danger {
    background: var(--red);
    color: white;
}

.btn-danger:hover {
    background: var(--red-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(215, 0, 0, 0.4);
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-large {
    padding: 16px 48px;
    font-size: 20px;
}

.btn-support {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    margin-top: 15px;
    font-size: 14px;
    padding: 12px 24px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-support:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.support-link {
    text-decoration: none;
    display: inline-block;
    margin-top: 20px;
}

.support-link:focus {
    outline: 2px solid var(--maya-blue);
    outline-offset: 4px;
    border-radius: 8px;
}

.login-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 400px;
    margin: 0 auto;
}

#profile-form {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 400px;
    margin: 30px auto 0;
}

#profile-form input {
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    background: var(--bg-primary);
    color: var(--text-primary);
}

#profile-form input:focus {
    outline: none;
    border-color: var(--maya-blue);
}

.hidden {
    display: none !important;
}

.stats {
    background: var(--bg-tertiary);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 30px;
    font-size: 18px;
    color: var(--text-primary);
}

.lobby-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.section {
    background: var(--bg-secondary);
    padding: 25px;
    border-radius: 12px;
}

#join-code-input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 15px;
    text-transform: uppercase;
    background: var(--bg-primary);
    color: var(--text-primary);
}

#tb-join-code-input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 15px;
    text-transform: uppercase;
    background: var(--bg-primary);
    color: var(--text-primary);
}

#lobby-code-display {
    margin-top: 20px;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    text-align: center;
}

#lobby-code {
    font-size: 24px;
    color: var(--maya-blue);
    letter-spacing: 3px;
}

.connection-status {
    margin-top: 10px;
    font-size: 14px;
    color: var(--text-secondary);
}

.connection-status.connected {
    color: #27ae60;
}

.connection-status.error {
    color: #e74c3c;
}

.card.my-card {
    border-color: var(--maya-blue) !important;
    box-shadow: 0 0 15px rgba(96, 191, 245, 0.5);
}

.card.opponent-card {
    border-color: var(--red) !important;
    box-shadow: 0 0 15px rgba(215, 0, 0, 0.5);
}

/* Add colored borders to face-down cards in player slots */
#player1-card-slot .card-back {
    cursor: pointer;
    transition: transform 0.2s ease;
    border: 3px solid var(--maya-blue);
    box-shadow: 0 0 15px rgba(96, 191, 245, 0.5), 0 10px 30px rgba(0,0,0,0.3);
}

#player1-card-slot .card-back:hover {
    transform: scale(1.05);
}

#player2-card-slot .card-back {
    border: 3px solid var(--red);
    box-shadow: 0 0 15px rgba(215, 0, 0, 0.5), 0 10px 30px rgba(0,0,0,0.3);
}

.claim-profile-link {
    color: #667eea;
    cursor: pointer;
    text-decoration: underline;
    margin-left: 10px;
    font-size: 14px;
}

.claim-profile-link:hover {
    color: #5568d3;
}

/* Music Contol */
.music-control {
    position: fixed;
    background: rgba(255, 255, 255, 0.5);  /* Light mode - semi-transparent white */
    backdrop-filter: blur(10px);
    width: 35vw;
    bottom: 60px;
    right: 2px;
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 5px 20px var(--shadow-heavy);
    display: none;
    z-index: 1000;
    border: 2px solid var(--maya-blue);
}

/* Dark mode override for music control */
body.dark-mode .music-control {
    background: rgba(42, 42, 42, 0.9);  /* Dark mode - semi-transparent dark */
}

/* Dark mode adjustments for collection modal */
body.dark-mode .modal-card.locked {
    background: linear-gradient(135deg, rgba(80, 80, 80, 0.3) 0%, rgba(60, 60, 60, 0.3) 100%);
}

body.dark-mode .modal-card[data-rarity="SSS"]:not(.locked) {
    background: linear-gradient(135deg, rgba(255, 0, 102, 0.25) 0%, rgba(255, 0, 102, 0.15) 100%);
}

body.dark-mode .modal-card[data-rarity="SS"]:not(.locked) {
    background: linear-gradient(135deg, rgba(153, 51, 255, 0.25) 0%, rgba(153, 51, 255, 0.15) 100%);
}

body.dark-mode .modal-card[data-rarity="S"]:not(.locked) {
    background: linear-gradient(135deg, rgba(255, 102, 0, 0.25) 0%, rgba(255, 102, 0, 0.15) 100%);
}

body.dark-mode .modal-card[data-rarity="A"]:not(.locked) {
    background: linear-gradient(135deg, rgba(255, 204, 0, 0.25) 0%, rgba(255, 204, 0, 0.15) 100%);
}

body.dark-mode .modal-card[data-rarity="B"]:not(.locked) {
    background: linear-gradient(135deg, rgba(0, 204, 255, 0.25) 0%, rgba(0, 204, 255, 0.15) 100%);
}

body.dark-mode .modal-card[data-rarity="C"]:not(.locked) {
    background: linear-gradient(135deg, rgba(0, 204, 102, 0.25) 0%, rgba(0, 204, 102, 0.15) 100%);
}

body.dark-mode .modal-card[data-rarity="D"]:not(.locked) {
    background: linear-gradient(135deg, rgba(139, 115, 85, 0.25) 0%, rgba(139, 115, 85, 0.15) 100%);
}

body.dark-mode .modal-card[data-rarity="F"]:not(.locked) {
    background: linear-gradient(135deg, rgba(184, 184, 184, 0.25) 0%, rgba(184, 184, 184, 0.15) 100%);
}

.music-control.active {
    display: block;
    width: min-content;
}

.music-control h4 {
    margin-bottom: 10px;
    color: var(--maya-blue);
    font-size: 14px;
}

.volume-controls {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    flex-direction: column;
}

.volume-btn {
    padding: 8px 12px;
    border: 2px solid var(--maya-blue);
    background: var(--bg-primary);
    color: var(--maya-blue);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    font-size: 12px;
}

.volume-btn:hover {
    background: var(--maya-blue);
    color: white;
}

.volume-btn.active {
    background: var(--maya-blue);
    color: white;
}

.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-primary);
    padding: 10px 15px;
    border-radius: 50px;
    box-shadow: 0 5px 20px var(--shadow-heavy);
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 2px solid var(--maya-blue);
    transition: all 0.3s;
}

.theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow-heavy);
}

.theme-toggle-icon {
    font-size: 20px;
}

.my-username {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    position: relative;
}

.my-username::before {
    content: '⭐ ';
    -webkit-text-fill-color: #ffd700;
    color: #ffd700;
}

.loading-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #764ba2;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.player-info.my-player h3 {
    color: var(--maya-blue);
    font-weight: 700;
}

.player-info.opponent-player h3 {
    color: var(--red);
}

.connection-status.loading {
    color: #667eea;
    font-style: italic;
}

/* Game Screen */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: 12px;
}

.player-info {
    text-align: center;
}

.score-display {
    font-size: 24px;
    font-weight: bold;
    color: var(--maya-blue);
    margin-top: 5px;
}

.round-info {
    font-size: 20px;
    font-weight: bold;
    color: var(--maya-blue);
}

.game-board {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    margin: 30px 0;
}

.card-slot {
    width: 200px;
    height: 300px;
    perspective: 1000px;
}

.card, .card-back {
    width: 100%;
    height: 100%;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 15px;
    transition: all 0.3s;
}

.card-back {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 24px;
    font-weight: bold;
    overflow: hidden;
}

.card-back img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.card {
    background: var(--bg-primary);
    border: 3px solid var(--maya-blue);
    animation: cardFlip 0.6s;
}

@keyframes cardFlip {
    0% { transform: rotateY(180deg); }
    100% { transform: rotateY(0deg); }
}

.card.winner {
    border-color: var(--tangerine);
    box-shadow: 0 0 30px rgba(255, 206, 0, 0.6);
    transform: scale(1.05);
}

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

.card-image {
    /* width: 100%;
    height: 140px;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%); */
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px 0;
    font-size: 48px;
    overflow: hidden;
}

.card-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
}

.card-name {
    font-size: 16px;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.card-arc {
    font-size: 11px;
    color: var(--text-secondary);
    font-style: italic;
}

.card-power {
    text-align: center;
    font-size: 36px;
    font-weight: bold;
    color: var(--maya-blue);
}

.vs {
    font-size: 36px;
    font-weight: bold;
    color: var(--brown);
}

.game-controls {
    text-align: center;
    margin-top: 40px;
    display: flex;
    gap: 15px;
    justify-content: center;
}

.waiting-message {
    text-align: center;
    margin-top: 20px;
    font-size: 18px;
    color: var(--brown);
    font-weight: bold;
}

.result-display {
    position: fixed;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-primary);
    padding: 25px 35px;
    border-radius: 15px;
    box-shadow: 0 20px 60px var(--shadow-heavy);
    text-align: center;
    z-index: 1000;
    border: 3px solid var(--maya-blue);
}

.result-display h2 {
    font-size: 24px;
    margin-bottom: 15px;
    color: var(--text-primary);
}

/* Card Shop Styles */
.shop-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.shop-stat-item {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    border: 2px solid var(--maya-blue);
}

.shop-stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.shop-stat-value {
    font-size: 32px;
    font-weight: 900;
    color: var(--maya-blue);
}

.shop-info {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.shop-info h3 {
    margin-bottom: 15px;
}

.shop-info ul {
    list-style: none;
    padding: 0;
}

.shop-info li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.shop-inventory {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.shop-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s;
}

.shop-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.shop-card.locked {
    opacity: 0.6;
}

.shop-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.shop-card-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--tangerine);
    margin: 15px 0;
}

.shop-card-stock {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.shop-buy-btn {
    width: 100%;
}

.points-earned {
    background: linear-gradient(135deg, rgba(96, 191, 245, 0.2) 0%, rgba(255, 206, 0, 0.2) 100%);
    border: 2px solid var(--maya-blue);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.points-earned h3 {
    color: var(--tangerine);
    margin-bottom: 15px;
    font-size: 24px;
}

.points-earned p {
    margin: 8px 0;
    font-size: 16px;
}

/* Arc unlock notification */
.arc-unlock-notification {
    background: linear-gradient(135deg, rgba(255, 0, 102, 0.2) 0%, rgba(153, 51, 255, 0.2) 100%);
    border: 2px solid var(--success);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
    animation: pulseGlow 2s ease-in-out infinite;
}

.arc-unlock-notification h3 {
    color: var(--success);
    margin-bottom: 15px;
    font-size: 24px;
    text-shadow: 0 0 10px rgba(96, 191, 245, 0.5);
}

.arc-unlock-notification p {
    margin: 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(96, 191, 245, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(96, 191, 245, 0.6);
    }
}

/* Arc Shop Sections */
.arc-shop-section,
.arc-packs-section {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 3px solid var(--border-color);
}

.arc-shop-section h3,
.arc-packs-section h3 {
    text-align: center;
    font-size: 28px;
    margin-bottom: 10px;
    color: var(--maya-blue);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.arc-shop-description,
.arc-packs-description {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 25px;
    font-size: 16px;
}

.arc-shop-grid,
.arc-packs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

/* Arc Shop Cards */
.arc-shop-card {
    background: var(--bg-secondary);
    border: 3px solid var(--border-color);
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: 0 4px 12px var(--shadow);
}

.arc-shop-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px var(--shadow-heavy);
    border-color: var(--maya-blue);
}

.arc-shop-card.locked {
    opacity: 0.7;
    filter: grayscale(50%);
}

.arc-shop-card.unlocked {
    border-color: var(--success);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(96, 191, 245, 0.1) 100%);
}

.arc-card-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, var(--lapis) 0%, var(--maya-blue) 100%);
}

.arc-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.arc-shop-card:hover .arc-card-image img {
    transform: scale(1.1);
}

.arc-card-content {
    padding: 20px;
}

.arc-card-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    text-align: center;
}

.arc-card-price {
    font-size: 22px;
    font-weight: 700;
    color: var(--tangerine);
    text-align: center;
    margin: 12px 0;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.arc-card-status {
    text-align: center;
    padding: 12px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 16px;
}

.arc-card-status.unlocked {
    background: var(--success);
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.arc-unlock-btn {
    width: 100%;
    margin-top: 10px;
}

/* Arc Pack Cards */
.arc-pack-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: 0 3px 10px var(--shadow);
}

.arc-pack-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px var(--shadow-heavy);
    border-color: var(--tangerine);
}

.arc-pack-card.locked {
    opacity: 0.6;
}

.arc-pack-image {
    width: 100%;
    height: 140px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, var(--lapis) 0%, var(--maya-blue) 100%);
}

.arc-pack-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.arc-pack-card:hover .arc-pack-image img {
    transform: scale(1.1);
}

.arc-pack-content {
    padding: 15px;
}

.arc-pack-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.arc-pack-header h4 {
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 700;
}

.arc-pack-collection {
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
}

.arc-pack-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--tangerine);
    text-align: center;
    margin: 10px 0;
}

.arc-pack-info {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 12px;
}

.arc-pack-buy-btn {
    width: 100%;
}

/* Pool status in lobby */
.pool-status-lobby {
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    padding: 12px;
    margin: 15px 0;
    background: linear-gradient(135deg, rgba(77, 171, 247, 0.1) 0%, rgba(255, 206, 0, 0.1) 100%);
    border: 2px solid rgba(77, 171, 247, 0.3);
    border-radius: 8px;
}

.pool-status-label {
    color: var(--maya-blue);
    margin-right: 8px;
}

#lobby-pool-count {
    color: var(--tangerine);
    font-size: 20px;
    font-weight: 700;
}

.pool-status-hint {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 400;
    margin-left: 10px;
}

/* Collection Screen */
.filter-section {
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px 15px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.filter-checkbox:hover {
    border-color: var(--maya-blue);
    background: var(--bg-tertiary);
}

.filter-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--maya-blue);
}

.filter-checkbox span {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    user-select: none;
}

/* Pool management section */
.pool-management-section {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    margin: 15px 0;
    background: var(--bg-secondary);
    border: 2px solid var(--maya-blue);
    border-radius: 8px;
    flex-wrap: wrap;
    justify-content: space-between;
}

/* Pool selection mode toggle */
.pool-mode-toggle {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border: 2px solid var(--maya-blue);
    margin: 0;
}

.pool-mode-toggle:hover {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    box-shadow: 0 0 10px rgba(77, 171, 247, 0.3);
}

/* Pool action buttons */
.pool-action-buttons {
    display: flex;
    gap: 10px;
    margin: 10px 0;
    justify-content: center;
    flex-wrap: wrap;
}

.pool-action-buttons .btn {
    padding: 8px 16px;
    font-size: 14px;
}

/* Pool status display */
.pool-status {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    padding: 12px;
    margin: 10px 0;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
}

#pool-count {
    color: var(--maya-blue);
    font-size: 24px;
}

#pool-max {
    color: var(--text-secondary);
}

#arc-filter {
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    width: 100%;
    max-width: 300px;
    background: var(--bg-primary);
    color: var(--text-primary);
}

#rarity-filter {
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    width: 100%;
    max-width: 300px;
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

#rarity-filter:hover {
    border-color: var(--maya-blue);
    background: var(--bg-secondary);
}

#rarity-filter:focus {
    outline: none;
    border-color: var(--maya-blue);
    box-shadow: 0 0 0 3px rgba(102, 204, 255, 0.2);
}

#saga-filter {
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    width: 100%;
    max-width: 300px;
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

#saga-filter:hover,
#arc-filter:hover {
    border-color: var(--maya-blue);
    background: var(--bg-secondary);
}

#saga-filter:focus,
#arc-filter:focus {
    outline: none;
    border-color: var(--maya-blue);
    box-shadow: 0 0 0 3px rgba(102, 204, 255, 0.2);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    grid-auto-rows: auto;
    gap: 20px;
    max-height: 600px;
    overflow-y: auto;
    width: 100%;
}

#collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

#cards-won-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.collection-card {
    height: 260px;
    border-radius: 12px;
    padding: 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    box-shadow: 0 5px 15px var(--shadow);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}

.collection-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    pointer-events: none;
    opacity: 0.25;
    box-shadow: inset 0 0 60px 30px var(--rarity-color, transparent);
}

/* Rarity-specific inward glows */
.collection-card[data-rarity="SSS"]::after { --rarity-color: #ff0066; }
.collection-card[data-rarity="SS"]::after { --rarity-color: #9933ff; }
.collection-card[data-rarity="S"]::after { --rarity-color: #ff6600; }
.collection-card[data-rarity="A"]::after { --rarity-color: #ffcc00; }
.collection-card[data-rarity="B"]::after { --rarity-color: #00ccff; }
.collection-card[data-rarity="C"]::after { --rarity-color: #00cc66; }
.collection-card[data-rarity="D"]::after { --rarity-color: #8b7355; }
.collection-card[data-rarity="F"]::after { --rarity-color: #b8b8b8; }

.collection-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

/* Pool indicator badge */
.collection-card.in-pool::before {
    content: '⭐';
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 24px;
    z-index: 10;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* Pool selection mode - show checkbox */
.pool-selection-active .collection-card {
    cursor: pointer;
    position: relative;
}

.pool-selection-active .collection-card::after {
    content: '☐';
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 28px;
    color: var(--text-secondary);
    z-index: 10;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.pool-selection-active .collection-card.in-pool::after {
    content: '☑';
    color: var(--maya-blue);
}

.pool-selection-active .collection-card.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.pool-selection-active .collection-card:not(.locked):hover {
    border-color: var(--maya-blue);
    box-shadow: 0 0 15px rgba(77, 171, 247, 0.5);
}

.collection-card.locked {
    opacity: 0.6;
    border-color: var(--text-tertiary);
    cursor: pointer;
    position: relative;
}

.collection-card.locked::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(128, 128, 128, 0.6);
    border-radius: 12px;
    pointer-events: none;
}

.collection-card .card-image {
    /* height: 120px; */
    font-size: 36px;
}

.collection-card .card-name {
    font-size: 13px;
    font-weight: bold;
}

.collection-card .card-arc {
    font-size: 10px;
}

.collection-card .card-power {
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.rarity-badge {
    font-weight: bold;
    font-size: 0.7em;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(250, 250, 250, 0.9);
}

body.dark-mode .rarity-badge {
    background: rgba(50, 50, 50, 1);
}

/* Card Detail Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.2s ease-in;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    position: relative;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    max-width: 90%;
    max-height: 90%;
    overflow-y: auto;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.card-detail-content {
    max-width: 500px;
    width: 100%;
}

.close-modal-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

.close-modal-btn:hover {
    background: rgba(255, 0, 0, 1);
    transform: scale(1.1);
}

.modal-card-display {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-card {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    border: 3px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
    position: relative;
}

/* Locked card - lighter grey background for readability */
.modal-card.locked {
    background: linear-gradient(135deg, rgba(180, 180, 180, 0.4) 0%, rgba(150, 150, 150, 0.3) 100%);
    border-color: var(--text-tertiary);
}

/* Rarity glow backgrounds for unlocked cards - more vibrant and lighter */
.modal-card[data-rarity="SSS"]:not(.locked) {
    background: linear-gradient(135deg, rgba(255, 0, 102, 0.35) 0%, rgba(255, 51, 153, 0.25) 100%);
    box-shadow: 0 8px 30px rgba(255, 0, 102, 0.5), inset 0 0 80px rgba(255, 0, 102, 0.2);
    border-color: rgba(255, 0, 102, 0.6);
}

.modal-card[data-rarity="SS"]:not(.locked) {
    background: linear-gradient(135deg, rgba(153, 51, 255, 0.35) 0%, rgba(179, 102, 255, 0.25) 100%);
    box-shadow: 0 8px 30px rgba(153, 51, 255, 0.5), inset 0 0 80px rgba(153, 51, 255, 0.2);
    border-color: rgba(153, 51, 255, 0.6);
}

.modal-card[data-rarity="S"]:not(.locked) {
    background: linear-gradient(135deg, rgba(255, 102, 0, 0.35) 0%, rgba(255, 140, 51, 0.25) 100%);
    box-shadow: 0 8px 30px rgba(255, 102, 0, 0.5), inset 0 0 80px rgba(255, 102, 0, 0.2);
    border-color: rgba(255, 102, 0, 0.6);
}

.modal-card[data-rarity="A"]:not(.locked) {
    background: linear-gradient(135deg, rgba(255, 204, 0, 0.4) 0%, rgba(255, 220, 77, 0.3) 100%);
    box-shadow: 0 8px 30px rgba(255, 204, 0, 0.6), inset 0 0 80px rgba(255, 204, 0, 0.25);
    border-color: rgba(255, 204, 0, 0.7);
}

.modal-card[data-rarity="B"]:not(.locked) {
    background: linear-gradient(135deg, rgba(0, 204, 255, 0.35) 0%, rgba(51, 220, 255, 0.25) 100%);
    box-shadow: 0 8px 30px rgba(0, 204, 255, 0.5), inset 0 0 80px rgba(0, 204, 255, 0.2);
    border-color: rgba(0, 204, 255, 0.6);
}

.modal-card[data-rarity="C"]:not(.locked) {
    background: linear-gradient(135deg, rgba(0, 204, 102, 0.35) 0%, rgba(51, 220, 140, 0.25) 100%);
    box-shadow: 0 8px 30px rgba(0, 204, 102, 0.5), inset 0 0 80px rgba(0, 204, 102, 0.2);
    border-color: rgba(0, 204, 102, 0.6);
}

.modal-card[data-rarity="D"]:not(.locked) {
    background: linear-gradient(135deg, rgba(139, 115, 85, 0.35) 0%, rgba(160, 140, 110, 0.25) 100%);
    box-shadow: 0 8px 30px rgba(139, 115, 85, 0.5), inset 0 0 80px rgba(139, 115, 85, 0.2);
    border-color: rgba(139, 115, 85, 0.6);
}

.modal-card[data-rarity="F"]:not(.locked) {
    background: linear-gradient(135deg, rgba(184, 184, 184, 0.4) 0%, rgba(200, 200, 200, 0.3) 100%);
    box-shadow: 0 8px 30px rgba(184, 184, 184, 0.5), inset 0 0 80px rgba(184, 184, 184, 0.2);
    border-color: rgba(184, 184, 184, 0.6);
}

.modal-card:hover {
    transform: scale(1.02);
}

.modal-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.modal-card-name {
    font-size: 24px;
    font-weight: bold;
    color: var(--text-tertiary);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.modal-card-arc {
    font-size: 14px;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 10px;
    border-radius: 12px;
}

.modal-card-image {
    width: 100%;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
}

.modal-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.modal-card-image.locked {
    filter: brightness(0.3);
}

.modal-card-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.modal-stat-item {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.modal-stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.modal-stat-value {
    font-size: 24px;
    font-weight: bold;
    color: var(--text-tertiary);
}

.modal-rarity-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 16px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.modal-type-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.4);
}

.modal-subtypes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.subtype-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(5px);
    transition: transform 0.2s, box-shadow 0.2s;
}

.subtype-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.modal-card-flavor {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--accent);
}

.modal-flavor-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.modal-flavor-text {
    font-size: 14px;
    color: var(--text-tertiary);
    line-height: 1.6;
    font-style: italic;
}

.modal-card-id {
    text-align: center;
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 10px;
    opacity: 0.6;
}

/* Admin Panel Styles */
#admin-screen {
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
}

.admin-panel {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.admin-header {
    margin-bottom: 20px;
}

.admin-header .btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.admin-section {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.admin-section-full {
    width: 100%;
    overflow-y: auto;
    height: 35vh;
}

.admin-section h3 {
    color: var(--maya-blue);
    margin-bottom: 15px;
    font-size: 1.3em;
}

/* Points Granter Styles */
.points-granter {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.points-granter-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 10px;
}

.points-granter-display {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    padding: 15px 30px;
    background: var(--bg-secondary);
    border: 2px solid var(--maya-blue);
    border-radius: 8px;
    min-width: 200px;
    text-align: center;
}

.points-granter-controls .btn {
    width: 50px;
    height: 50px;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

#points-granter-section {
    display: none; /* Hidden by default, shown via JS if flag is true */
}

/* Win Simulator Styles */
.win-simulator {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.win-simulator .btn {
    font-weight: 600;
}

.help-text {
    color: var(--text-secondary);
    font-size: 0.9em;
    margin-bottom: 15px;
}

.arc-toggles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
    row-gap: 4%;
    column-gap: 15%;
}

.arc-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.arc-toggle:hover {
    border-color: var(--maya-blue);
    transform: translateY(-2px);
}

.arc-toggle label {
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    flex: 1;
    padding-right: 4px;;
}

.arc-toggle input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

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

.rarity-stat {
    padding: 15px;
    background: var(--bg-secondary);
    border-left: 4px solid;
    border-radius: 6px;
    transition: transform 0.2s ease;
}

.rarity-stat:hover {
    transform: translateX(5px);
}

.rarity-stat .rarity-label {
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 5px;
}

.rarity-stat .rarity-count {
    color: var(--text-secondary);
    font-size: 0.9em;
}

.rarity-stat .rarity-chance {
    color: var(--brown);
    font-size: 0.85em;
    margin-top: 5px;
}

.admin-bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.pool-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pool-stats p {
    font-size: 1.1em;
    color: var(--text-primary);
}

.pool-stats strong {
    color: var(--maya-blue);
    font-size: 1.2em;
}

.test-deck-display {
    margin-top: 15px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.test-card {
    padding: 12px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.test-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
}

.test-card .card-name {
    font-weight: bold;
    color: var(--text-primary);
    font-size: 0.9em;
}

.test-card .card-power {
    color: var(--brown);
    font-size: 1.2em;
    font-weight: bold;
}

.test-card .card-rarity {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: bold;
    color: white;
}

/* Game Over Screen */
#gameover-screen .container {
    text-align: center;
}

#gameover-result {
    font-size: 48px;
    margin-bottom: 30px;
}

#gameover-stats {
    font-size: 24px;
    margin-bottom: 30px;
}

#cards-won-grid {
    max-height: 400px;
}

/* Matchup History Styles */
#matchup-history-display {
    margin: 30px 0;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 10px;
    border: 2px solid var(--border-color);
}

#matchup-history-display h3 {
    color: var(--maya-blue);
    margin-bottom: 20px;
    font-size: 24px;
    text-align: center;
}

.matchup-history-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 500px;
    overflow-y: auto;
    padding: 10px;
}

.matchup-item {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.matchup-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.matchup-round {
    text-align: center;
    font-weight: bold;
    color: var(--maya-blue);
    font-size: 16px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.matchup-cards {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.matchup-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s;
}

.matchup-card.winner {
    border-color: #4CAF50;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1), var(--card-bg));
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.3);
}

.matchup-card.loser {
    border-color: #f44336;
    opacity: 0.7;
}

.matchup-card.tie {
    border-color: #FFC107;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), var(--card-bg));
}

.matchup-card-label {
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 14px;
}

.matchup-card-image {
    width: 80px;
    height: 80px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-secondary);
}

.matchup-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.matchup-card-image .card-emoji {
    font-size: 48px;
}

.matchup-card-info {
    text-align: center;
}

.matchup-card-name {
    font-size: 14px;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.matchup-card-power {
    font-size: 16px;
    font-weight: bold;
    color: var(--maya-blue);
}

.matchup-vs {
    font-size: 20px;
    font-weight: bold;
    color: var(--maya-blue);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.matchup-result {
    text-align: center;
    font-weight: bold;
    color: var(--text-primary);
    font-size: 14px;
    margin-top: 8px;
    padding: 8px;
    background: var(--bg-primary);
    border-radius: 5px;
}

#admin-screen {
    background: var(--bg-primary);
}

#admin-screen .screen-header {
    background: var(--card-bg);
    padding: 20px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#admin-screen .screen-header h2 {
    margin: 0;
    color: var(--text-primary);
}

/* Bot Mode Styles */
.difficulty-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 15px 0;
}

.btn-difficulty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    text-align: center;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--maya-blue), var(--lapis));
    border: 2px solid var(--border-color);
    transition: all 0.3s;
}

.btn-difficulty:hover {
    background: linear-gradient(170deg, var(--maya-blue), var(--lapis));
    border-color: var(--maya-blue);
    transform: translateX(5px);
}

.difficulty-icon {
    font-size: 2em;
    margin-bottom: 5px;
}

.difficulty-name {
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 3px;
}

.difficulty-desc {
    font-size: 0.85em;
    opacity: 0.8;
}

/* Scroll to Top Button */
.scroll-top {
    position: fixed;
    bottom: 15px;
    right: 15px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--maya-blue), var(--persian-blue));
    border: none;
    border-radius: 12px;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0.85;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.scroll-top:hover {
    opacity: 1;
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(96, 191, 245, 0.5);
}

.scroll-top::before {
    content: '⬆️';
    font-size: 24px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Draft War Styles */
draft-war-mode-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 30px 0;
}

.mode-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
}

.mode-card:hover {
    border-color: var(--maya-blue);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(102, 204, 255, 0.3);
}

.mode-card h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.mode-description {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 14px;
}

.role-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 20px 0;
}

.role-badge {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
}

.role-badge.captain {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #000;
}

.role-badge.vice {
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
    color: #000;
}

.role-badge.tank {
    background: linear-gradient(135deg, #cd7f32 0%, #c9a45a 100%);
    color: #fff;
}

.role-badge.healer {
    background: linear-gradient(135deg, #4ade80 0%, #86efac 100%);
    color: #000;
}

.role-badge.support {
    background: linear-gradient(135deg, #60a5fa 0%, #93c5fd 100%);
    color: #000;
}

.role-badge.traitor {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    color: #fff;
}

.wager-description {
    text-align: center;
    font-size: 18px;
    margin: 20px 0;
    color: var(--text-secondary);
}

.wager-selector {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.wager-btn {
    min-width: 120px;
    padding: 15px 25px;
    font-size: 16px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
}

.wager-btn.active {
    background: var(--maya-blue);
    border-color: var(--maya-blue);
    color: white;
}

.draft-war-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
}

draft-war-info {
    flex: 1;
}

draft-war-info h3 {
    margin: 0 0 5px 0;
    color: var(--text-primary);
}

draft-war-score {
    font-size: 18px;
    font-weight: 600;
    color: var(--maya-blue);
}

.assignment-phase {
    text-align: center;
    flex: 1;
}

.assignment-phase p {
    margin: 5px 0;
    font-size: 16px;
}

#tb-turn-indicator {
    font-weight: 700;
    font-size: 18px;
}

.draft-war-board {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 30px;
    margin: 30px 0;
}

draft-war-column h4 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.role-slots {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.role-slot {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 15px;
    min-height: 100px;
}

.role-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.role-name {
    font-weight: 600;
    color: var(--text-primary);
}

.role-multiplier {
    color: var(--maya-blue);
    font-weight: 700;
}

.assigned-card {
    display: flex;
    gap: 12px;
    align-items: center;
}

.card-image-small {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    border-radius: 6px;
    background: var(--bg-tertiary);
}

.card-image-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.card-details {
    flex: 1;
}

.card-details .card-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.card-details .card-power {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 3px 0;
}

.role-score {
    font-size: 16px;
    font-weight: 700;
    color: var(--success);
}

.hidden-card {
    justify-content: center;
}

.card-back-small {
    width: 50px;
    height: 50px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--text-secondary);
}

.empty-slot {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 20px 0;
}

.vs-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 900;
    color: var(--maya-blue);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.card-selection {
    margin: 30px 0;
}

.card-selection h3 {
    text-align: center;
    margin-bottom: 20px;
}

.card-hand {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    max-width: 900px;
    margin: 0 auto;
}

.hand-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.hand-card:hover {
    border-color: var(--maya-blue);
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(102, 204, 255, 0.3);
}

.hand-card .card-image {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    margin-bottom: 10px;
    border-radius: 6px;
    background: var(--bg-tertiary);
}

.hand-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.hand-card .card-name {
    font-weight: 600;
    font-size: 13px;
    margin: 8px 0;
    color: var(--text-primary);
}

.hand-card .card-power {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 5px 0;
}

.hand-card .card-rarity {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    color: white;
    margin-top: 5px;
}

.assignment-controls {
    margin: 30px 0;
    padding: 25px;
    background: var(--bg-secondary);
    border: 2px solid var(--maya-blue);
    border-radius: 12px;
    text-align: center;
}

.assignment-controls h3 {
    margin-bottom: 20px;
    color: var(--text-primary);
}

.role-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.role-assign-btn {
    padding: 15px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: center;
}

.role-assign-btn:hover {
    border-color: var(--maya-blue);
    background: var(--bg-primary);
}

.role-assign-btn .role-name {
    font-weight: 700;
    font-size: 16px;
}

.role-assign-btn .role-calc {
    font-size: 13px;
    color: var(--text-secondary);
}

draft-war-comparison {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 30px 0;
}

.final-team {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
}

.final-team h3 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.final-roles {
    display: flex;
    flex-direction: row;
    overflow: auto;
    text-wrap-mode: nowrap;
    gap: 10px;
    margin-bottom: 20px;
}

.final-role-item {
    padding: 10px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
}

.final-role-item .role-label {
    font-weight: 600;
    width: -webkit-fill-available;
    color: var(--maya-blue);
}

.final-role-item .card-name {
    margin-bottom: 0;
    flex: 1;
    color: var(--text-primary);
    min-width: -webkit-fill-available;
}

.final-role-item .type-bonus {
    font-weight: 700;
    font-size: 13px;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.final-role-item .synergy-bonus {
    font-weight: 700;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #000;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    animation: synergyPulse 2s ease-in-out infinite;
}

@keyframes synergyPulse {
    0%, 100% {
        box-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
    }
    50% {
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
    }
}

.final-role-item .role-calculation {
    color: var(--text-secondary);
    font-size: 12px;
    width: 100%;
    text-decoration: overline;
}

.final-score {
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--success);
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
}

/* Draft War Card Draw Area (matches regular game) */
.tb-card-selection-top {
    margin: 30px 0;
    padding: 30px;
    background: var(--bg-secondary);
    border-radius: 12px;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.tb-card-draw-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.tb-card-draw-area .card-slot {
    width: 200px;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tb-card-draw-area .card-back {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 3px solid var(--maya-blue);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(96, 191, 245, 0.5), 0 10px 30px rgba(0,0,0,0.3);
    transition: transform 0.2s ease;
    cursor: pointer;
}

.tb-card-draw-area .card-back:hover {
    transform: scale(1.05);
}

.tb-card-draw-area .card-back img {
    width: 80%;
    height: 80%;
    object-fit: contain;
    opacity: 0.7;
}

.tb-card-draw-area .card {
    width: 200px;
    height: 280px;
    background: var(--bg-tertiary);
    border: 3px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    animation: cardFlip 0.6s ease-out;
}

@keyframes cardFlip {
    0% {
        transform: rotateY(180deg) scale(0.8);
        opacity: 0;
    }
    100% {
        transform: rotateY(0deg) scale(1);
        opacity: 1;
    }
}

.tb-card-draw-area .card.revealed-card {
    border-color: var(--maya-blue);
    box-shadow: 0 0 30px rgba(102, 204, 255, 0.5);
}

.tb-card-draw-area .card .card-header {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.tb-card-draw-area .card .card-name {
    font-weight: 700;
    font-size: 16px;
    color: var(--text-primary);
    text-align: center;
}

.tb-card-draw-area .card .card-arc {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
}

.tb-card-draw-area .card .card-image {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    margin: 10px 0;
}

.tb-card-draw-area .card .card-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.tb-card-draw-area .card .card-power {
    text-align: center;
    font-size: 24px;
    font-weight: 900;
    color: var(--maya-blue);
    padding-top: 10px;
    border-top: 2px solid var(--border-color);
}

.music-control-close {
    position: absolute;
    top: 0px;
    right: 0px;
    width: 15px;
    height: 15px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    line-height: 20px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .draft-war-board {
        grid-template-columns: 1fr;
    }
    
    .vs-divider {
        transform: rotate(90deg);
        margin: 20px 0;
    }
    
    .draft-war-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .card-hand {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
}


/* Responsive admin panel layouts */
@media (max-width: 1024px) {
    .test-deck-display {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    .container {
        padding: 20px;
        margin: 10px;
    }

    h1 {
        font-size: 1.8em;
        margin-bottom: 20px;
    }

    h2 {
        font-size: 1.4em;
        margin-bottom: 15px;
    }

    h3 {
        font-size: 1.2em;
        margin-bottom: 10px;
    }

    .admin-bottom-grid {
        grid-template-columns: 1fr;
    }
    
    .arc-toggles {
        grid-template-columns: 1fr;
    }
    
    .rarity-stats {
        grid-template-columns: 1fr;
    }
    
    .test-deck-display {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Header adjustments */
    .header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    #player-name {
        display: block;
        margin-bottom: 10px;
    }

    /* Stats bar */
    .stats {
        font-size: 14px;
        padding: 12px;
    }

    /* Lobby actions */
    .lobby-actions {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .section {
        padding: 15px;
    }

    /* Buttons */
    .btn {
        padding: 10px 20px;
        font-size: 14px;
        width: 100%;
    }

    .btn-large {
        padding: 14px 32px;
        font-size: 18px;
    }

    .btn-small {
        padding: 8px 16px;
        font-size: 13px;
        width: auto;
    }

    /* Login options */
    .login-options {
        gap: 12px;
    }

    /* Profile form */
    #profile-form {
        gap: 12px;
        margin: 20px auto 0;
    }

    #profile-form input {
        padding: 10px;
        font-size: 14px;
    }

    /* Theme toggle - reposition for mobile */
    .theme-toggle {
        top: 10px;
        right: 10px;
        padding: 8px 12px;
        font-size: 12px;
    }

    .theme-toggle-icon {
        font-size: 16px;
    }

    /* Music control - reposition for mobile */
    .music-control {
        padding: 10px;
    }

    .music-control h4 {
        font-size: 12px;
        margin-bottom: 8px;
    }

    .music-control-close:hover {
        background: rgba(255, 0, 0, 0.1);
        color: var(--danger);
        transform: scale(1.1);
    }

    .volume-btn {
        padding: 6px 10px;
        font-size: 11px;
    }

    /* Game header */
    .game-header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    .player-info h3 {
        font-size: 16px;
    }

    .player-info p {
        font-size: 13px;
    }

    .score-display {
        font-size: 20px;
    }

    .round-info {
        font-size: 16px;
        order: -1;
    }

    /* Game board */
    .game-board {
        flex-direction: column;
        gap: 15px;
        margin: 30px 0;
        min-height: auto;
    }
    
    .card-slot {
        width: 160px;
        height: 240px;
    }

    .vs {
        font-size: 24px;
    }

    .card, .card-back {
        padding: 12px;
    }

    .card-name {
        font-size: 14px;
    }

    .card-arc {
        font-size: 10px;
    }

    .card-image {
        /* height: 100px; */
        font-size: 40px;
    }

    .card-power {
        font-size: 28px;
    }

    /* Game controls */
    .game-controls {
        flex-direction: column;
        gap: 10px;
        margin-top: 20px;
    }

    .waiting-message {
        font-size: 16px;
        margin-top: 15px;
    }

    /* Result display */
    .result-display {
        width: 90%;
        max-width: 300px;
        padding: 20px;
        top: 25%;
    }

    .result-display h2 {
        font-size: 18px;
        margin-bottom: 12px;
    }

    /* Collection screen */
    .filter-section {
        margin-bottom: 15px;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .filter-checkbox {
        justify-content: center;
    }

    #arc-filter {
        padding: 8px;
        font-size: 14px;
        max-width: 100%;
    }

    #rarity-filter {
        padding: 8px;
        font-size: 14px;
        max-width: 100%;
    }

    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 15px;
        max-height: 500px;
    }

    .collection-card {
        height: 220px;
        padding: 10px;
    }

    .collection-card .card-image {
        /* height: 90px; */
        font-size: 32px;
    }

    .collection-card .card-name {
        font-size: 12px;
    }

    .collection-card .card-arc {
        font-size: 9px;
    }

    .collection-card .card-power {
        font-size: 24px;
    }

    .arc-toggles {
        grid-template-columns: 1fr;
    }
    
    .rarity-stats {
        grid-template-columns: 1fr;
    }
    
    .test-deck-display {
        grid-template-columns: 1fr;
    }

    /* Game over screen */
    #gameover-result {
        font-size: 32px;
        margin-bottom: 20px;
    }

    #gameover-stats {
        font-size: 16px;
        margin-bottom: 20px;
    }

    #gameover-stats p {
        margin-bottom: 8px;
    }

    #cards-won-grid {
        max-height: 300px;
    }

    /* Matchup history mobile styles */
    .matchup-history-grid {
        max-height: 400px;
    }

    .matchup-cards {
        flex-direction: column;
        gap: 10px;
    }

    .matchup-card {
        width: 100%;
    }

    .matchup-card-image {
        width: 60px;
        height: 60px;
    }

    .matchup-card-image .card-emoji {
        font-size: 36px;
    }

    .matchup-vs {
        transform: rotate(90deg);
        font-size: 18px;
    }

    /* Lobby code display */
    #lobby-code-display {
        padding: 15px;
    }

    #lobby-code {
        font-size: 18px;
        letter-spacing: 1px;
        word-break: break-all;
    }

    .connection-status {
        font-size: 13px;
    }

    /* Join code input */
    #join-code-input {
        padding: 10px;
        font-size: 14px;
    }

    /* Claim profile link */
    .claim-profile-link {
        font-size: 13px;
        display: block;
        margin-left: 0;
        margin-top: 8px;
    }
    
    .difficulty-buttons {
        gap: 8px;
    }
    
    .btn-difficulty {
        padding: 12px;
    }
    
    .difficulty-icon {
        font-size: 1.5em;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .container {
        padding: 15px;
        margin: 5px;
    }

    h1 {
        font-size: 1.5em;
    }

    h2 {
        font-size: 1.2em;
    }

    h3 {
        font-size: 1.1em;
    }

    .test-deck-display {
        grid-template-columns: 1fr;
    }
    
    .card-slot {
        width: 140px;
        height: 210px;
    }

    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 10px;
    }

    .collection-card {
        height: 190px;
        padding: 8px;
    }

    .collection-card .card-image {
        /* height: 70px; */
        font-size: 28px;
    }

    .stats {
        font-size: 12px;
    }

    #gameover-result {
        font-size: 24px;
    }

    #gameover-stats {
        font-size: 14px;
    }
}

.deck-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 40px;
}

.card-deck-stack {
    display: flex;
    gap: -30px;
    margin-bottom: 20px;
}

.deck-card-back {
    width: 80px;
    height: 120px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border: 3px solid var(--border-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin-left: -60px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    position: relative;
}

.deck-card-back:first-child {
    margin-left: 0;
}

.deck-card-back::after {
    content: '?';
    color: var(--text-secondary);
    font-weight: 900;
}

.revealed-card-area {
    display: flex;
    justify-content: center;
    padding: 30px;
}

.revealed-card-display {
    transform: scale(1.2);
    animation: cardReveal 0.5s ease-out;
}

@keyframes cardReveal {
    0% {
        transform: scale(0) rotateY(180deg);
        opacity: 0;
    }
    100% {
        transform: scale(1.2) rotateY(0deg);
        opacity: 1;
    }
}

.hand-card.revealed {
    border-color: var(--maya-blue);
    box-shadow: 0 0 30px rgba(102, 204, 255, 0.5);
    cursor: default;
}

.role-assign-btn-simple {
    padding: 20px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: center;
    min-height: 100px;
}

.role-assign-btn-simple:hover {
    border-color: var(--maya-blue);
    background: var(--bg-primary);
    transform: translateY(-3px);
}

/* Skip button styling */
.role-skip-btn {
    padding: 20px;
    background: linear-gradient(135deg, #ff9500 0%, #ff5e00 100%);
    border: 2px solid #ff9500;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: center;
    min-height: 100px;
    color: white;
}

.role-skip-btn:hover {
    border-color: #ffb84d;
    background: linear-gradient(135deg, #ffb84d 0%, #ff7733 100%);
    transform: translateY(-3px);
    box-shadow: 0 4px 20px rgba(255, 149, 0, 0.4);
}

.role-skip-btn .role-name-large {
    color: white;
}

.role-skip-btn .role-desc {
    color: rgba(255, 255, 255, 0.9);
}

.role-name-large {
    font-weight: 700;
    font-size: 20px;
    color: var(--text-primary);
}

.role-desc {
    font-size: 14px;
    color: var(--text-secondary);
    font-style: italic;
}

.assignment-controls.hidden {
    display: none;
}

/* Lobby Browser Styles */
.lobby-browser-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.lobby-tab-btn {
    flex: 1;
    padding: 10px 20px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.lobby-tab-btn:hover {
    border-color: var(--maya-blue);
    color: var(--text-primary);
}

.lobby-tab-btn.active {
    background: linear-gradient(135deg, var(--maya-blue), var(--persian-blue));
    border-color: var(--maya-blue);
    color: white;
}

.lobby-list {
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    min-height: 150px;
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 10px;
}

.lobby-list-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px 20px;
    font-style: italic;
}

.lobby-item {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
}

.lobby-item:hover {
    border-color: var(--maya-blue);
    transform: translateX(5px);
}

.lobby-item:last-child {
    margin-bottom: 0;
}

.lobby-info {
    flex: 1;
}

.lobby-host {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 16px;
}

.lobby-details {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.lobby-game-type {
    display: inline-block;
    padding: 2px 8px;
    background: var(--maya-blue);
    color: white;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-right: 8px;
}

.lobby-time {
    color: var(--text-tertiary);
    font-size: 11px;
}

.lobby-join-btn {
    padding: 8px 20px;
    background: linear-gradient(135deg, var(--maya-blue), var(--persian-blue));
    border: none;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.lobby-join-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(96, 191, 245, 0.4);
}

.lobby-restore-banner {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.2), rgba(255, 152, 0, 0.2));
    border: 2px solid rgba(255, 193, 7, 0.5);
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lobby-restore-info {
    flex: 1;
}

.lobby-restore-title {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.lobby-restore-desc {
    font-size: 13px;
    color: var(--text-secondary);
}

.lobby-restore-actions {
    display: flex;
    gap: 10px;
}
/* Lobby Browser Styles */
.lobby-browser-tabs { display: flex; gap: 10px; margin-bottom: 15px; }
.lobby-tab-btn { flex: 1; padding: 10px 20px; background: var(--bg-tertiary); border: 2px solid var(--border-color); border-radius: 8px; color: var(--text-secondary); cursor: pointer; transition: all 0.3s; font-weight: 600; }
.lobby-tab-btn:hover { border-color: var(--maya-blue); color: var(--text-primary); }
.lobby-tab-btn.active { background: linear-gradient(135deg, var(--maya-blue), var(--persian-blue)); border-color: var(--maya-blue); color: var(--text-primary); }
.lobby-list { background: var(--bg-tertiary); border: 2px solid var(--border-color); border-radius: 8px; padding: 15px; min-height: 150px; max-height: 400px; overflow-y: auto; margin-bottom: 10px; }
.lobby-list-empty { text-align: center; color: var(--text-secondary); padding: 40px 20px; font-style: italic; }
.lobby-item { background: var(--bg-primary); border: 2px solid var(--border-color); border-radius: 8px; padding: 12px 15px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; transition: all 0.3s; }
.lobby-item:hover { border-color: var(--maya-blue); transform: translateX(5px); }
.lobby-item:last-child { margin-bottom: 0; }
.lobby-info { flex: 1; }
.lobby-host { font-weight: 700; color: var(--text-primary); font-size: 16px; }
.lobby-details { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.lobby-game-type { display: inline-block; padding: 2px 8px; background: var(--maya-blue); color: white; border-radius: 4px; font-size: 11px; font-weight: 600; margin-right: 8px; }
.lobby-time { color: var(--text-tertiary); font-size: 11px; }
.lobby-join-btn { padding: 8px 20px; background: linear-gradient(135deg, var(--maya-blue), var(--persian-blue)); border: none; border-radius: 6px; color: (var(--text-tertiary)); font-weight: 600; cursor: pointer; transition: all 0.3s; }
.lobby-join-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(96, 191, 245, 0.4); }
.lobby-restore-banner { background: linear-gradient(135deg, rgba(255, 193, 7, 0.2), rgba(255, 152, 0, 0.2)); border: 2px solid rgba(255, 193, 7, 0.5); border-radius: 8px; padding: 15px 20px; margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center; }
.lobby-restore-info { flex: 1; }
.lobby-restore-title { font-weight: 700; color: var(--text-primary); margin-bottom: 5px; }
.lobby-restore-desc { font-size: 13px; color: var(--text-secondary); }
.lobby-restore-actions { display: flex; gap: 10px; }
