/* BRICKVADERS — the cabinet. The game itself is one canvas; everything here is the
   plastic and the glass around it. */
:root {
    --sw: 480px; --sh: 640px; --sl: 0px; --st: 0px; --deck: 0px; --side: 0px;
    --pink: #ff3ad8; --cyan: #3ae8ff; --yellow: #ffe23a; --red: #ff2448; --green: #3aff5a; --ink: #04020c;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
    width: 100%; height: 100%; overflow: hidden; background: var(--ink); color: #e6e4ff;
    font-family: 'Press Start 2P', 'Courier New', monospace; touch-action: none; user-select: none; -webkit-user-select: none;
}
body {
    background:
        radial-gradient(ellipse at 50% 120%, rgba(255, 58, 216, 0.16), transparent 60%),
        radial-gradient(ellipse at 50% -20%, rgba(58, 232, 255, 0.10), transparent 55%),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.015) 0 2px, transparent 2px 6px),
        #04020c;
}
button { font-family: inherit; color: inherit; }

#back-link {
    position: fixed; top: 8px; left: 8px; z-index: 99999; font-family: Arial, Helvetica, sans-serif; font-size: 13px;
    color: #fff; background: rgba(0, 0, 0, 0.55); padding: 6px 12px; border-radius: 6px; text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.25);
}
#back-link:hover { background: rgba(0, 0, 0, 0.8); }
body.playing #back-link { display: none; }

/* ---------------------------------------------------------------- the monitor */
#screen {
    position: fixed; left: var(--sl); top: var(--st); width: var(--sw); height: var(--sh);
    background: #000; border-radius: 10px; overflow: hidden;
    box-shadow: 0 0 0 3px #111018, 0 0 0 6px #2a2440, 0 0 40px rgba(255, 58, 216, 0.22), 0 0 90px rgba(58, 232, 255, 0.10);
    touch-action: none;
}
#game { display: block; width: 100%; height: 100%; image-rendering: pixelated; cursor: none; }
body.touch #game { cursor: default; }
#glass {
    position: absolute; inset: 0; pointer-events: none; border-radius: 10px;
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0) 28%),
        radial-gradient(ellipse at 50% 50%, transparent 70%, rgba(0, 0, 0, 0.35) 100%);
    box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.8);
}
body[data-layout="portrait"] #screen { border-radius: 0 0 10px 10px; }
body[data-layout="portrait"] #glass { border-radius: 0 0 10px 10px; }

/* ---------------------------------------------------------------- side art (wide desktops) */
.side {
    display: none; position: fixed; top: 0; bottom: 0; width: var(--side); padding: 28px 22px;
    flex-direction: column; justify-content: center; gap: 22px; overflow: hidden;
}
body.wide .side { display: flex; }
#side-l { left: 0; align-items: flex-end; }
#side-r { right: 0; align-items: flex-start; }
.marquee {
    font-size: clamp(18px, 2.4vw, 34px); line-height: 1.15; text-align: right; letter-spacing: 2px;
    background: linear-gradient(180deg, #ff2448 0%, #ff8a1a 30%, #ffe23a 48%, #3aff5a 52%, #3ae8ff 75%, #b03aff 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    filter: drop-shadow(0 0 10px rgba(255, 58, 216, 0.55)) drop-shadow(3px 3px 0 #000);
    max-width: 320px;
}
.panel {
    max-width: 320px; width: 100%; background: linear-gradient(180deg, rgba(20, 10, 40, 0.86), rgba(8, 4, 20, 0.86));
    border: 2px solid #000; box-shadow: 0 0 0 2px #3a2a6a, 0 0 22px rgba(58, 232, 255, 0.12); padding: 14px 16px; border-radius: 6px;
    font-size: 9px; line-height: 1.75; color: #c8c4ec;
}
.panel h3 { font-size: 11px; color: var(--yellow); margin-bottom: 10px; text-shadow: 0 0 8px rgba(255, 226, 58, 0.5); letter-spacing: 1px; }
.panel p { margin-bottom: 8px; }
.panel b.c { color: var(--cyan); font-weight: normal; } .panel b.y { color: var(--yellow); font-weight: normal; }
.panel b.p { color: var(--pink); font-weight: normal; } .panel b.g { color: var(--green); font-weight: normal; } .panel b.r { color: var(--red); font-weight: normal; }
.panel table { border-collapse: collapse; width: 100%; }
.panel td { padding: 3px 0; vertical-align: top; }
.panel td:first-child { color: var(--cyan); padding-right: 10px; white-space: nowrap; }
.panel .small { margin-top: 8px; color: #8a86b0; }
.caps { list-style: none; columns: 2; column-gap: 12px; }
.caps li { margin-bottom: 6px; white-space: nowrap; }
.caps i {
    display: inline-block; width: 22px; height: 12px; line-height: 12px; text-align: center; font-style: normal; font-size: 8px; color: #fff;
    background: var(--c); border-radius: 6px; margin-right: 6px; box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4), inset 0 -2px 0 rgba(0, 0, 0, 0.35), 0 0 8px var(--c);
}

/* ---------------------------------------------------------------- touch deck */
#deck { display: none; }
body.touch #deck { display: block; }
#pad {
    position: fixed; touch-action: none; border-radius: 14px;
    background: linear-gradient(180deg, #1a1430, #0c0818); border: 2px solid #000;
    box-shadow: 0 0 0 2px #3a2a6a, inset 0 4px 14px rgba(0, 0, 0, 0.7), 0 0 18px rgba(58, 232, 255, 0.12);
    overflow: hidden;
}
#pad .ridges {
    position: absolute; inset: 10px 12px;
    background: repeating-linear-gradient(90deg, rgba(58, 232, 255, 0.22) 0 3px, transparent 3px 14px);
    border-radius: 8px; opacity: 0.55;
}
#pad .pad-label { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; font-size: 9px; color: #8a86c0; letter-spacing: 2px; }
#btns { position: fixed; display: flex; gap: 14px; align-items: center; justify-content: center; pointer-events: none; }
.abtn {
    pointer-events: auto; touch-action: none; border-radius: 50%; border: 3px solid rgba(0, 0, 0, 0.7); font-size: 10px; color: #fff;
    text-shadow: 0 2px 0 #000; box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.35), inset 0 4px 0 rgba(255, 255, 255, 0.35), 0 0 0 3px #1a1430, 0 0 18px rgba(255, 58, 80, 0.3);
}
.abtn.down { transform: translateY(2px) scale(0.95); filter: brightness(1.35); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.35), 0 0 0 3px #1a1430, 0 0 26px rgba(255, 255, 255, 0.4); }
#btn-fire { width: 92px; height: 92px; background: radial-gradient(circle at 40% 35%, #ff7a8a, #c0102a); }
#btn-bomb { width: 64px; height: 64px; font-size: 8px; background: radial-gradient(circle at 40% 35%, #ffb0e0, #c02a8a); }
#btn-pause {
    position: fixed; z-index: 30; width: 44px; height: 44px; border-radius: 10px; font-size: 14px; touch-action: none;
    border: 2px solid rgba(255, 255, 255, 0.25); background: rgba(10, 6, 24, 0.75); color: #fff;
}

/* portrait: the deck fills the space under the screen */
body[data-layout="portrait"] #pad { left: 12px; bottom: max(12px, env(safe-area-inset-bottom)); width: calc(58vw - 18px); height: calc(var(--deck) - 24px); max-height: 220px; }
body[data-layout="portrait"] #btns { right: 8px; bottom: max(12px, env(safe-area-inset-bottom)); width: calc(42vw - 14px); height: calc(var(--deck) - 24px); max-height: 220px; flex-direction: column-reverse; gap: 10px; }
body[data-layout="portrait"] #btn-pause { right: 10px; top: calc(var(--sh) + 8px); }
body[data-layout="portrait"] #btns { padding-top: 40px; }

/* landscape: pad on the left, buttons on the right */
body[data-layout="landscape"] #pad { left: max(10px, env(safe-area-inset-left)); bottom: 14px; width: calc(var(--side) - 22px); height: 46vh; min-width: 90px; }
body[data-layout="landscape"] #btns { right: max(8px, env(safe-area-inset-right)); bottom: 14px; width: calc(var(--side) - 16px); min-width: 96px; flex-direction: column-reverse; gap: 10px; }
body[data-layout="landscape"] #btn-pause { right: max(12px, env(safe-area-inset-right)); top: 10px; }

/* desktop with a touch screen: keep the controls small over the cabinet */
body[data-layout="desktop"] #pad { left: 12px; bottom: 12px; width: 180px; height: 120px; opacity: 0.85; }
body[data-layout="desktop"] #btns { right: 12px; bottom: 12px; }
body[data-layout="desktop"] #btn-pause { right: 12px; top: 10px; }

.noscript { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; }
