/* DailyGuessr Game Styles */

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    color: #e3f2fd;
    background:
        radial-gradient(circle at 0% 0%, rgba(0, 200, 255, 0.18), transparent 55%),
        radial-gradient(circle at 100% 100%, rgba(245, 99, 255, 0.2), transparent 55%),
        radial-gradient(circle at 50% 0%, rgba(68, 255, 179, 0.22), transparent 55%),
        linear-gradient(135deg, #050816, #020617 50%, #020617 80%, #000 100%);
    background-attachment: fixed;
    background-size: cover;
    min-height: 100vh;
}

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

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

.topbar h1 {
    margin: 0;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: linear-gradient(120deg, #66e5ff, #8ef7b8, #ffb3ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.home {
    color: #c5d9ff;
    text-decoration: none;
    border: 1px solid rgba(148, 163, 184, 0.45);
    padding: 8px 12px;
    border-radius: 8px;
    background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.75));
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.9), 0 10px 30px rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.home:hover {
    background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.85), rgba(15, 23, 42, 0.65));
    border-color: rgba(148, 163, 184, 0.85);
    transform: translateY(-1px);
    box-shadow: 0 14px 45px rgba(15, 23, 42, 1), 0 0 0 1px rgba(148, 163, 184, 0.5);
}

.game-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Game Info Bar */
.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.8));
    border: 1px solid rgba(148, 163, 184, 0.4);
    border-radius: 12px;
    font-size: 16px;
    box-shadow:
        0 18px 55px rgba(15, 23, 42, 0.95),
        0 0 0 1px rgba(15, 23, 42, 0.9),
        0 0 24px rgba(59, 130, 246, 0.45);
}

.round-info,
.score-info {
    font-weight: 600;
}

.round-info span {
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 13px;
    color: #a5b4fc;
}

.round-info span span {
    font-size: 16px;
    color: #e5e7eb;
}

.score-info {
    color: #c7d2fe;
    display: flex;
    align-items: center;
    gap: 8px;
}

.score-info span span {
    color: #f9fafb;
}

.score-separator {
    opacity: 0.4;
    color: #64748b;
}

/* Street View Container */
.streetview-container {
    position: relative;
    width: 100%;
    height: 500px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.45);
    box-shadow:
        0 22px 65px rgba(15, 23, 42, 0.9),
        0 0 0 1px rgba(15, 23, 42, 0.95),
        0 0 40px rgba(37, 99, 235, 0.6);
}

.streetview {
    width: 100%;
    height: 100%;
}

.streetview-overlay {
    position: absolute;
    bottom: 12px;
    left: 12px;
    z-index: 10;
}

.lock-btn {
    background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.86));
    border: 1px solid rgba(148, 163, 184, 0.55);
    color: #e3f2fd;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    backdrop-filter: blur(12px);
    box-shadow:
        0 10px 30px rgba(15, 23, 42, 0.95),
        0 0 24px rgba(34, 197, 94, 0.55);
}

.lock-btn:hover {
    background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.9));
    transform: translateY(-1px);
    border-color: rgba(187, 247, 208, 0.9);
    box-shadow:
        0 14px 40px rgba(15, 23, 42, 1),
        0 0 32px rgba(34, 197, 94, 0.8);
}

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

.guess-btn,
.next-round-btn {
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #e3f2fd;
    background: radial-gradient(circle at top left, rgba(21, 128, 61, 0.96), rgba(22, 163, 74, 0.88));
    border: 1px solid rgba(34, 197, 94, 0.85);
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease, filter 0.16s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 0 18px rgba(15, 23, 42, 0.9);
    box-shadow:
        0 16px 42px rgba(15, 23, 42, 0.9),
        0 0 0 1px rgba(15, 23, 42, 1),
        0 0 34px rgba(34, 197, 94, 0.9);
}

.guess-btn:hover:not(:disabled) {
    background: radial-gradient(circle at top left, rgba(22, 163, 74, 0.99), rgba(21, 128, 61, 0.95));
    transform: translateY(-1.5px);
    border-color: rgba(187, 247, 208, 0.95);
    box-shadow:
        0 20px 52px rgba(15, 23, 42, 1),
        0 0 44px rgba(34, 197, 94, 1);
    filter: saturate(1.15);
}

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

.next-round-btn {
    background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.96), rgba(59, 130, 246, 0.9));
    border-color: rgba(59, 130, 246, 0.95);
    box-shadow:
        0 16px 42px rgba(15, 23, 42, 0.9),
        0 0 0 1px rgba(15, 23, 42, 1),
        0 0 34px rgba(59, 130, 246, 0.9);
}

.next-round-btn:hover:not(:disabled) {
    background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.99), rgba(37, 99, 235, 0.96));
    transform: translateY(-1.5px);
    border-color: rgba(191, 219, 254, 0.96);
    box-shadow:
        0 20px 52px rgba(15, 23, 42, 1),
        0 0 44px rgba(59, 130, 246, 1);
}

.next-round-btn:disabled {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(30, 64, 175, 0.7);
    color: rgba(148, 163, 184, 0.7);
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow:
        0 8px 24px rgba(15, 23, 42, 0.95),
        0 0 0 1px rgba(15, 23, 42, 1),
        0 0 24px rgba(30, 64, 175, 0.6);
}

/* Map Container Overlay */
.map-container-overlay {
    position: absolute;
    bottom: 20px;
    /* Shift left so it doesn't sit under Street View controls */
    right: 80px;
    width: 240px;
    height: 300px;
    background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.82));
    border: 1px solid rgba(148, 163, 184, 0.48);
    border-radius: 12px;
    box-shadow:
        0 22px 65px rgba(15, 23, 42, 0.95),
        0 0 0 1px rgba(15, 23, 42, 1),
        0 0 38px rgba(59, 130, 246, 0.7);
    z-index: 20;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(16px);
    opacity: 0.5;
    transform: scale(0.6);
    transform-origin: bottom right;
    transition: all 0.3s ease;
    pointer-events: auto;
}

.map-container-overlay.hidden {
    display: none;
}

/* Ensure map container is visible at init */
#map-container {
    display: block;
}

.map-container-overlay:hover {
    width: min(400px, 80vw);
    height: min(55vh, 460px);
    opacity: 1;
    transform: scale(1);
    background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.94));
    border-color: rgba(191, 219, 254, 0.9);
    box-shadow:
        0 26px 80px rgba(15, 23, 42, 1),
        0 0 0 1px rgba(15, 23, 42, 1),
        0 0 50px rgba(59, 130, 246, 1);
}

.map-container-overlay:not(:hover) .map {
    pointer-events: none;
}

.map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.86));
    border-bottom: 1px solid rgba(148, 163, 184, 0.4);
    flex-shrink: 0;
}

.map-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #e5e7eb;
    white-space: nowrap;
}

.close-map-btn {
    background: transparent;
    border: none;
    color: #e3f2fd;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 16px;
    transition: background 0.2s ease, color 0.2s ease, transform 0.12s ease;
}

.close-map-btn:hover {
    background: rgba(148, 163, 184, 0.25);
    color: #f9fafb;
    transform: translateY(-1px);
}

.map {
    width: 100%;
    flex: 1;
    height: 40vh;
    min-height: 240px;
}

.map-instructions {
    padding: 12px 16px;
    text-align: center;
    background: radial-gradient(circle at bottom, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.9));
    border-top: 1px solid rgba(148, 163, 184, 0.4);
    flex-shrink: 0;
}

.map-instructions p {
    margin: 0 0 10px 0;
    color: #c7d2fe;
    font-size: 13px;
    white-space: nowrap;
}

.confirm-guess-btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #f9fafb;
    background: radial-gradient(circle at top left, rgba(220, 38, 38, 0.96), rgba(239, 68, 68, 0.92));
    border: 1px solid rgba(248, 113, 113, 0.9);
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease, filter 0.16s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-shadow: 0 0 16px rgba(15, 23, 42, 0.95);
    box-shadow:
        0 14px 40px rgba(15, 23, 42, 0.95),
        0 0 0 1px rgba(15, 23, 42, 1),
        0 0 30px rgba(248, 113, 113, 0.85);
}

.confirm-guess-btn:hover:not(:disabled) {
    background: radial-gradient(circle at top left, rgba(239, 68, 68, 0.99), rgba(220, 38, 38, 0.97));
    transform: translateY(-1.5px);
    border-color: rgba(254, 226, 226, 0.95);
    box-shadow:
        0 18px 52px rgba(15, 23, 42, 1),
        0 0 42px rgba(248, 113, 113, 1);
}

.confirm-guess-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 10% 20%, rgba(15, 23, 42, 0.86), rgba(15, 23, 42, 0.96));
    backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.94));
    border: 1px solid rgba(148, 163, 184, 0.55);
    border-radius: 16px;
    padding: 24px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow:
        0 26px 80px rgba(15, 23, 42, 0.96),
        0 0 0 1px rgba(15, 23, 42, 1),
        0 0 40px rgba(59, 130, 246, 0.9);
    z-index: 1001;
}

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

.modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.close-modal-btn {
    background: transparent;
    border: none;
    color: #e5e7eb;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 18px;
    transition: all 0.18s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.close-modal-btn:hover {
    background: rgba(148, 163, 184, 0.25);
    transform: scale(1.05) translateY(-1px);
}

.modal-body {
    margin-bottom: 20px;
}

.modal-footer {
    display: flex;
    justify-content: center;
    gap: 12px;
}

/* Results Modal */
.result-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.9));
    border-radius: 8px;
    box-shadow: inset 0 0 0 1px rgba(30, 64, 175, 0.5);
}

.result-item.highlight {
    background: radial-gradient(circle at top left, rgba(22, 163, 74, 0.24), rgba(21, 128, 61, 0.3));
    border: 1px solid rgba(34, 197, 94, 0.7);
    font-weight: 600;
    box-shadow:
        inset 0 0 0 1px rgba(15, 23, 42, 0.9),
        0 0 24px rgba(34, 197, 94, 0.5);
}

.result-label {
    color: #a5b4fc;
    font-size: 14px;
}

.result-value {
    font-size: 14px;
    font-weight: 600;
    color: #f9fafb;
}

.round-map {
    width: 100%;
    height: 300px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.55);
    box-shadow:
        0 14px 42px rgba(15, 23, 42, 0.9),
        0 0 0 1px rgba(15, 23, 42, 1),
        0 0 30px rgba(59, 130, 246, 0.75);
}

/* Game Over Modal */
.final-score {
    text-align: center;
    padding: 20px;
}

.final-score-label {
    font-size: 18px;
    color: #a5b4fc;
    margin-bottom: 12px;
}

.final-score-value {
    font-size: 48px;
    font-weight: 800;
    color: #e5e7eb;
    margin: 0;
}

.close-results-btn,
.play-again-btn {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #e3f2fd;
    background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.96), rgba(59, 130, 246, 0.92));
    border: 1px solid rgba(59, 130, 246, 0.9);
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 0 18px rgba(15, 23, 42, 0.95);
    box-shadow:
        0 16px 46px rgba(15, 23, 42, 0.96),
        0 0 0 1px rgba(15, 23, 42, 1),
        0 0 36px rgba(59, 130, 246, 0.95);
}

.close-results-btn:hover,
.play-again-btn:hover {
    background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.99), rgba(37, 99, 235, 0.98));
    transform: translateY(-1.5px);
    border-color: rgba(191, 219, 254, 0.95);
    box-shadow:
        0 20px 58px rgba(15, 23, 42, 1),
        0 0 46px rgba(59, 130, 246, 1);
}

/* API Warning */
.api-warning {
    padding: 16px;
    background: radial-gradient(circle at top left, rgba(248, 113, 113, 0.16), rgba(127, 29, 29, 0.5));
    border: 1px solid rgba(248, 113, 113, 0.8);
    border-radius: 12px;
    margin-bottom: 20px;
    color: #ffcdd2;
}

.api-warning.hidden {
    display: none;
}

.api-warning p {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Footer */
.footer {
    margin-top: 20px;
    text-align: center;
    opacity: 0.75;
    font-size: 12px;
    color: #94a3b8;
}

/* Hide Google attribution/buttons and links inside game containers */
.streetview-container .gm-style-cc,
.streetview-container .gmnoprint.gm-style-cc,
.map-container-overlay .gm-style-cc,
.map-container-overlay .gmnoprint.gm-style-cc {
    display: none !important;
}

/* As a safeguard, prevent clicks on any remaining Google attribution within containers */
.streetview-container .gm-style a,
.map-container-overlay .gm-style a {
    pointer-events: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .streetview-container {
        height: 400px;
    }
    
    .map-container-overlay {
        width: calc(100% - 40px);
        height: 400px;
        bottom: 10px;
        right: 10px; /* On small screens, keep minimal offset */
        left: 10px;
    }
    
    .game-info {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .modal-content {
        padding: 16px;
        width: 95%;
    }
    
    .final-score-value {
        font-size: 36px;
    }
}


