/* ============================================
   SPOTZ - Main Styles
   ============================================ */

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

body {
    background: #0a0e17;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
    color: #fff;
    user-select: none;
    -webkit-user-select: none;
}

.hidden {
    display: none !important;
}

/* ============================================
   INTRO SCREEN
   ============================================ */

.intro-screen {
    position: fixed;
    inset: 0;
    background: #0a0e17;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    cursor: pointer;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.intro-screen.exiting {
    opacity: 0;
    transform: scale(1.1);
}

.intro-logo {
    display: flex;
    align-items: center;
    gap: 4px;
}

.intro-letter {
    font-size: clamp(48px, 15vw, 120px);
    font-weight: 900;
    letter-spacing: 2px;
    color: #fff;
}

.intro-o {
    width: clamp(50px, 14vw, 110px);
    height: clamp(50px, 14vw, 110px);
    border-radius: 50%;
    background: #0d1117;
    border: 3px solid #1a2332;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.intro-o:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.3);
}

.intro-o canvas {
    width: 100%;
    height: 100%;
}

.intro-tagline {
    margin-top: 30px;
    color: #64748b;
    font-size: 14px;
    letter-spacing: 2px;
    text-transform: uppercase;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ============================================
   GAME SCREEN
   ============================================ */

.game-screen {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
}

/* Header */
.header {
    background: #111827;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #1e293b;
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 1px;
    cursor: pointer;
}

.logo-dot {
    width: 18px;
    height: 18px;
    background: #f59e0b;
    border-radius: 50%;
    box-shadow: 0 0 10px #f59e0b88;
    position: relative;
}

.logo-dot::after {
    content: '';
    position: absolute;
    inset: 0;
    background: #f59e0b;
    border-radius: 50%;
    animation: logoPulse 2s infinite;
}

@keyframes logoPulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0; transform: scale(1.6); }
}

.hint {
    color: #64748b;
    font-size: 11px;
}

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

.btn {
    background: #1e293b;
    color: #fff;
    border: 1px solid #334155;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.btn:hover {
    background: #334155;
}

.btn-collection {
    color: #f59e0b;
    font-size: 11px;
    font-weight: 600;
}

.btn-sound {
    font-size: 11px;
    font-weight: 600;
}

.btn-sound.on {
    color: #4ade80;
}

.btn-sound.off {
    color: #f87171;
}

.zoom-label {
    color: #94a3b8;
    font-size: 11px;
    width: 40px;
    text-align: center;
}

/* Notification */
.notification {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    background: #f59e0b;
    color: #000;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.3);
    animation: notifIn 0.4s ease;
    white-space: nowrap;
    display: none;
}

.notification.show {
    display: block;
}

@keyframes notifIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Collection Panel */
.collection-panel {
    position: absolute;
    top: 50px;
    right: 12px;
    z-index: 40;
    background: #111827;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 14px;
    width: 240px;
    max-height: 360px;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.collection-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 10px;
}

.collection-empty {
    color: #64748b;
    font-size: 11px;
}

.collection-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #1e293b;
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 6px;
}

.collection-item-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.collection-item-name {
    font-size: 11px;
    font-weight: 600;
}

.collection-item-rarity {
    font-size: 10px;
    color: #94a3b8;
}

/* World Container */
.world-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    cursor: grab;
}

.world-container:active {
    cursor: grabbing;
}

.world-svg {
    position: absolute;
    transform-origin: 0 0;
}

/* Conversation Bubble - FIXED TO TOP LEFT WITH SCROLLING */
.conv-bubble {
    position: fixed !important;
    top: 70px !important;
    left: 20px !important;
    z-index: 100;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    padding: 14px;
    width: 320px;
    max-height: 50vh;
    overflow-y: auto;
    border: 1px solid #334155;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    pointer-events: auto;
}

.conv-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.conv-area-name {
    font-size: 10px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.conv-like-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.5;
    transition: opacity 0.2s, transform 0.2s;
}

.conv-like-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.conv-like-btn.liked {
    opacity: 1;
}

.conv-like-btn.liked .heart-empty {
    display: none;
}

.conv-like-btn .heart-filled {
    display: none;
}

.conv-like-btn.liked .heart-filled {
    display: inline;
}

/* Scrollbar styling for conversation bubble */
.conv-bubble::-webkit-scrollbar {
    width: 6px;
}

.conv-bubble::-webkit-scrollbar-track {
    background: transparent;
}

.conv-bubble::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 3px;
}

.conv-participants {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
}

.conv-pdot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.conv-line {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
    animation: fadeIn 0.3s ease;
}

.conv-line-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin-top: 5px;
    flex-shrink: 0;
}

.conv-line-text {
    font-size: 13px;
    color: #cbd5e1;
    line-height: 1.4;
}

.conv-line.speaking .conv-line-text {
    color: #ffffff;
}

.conv-exit {
    font-size: 13px;
    color: #94a3b8;
    font-style: italic;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #334155;
    animation: fadeIn 0.3s ease;
}

.conv-scatter {
    font-size: 13px;
    color: #f87171;
    font-style: italic;
    font-weight: 500;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #334155;
    animation: fadeIn 0.3s ease;
}

.typing {
    display: flex;
    gap: 4px;
    align-items: center;
    height: 18px;
}

.typing-dot {
    width: 5px;
    height: 5px;
    background: #475569;
    border-radius: 50%;
    animation: typingBounce 1s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

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

/* News Ticker - above location ticker */
.news-ticker {
    background: #1e293b;
    padding: 6px 0;
    overflow: hidden;
    border-top: 1px solid #334155;
    font-size: 11px;
    color: #fbbf24;
    flex-shrink: 0;
    position: relative;
}

.news-ticker-inner {
    display: flex;
    gap: 60px;
    animation: newsTicker 45s linear infinite;
    width: max-content;
    padding: 0 12px;
}

.news-ticker:hover .news-ticker-inner {
    animation-play-state: paused;
}

@keyframes newsTicker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.news-item {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    white-space: nowrap;
}

.news-label {
    background: #dc2626;
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
}

.news-label.breaking {
    background: #dc2626;
}

.news-label.obituary {
    background: #6b7280;
}

.news-label.crime {
    background: #7c3aed;
}

.news-label.election {
    background: #2563eb;
}

.news-label.sport {
    background: #16a34a;
}

/* Footer - ticker style auto-scroll */
.footer {
    background: #111827;
    padding: 8px 0;
    overflow: hidden;
    border-top: 1px solid #334155;
    font-size: 10px;
    color: #ffffff;
    flex-shrink: 0;
    position: relative;
}

.footer-inner {
    display: flex;
    gap: 24px;
    animation: ticker 30s linear infinite;
    width: max-content;
    padding: 0 12px;
}

.footer:hover .footer-inner {
    animation-play-state: paused;
}

@keyframes ticker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.footer-item {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.2s;
}

.footer-item:hover {
    background: #1e293b;
}

.footer-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 600px) {
    .header {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }

    .hint {
        display: none;
    }

    .controls {
        width: 100%;
        justify-content: center;
    }
    
    .conv-bubble {
        width: calc(100% - 40px) !important;
        max-width: 320px;
    }
}
