body,
html {
    margin: 0;
    padding: 0;
    background-color: #000;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Courier New', Courier, monospace;
}

/* ============================================
   VIDEO CONTAINER
   ============================================ */

#video-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #000;
    z-index: 1;
    overflow: hidden;
}

#tiktok-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

#video-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a0a1a 0%, #1a1a2e 50%, #0a0a1a 100%);
    color: rgba(150, 180, 255, 0.5);
}

#video-placeholder.hidden {
    display: none;
}

.placeholder-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.4;
}

.placeholder-text {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* ============================================
   UI OVERLAY
   ============================================ */

#ui-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 40;
}

#ui-overlay .action-icon,
#ui-overlay #signup-btn,
#ui-overlay #top-bar a {
    pointer-events: auto;
}

/* ============================================
   TOUCH LAYER (swipe nav + tap to pause)
   ============================================ */

#touch-layer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}


/* Top bar inside 9:16 viewport */
#top-bar {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
}

#top-bar a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

#top-bar a:hover {
    color: rgba(255, 255, 255, 0.9);
}

#signup-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #0ff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#signup-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.7);
}

#signup-btn span {
    font-size: 16px;
    font-weight: bold;
    font-style: italic;
    font-family: Georgia, serif;
    color: #000;
    line-height: 1;
}

/* ============================================
   BOTTOM ACTION ICONS (game + chat)
   ============================================ */

#bottom-actions {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 24px;
}

#bottom-actions.hidden {
    display: none;
}

.action-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(0, 255, 255, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 28px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: icon-pulse 2s ease-in-out infinite;
    box-shadow: 0 0 16px rgba(0, 255, 255, 0.25);
    transition: transform 0.15s ease;
}

.action-icon:hover {
    transform: scale(1.1);
}

.action-icon:active {
    transform: scale(0.95);
    animation: none;
}

.action-icon.active {
    background: rgba(0, 255, 255, 0.3);
    color: #0ff;
    animation: none;
}

@keyframes icon-pulse {
    0%, 100% {
        box-shadow: 0 0 16px rgba(0, 255, 255, 0.25);
        border-color: rgba(0, 255, 255, 0.4);
    }
    50% {
        box-shadow: 0 0 28px rgba(0, 255, 255, 0.55);
        border-color: rgba(0, 255, 255, 0.8);
    }
}

/* Game icon (image inside circle) */
#btn-game {
    padding: 0;
    overflow: hidden;
}

#side-game-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

#btn-game.no-icon {
    font-size: 26px;
}

#btn-game.no-icon #side-game-icon {
    display: none;
}

/* ============================================
   VIDEO INFO (bottom-left)
   ============================================ */

#video-info {
    position: absolute;
    bottom: 100px;
    left: 12px;
    right: 12px;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,0.9);
    pointer-events: none;
}

#video-handle {
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 4px;
    opacity: 0.9;
}

#video-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 4px;
    line-height: 1.2;
}

#video-desc {
    font-size: 13px;
    opacity: 0.8;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   M.I.K.E. OVERLAY CONTAINER
   ============================================ */

#mike-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 35;
    display: none;
    background: rgba(0, 0, 0, 0.6);
}

#mike-container.visible {
    display: block;
}

#mike-container canvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: block;
}

/* M.I.K.E. chat input bar */
#mike-chat-input {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10;
    box-sizing: border-box;
}

#mike-chat-input #chat-input {
    flex: 1;
    min-width: 0;
    padding: 12px 16px;
    font-size: 16px;
    font-family: 'Courier New', Courier, monospace;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 24px;
    color: #fff;
    outline: none;
    -webkit-appearance: none;
}

#mike-chat-input #chat-input:focus {
    border-color: #0ff;
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.3);
}

#mike-chat-input #chat-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

#mike-chat-input #chat-send {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #0ff;
    border: none;
    color: #000;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease;
}

#mike-chat-input #chat-send:active {
    transform: scale(0.9);
}

/* MIKE's chat bubble */
.mike-chat-bubble {
    position: relative;
    width: 100%;
    max-width: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: scale(var(--fit-scale, 1));
    transform-origin: top center;
}

.mike-chat-bubble .bubble-bg {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 0 10px rgba(100, 150, 255, 0.5));
}

.mike-chat-bubble .bubble-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -55%);
    width: 75%;
    text-align: center;
    font-size: 18px;
    color: #222;
    text-shadow: none;
    word-wrap: break-word;
    line-height: 1.3;
}

/* Bubble overlay - outside transformed containers for true fixed positioning */
#bubble-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 5%;
}

#bubble-overlay .mike-chat-bubble {
    pointer-events: auto;
}

/* ============================================
   MODAL STYLES (CRT aesthetic)
   ============================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content.crt-modal {
    background: linear-gradient(135deg, #0a0a15 0%, #1a1a2e 100%);
    border: 2px solid #44f;
    border-radius: 8px;
    padding: 32px 24px;
    max-width: 360px;
    width: 100%;
    text-align: center;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.25s ease;
    box-shadow: 0 0 30px rgba(68, 68, 255, 0.3), inset 0 0 60px rgba(68, 68, 255, 0.05);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #44f;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbf;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(68, 68, 255, 0.3);
    color: #fff;
}

.modal-title {
    font-family: 'Courier New', Courier, monospace;
    font-size: 24px;
    font-weight: bold;
    color: #bbf;
    text-shadow: 0 0 10px #66f;
    margin: 0 0 8px 0;
    text-transform: uppercase;
}

.modal-subtitle {
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    color: #88a;
    margin: 0 0 24px 0;
    line-height: 1.4;
}

.modal-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    font-family: 'Courier New', Courier, monospace;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #44f;
    border-radius: 4px;
    color: #0ff;
    text-shadow: 0 0 5px #0ff;
    margin-bottom: 16px;
    outline: none;
    text-align: center;
    text-transform: lowercase;
    box-sizing: border-box;
}

.modal-input:focus {
    border-color: #0ff;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.modal-input::placeholder {
    color: #446;
    text-shadow: none;
}

.modal-btn {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    text-transform: uppercase;
    background: linear-gradient(135deg, #44f 0%, #22a 100%);
    border: 1px solid #66f;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.modal-btn:hover {
    background: linear-gradient(135deg, #55f 0%, #33b 100%);
    box-shadow: 0 0 20px rgba(68, 68, 255, 0.5);
}

.modal-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.modal-btn.founder-btn {
    background: linear-gradient(135deg, #f80 0%, #a50 100%);
    border-color: #fa0;
}

.modal-btn.founder-btn:hover {
    background: linear-gradient(135deg, #fa0 0%, #b60 100%);
    box-shadow: 0 0 20px rgba(255, 136, 0, 0.5);
}

.modal-success {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    background: rgba(0, 255, 100, 0.1);
    border: 1px solid #0f6;
    border-radius: 4px;
    color: #0f6;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    font-size: 18px;
    text-shadow: 0 0 10px #0f6;
    margin-top: 16px;
}

.modal-success.show {
    display: flex;
}

.success-icon {
    font-size: 24px;
}

/* ============================================
   COMBINED MODAL STYLES
   ============================================ */

.modal-divider {
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    color: #446;
    margin: 24px 0;
    text-align: center;
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-divider::before,
.modal-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #446;
}

.founder-section {
    text-align: center;
}
