/* Piilu paika - Full Screen Estonian GeoGuessr Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #000;
    color: #fff;
    overflow: hidden;
    height: 100vh;
    touch-action: manipulation; /* Prevent zoom on double-tap */
    -webkit-touch-callout: none; /* Prevent callout on iOS */
    -webkit-user-select: none; /* Prevent text selection on iOS */
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Allow scrolling on landing page */
body.landing-page {
    overflow: auto;
    height: auto;
    min-height: 100vh;
}

/* Page system */
.page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
}

/* Landing page specific positioning */
body.landing-page .page#landingPage {
    position: static;
    width: 100%;
    height: auto;
    min-height: 100vh;
}

/* Countdown Overlay */
.countdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    flex-direction: column;
}

.countdown-content {
    text-align: center;
    color: white;
}

.countdown-display {
    margin-bottom: 20px;
}

.countdown-number {
    font-size: 8rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    animation: pulse 1s ease-in-out infinite;
}

.countdown-text {
    font-size: 2rem;
    font-weight: 500;
    color: #fff;
    margin-top: 10px;
}

.countdown-location {
    margin-top: 20px;
    padding: 15px 25px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.location-name {
    font-size: 1.2rem;
    font-weight: 500;
    color: #fff;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* Landing Page */
.landing-container {
    width: 100%;
    min-height: 100vh;
    background: linear-gradient(135deg, #f19300 0%, #000 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: visible;
    padding: 2rem 0;
}

.landing-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.landing-content {
    text-align: center;
    z-index: 2;
    position: relative;
    max-width: 600px;
    padding: 2rem;
    width: 100%;
}

.game-title {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #fff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.game-subtitle {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 1rem;
    color: rgba(255,255,255,0.9);
}

.game-description {
    font-size: 1.1rem;
    margin-bottom: 3rem;
    color: rgba(255,255,255,0.8);
    line-height: 1.6;
}

.landing-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    min-width: 180px;
}

/* Settings Page */
.settings-container {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #000 0%, #f19300 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.settings-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.settings-content {
    background: rgba(0,0,0,0.95);
    color: #f19300;
    border-radius: 20px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    backdrop-filter: blur(20px);
    z-index: 2;
    position: relative;
}

.settings-content::-webkit-scrollbar {
    width: 8px;
}

.settings-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.settings-content::-webkit-scrollbar-thumb {
    background: #f19300;
    border-radius: 4px;
}

.settings-content::-webkit-scrollbar-thumb:hover {
    background: #ff9f00;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f19300;
}

.settings-header h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #f19300;
}

.btn-close {
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-close:hover {
    background: #ff3742;
    transform: scale(1.1);
}

.settings-form {
    margin-bottom: 2rem;
}

.setting-group {
    margin-bottom: 1.5rem;
}

.setting-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #f19300;
    font-size: 1rem;
}

.setting-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #f19300;
    border-radius: 10px;
    font-size: 1rem;
    background: #1a1a19;
    color: white;
    transition: border-color 0.3s ease;
}

.setting-input:focus {
    outline: none;
    border-color: #f19300;
}

.movement-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.checkbox-label:hover {
    background-color: rgba(241, 147, 0, 0.1);
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #f19300;
}

.checkbox-label span {
    font-weight: 400;
    color: #fff;
    font-size: 0.95rem;
}

.time-limit-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.time-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #575757;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.time-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #f19300;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.time-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #f19300;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.time-display {
    text-align: center;
    font-weight: 600;
    color: #f19300;
    font-size: 1.1rem;
}

.settings-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.settings-buttons .btn {
    min-width: 120px;
}

/* Join Game Page */
.join-game-container {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #000 0%, #f19300 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.join-game-content {
    background: rgba(0,0,0,0.95);
    color: #f19300;
    border-radius: 20px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    backdrop-filter: blur(20px);
    z-index: 2;
    position: relative;
}

.join-game-header {
    text-align: center;
    margin-bottom: 2rem;
}

.join-game-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #f19300;
    margin-bottom: 0.5rem;
}

.join-game-subtitle {
    font-size: 1.1rem;
    color: #ffffff;
    margin: 0;
}

.player-list-container {
    margin-bottom: 2rem;
}

.player-list-container h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
}

.player-list {
    max-height: 300px;
    overflow-y: auto;
    border: 2px solid #f19300;
    border-radius: 10px;
    padding: 1rem;
    background: #1a1a1a;
    margin-bottom: 1rem;
}

.player-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #f19300;
    transition: all 0.2s ease;
}

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

.player-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.player-name {
    font-weight: 600;
    color: #333;
    flex: 1;
}

.player-remove {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.player-remove:hover {
    background: #c82333;
    transform: scale(1.1);
}

.player-count-display {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: #f19300;
    padding: 0.5rem;
    background: rgba(191, 90, 0, 0.1);
    border-radius: 8px;
}

.add-player-section {
    margin-bottom: 2rem;
}

.add-player-form {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.add-player-form input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #f19300;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.add-player-form input:focus {
    outline: none;
    border-color: #f19300;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.add-player-hint {
    font-size: 0.9rem;
    color: #666;
    text-align: center;
    margin: 0;
}

.join-game-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.join-game-buttons .btn {
    min-width: 150px;
}

/* Game Summary Page */
#summaryPage {
    z-index: 100 !important;
}

.summary-container {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #000 0%, #f19300 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    z-index: 100;
}

.summary-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.summary-content {
    background: rgba(0,0,0,0.95);
    color: #f19300;
    border-radius: 20px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    backdrop-filter: blur(20px);
    z-index: 2;
    position: relative;
}

.summary-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f19300;
}

.summary-header h2 {
    font-size: 2rem;
    font-weight: 600;
    color: #f19300;
    margin-bottom: 1rem;
}

.final-score {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    background: #1a1a1a;
    color: white;
    padding: 1rem 2rem;
    border-radius: 15px;
    font-size: 1.2rem;
    font-weight: 600;
}

.summary-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #1a1a1a;
    border-radius: 10px;
    border-left: 4px solid #f19300;
}

.stat-label {
    font-weight: 600;
    color: #ffffff;
}

.stat-value {
    font-weight: 700;
    color: #f19300;
    font-size: 1.1rem;
}

.round-details {
    margin-bottom: 2rem;
}

.round-details h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #f19300;
    margin-bottom: 1rem;
    text-align: center;
}

.round-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: #1a1a1a;
    border-radius: 8px;
    border-left: 4px solid #f19300;
}

.round-item.worst {
    border-left-color: #dc3545;
}

.round-item.best {
    border-left-color: #f19300;
}

.round-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.round-number {
    font-weight: 600;
    color: #ffffff;
}

.round-location {
    font-size: 0.9rem;
    color: #666;
}

.round-stats {
    text-align: right;
    font-size: 0.9rem;
}

.round-distance {
    color: #ffffff;
}

.round-points {
    font-weight: 600;
    color: #f19300;
}

.summary-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.summary-buttons .btn {
    min-width: 120px;
    flex: 1;
    max-width: 150px;
}

/* Timer styles */
.timer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0,0,0,0.7);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    backdrop-filter: blur(10px);
}

.timer span {
    font-weight: 600;
    font-size: 1.1rem;
    color: #fff;
}

.btn-small {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    min-width: auto;
}

/* Multiplayer styles */
.multiplayer-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: rgba(0,0,0,0.7);
    padding: 0.75rem 1rem;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    margin-left: 1rem;
}

.current-player {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #4CAF50;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    padding: 0.25rem 0;
}

.player-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

.player-name {
    font-size: 1rem;
    color: #f19300;
    font-weight: 700;
}

.player-scores {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.player-score-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.12);
    padding: 0.2rem 0.4rem;
    border-radius: 6px;
    font-size: 0.78rem;
}

.player-score-item.current {
    background: rgba(191, 90, 0, 0.3);
    border: 1px solid #f19300;
}

.player-score-name {
    color: #fff;
    font-weight: 600;
    font-size: 0.8rem;
}

.player-score-value {
    color: #f19300;
    font-weight: 700;
    font-size: 0.85rem;
}

.player-count-info {
    display: none;
}

.player-count {
    display: none;
}

/* Host controls */
.host-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: rgba(0,0,0,0.7);
    padding: 0.75rem 1rem;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    margin-left: 1rem;
}

/* Host bottom controls */
.host-bottom-controls {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
}

/* Standalone next round button */
.standalone-next-button {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
}

.host-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    color: #fff;
}

.host-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #ffc107;
}

.round-status {
    font-size: 0.8rem;
    opacity: 0.8;
}

.host-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.host-buttons .btn {
    min-width: 100px;
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
}

/* Player waiting state */
.player-waiting {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: rgba(0,0,0,0.8);
    color: #fff;
    font-size: 1.2rem;
    text-align: center;
}

.countdown-display {
    text-align: center;
    margin-top: 20px;
}

.countdown-display h2 {
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.countdown-number {
    font-size: 4rem;
    font-weight: bold;
    color: #f19300;
    text-shadow: 0 0 20px rgba(225, 193, 7, 0.5);
    animation: countdownPulse 1s ease-in-out;
}

@keyframes countdownPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Countdown overlay */
.countdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    margin: 0;
    padding: 0;
}

.countdown-content {
    text-align: center;
    color: #fff;
}

.countdown-content h2 {
    font-size: 2rem;
    margin-bottom: 30px;
    color: #fff;
}

.countdown-content .countdown-number {
    font-size: 6rem;
    font-weight: bold;
    color: #f19300;
    text-shadow: 0 0 30px rgba(225, 193, 7, 0.8);
    animation: countdownPulse 1s ease-in-out;
}

.countdown-location {
    margin-top: 20px;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
}

.countdown-location p {
    margin: 0;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.waiting-message {
    background: rgba(255,255,255,0.1);
    padding: 2rem;
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.waiting-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top: 4px solid #f19300;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* Game Lobby Styles */
.lobby-host, .lobby-player {
    max-width: 600px;
    margin: 0 auto;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding: 1rem;
}

.game-code-section {
    text-align: center;
    margin-bottom: 2rem;
    background: rgba(255,255,255,0.1);
    padding: 2rem;
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.qr-code-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.qr-code-container {
    display: flex;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.qr-code-container canvas {
    border-radius: 10px;
    background: white;
    padding: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.qr-instructions {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.8);
    margin: 0;
}

.game-code-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0;
}

.game-code {
    font-size: 3rem;
    font-weight: bold;
    color: #f19300;
    background: rgba(0,0,0,0.3);
    padding: 1rem 2rem;
    border-radius: 10px;
    letter-spacing: 0.5rem;
    font-family: 'Courier New', monospace;
    border: 2px solid #f19300;
}

.code-instructions {
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
    margin-top: 1rem;
}

.players-list {
    background: rgba(255,255,255,0.1);
    padding: 1.5rem;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    margin-bottom: 2rem;
}

.players-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.player-card {
    background: rgba(255,255,255,0.1);
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.player-card.host {
    border-color: #f19300;
    background: rgba(255,193,7,0.1);
}

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

.player-name {
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.5rem;
}

.player-status {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.7);
}

.player-status.host {
    color: #f19300;
}

.btn-kick {
    background: rgba(220, 53, 69, 0.8);
    color: #fff;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    flex-shrink: 0;
}

.btn-kick:hover {
    background: #dc3545;
    transform: scale(1.1);
}

.btn-kick:active {
    transform: scale(0.95);
}

.lobby-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.lobby-controls .btn {
    min-width: 150px;
}

.join-form {
    max-width: 400px;
    margin: 0 auto;
    background: rgba(255,255,255,0.1);
    padding: 2rem;
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.join-form .form-group {
    margin-bottom: 1.5rem;
}

.join-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: #f19300;
    font-weight: 500;
}

.join-form input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid rgb(0, 0, 0);
    border-radius: 8px;
    background: rgba(0,0,0,0.8);
    color: #ffffff;
    font-size: 1rem;
}

.join-form input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.join-form input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(102,126,234,0.2);
}

.join-form .btn {
    width: 100%;
    margin-bottom: 0.5rem;
}

.join-form .btn:last-child {
    margin-bottom: 0;
}

.input-hint {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
    margin-top: 0.25rem;
    margin-bottom: 0;
}

.join-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.join-buttons .btn {
    flex: 1;
    min-width: 120px;
}

/* Copy button animation */
.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.copy-success {
    background: #28a745 !important;
    color: white !important;
}

/* Multiplayer summary styles */
.leaderboard {
    margin-bottom: 2rem;
}

.leaderboard h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
    text-align: center;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: #1a1a1a;
    border-radius: 8px;
    border-left: 4px solid #f19300;
}

.leaderboard-item.first {
    border-left-color: #f19300;
    background: linear-gradient(135deg, #f19300, #1a1a1a);
}

.leaderboard-item.second {
    border-left-color: #666;
    background: linear-gradient(135deg, #666, #1a1a1a);
}

.leaderboard-item.third {
    border-left-color: #8B4513;
    background: linear-gradient(135deg, #8B4513, #1a1a1a);
}

.leaderboard-position {
    font-weight: 700;
    font-size: 1.2rem;
    color: #f19300;
    min-width: 30px;
}

.leaderboard-name {
    font-weight: 600;
    color: #333;
    flex: 1;
    margin-left: 1rem;
}

.leaderboard-score {
    font-weight: 700;
    color: #333;
    font-size: 1.1rem;
}

/* Prevent zoom on mobile devices */
html {
    touch-action: manipulation;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

/* Mobile-specific zoom prevention */
@media (max-width: 768px) {
    html, body {
        touch-action: manipulation;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -khtml-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        -webkit-text-size-adjust: none;
        -ms-text-size-adjust: none;
    }
    
    /* Prevent zoom on input focus */
    input, textarea, select {
        font-size: 16px !important;
        -webkit-text-size-adjust: 100%;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .game-title {
        font-size: 3rem;
    }
    
    .landing-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-large {
        width: 100%;
        max-width: 300px;
    }
    
    .settings-content {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .settings-buttons {
        flex-direction: column;
    }
    
    .settings-buttons .btn {
        width: 100%;
    }
    
    /* Lobby mobile styles */
    .lobby-host, .lobby-player {
        max-width: 100%;
        padding: 0 1rem;
        max-height: calc(100vh - 80px);
    }
    
    .game-code-section {
        padding: 1.5rem 1rem;
        margin-bottom: 1.5rem;
    }
    
    .qr-code-section {
        margin-top: 1rem;
        padding-top: 1rem;
    }
    
    .qr-code-container canvas {
        width: 120px;
        height: 120px;
        padding: 8px;
    }
    
    .qr-instructions {
        font-size: 0.8rem;
    }
    
    .game-code-section h2 {
        font-size: 1.3rem;
        margin-bottom: 0.75rem;
    }
    
    .game-code {
        font-size: 2rem !important;
        padding: 0.75rem 1.25rem !important;
        letter-spacing: 0.3rem !important;
    }
    
    .game-code-display {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .game-code-display .btn-small {
        width: 100%;
    }
    
    .code-instructions {
        font-size: 0.9rem;
        margin-top: 0.75rem;
    }
    
    .players-list {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .players-list h3 {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    .players-container {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        max-height: 300px;
    }
    
    .player-card {
        padding: 0.875rem;
    }
    
    .lobby-controls {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0 1rem 1rem;
    }
    
    .lobby-controls .btn {
        width: 100%;
        min-width: auto;
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    /* Waiting message mobile */
    .waiting-message {
        padding: 2rem 1.5rem;
        margin: 1rem;
    }
    
    .waiting-message h2 {
        font-size: 1.5rem;
        margin: 1rem 0 0.5rem;
    }
    
    .waiting-message p {
        font-size: 1rem;
        margin: 0;
    }
    
    .waiting-spinner {
        width: 50px;
        height: 50px;
    }
    
    .lobby-player {
        display: flex;
        flex-direction: column;
        min-height: calc(100vh - 100px);
        justify-content: center;
        padding: 1rem;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }
    
    #leaveLobbyPlayerBtn {
        width: 100%;
        max-width: 300px;
        margin: 2rem auto 0;
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    /* Container adjustments */
    .container {
        padding: 1rem;
    }
    
    .container h1 {
        font-size: 1.75rem;
        margin-bottom: 1.5rem;
        text-align: center;
    }
}

/* Full screen Street View container */
.streetview-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
}

.map-container {
    width: 100%;
    height: 100%;
}

/* Game overlay */
.game-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10;
    pointer-events: none;
}

/* Top bar */
.top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 70%, transparent 100%);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: auto;
}

.game-title {
    color: white;
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.subtitle {
    font-size: 1rem;
    font-weight: 300;
    opacity: 0.9;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.game-info {
    display: flex;
    gap: 30px;
    align-items: center;
}

.score-display, .round-info, .distance-display, .points-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    background: rgba(0,0,0,0.6);
    padding: 15px 20px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
}

.score-label, .round-label, .distance-label, .points-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #ccc;
}

.score-value, .round-value, .distance-value, .points-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #f19300;
}

/* Bottom controls */
.bottom-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(0deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 70%, transparent 100%);
    padding: 20px;
    display: flex;
    justify-content: center;
    pointer-events: auto;
}

.game-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* Buttons */
.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.btn-primary {
    background: #f19300;
    color: white;
    box-shadow: 0 4px 15px rgba(191, 90, 0, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(191, 90, 0, 0.4);
}

.btn-primary:disabled {
    background: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.5);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: #000;
    color: #f19300;
    border: 1px solid #f19300;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(191, 90, 0, 0.4);
}

/* Bottom right corner guessing map */
.corner-guess-map {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 300px;
    height: 200px;
    background: rgba(26,26,26,0.95);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    backdrop-filter: blur(20px);
    pointer-events: auto;
    z-index: 20;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    overflow: hidden;
}

.corner-guess-map:hover {
    width: 450px;
    height: 350px;
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.corner-map-container {
    flex: 1;
    margin: 10px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #f19300;
    cursor: crosshair;
    transition: all 0.3s ease;
    position: relative;
}

/* Submit guess button container positioned at bottom middle */
.submit-guess-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 30; /* Higher z-index to ensure it's above everything */
    display: none;
    transition: all 0.3s ease;
    pointer-events: auto; /* Ensure it's clickable */
}

.submit-guess-container.show {
    display: block;
}

.submit-guess-container .btn {
    padding: 14px 28px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    pointer-events: auto;
    position: relative;
    z-index: 31; /* Even higher z-index for the button itself */
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    border: none;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.submit-guess-container .btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    background: linear-gradient(135deg, #ff7b45, #f19300);
}

.submit-guess-container .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

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

.btn-overlay {
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    border: 2px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(10px);
}

.guess-map-container {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    overflow: hidden;
    cursor: crosshair;
}

.guess-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
}

/* Fullscreen map for results */
.fullscreen-map {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 15;
    display: none;
}

.fullscreen-map.show {
    display: block;
}

.fullscreen-map-container {
    width: 100%;
    height: 100%;
}

/* Result panel overlay on fullscreen map */
.result-panel-overlay {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: rgba(0,0,0,0.95);
    color: #f19300;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    backdrop-filter: blur(20px);
    pointer-events: auto;
    z-index: 20;
    max-height: 300px;
    overflow-y: auto;
}

/* Hide result info when we only want to show the button */
.result-panel-overlay.hide-content .result-info {
    display: none;
}

.result-panel-overlay.hide-content h3 {
    display: none;
}

/* Result panel buttons */
.result-panel-buttons {
    margin-top: 20px;
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Bottom controls on fullscreen map */
.fullscreen-map .bottom-controls {
    z-index: 20;
}

.result-panel-content h3 {
    margin-bottom: 15px;
    color: #f19300;
    font-size: 1.5rem;
    text-align: center;
}

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

.result-info p {
    margin-bottom: 0;
    font-size: 1rem;
    padding: 10px;
    background: #1a1a1a;
    border-radius: 8px;
    border-left: 4px solid #f19300;
}

.result-info span {
    font-weight: 600;
    color: #ffffff;
}

/* Responsive Design */
@media (max-width: 768px) {
    .title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .game-info {
        gap: 15px;
    }
    
    .score-display, .round-info, .distance-display, .points-display {
        padding: 10px 15px;
    }
    
    .score-value, .round-value, .distance-value, .points-value {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 1rem;
    }
    
    .corner-guess-map {
        width: 100vw;
        height: 33vh; /* Bottom 1/3 of screen */
        bottom: 0;
        right: 0;
        left: 0;
        border-radius: 15px 15px 0 0; /* Rounded top corners only */
        transition: none; /* Remove transitions on mobile */
    }
    
    .corner-guess-map:hover {
        /* No hover effects on mobile */
        width: 100vw;
        height: 33vh;
        transform: none;
        box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    }
    
    .corner-map-container {
        margin: 15px; /* More margin for better touch interaction */
        border-radius: 10px;
        cursor: pointer; /* Change from crosshair to pointer for mobile */
        touch-action: manipulation; /* Prevent zoom on double-tap */
    }
    
    .submit-guess-container {
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .result-panel-overlay {
        bottom: 10px;
        left: 10px;
        right: 10px;
        padding: 15px;
        max-height: 150px;
    }
    
    .result-info {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .top-bar {
        padding: 15px;
    }
    
    .bottom-controls {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.5rem;
    }
    
    .game-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .score-display, .round-info, .distance-display, .points-display {
        padding: 8px 12px;
    }
    
    .score-value, .round-value, .distance-value, .points-value {
        font-size: 1.3rem;
    }
    
    .game-controls {
        flex-direction: column;
        width: 100%;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .corner-guess-map {
        width: 100vw;
        height: 33vh; /* Bottom 1/3 of screen */
        bottom: 0;
        right: 0;
        left: 0;
        border-radius: 15px 15px 0 0; /* Rounded top corners only */
        transition: none; /* Remove transitions on mobile */
    }
    
    .corner-guess-map:hover {
        /* No hover effects on mobile */
        width: 100vw;
        height: 33vh;
        transform: none;
        box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    }
    
    .corner-map-container {
        margin: 10px; /* Slightly less margin for smaller screens */
        border-radius: 8px;
        cursor: pointer; /* Change from crosshair to pointer for mobile */
        touch-action: manipulation; /* Prevent zoom on double-tap */
    }
    
    .submit-guess-container {
        bottom: 5px;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .submit-guess-container .btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
}

/* Location generation loading overlay */
.location-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.location-loading-content {
    text-align: center;
    color: white;
    max-width: 400px;
    padding: 2rem;
}

.location-loading-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 1rem 0 0.5rem 0;
    color: #f19300;
}

.location-loading-content p {
    font-size: 1rem;
    opacity: 0.8;
    margin: 0;
}

.location-loading-content .loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 107, 53, 0.3);
    border-top: 4px solid #f19300;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f19300;
    border-top: 3px solid #f19300;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Success/Error states */
.success {
    color: #28a745;
}

.error {
    color: #dc3545;
}

.warning {
    color: #ffc107;
}

/* Hide scrollbars for overlay panels */
.guess-panel-content::-webkit-scrollbar,
.result-panel-content::-webkit-scrollbar {
    width: 6px;
}

.guess-panel-content::-webkit-scrollbar-track,
.result-panel-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.guess-panel-content::-webkit-scrollbar-thumb,
.result-panel-content::-webkit-scrollbar-thumb {
    background: #f19300;
    border-radius: 3px;
}

.guess-panel-content::-webkit-scrollbar-thumb:hover,
.result-panel-content::-webkit-scrollbar-thumb:hover {
    background: #5a6fd8;
}

/* Lobby scrollbar styling */
.lobby-host::-webkit-scrollbar,
.lobby-player::-webkit-scrollbar,
.players-container::-webkit-scrollbar {
    width: 8px;
}

.lobby-host::-webkit-scrollbar-track,
.lobby-player::-webkit-scrollbar-track,
.players-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.lobby-host::-webkit-scrollbar-thumb,
.lobby-player::-webkit-scrollbar-thumb,
.players-container::-webkit-scrollbar-thumb {
    background: #f19300;
    border-radius: 4px;
}

.lobby-host::-webkit-scrollbar-thumb:hover,
.lobby-player::-webkit-scrollbar-thumb:hover,
.players-container::-webkit-scrollbar-thumb:hover {
    background: #d17a00;
}

/* Smooth scrolling for lobby */
.lobby-host,
.lobby-player,
.players-container {
    scroll-behavior: smooth;
}

/* Login and Authentication Styles */
.login-container {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
}

.btn-login {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.btn-login:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.8);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.username {
    color: #f19300;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.3s ease;
}

.username:hover {
    color: #ffb347;
}

.btn-logout {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: #c82333;
    transform: translateY(-1px);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: rgba(0, 0, 0, 0.95);
    color: #f19300;
    border-radius: 20px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f19300;
}

.modal-header h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #f19300;
    margin: 0;
}

.modal-body {
    color: white;
}

/* Auth Form Styles */
.auth-tabs {
    display: flex;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-tab {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
}

.auth-tab.active {
    color: #f19300;
    border-bottom-color: #f19300;
}

.auth-tab:hover {
    color: white;
}

.auth-form .form-group {
    margin-bottom: 1.5rem;
}

.auth-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: #f19300;
    font-weight: 500;
}

.auth-form input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #f19300;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.auth-form input:focus {
    outline: none;
    border-color: #ffb347;
    box-shadow: 0 0 0 3px rgba(255, 179, 71, 0.1);
}

.auth-form input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Leaderboard Styles */
.leaderboard-section {
    margin-top: 3rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 2rem;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.leaderboard-section h3 {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: #f19300;
    margin-bottom: 1.5rem;
}

.leaderboard-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.leaderboard-tab {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
}

.leaderboard-tab.active {
    color: #f19300;
    border-bottom-color: #f19300;
}

.leaderboard-tab:hover {
    color: white;
}

.leaderboard-content {
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border-left: 4px solid #f19300;
    transition: all 0.3s ease;
}

.leaderboard-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.leaderboard-item.first {
    border-left-color: #ffd700;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 255, 255, 0.05));
}

.leaderboard-item.second {
    border-left-color: #c0c0c0;
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.1), rgba(255, 255, 255, 0.05));
}

.leaderboard-item.third {
    border-left-color: #cd7f32;
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.1), rgba(255, 255, 255, 0.05));
}

.leaderboard-rank {
    font-weight: 700;
    font-size: 1.2rem;
    color: #f19300;
    min-width: 30px;
}

.leaderboard-username {
    font-weight: 600;
    color: white;
    flex: 1;
    margin-left: 1rem;
}

.leaderboard-score {
    font-weight: 700;
    color: #f19300;
    font-size: 1.1rem;
}

.leaderboard-empty {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
    padding: 2rem;
}

/* Profile Styles */
.profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.profile-stat {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
    border-left: 4px solid #f19300;
}

.profile-stat-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
}

.profile-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f19300;
}

.profile-games {
    margin-top: 2rem;
}

.profile-games h3 {
    color: #f19300;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.profile-game-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    border-left: 4px solid #f19300;
}

.profile-game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.profile-game-date {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.profile-game-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
    font-size: 0.9rem;
}

.profile-game-stat {
    text-align: center;
}

.profile-game-stat-label {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.25rem;
}

.profile-game-stat-value {
    color: #f19300;
    font-weight: 600;
}

/* Chat Styles */
.chat-toggle-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f19300, #e67e22);
    border: none;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1000;
}

.chat-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(241, 147, 0, 0.4);
}

.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border-radius: 12px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.chat-panel {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 350px;
    height: 500px;
    background: #2b2d31;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    z-index: 1001;
    overflow: hidden;
    animation: slideIn 0.3s ease;
}

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

.chat-header {
    background: #1e1f22;
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    border-bottom: 1px solid #3f4147;
}

.chat-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.chat-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.chat-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: #1e1f22;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Dark scrollbar for chat */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #1e1f22;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #3f4147;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #4f5258;
}

.chat-message {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-width: 80%;
    animation: messageSlideIn 0.2s ease;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.own {
    align-self: flex-end;
    align-items: flex-end;
}

.chat-message.other {
    align-self: flex-start;
    align-items: flex-start;
}

.chat-message.system {
    align-self: stretch;
    align-items: center;
    max-width: 100%;
    width: 100%;
}

.chat-message-sender {
    font-size: 0.75rem;
    font-weight: 600;
    color: #b5bac1;
    padding: 0 0.5rem;
}

.chat-message.own .chat-message-sender {
    color: #f19300;
}

.chat-message-bubble {
    padding: 0.625rem 0.875rem;
    border-radius: 12px;
    word-wrap: break-word;
    font-size: 0.9rem;
    line-height: 1.4;
}

.chat-message.own .chat-message-bubble {
    background: linear-gradient(135deg, #f19300, #e67e22);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.other .chat-message-bubble {
    background: #383a40;
    color: #dbdee1;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.chat-message-bubble.system {
    background: transparent;
    color: #80848e;
    border: none;
    border-radius: 0;
    padding: 0.375rem 0.5rem;
    font-size: 0.75rem;
    text-align: center;
    font-weight: 400;
    font-style: italic;
}

.chat-message-time {
    font-size: 0.7rem;
    color: #80848e;
    padding: 0 0.5rem;
}

.chat-input-container {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    background: #2b2d31;
    border-top: 1px solid #3f4147;
    flex-shrink: 0;
}

.chat-input {
    flex: 1;
    padding: 0.625rem 0.875rem;
    border: 1px solid #3f4147;
    border-radius: 20px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
    background: #383a40;
    color: #dbdee1;
}

.chat-input::placeholder {
    color: #80848e;
}

.chat-input:focus {
    border-color: #f19300;
    background: #404249;
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f19300, #e67e22);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(241, 147, 0, 0.3);
}

.chat-send-btn:active {
    transform: scale(0.95);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive Design for New Elements */
@media (max-width: 768px) {
    .login-container {
        top: 10px;
        right: 10px;
    }
    
    .user-info {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.75rem;
    }
    
    .leaderboard-section {
        margin-top: 2rem;
        padding: 1.5rem;
    }
    
    .leaderboard-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .leaderboard-tab {
        text-align: center;
        border-bottom: none;
        border-right: 2px solid transparent;
    }
    
    .leaderboard-tab.active {
        border-bottom: none;
        border-right-color: #f19300;
    }
    
    .profile-stats {
        grid-template-columns: 1fr 1fr;
    }
    
    .profile-game-stats {
        grid-template-columns: 1fr 1fr;
    }
    
    /* Chat responsive */
    .chat-panel {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        bottom: 10px;
        right: 10px;
        max-height: 600px;
    }
    
    .chat-toggle-btn {
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
    }
}