@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --bg: #0f0f1a;
    --panel: #1a1a2e;
    --accent: #e94560;
    --accent-dim: #a83248;
    --text: #f0f0f0;
    --text-dim: #8888aa;
    --success: #4ade80;
    --warning: #fbbf24;
    --danger: #ef4444;
    --highlight: #252545;
    --gold: #ffd700;
}

html {
    font-size: 16px;
}

body {
    font-family: 'Press Start 2P', monospace;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    image-rendering: pixelated;
    font-size: 12px;
    line-height: 1.6;
    padding: 0;
    overflow-x: hidden;
}

#game-container {
    width: 100%;
    max-width: 500px;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--panel);
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Header */
#header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(180deg, var(--highlight) 0%, var(--panel) 100%);
    border-bottom: 3px solid var(--accent);
    flex-shrink: 0;
}

#header-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#title {
    color: var(--accent);
    font-size: 14px;
    letter-spacing: 2px;
}

#venue {
    color: var(--text-dim);
    font-size: 8px;
    letter-spacing: 1px;
}

.icon-btn {
    background: var(--highlight);
    border: 2px solid var(--accent);
    color: var(--text-dim);
    width: 44px;
    height: 44px;
    font-size: 18px;
    cursor: pointer;
    border-radius: 0;
    font-family: inherit;
}

.icon-btn.active {
    color: var(--success);
    border-color: var(--success);
}

/* Wallet */
#wallet {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr 1fr;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg);
    border-bottom: 2px solid var(--highlight);
}

#wallet > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.wallet-label {
    font-size: 8px;
    color: var(--text-dim);
    letter-spacing: 1px;
}

.wallet-value {
    font-size: 14px;
    color: var(--text);
}

#wallet-cash .wallet-value {
    color: var(--success);
    font-size: 20px;
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
}

#wallet-goal {
    justify-content: center;
}

.progress-bar {
    width: 100%;
    height: 14px;
    background: var(--highlight);
    border: 2px solid var(--accent-dim);
    border-radius: 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, var(--warning) 50%, var(--success) 100%);
    width: 0%;
    transition: width 0.3s ease;
}

#wallet-heat {
    justify-content: center;
}

.heat-bar {
    width: 100%;
    height: 14px;
    background: var(--highlight);
    border: 2px solid var(--danger);
    overflow: hidden;
}

.heat-fill {
    height: 100%;
    background: var(--danger);
    width: 0%;
    transition: width 0.3s ease;
}

/* Main */
#main {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

#scene {
    position: relative;
    height: 140px;
    background: #050508;
    flex-shrink: 0;
    overflow: hidden;
}

.scene-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.heat-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--danger);
    pointer-events: none;
}

/* Tab Bar */
#tab-bar {
    display: flex;
    background: var(--bg);
    border-bottom: 2px solid var(--accent);
    flex-shrink: 0;
}

#tab-bar .tab {
    flex: 1;
    padding: 14px 8px;
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    background: var(--highlight);
    color: var(--text-dim);
    border: none;
    cursor: pointer;
    border-right: 1px solid var(--bg);
    transition: all 0.15s;
}

#tab-bar .tab:last-child {
    border-right: none;
}

#tab-bar .tab.active {
    background: var(--accent);
    color: var(--bg);
}

/* Panel */
#panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 280px;
}

.tab-content {
    display: none;
    flex: 1;
    padding: 12px 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 200px;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
}

/* Market */
#market-list, #stash-list, #map-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 12px;
}

.market-item {
    background: var(--highlight);
    border-radius: 0;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.item-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.item-name {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.demand-warning {
    font-size: 7px;
    color: var(--danger);
    background: rgba(239, 68, 68, 0.2);
    padding: 2px 4px;
}

.demand-low {
    font-size: 7px;
    color: var(--warning);
    background: rgba(251, 191, 36, 0.2);
    padding: 2px 4px;
}

.demand-soft {
    font-size: 7px;
    color: var(--text-dim);
    background: rgba(136, 136, 170, 0.2);
    padding: 2px 4px;
}

.sell-price {
    font-size: 9px;
    color: var(--warning);
    margin-top: -6px;
    margin-bottom: 4px;
}

.item-name-text {
    color: var(--text);
    font-size: 11px;
}

.item-price {
    color: var(--text-dim);
    font-size: 12px;
}

.item-price.high { color: var(--danger); }
.item-price.low { color: var(--success); }

.item-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.btn-buy-one, .btn-sell-one {
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    width: 56px;
    height: 48px;
    border: none;
    border-radius: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s;
}

.btn-buy-one:active, .btn-sell-one:active {
    transform: scale(0.95);
}

.btn-buy-one {
    background: var(--success);
    color: var(--bg);
}

.btn-sell-one {
    background: var(--accent);
    color: var(--bg);
}

.btn-buy-one.disabled, .btn-sell-one.disabled {
    background: var(--panel);
    color: var(--text-dim);
    cursor: not-allowed;
    opacity: 0.5;
}

.btn-max {
    font-family: 'Press Start 2P', monospace;
    font-size: 8px;
    padding: 8px 10px;
    border: none;
    border-radius: 0;
    cursor: pointer;
    background: var(--highlight);
    color: var(--text-dim);
    transition: transform 0.1s;
}

.btn-max:active {
    transform: scale(0.95);
}

.btn-max.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.item-qty-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-input {
    width: 50px;
    height: 48px;
    text-align: center;
    font-family: 'Press Start 2P', monospace;
    font-size: 14px;
    background: var(--bg);
    color: var(--text);
    border: 2px solid var(--accent-dim);
    border-radius: 0;
}

.item-owned {
    color: var(--warning);
    font-size: 11px;
    min-width: 30px;
    text-align: center;
}

/* Stash Item */
.stash-item {
    background: var(--highlight);
    border-radius: 0;
    padding: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stash-item-name {
    font-size: 11px;
    color: var(--text);
}

.stash-item-qty {
    font-size: 14px;
    color: var(--warning);
}

.stash-item-value {
    font-size: 10px;
    color: var(--text-dim);
}

.stash-empty {
    text-align: center;
    color: var(--text-dim);
    font-size: 11px;
    padding: 40px 20px;
}

/* Map Item */
.map-item {
    background: var(--highlight);
    border-radius: 0;
    padding: 12px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.15s;
    display: flex;
    gap: 12px;
    align-items: center;
}

.map-item:active {
    transform: scale(0.98);
}

.map-item.current {
    border-color: var(--accent);
    cursor: default;
}

.map-item-image {
    flex-shrink: 0;
    width: 70px;
    height: 70px;
    border-radius: 0;
    overflow: hidden;
}

.map-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.map-item-info {
    flex: 1;
    min-width: 0;
}

.map-item-name {
    font-size: 11px;
    color: var(--accent);
    margin-bottom: 4px;
}

.map-item-desc {
    font-size: 9px;
    color: var(--text-dim);
    line-height: 1.4;
}

.map-item-price {
    font-size: 9px;
    color: var(--success);
    margin-top: 6px;
}

/* Message Log */
#message-log {
    max-height: 60px;
    overflow: hidden;
    font-size: 10px;
    color: var(--text-dim);
    flex-shrink: 0;
    background: var(--bg);
    padding: 10px 16px;
    border-top: 1px solid var(--highlight);
}

.log-entry { margin-bottom: 4px; }
.log-entry.event { color: var(--warning); }
.log-entry.success { color: var(--success); }
.log-entry.danger { color: var(--danger); }

/* Ticket Banner */
#ticket-banner {
    background: linear-gradient(90deg, var(--success), var(--warning));
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: ticket-pulse 1s infinite;
}

#ticket-banner.hidden {
    display: none;
}

@keyframes ticket-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

#ticket-banner span {
    font-size: 10px;
    color: var(--bg);
    font-weight: bold;
}

#btn-buy-ticket {
    font-family: 'Press Start 2P', monospace;
    font-size: 12px;
    padding: 12px 20px;
    background: var(--bg);
    color: var(--success);
    border: none;
    border-radius: 0;
    cursor: pointer;
}

/* Actions */
#actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    border-top: 2px solid var(--accent);
    flex-shrink: 0;
}

#actions button {
    padding: 18px 4px;
    font-family: 'Press Start 2P', monospace;
    font-size: 11px;
    background: var(--highlight);
    color: var(--text);
    border: none;
    border-right: 1px solid var(--bg);
    cursor: pointer;
    transition: all 0.1s;
    touch-action: manipulation;
    min-height: 60px;
}

#actions button:last-child { border-right: none; }
#actions button:active {
    background: var(--accent);
    color: var(--bg);
    transform: scale(0.98);
}

/* Footer */
#footer {
    padding: 12px 16px;
    background: var(--bg);
    border-top: 1px solid var(--highlight);
    flex-shrink: 0;
}

#status-bar {
    font-size: 10px;
    color: var(--text-dim);
    min-height: 16px;
}

/* Modal - Bottom Sheet Style */
#modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: flex-end;
    z-index: 300;
}

#modal.hidden { display: none; }

#modal-content {
    background: var(--panel);
    border: 3px solid var(--accent);
    border-bottom: none;
    padding: 20px;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 0;
    animation: slide-up 0.2s ease-out;
}

@keyframes slide-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

#modal-title {
    color: var(--accent);
    margin-bottom: 16px;
    font-size: 14px;
    text-align: center;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-close {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: var(--highlight);
    border: none;
    color: var(--text);
    font-size: 20px;
    cursor: pointer;
    padding: 8px 12px;
    line-height: 1;
    border-radius: 0;
}

#modal-body {
    margin-bottom: 16px;
    font-size: 12px;
    line-height: 1.8;
}

#modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    padding-top: 8px;
}

#modal-actions button {
    font-family: 'Press Start 2P', monospace;
    font-size: 11px;
    padding: 16px 28px;
    background: var(--highlight);
    color: var(--text);
    border: 2px solid var(--accent);
    cursor: pointer;
    border-radius: 0;
    min-height: 52px;
}

#modal-actions button.primary {
    background: var(--accent);
    color: var(--bg);
}

#modal-actions button.danger {
    background: var(--danger);
    color: var(--bg);
    border-color: var(--danger);
}

/* Quest and Help Content */
.quest-content p,
.help-content p {
    font-size: 11px;
    line-height: 1.8;
    margin-bottom: 12px;
}

.quest-options,
.help-content ul {
    list-style: none;
    margin-top: 16px;
}

.quest-options li {
    background: var(--highlight);
    padding: 16px;
    margin-bottom: 10px;
    border: 2px solid var(--accent-dim);
    border-radius: 0;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.15s;
}

.quest-options li:active {
    background: var(--accent-dim);
    border-color: var(--accent);
    transform: scale(0.98);
}

.help-content ul li {
    font-size: 10px;
    color: var(--text-dim);
    margin-bottom: 10px;
    padding-left: 16px;
    position: relative;
}

.help-content ul li::before {
    content: ">";
    position: absolute;
    left: 0;
    color: var(--accent);
}

/* NPC List */
.npc-list { list-style: none; }

.npc-list li {
    padding: 16px;
    border: 2px solid var(--highlight);
    margin-bottom: 10px;
    cursor: pointer;
    border-radius: 0;
    transition: all 0.15s;
    background: var(--highlight);
}

.npc-list li:active {
    border-color: var(--warning);
    transform: scale(0.98);
}

.npc-list li.talked { opacity: 0.5; }
.npc-list .npc-name { color: var(--warning); margin-bottom: 8px; font-size: 12px; }
.npc-list .npc-desc { font-size: 10px; color: var(--text-dim); font-style: italic; }

/* NPC Portrait */
.npc-portrait {
    text-align: center;
    margin-bottom: 16px;
}

.npc-portrait img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    object-position: center top;
    border-radius: 0;
    border: 3px solid var(--accent);
}

/* Event Image */
.event-image {
    text-align: center;
    margin-bottom: 16px;
}

.event-image img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: 0;
}

/* Conversation */
.conversation { font-size: 12px; }

.conversation .npc-speech {
    background: var(--highlight);
    padding: 16px;
    border-radius: 0;
    margin-bottom: 16px;
    border-left: 4px solid var(--warning);
    line-height: 1.8;
}

.conversation .npc-appearance {
    font-size: 10px;
    color: var(--text-dim);
    font-style: italic;
    margin-bottom: 12px;
}

.conversation-options { list-style: none; }

.conversation-options li {
    padding: 16px;
    border: 2px solid var(--highlight);
    margin-bottom: 10px;
    cursor: pointer;
    font-size: 11px;
    border-radius: 0;
    background: var(--highlight);
}

.conversation-options li:active {
    border-color: var(--accent);
    transform: scale(0.98);
}

/* Wook Interruptions */
.interruption { font-size: 12px; }

.interruption-text {
    background: var(--highlight);
    padding: 16px;
    border-radius: 0;
    margin-bottom: 16px;
    border-left: 4px solid var(--accent);
    line-height: 1.8;
}

.interruption-options { list-style: none; padding: 0; }

.interruption-options li {
    padding: 14px 16px;
    border: 2px solid var(--highlight);
    margin-bottom: 10px;
    cursor: pointer;
    font-size: 11px;
    border-radius: 0;
    background: var(--highlight);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.interruption-options li:active {
    border-color: var(--accent);
    transform: scale(0.98);
}

.time-cost {
    color: var(--warning);
    font-size: 9px;
    white-space: nowrap;
}

.interruption-result {
    font-size: 12px;
    line-height: 1.8;
}

.interruption-result p {
    margin-bottom: 8px;
}

/* Start Screen */
#start-screen {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(180deg, #0a0a15 0%, #1a1a2e 50%, #0f0f1a 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
    padding: 20px;
}

#start-screen.hidden { display: none; }

#start-content {
    text-align: center;
    max-width: 100%;
}

#start-graphic {
    margin-bottom: 20px;
}

.stealie {
    font-size: 60px;
    color: var(--accent);
    text-shadow: 0 0 30px var(--accent);
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { text-shadow: 0 0 20px var(--accent); }
    50% { text-shadow: 0 0 40px var(--accent), 0 0 60px var(--warning); }
}

#game-title {
    font-size: 24px;
    color: var(--accent);
    margin-bottom: 8px;
    letter-spacing: 4px;
}

.tagline {
    color: var(--text-dim);
    font-size: 10px;
    margin-bottom: 24px;
}

.venue-info {
    margin-bottom: 20px;
}

.venue-name {
    color: var(--warning);
    font-size: 12px;
    margin-bottom: 4px;
}

.venue-location {
    color: var(--text-dim);
    font-size: 10px;
}

.goal-text {
    color: var(--text);
    font-size: 11px;
    margin-bottom: 30px;
    line-height: 1.8;
}

.start-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

#btn-start,
#btn-leaderboard {
    font-family: 'Press Start 2P', monospace;
    font-size: 14px;
    padding: 22px 0;
    background: var(--accent);
    color: var(--bg);
    border: none;
    cursor: pointer;
    border-radius: 0;
    min-height: 64px;
    width: 280px;
}

#btn-start {
    animation: pulse 2s infinite;
}

#btn-leaderboard {
    background: var(--highlight);
    color: var(--text);
    border: 2px solid var(--accent);
}

#btn-leaderboard:hover {
    background: var(--accent-dim);
    color: var(--bg);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 20px var(--accent-dim); }
    50% { transform: scale(1.02); box-shadow: 0 0 30px var(--accent); }
}

#btn-start:active,
#btn-leaderboard:active {
    animation: none;
    transform: scale(0.95);
}

.credits {
    margin-top: 30px;
    font-size: 8px;
    color: var(--text-dim);
}

/* End Screen */
#end-screen {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
    padding: 20px;
    overflow-y: auto;
}

#end-screen.hidden { display: none; }

#end-content {
    text-align: center;
    max-width: 380px;
    width: 100%;
}

#end-title { font-size: 20px; margin-bottom: 24px; }
#end-title.win { color: var(--success); }
#end-title.lose { color: var(--danger); }

#end-message { margin-bottom: 20px; font-size: 12px; line-height: 1.8; }

#arrest-image {
    margin: 20px 0;
    text-align: center;
}

#arrest-image.hidden { display: none; }

#arrest-image img {
    max-width: 100%;
    max-height: 200px;
    object-fit: cover;
}

#win-video {
    margin: 20px 0;
    border-radius: 0;
    overflow: hidden;
}

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

#win-video iframe {
    border-radius: 0;
}

#end-stats { color: var(--text-dim); margin-bottom: 30px; font-size: 11px; }

#btn-restart {
    font-family: 'Press Start 2P', monospace;
    font-size: 12px;
    padding: 18px 36px;
    background: var(--accent);
    color: var(--bg);
    border: none;
    cursor: pointer;
    border-radius: 0;
    min-height: 56px;
}

/* Name Entry */
#name-entry {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

#name-entry.hidden { display: none; }

#player-name {
    font-family: 'Press Start 2P', monospace;
    font-size: 11px;
    padding: 12px 16px;
    background: var(--panel);
    color: var(--text);
    border: 2px solid var(--accent);
    border-radius: 0;
    width: 140px;
}

#btn-save-score {
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    padding: 12px 16px;
    background: var(--success);
    color: var(--bg);
    border: none;
    cursor: pointer;
    border-radius: 0;
}

/* Share Buttons */
#share-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 24px;
}

#share-buttons.hidden { display: none; }

.share-btn {
    font-family: 'Press Start 2P', monospace;
    font-size: 9px;
    padding: 12px 16px;
    background: var(--highlight);
    color: var(--text);
    border: 2px solid var(--accent-dim);
    cursor: pointer;
    border-radius: 0;
}

.share-btn:active {
    background: var(--accent);
    color: var(--bg);
}

/* Leaderboard */
#leaderboard-section {
    margin: 24px 0;
    text-align: left;
}

#lb-tabs {
    display: flex;
    margin-bottom: 12px;
}

.lb-tab {
    flex: 1;
    font-family: 'Press Start 2P', monospace;
    font-size: 9px;
    padding: 10px;
    background: var(--highlight);
    color: var(--text-dim);
    border: none;
    cursor: pointer;
}

.lb-tab.active {
    background: var(--accent);
    color: var(--bg);
}

.lb-tab:first-child { border-radius: 0; }
.lb-tab:last-child { border-radius: 0; }

#lb-content {
    background: var(--panel);
    border-radius: 0;
    padding: 12px;
    min-height: 120px;
}

.lb-panel { display: none; }
.lb-panel.active { display: block; }

.leaderboard-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: lb-counter;
}

.leaderboard-list li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--highlight);
    font-size: 10px;
    counter-increment: lb-counter;
}

.leaderboard-list li:last-child { border-bottom: none; }

.leaderboard-list li::before {
    content: counter(lb-counter) ".";
    color: var(--accent);
    margin-right: 8px;
    min-width: 20px;
}

.lb-name {
    flex: 1;
    color: var(--text);
}

.lb-score {
    color: var(--success);
}

.no-scores {
    color: var(--text-dim);
    font-size: 10px;
    text-align: center;
    padding: 20px;
}

/* Modal Leaderboard Tabs */
.lb-modal-tabs {
    display: flex;
    margin-bottom: 16px;
}

.lb-modal-tab {
    flex: 1;
    font-family: 'Press Start 2P', monospace;
    font-size: 9px;
    padding: 10px;
    background: var(--highlight);
    color: var(--text-dim);
    border: none;
    cursor: pointer;
}

.lb-modal-tab.active {
    background: var(--accent);
    color: var(--bg);
}

.lb-modal-tab:first-child { border-radius: 0; }
.lb-modal-tab:last-child { border-radius: 0; }

.lb-modal-panel { display: none; }
.lb-modal-panel.active { display: block; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 0; }

/* NBOMe Trip Animation */
@keyframes nbome-shake {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    10% { transform: translate(-5px, -5px) rotate(-1deg); }
    20% { transform: translate(5px, -5px) rotate(1deg); }
    30% { transform: translate(-5px, 5px) rotate(0deg); }
    40% { transform: translate(5px, 5px) rotate(1deg); }
    50% { transform: translate(-5px, -5px) rotate(-1deg); }
    60% { transform: translate(5px, -5px) rotate(0deg); }
    70% { transform: translate(-5px, 5px) rotate(-1deg); }
    80% { transform: translate(5px, 5px) rotate(1deg); }
    90% { transform: translate(-5px, -5px) rotate(0deg); }
}

@keyframes nbome-hue {
    0% { filter: hue-rotate(0deg) saturate(1); }
    25% { filter: hue-rotate(90deg) saturate(2); }
    50% { filter: hue-rotate(180deg) saturate(3); }
    75% { filter: hue-rotate(270deg) saturate(2); }
    100% { filter: hue-rotate(360deg) saturate(1); }
}

@keyframes nbome-melt {
    0% { transform: scaleY(1) skewX(0deg); }
    25% { transform: scaleY(1.1) skewX(5deg); }
    50% { transform: scaleY(0.9) skewX(-5deg); }
    75% { transform: scaleY(1.2) skewX(10deg); }
    100% { transform: scaleY(1) skewX(0deg); }
}

@keyframes nbome-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.nbome-trip {
    animation: nbome-shake 0.5s infinite, nbome-hue 2s infinite;
}

.nbome-trip #game-container {
    animation: nbome-melt 1s infinite;
}

.nbome-intense {
    animation: nbome-shake 0.2s infinite, nbome-hue 0.5s infinite;
}

.nbome-intense #game-container {
    animation: nbome-melt 0.3s infinite;
    filter: blur(2px);
}

.nbome-intense * {
    animation: nbome-pulse 0.3s infinite;
}

.nbome-chaos {
    animation: nbome-shake 0.1s infinite, nbome-hue 0.2s infinite;
}

.nbome-chaos #game-container {
    animation: nbome-melt 0.1s infinite;
    filter: blur(5px) invert(1);
    transform: scale(1.1);
}

.nbome-blackout {
    background: #000 !important;
    transition: background 1s ease;
}

.nbome-blackout #game-container {
    opacity: 0;
    transition: opacity 1s ease;
}

/* Desktop */
@media (min-width: 520px) {
    body { padding: 20px; align-items: center; }

    #game-container {
        min-height: auto;
        max-height: 95vh;
        border: 4px solid var(--accent);
        border-radius: 0;
    }

    #modal-content {
        border-radius: 0;
        border-bottom: 3px solid var(--accent);
        max-height: 80vh;
    }

    #game-title { font-size: 28px; }
    .stealie { font-size: 80px; }
}

/* Safe Areas */
@supports (padding-top: env(safe-area-inset-top)) {
    #header { padding-top: calc(12px + env(safe-area-inset-top)); }
    #footer { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
}

/* Easter Egg */
.easter-egg {
    text-align: center;
    padding: 20px;
}

.easter-egg p {
    line-height: 1.8;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; }
input[type="number"] { -moz-appearance: textfield; }
