:root {
    --void: #0B0710;
    --panel: #1B1130;
    --ink: #140C1B;
    --text: #E8E2F5;
    --dim: #9C8CC4;
    --lime: #6FE04A;
    --cyan: #3EE0E0;
    --amber: #F5C542;
    --px: 4px;
    --font: 'Press Start 2P', 'Courier New', monospace;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    color: var(--text);
    background: var(--void);
    background-image:
        radial-gradient(circle at 50% 0%, #241640 0%, transparent 60%),
        repeating-linear-gradient(0deg, transparent 0 2px, rgba(0, 0, 0, 0.22) 2px 4px);
    font-family: var(--font);
    -webkit-font-smoothing: none;
}

#app {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 28px 14px 24px;
    box-sizing: border-box;
}

.hdr {
    text-align: center;
}

.top-links {
    position: fixed;
    top: 14px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 5;
}

.top-link {
    font-family: 'Orbitron', sans-serif;
    font-size: 10px;
    color: var(--dim);
    background: none;
    border: none;
    padding: 2px;
    letter-spacing: 0.02em;
    cursor: pointer;
}

.top-link:hover {
    color: var(--cyan);
}

.top-link-sep {
    color: var(--dim);
    font-size: 10px;
}

.info-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(11, 7, 16, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 10;
}

.info-modal-card {
    width: 100%;
    max-width: 560px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    background: var(--panel);
    border: 2px solid var(--ink);
    box-shadow: 0 0 0 2px #3D2A63;
}

.info-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 2px solid var(--ink);
    flex-shrink: 0;
}

.info-modal-title {
    margin: 0;
    font-family: var(--font);
    font-size: 14px;
    color: var(--cyan);
    letter-spacing: 0.03em;
}

.info-modal-close {
    font-family: var(--font);
    font-size: 16px;
    color: var(--dim);
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
    padding: 4px 6px;
}

.info-modal-close:hover {
    color: var(--text);
}

.info-modal-body {
    padding: 16px 20px 20px;
    overflow-y: auto;
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    color: var(--text);
    line-height: 1.6;
}

.about-screenshot {
    display: block;
    width: 100%;
    margin: 0 0 14px;
    border: 2px solid var(--ink);
    box-shadow: 0 0 0 2px #3D2A63;
    image-rendering: pixelated;
}

.info-modal-body p {
    margin: 0 0 12px;
}

.info-modal-body p:last-child {
    margin-bottom: 0;
}

.info-modal-note {
    color: var(--dim);
    font-size: 11px;
}

.changelog-day {
    margin-bottom: 18px;
}

.changelog-day:last-child {
    margin-bottom: 0;
}

.changelog-date {
    margin: 0 0 8px;
    font-family: var(--font);
    font-size: 11px;
    color: var(--amber);
    letter-spacing: 0.02em;
}

.changelog-list {
    margin: 0;
    padding-left: 18px;
}

.changelog-list li {
    margin-bottom: 6px;
}

.changelog-list li:last-child {
    margin-bottom: 0;
}

.title {
    margin: 0;
    font-size: 32px;
    color: var(--lime);
    text-shadow: 3px 3px 0 var(--ink), 6px 6px 0 rgba(62, 224, 224, 0.4);
    letter-spacing: 0.04em;
}

.sub {
    margin: 10px 0 0;
    font-family: 'Orbitron', sans-serif;
    font-size: 13px;
    color: var(--dim);
    letter-spacing: 0.03em;
}

.stage {
    line-height: 0;
}

.play-area {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 14px;
}

.chat-panel {
    display: flex;
    flex-direction: column;
    width: 260px;
    /* Matches GAME_HEIGHT (src/game/main.ts). Without an explicit height here, a
       flex child with no height of its own just grows to fit its content - as
       messages piled up, chat-messages' overflow-y:auto (below) never actually
       got a bounded box to scroll within, so it grew instead, and align-items:
       stretch on the parent .play-area row dragged the whole page taller along
       with it every time a new message arrived. */
    height: 768px;
    background: var(--panel);
    border: 2px solid var(--ink);
    box-shadow: 0 0 0 2px #3D2A63;
}

.chat-tabs {
    display: flex;
}

.chat-tab {
    flex: 1;
    font-family: var(--font);
    font-size: 9px;
    color: var(--dim);
    background: var(--ink);
    border: none;
    border-bottom: 2px solid #3D2A63;
    padding: 10px 4px;
    letter-spacing: 0.02em;
    cursor: pointer;
}

.chat-tab-active {
    color: var(--ink);
    background: var(--cyan);
    border-bottom-color: var(--cyan);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chat-message {
    margin: 0;
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    color: var(--text);
    line-height: 1.4;
    word-break: break-word;
}

.chat-username {
    color: var(--lime);
    font-weight: 700;
}

.chat-flag {
    margin: 0;
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    color: #ff8080;
    line-height: 1.4;
    word-break: break-word;
    border-bottom: 1px solid #3D2A63;
    padding-bottom: 6px;
}

.chat-flag-detail {
    color: var(--dim);
    font-size: 9px;
}

.chat-flag-empty {
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    color: var(--dim);
    text-align: center;
}

.chat-mod-btn {
    margin-left: 6px;
    font-family: var(--font);
    font-size: 7px;
    color: #ff8080;
    background: var(--ink);
    border: 1px solid #ff8080;
    padding: 2px 4px;
    cursor: pointer;
    vertical-align: middle;
}

.chat-input-row {
    display: flex;
    gap: 6px;
    padding: 10px;
    border-top: 2px solid var(--ink);
}

.chat-input {
    flex: 1;
    min-width: 0;
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    color: var(--text);
    background: var(--ink);
    border: 2px solid #3D2A63;
    padding: 6px 8px;
    outline: none;
}

.chat-input:focus {
    border-color: var(--cyan);
}

.chat-send {
    padding: 6px 10px;
}

.chat-locked {
    justify-content: center;
}

.chat-locked-message {
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    color: var(--dim);
    letter-spacing: 0.02em;
}

.ideas-panel {
    width: 100%;
    /* Roughly matches .play-area's own width (game-frame + gap + chat-panel) so
       this reads as one more section stacked directly under it, not an
       unrelated full-bleed block - see App.tsx, which renders this right below
       .play-area. Not pixel-exact (border-image adds a few px to game-frame) -
       close enough for a visual match, same "no responsive polish pass yet"
       spirit as the rest of this fixed-size-canvas layout. */
    max-width: 1306px;
    box-sizing: border-box;
    background: var(--panel);
    border: 2px solid var(--ink);
    box-shadow: 0 0 0 2px #3D2A63;
    padding: 16px 20px 20px;
}

.ideas-title {
    margin: 0;
    font-family: var(--font);
    font-size: 14px;
    color: var(--cyan);
    letter-spacing: 0.03em;
}

.ideas-subtitle {
    margin: 8px 0 14px;
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    color: var(--dim);
}

.ideas-input-row {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.ideas-input {
    flex: 1;
    min-width: 0;
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    color: var(--text);
    background: var(--ink);
    border: 2px solid #3D2A63;
    padding: 8px 10px;
    outline: none;
}

.ideas-input:focus {
    border-color: var(--cyan);
}

.ideas-send {
    padding: 6px 14px;
}

.ideas-locked-message {
    margin: 0 0 14px;
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    color: var(--dim);
    letter-spacing: 0.02em;
}

.ideas-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
}

.ideas-empty {
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    color: var(--dim);
    text-align: center;
    margin: 20px 0;
}

.idea-row {
    display: flex;
    align-items: stretch;
    gap: 12px;
    background: var(--ink);
    border: 1px solid #3D2A63;
    padding: 10px 12px;
}

.idea-upvote-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 52px;
    flex-shrink: 0;
    background: var(--panel);
    border: 2px solid #3D2A63;
    color: var(--dim);
    cursor: pointer;
    padding: 6px 4px;
}

.idea-upvote-btn:hover:not(:disabled) {
    border-color: var(--cyan);
    color: var(--cyan);
}

.idea-upvote-btn:disabled {
    cursor: default;
    opacity: 0.5;
}

.idea-upvote-btn-active {
    border-color: var(--lime);
    color: var(--lime);
}

.idea-upvote-arrow {
    font-size: 12px;
    line-height: 1;
}

.idea-upvote-count {
    font-family: var(--font);
    font-size: 10px;
    line-height: 1;
}

.idea-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.idea-content {
    margin: 0;
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    color: var(--text);
    line-height: 1.4;
    word-break: break-word;
}

.idea-username {
    font-family: 'Orbitron', sans-serif;
    font-size: 10px;
    color: var(--lime);
}

.game-frame {
    display: inline-block;
    line-height: 0;
    border-style: solid;
    border-width: 4px;
    border-image-source: url('/assets/ui/window_frame.png');
    border-image-slice: 32;
    border-image-width: 32px;
    border-image-repeat: stretch;
    image-rendering: pixelated;
    box-shadow: 0 0 0 var(--px) var(--ink), 0 10px 0 0 rgba(0, 0, 0, 0.45);
}

/* App.tsx actually resizes the Phaser canvas to window.innerWidth/Height on entering
   fullscreen (more world visible, sprites stay native size, not CSS-stretched) - this
   just drops the small window's border/shadow and lets the enlarged canvas center itself. */
.game-frame:fullscreen {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100vw;
    height: 100vh;
    border: none;
    box-shadow: none;
    background: var(--void);
}

.ftr {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.chip {
    display: inline-block;
    background: var(--panel);
    border: 2px solid var(--ink);
    box-shadow: 0 0 0 2px #3D2A63;
    padding: 8px 12px;
    font-size: 9px;
    color: var(--amber);
    letter-spacing: 0.02em;
}

.btn-link {
    font-family: var(--font);
    font-size: 9px;
    color: var(--ink);
    background: var(--cyan);
    border: 2px solid var(--ink);
    box-shadow: inset -3px -3px 0 rgba(0, 0, 0, 0.3), inset 3px 3px 0 rgba(255, 255, 255, 0.35);
    padding: 9px 14px;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    cursor: pointer;
}

.btn-link:hover {
    background: #6CF0F0;
    transform: translate(0, -1px);
}

.btn-link:active {
    transform: translate(0, 2px);
    box-shadow: inset 3px 3px 0 rgba(0, 0, 0, 0.3);
}

.btn-link:disabled {
    cursor: default;
    opacity: 0.6;
    transform: none;
}

.login-screen {
    display: flex;
    justify-content: center;
    padding: 20px 0 40px;
}

.login-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 280px;
    background: var(--panel);
    border: 2px solid var(--ink);
    box-shadow: 0 0 0 2px #3D2A63;
    padding: 20px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.login-mode-toggle {
    background: none;
    border: none;
    padding: 0;
    font-family: 'Orbitron', sans-serif;
    font-size: 10px;
    color: var(--cyan);
    text-decoration: underline;
    text-align: center;
    cursor: pointer;
}

.login-mode-toggle:hover {
    color: #6CF0F0;
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 9px;
    color: var(--dim);
    letter-spacing: 0.05em;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 2px;
    background: #3D2A63;
}

.login-label {
    font-size: 9px;
    color: var(--dim);
    letter-spacing: 0.02em;
}

.login-input {
    font-family: 'Orbitron', sans-serif;
    font-size: 13px;
    color: var(--text);
    background: var(--ink);
    border: 2px solid #3D2A63;
    padding: 8px 10px;
    outline: none;
}

.login-input:focus {
    border-color: var(--cyan);
}

.upgrade-form {
    display: flex;
    align-items: center;
    gap: 6px;
}

.upgrade-form .login-input {
    width: 180px;
    padding: 6px 8px;
    font-size: 11px;
}

.login-error {
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    color: #ff5c5c;
    margin: 4px 0 0;
}
