@import url('https://fonts.googleapis.com/css2?family=Comic+Neue:wght@700&family=Fredoka+One&family=Pacifico&family=Press+Start+2P&family=Permanent+Marker&family=Bungee&family=Righteous&family=Bangers&family=Lobster&family=Russo+One&family=Special+Elite&family=Abril+Fatface&display=swap');

/* Reset & Base */
* {
    box-sizing: border-box;
    user-select: none;
    /* Prevent selection while dragging */
}

body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #ffffff;
    /* White theme */
    font-family: 'Courier New', Courier, monospace;
    color: #000000;
}

/* Viewport & World */
#viewport {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
    cursor: grab;
}

#viewport:active {
    cursor: grabbing;
}

#world {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    transform-origin: 0 0;
    /* Will be transformed by JS */
}

.canvas-item {
    position: absolute;
    white-space: nowrap;
    transform-origin: center center;
    text-shadow: 1px 1px 0px #ccc;
}

/* 12 font families used by canvas items and question responses */
.font-0  { font-family: 'Comic Neue', cursive; }
.font-1  { font-family: 'Fredoka One', cursive; }
.font-2  { font-family: 'Pacifico', cursive; }
.font-3  { font-family: 'Press Start 2P', monospace; font-size: 12px !important; }
.font-4  { font-family: 'Permanent Marker', cursive; }
.font-5  { font-family: 'Bungee', cursive; }
.font-6  { font-family: 'Righteous', cursive; }
.font-7  { font-family: 'Bangers', cursive; letter-spacing: 1px; }
.font-8  { font-family: 'Lobster', cursive; }
.font-9  { font-family: 'Russo One', sans-serif; }
.font-10 { font-family: 'Special Elite', cursive; }
.font-11 { font-family: 'Abril Fatface', cursive; }

/* SVG Overlay for lines */
#overlay-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
}

/* UI Layer (Empty now, but kept for structure if needed) */
#ui-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

/* Center Console (Input Box) */
#center-console {
    position: absolute;
    /* Moves with world */
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    pointer-events: auto;
    background: #c0c0c0;
    /* Light theme (Windows Classic Gray) */
    border: 3px outset #ffffff;
    padding: 10px;
    width: 300px;
    text-align: center;
    box-shadow: 10px 10px 0px #888;
    color: #000;
    z-index: 1000;
}

.marquee-container {
    background-color: #000;
    color: #ff00ff;
    font-weight: bold;
    border: 2px inset #888;
    margin-bottom: 10px;
    font-family: 'Comic Sans MS', cursive, sans-serif;
}

.input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

#user-input {
    background-color: #ffffff;
    color: #000;
    border: 2px inset #888;
    padding: 5px;
    font-family: 'Verdana', sans-serif;
    font-weight: bold;
    font-size: 14px;
}

#submit-btn {
    background-color: #c0c0c0;
    color: #000;
    border: 2px outset #fff;
    padding: 5px;
    font-weight: bold;
    cursor: pointer;
    font-family: 'Tahoma', sans-serif;
    letter-spacing: 1px;
}

#submit-btn:active {
    border-style: inset;
}

#status-msg {
    margin-top: 5px;
    font-size: 10px;
    color: #ff0000;
    min-height: 12px;
}

/* Popups & Stupid Stuff */
#popups-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 80;
    overflow: hidden;
}

.stupid-popup {
    position: absolute;
    background: #c0c0c0;
    border: 2px outset #fff;
    padding: 2px;
    box-shadow: 5px 5px 0 #000;
    pointer-events: auto;
    max-width: 200px;
    text-align: center;
    font-family: 'Tahoma', sans-serif;
    animation: popIn 0.2s ease-out;
}

.popup-header {
    background: #000080;
    color: #fff;
    padding: 2px;
    font-size: 10px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
}

.popup-close {
    cursor: pointer;
    background: #c0c0c0;
    color: #000;
    border: 1px outset #fff;
    width: 12px;
    height: 12px;
    line-height: 10px;
    text-align: center;
}

.popup-content {
    padding: 10px;
    color: #000;
    font-size: 12px;
}

.stupid-shape {
    position: absolute;
    pointer-events: none;
    z-index: 10;
    opacity: 0.8;
}

@keyframes popIn {
    from {
        transform: scale(0);
    }

    to {
        transform: scale(1);
    }
}

/* Fonts */
.font-0 {
    font-family: 'Arial', sans-serif;
}

.font-1 {
    font-family: 'Verdana', sans-serif;
}

.font-2 {
    font-family: 'Tahoma', sans-serif;
}

.font-3 {
    font-family: 'Trebuchet MS', sans-serif;
}

.font-4 {
    font-family: 'Times New Roman', serif;
}

.font-5 {
    font-family: 'Georgia', serif;
}

.font-6 {
    font-family: 'Garamond', serif;
}

.font-7 {
    font-family: 'Courier New', monospace;
}

.font-8 {
    font-family: 'Brush Script MT', cursive;
}

.font-9 {
    font-family: 'Comic Sans MS', cursive, sans-serif;
}

.font-10 {
    font-family: 'Impact', sans-serif;
}

.font-11 {
    font-family: 'Papyrus', fantasy;
}

#online-count {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Comic Sans MS', cursive, sans-serif;
    font-size: 16px;
    color: #000;
    background: #fff;
    border: 2px solid #000;
    padding: 5px 10px;
    pointer-events: auto;
    z-index: 1000;
}

.user-viewport {
    position: absolute;
    border: 2px dashed #ff00ff;
    pointer-events: none;
    z-index: 5;
    transform-origin: 0 0;
}

.user-viewport::after {
    content: 'USER';
    position: absolute;
    top: -20px;
    left: 0;
    background: #ff00ff;
    color: #fff;
    font-size: 10px;
    padding: 2px;
    font-family: 'Arial', sans-serif;
}

/* ── Answer Question Button ─────────────────────────────────────────────── */

#answer-q-btn {
    background-color: #000080;
    color: #ffff00;
    border: 2px outset #aaaaff;
    padding: 4px 8px;
    font-weight: bold;
    cursor: pointer;
    font-family: 'Tahoma', sans-serif;
    font-size: 11px;
    letter-spacing: 0.5px;
    margin-top: 4px;
    width: 100%;
    transition: background 0.15s;
}

#answer-q-btn:hover {
    background-color: #0000aa;
}

#answer-q-btn:active {
    border-style: inset;
}

/* ── Question Circles on Canvas ─────────────────────────────────────────── */

.question-circle-wrapper {
    position: absolute;
    transform: translate(-50%, -50%);
    pointer-events: auto;
}

.question-circle {
    border-radius: 50%;
    position: relative;
    overflow: visible;
    transition: border-color 0.5s ease;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.08);
}

.question-circle-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    overflow: visible;
}

.question-text-label {
    position: absolute;
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Comic Sans MS', cursive, sans-serif;
    font-size: 28px;
    font-weight: bold;
    color: #000;
    text-align: center;
    width: 75%;
    pointer-events: none;
    z-index: 2;
    text-shadow: 0 0 4px rgba(255,255,255,0.8);
    word-wrap: break-word;
    white-space: normal;
}

.question-response {
    position: absolute;
    font-size: 16px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 1;
    text-shadow: 1px 1px 0 rgba(255,255,255,0.5);
}


.question-status-badge {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-family: 'Tahoma', sans-serif;
    font-size: 9px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    pointer-events: none;
    letter-spacing: 0.5px;
}

.q-status-open {
    background: rgba(0, 200, 80, 0.85);
    color: #fff;
}

.q-status-closed {
    background: rgba(200, 50, 50, 0.85);
    color: #fff;
}

/* ── Answer Question Modal ───────────────────────────────────────────────── */

#aq-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

#aq-modal.aq-hidden {
    display: none;
}

#aq-modal-box {
    background: #c0c0c0;
    border: 3px outset #ffffff;
    box-shadow: 8px 8px 0 #555;
    width: min(420px, 90vw);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

#aq-modal-header {
    background: #000080;
    color: #fff;
    padding: 5px 8px;
    font-size: 12px;
    font-weight: bold;
    font-family: 'Tahoma', sans-serif;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

#aq-close-btn {
    background: #c0c0c0;
    color: #000;
    border: 2px outset #fff;
    width: 16px; height: 16px;
    line-height: 12px;
    text-align: center;
    cursor: pointer;
    font-size: 10px;
    font-weight: bold;
    padding: 0;
}

#aq-modal-body {
    padding: 14px;
    overflow-y: auto;
    flex: 1;
    font-family: 'Tahoma', sans-serif;
}

/* Step 1: question list */
#aq-q-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.aq-question-item {
    background: #fff;
    border: 2px inset #888;
    padding: 10px 12px;
    cursor: pointer;
    font-size: 13px;
    color: #000;
    transition: background 0.15s;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.aq-question-item:hover {
    background: #e8e8ff;
}

.aq-q-text { font-weight: bold; }

.aq-q-meta {
    font-size: 11px;
    color: #555;
    display: flex;
    gap: 8px;
}

.aq-q-size { color: #0000aa; }

.aq-goto-link {
    font-size: 10px;
    color: #0000cc;
    text-decoration: underline;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
}

.aq-goto-link:hover { color: #ff0000; }

.aq-empty {
    color: #888;
    font-size: 13px;
    text-align: center;
    padding: 20px 0;
}

/* Step 2: answer input */
.aq-hidden { display: none !important; }

#aq-selected-q {
    background: #000080;
    color: #fff;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 10px;
    word-wrap: break-word;
}

#aq-answer-input {
    width: 100%;
    height: 70px;
    background: #fff;
    border: 2px inset #888;
    padding: 6px 8px;
    font-family: 'Verdana', sans-serif;
    font-size: 14px;
    font-weight: bold;
    color: #000;
    resize: none;
    outline: none;
}

#aq-char-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
    font-size: 11px;
}

#aq-char-count { color: #333; }

#aq-too-long {
    color: #cc0000;
    font-weight: bold;
    animation: blinkWarning 0.6s step-end infinite;
}

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

#aq-cooldown-msg {
    color: #cc7700;
    font-size: 11px;
    min-height: 16px;
    margin-top: 4px;
}

#aq-answer-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

#aq-back-btn, #aq-submit-btn {
    background: #c0c0c0;
    color: #000;
    border: 2px outset #fff;
    padding: 5px 14px;
    cursor: pointer;
    font-family: 'Tahoma', sans-serif;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

#aq-back-btn:active, #aq-submit-btn:active { border-style: inset; }

#aq-submit-btn {
    background: #000080;
    color: #fff;
    border-color: #aaaaff;
}

#aq-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Admin Mode Badge ───────────────────────────────────────────────────── */

#admin-mode-badge {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(100, 60, 220, 0.92);
    color: #fff;
    font-family: 'Tahoma', sans-serif;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.5px;
    padding: 0;
    border-radius: 6px 6px 0 0;
    z-index: 999;
    pointer-events: auto;
    text-transform: uppercase;
    box-shadow: 0 -2px 10px rgba(100,60,220,0.5);
    white-space: nowrap;
    display: flex;
    overflow: hidden;
}

.admin-badge-text {
    padding: 4px 18px;
    pointer-events: none;
}

.admin-logout-btn {
    background: rgba(220, 60, 60, 0.9);
    padding: 0;
    width: 0;
    cursor: pointer;
    transition: width 0.3s ease, padding 0.3s ease, background 0.15s;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#admin-mode-badge:hover .admin-logout-btn {
    width: 60px;
    padding: 4px 0;
}

.admin-logout-btn:hover {
    background: rgba(255, 80, 80, 1) !important;
}

/* ── Admin Drag Handle ──────────────────────────────────────────────────── */

.question-circle-wrapper.admin-draggable {
    cursor: grab;
}

.question-circle-wrapper.admin-draggable:active {
    cursor: grabbing;
}

.admin-drag-handle {
    position: absolute;
    top: -26px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(100, 60, 220, 0.9);
    color: #fff;
    font-family: 'Tahoma', sans-serif;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 1px;
    padding: 3px 10px;
    border-radius: 4px;
    pointer-events: none;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.15s ease;
    box-shadow: 0 0 8px rgba(100,60,220,0.6);
}

.question-circle-wrapper.admin-draggable:hover .admin-drag-handle {
    opacity: 1;
}

.question-circle-wrapper.admin-draggable:hover .question-circle {
    outline: 3px dashed rgba(100, 60, 220, 0.7);
    outline-offset: 4px;
}

