/* base.css — shared look: low-saturation cinematic night palette, pixel font, panels and buttons. */
:root {
  --font: "Trebuchet MS", sans-serif;
  --bg: #1b1d23;
  --panel: rgba(30, 32, 40, 0.94);
  --panel2: #262a33;
  --line: #c9b98f;
  --line-dark: #6c6250;
  --ink: #efe8d6;
  --dim: #a9a294;
  --red: #b5523b;
  --jade: #6fa58a;
  --gold: #e0b45a;
  --outline: #12141a;
  --u: clamp(12px, 1.32vw, 24px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink);
  font-family: var(--font); user-select: none; -webkit-user-select: none; touch-action: none; }
#ui { position: fixed; inset: 0; pointer-events: none; z-index: 10; font-size: var(--u); }
#ui > * { pointer-events: auto; }
#ui .pass { pointer-events: none; }
#fxlayer { position: fixed; inset: 0; pointer-events: none; z-index: 9; overflow: hidden; }
.ftext { position: absolute; left: 0; top: 0; font-family: var(--font); font-size: calc(var(--u) * 1.1); color: #fff; white-space: nowrap;
  text-shadow: 2px 0 var(--outline), -2px 0 var(--outline), 0 2px var(--outline), 0 -2px var(--outline), 2px 2px var(--outline); will-change: transform, opacity; }
#subtitle { position: fixed; left: 50%; bottom: 12%; transform: translateX(-50%); max-width: 60%; z-index: 30; padding: 6px 14px;
  background: rgba(14, 15, 20, 0.78); border: 2px solid var(--line-dark); color: var(--ink); font-size: max(14px, calc(var(--u) * 1.0));
  text-align: center; opacity: 0; transition: opacity .2s; pointer-events: none; }
#subtitle.on { opacity: 1; }
#toasts { position: fixed; top: 14%; left: 50%; transform: translateX(-50%); z-index: 40; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.toast { background: var(--panel); border: 2px solid var(--line); padding: 6px 14px; font-size: max(14px, var(--u)); color: var(--ink);
  box-shadow: 0 3px 0 var(--outline); animation: pop .25s cubic-bezier(.3,1.6,.5,1); transition: opacity .4s, transform .4s; white-space: nowrap; }
.toast.good { border-color: var(--jade); }
.toast.bad { border-color: var(--red); }
.toast.gold { border-color: var(--gold); color: #ffe6a8; }
.toast.out { opacity: 0; transform: translateY(-8px); }

.outlined { text-shadow: 2px 0 var(--outline), -2px 0 var(--outline), 0 2px var(--outline), 0 -2px var(--outline), 2px 2px 0 var(--outline), 3px 3px 0 rgba(0,0,0,.4); }

/* panels: a double pixel border, ivory-gold outer line with a dark inner line and stepped corners */
.panel { background: var(--panel); border: 3px solid var(--line); box-shadow: inset 0 0 0 3px var(--outline), inset 0 0 0 5px var(--line-dark), 0 5px 0 var(--outline);
  padding: calc(var(--u) * 0.9); color: var(--ink); animation: pop .22s cubic-bezier(.3,1.6,.5,1); }
.panel h2 { margin: 0 0 calc(var(--u) * .6); font-size: calc(var(--u) * 1.4); font-weight: 400; color: #f4e2b0; }

.btn { font-family: var(--font); font-size: max(14px, var(--u)); color: var(--ink); background: #3a3f4b; border: 3px solid var(--line);
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.35), 0 4px 0 var(--outline); padding: 0 calc(var(--u) * 0.9); min-height: 44px; min-width: 44px;
  cursor: pointer; transition: transform .08s, filter .12s; text-shadow: 2px 2px 0 var(--outline); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:hover, .btn.focus { filter: brightness(1.18); transform: translateY(-1px) scale(1.03); }
.btn:active { transform: translateY(2px) scale(0.97); box-shadow: inset 0 -2px 0 rgba(0,0,0,.35), 0 2px 0 var(--outline); }
.btn.primary { background: var(--red); border-color: #f0d49a; }
.btn.jade { background: #3f6b58; }
.btn.gold { background: #8a6a2c; border-color: #f6dc9c; }
.btn.off { filter: grayscale(.8) brightness(.7); }
.btn img { width: 1.3em; height: 1.3em; image-rendering: pixelated; }

.chip { display: inline-flex; align-items: center; gap: 4px; }
.chip img { width: 1.4em; height: 1.4em; image-rendering: pixelated; }
.rar0 { color: var(--r0, #b4ada2); } .rar1 { color: #86b893; } .rar2 { color: #79a6d2; } .rar3 { color: #b892d2; } .rar4 { color: #e8bd62; }
.ricon { image-rendering: pixelated; }

@keyframes pop { 0% { transform: scale(.7); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes pulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes slam { 0% { transform: scale(2.2); opacity: 0; } 60% { transform: scale(.92); opacity: 1; } 100% { transform: scale(1); } }
