/* Outlevel — global styles for the platformer prototype */

:root {
  --vw: 480;
  --vh: 270;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body, #root {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: #000;
  font-family: 'VT323', 'IBM Plex Mono', monospace;
}

body { cursor: none; }
body.no-pixel-cursor { cursor: auto; }

/* ---------- Stage ---------- */
.stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.canvas-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

canvas.game {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  display: block;
  background: #000;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.04), 0 30px 80px rgba(0,0,0,0.6);
}

/* ---------- HUD ---------- */
.hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 22px;
}

.hud-row {
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
}

.hud-top { justify-content: space-between; }
.hud-bottom { display: grid; grid-template-columns: 1fr auto 1fr; align-items: flex-end; gap: 8px; }
.hud-bottom .hud-progress:first-child { justify-self: start; }
.hud-time-center { justify-self: center; min-width: 0; }
.hud-bottom > :nth-child(3) { justify-self: end; }

.hud-brand {
  display: flex;
  align-items: center;
  gap: 6px;
}
.hud-brand-cursor {
  display: inline-block;
  animation: blink 1s infinite step-end;
  font-family: 'Courier New', monospace;
  margin-left: 2px;
}
@keyframes blink { 50% { opacity: 0; } }

.hud-themes {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}
.hud-themebtn {
  font-size: 12px;
  padding: 6px 10px;
  border: 1px solid;
  background: transparent;
  cursor: none;
  letter-spacing: 0.05em;
  transition: transform 0.05s;
}
.hud-themebtn:hover { transform: translate(-1px, -1px); }
.hud-themebtn.is-active { box-shadow: 2px 2px 0 currentColor; }

.hud-tools { display: flex; gap: 6px; }
.hud-tool {
  font-size: 14px;
  padding: 4px 10px;
  border: 1px solid;
  background: transparent;
  cursor: none;
  letter-spacing: 0.05em;
}
.hud-tool:hover { transform: translate(-1px, -1px); }

.hud-progress {
  border: 1px solid;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
  letter-spacing: 0.05em;
}
.hud-progress-bar {
  flex: 1;
  height: 8px;
  position: relative;
  border: 1px solid currentColor;
}
.hud-progress-fill {
  height: 100%;
  transition: width 0.3s;
}

.hud-help {
  font-size: 16px;
  letter-spacing: 0.05em;
}
.hud-help span {
  padding: 1px 5px;
  border: 1px solid currentColor;
  margin: 0 4px;
}

.hud-prompt {
  font-size: 16px;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
}
.hud-cursor {
  display: inline-block;
  width: 8px;
  height: 14px;
  margin-left: 4px;
  animation: blink 1s infinite step-end;
}

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(2px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.18s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  position: relative;
  width: min(840px, 92vw);
  max-height: 90vh;
  border: 3px solid;
  box-shadow: 8px 8px 0 rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  animation: modalIn 0.22s cubic-bezier(.2,.8,.2,1);
  overflow: hidden;
}
@keyframes modalIn { from { transform: translateY(20px) scale(0.96); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-marquee {
  padding: 8px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.modal-marquee-coin {
  font-size: 16px;
  animation: pulse 1.5s infinite;
}
@keyframes pulse { 50% { transform: scale(1.2); } }

.modal-close,
.slot-esc {
  position: absolute;
  top: 0;
  right: 4px;
  z-index: 20;
}
.modal-close,
.slot-esc,
.mg-close {
  width: 28px !important;
  height: 28px !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  color: #fff !important;
  cursor: none;
  font-size: 20px !important;
  font-weight: bold;
  line-height: 1;
  font-family: 'Press Start 2P', monospace !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  opacity: 1 !important;
  box-shadow: none;
  text-shadow: 0 0 4px #000, 2px 2px 0 #000;
}
.modal-close:hover,
.slot-esc:hover,
.mg-close:hover { background: transparent !important; color: #fff !important; transform: scale(1.2); }

.modal-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  padding: 28px 32px;
}

.modal-screen {
  position: relative;
  border: 3px solid;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.modal-screen-glyph {
  font-size: 110px;
  filter: drop-shadow(0 0 16px currentColor);
  animation: pulseGlyph 1.8s ease-in-out infinite;
}
@keyframes pulseGlyph { 50% { transform: scale(1.06); } }
.modal-screen-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,0) 0,
    rgba(0,0,0,0) 2px,
    rgba(0,0,0,0.18) 2px,
    rgba(0,0,0,0.18) 3px
  );
  pointer-events: none;
}

.modal-text { display: flex; flex-direction: column; gap: 14px; }

.modal-category {
  font-size: 12px;
  letter-spacing: 0.15em;
}

.modal-name {
  font-size: 28px;
  letter-spacing: 0.04em;
  line-height: 1.1;
}

.modal-pitch {
  font-size: 19px;
  line-height: 1.45;
  text-wrap: pretty;
  max-width: 52ch;
}

.modal-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}
.stat {
  display: flex;
  align-items: center;
  gap: 6px;
}
.stat-label {
  font-size: 12px;
  letter-spacing: 0.1em;
  width: 22px;
}
.stat-bar {
  flex: 1;
  height: 10px;
  border: 1px solid;
  position: relative;
}
.stat-fill { height: 100%; }
.stat-value {
  font-size: 16px;
  width: 26px;
  text-align: right;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.modal-cta {
  border: 2px solid;
  padding: 10px 16px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-decoration: none;
  cursor: none;
  box-shadow: 4px 4px 0 currentColor;
  transition: transform 0.05s, box-shadow 0.05s;
}
.modal-cta:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 currentColor; }
.modal-cta:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 currentColor; }
.modal-secondary {
  border: 1px solid;
  background: transparent;
  padding: 10px 14px;
  font-size: 16px;
  cursor: none;
  letter-spacing: 0.05em;
}
.modal-secondary:hover { transform: translate(-1px, -1px); }

/* ---------- Touch controls ---------- */
.touch-controls {
  position: absolute;
  bottom: 80px;
  left: 0;
  right: 0;
  display: none;
  justify-content: space-between;
  padding: 0 22px;
  pointer-events: none;
  z-index: 15;
}
.touch-pad, .touch-actions {
  display: flex;
  gap: 10px;
  pointer-events: auto;
}
.touch-btn {
  width: 52px;
  height: 52px;
  border: 2px solid;
  font-size: 18px;
  cursor: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
@media (hover: none) and (pointer: coarse) {
  .touch-controls { display: flex; }
}

/* ---------- Title screen ---------- */
.title-screen {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.title-stars { position: absolute; inset: 0; }
.title-stars span {
  position: absolute;
  width: 2px;
  height: 2px;
  animation: starflick 2s infinite;
}
@keyframes starflick { 50% { opacity: 0; } }
.title-stack {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
  z-index: 2;
}
.title-name-row {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.1vw, 16px);
}
.title-name-cursor {
  display: inline-block;
  animation: blink 1s infinite step-end;
  font-family: 'Courier New', monospace;
  margin-left: 0.08em;
}
.title-name {
  font-size: clamp(48px, 9vw, 120px);
  letter-spacing: 0.04em;
}
@keyframes titleGlitch {
  0%, 90%, 100% { transform: translate(0,0); }
  92% { transform: translate(-2px, 1px); }
  94% { transform: translate(2px, -1px); }
}
.title-sub {
  font-size: 16px;
  letter-spacing: 0.4em;
}
.title-desc {
  font-size: 22px;
  max-width: 540px;
  line-height: 1.4;
}
.title-cta {
  margin-top: clamp(48px, 8vh, 96px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  line-height: 1;
  padding: 26px 44px;
  border: none;
  font-size: 22px;
  cursor: none;
  letter-spacing: 0.08em;
  box-shadow: 0 6px 0 rgba(0,0,0,0.35);
  transition: transform 0.06s, box-shadow 0.06s;
  animation: ctaPulse 1.4s infinite;
}
.title-cta-arrow {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 16px solid currentColor;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
}
@keyframes ctaPulse { 50% { transform: scale(1.03); } }
.title-cta:hover { transform: translate(-2px,-2px) scale(1.04); box-shadow: 8px 8px 0 currentColor; }
.title-cta:active { transform: translate(2px,2px); box-shadow: 2px 2px 0 currentColor; }
.title-hint { font-size: 16px; letter-spacing: 0.08em; opacity: 0.8; }

/* ---------- HUD stats (hearts + coins) ---------- */
.hud-stats { display: flex; gap: 10px; align-items: center; }
.hud-stat {
  border: 1px solid;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.05em;
  font-size: 14px;
}
.hud-hearts { display: flex; gap: 2px; font-size: 18px; line-height: 1; }
.hud-heart { transition: opacity 0.2s, color 0.2s; }
.coin-pop {
  position: absolute;
  top: -14px;
  right: 8px;
  pointer-events: none;
  white-space: nowrap;
  animation: coinPopRise 1.2s ease-out forwards;
}
@keyframes coinPopRise {
  0% { opacity: 0; transform: translateY(6px); }
  15% { opacity: 1; transform: translateY(0); }
  70% { opacity: 1; transform: translateY(-6px); }
  100% { opacity: 0; transform: translateY(-16px); }
}
.hud-combo {
  display: none;
  border: 1px solid;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  min-width: 180px;
  letter-spacing: 0.05em;
}
.hud-combo-bar {
  flex: 1;
  height: 6px;
  border: 1px solid currentColor;
  position: relative;
}
.hud-combo-fill { height: 100%; transition: width 0.18s; }

/* ---------- Footer (legal) ---------- */
.footer {
  position: absolute;
  bottom: 10px;
  right: 18px;
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 16px;
  z-index: 20;
  letter-spacing: 0.04em;
  pointer-events: auto;
}
.footer-link {
  background: transparent;
  border: none;
  color: inherit;
  cursor: none;
  font: inherit;
  padding: 2px 4px;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.footer-link:hover { opacity: 1; }
.footer-sep { opacity: 0.4; }

/* ---------- Legal modal ---------- */
.legal-modal { width: min(560px, 92vw); }
.legal-body {
  display: block !important;
  padding: 24px 32px 32px !important;
  font-size: 16px;
  line-height: 1.5;
}
.legal-body p { margin-bottom: 14px; }
.legal-body a { color: inherit; }
.legal-cta {
  display: inline-block;
  margin-top: 6px;
  border: 2px solid;
  padding: 10px 16px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-decoration: none;
  cursor: none;
  box-shadow: 4px 4px 0 currentColor;
  transition: transform 0.05s, box-shadow 0.05s;
}
.legal-cta:hover { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 currentColor; }

/* ---------- Slot machine ---------- */
/* slot-esc unified with .modal-close above */
.slot-modal { width: min(560px, 92vw); }
.slot-backdrop { animation: slotBackdropFade 0.55s ease-out; }
@keyframes slotBackdropFade {
  from { background: rgba(0,0,0,0); }
  to { background: rgba(0,0,0,0.7); }
}
.slide-in-left { animation: slideInFromLeft 0.55s cubic-bezier(.2,.8,.2,1); }
@keyframes slideInFromLeft {
  0% { transform: translateX(-110vw) scale(0.95); opacity: 0; }
  60% { opacity: 1; }
  100% { transform: translateX(0) scale(1); opacity: 1; }
}
.slot-body {
  display: flex !important;
  flex-direction: column;
  gap: 18px;
  padding: 24px 28px 28px !important;
  align-items: stretch;
}
.slot-reels {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  border: 3px solid;
  padding: 14px;
}
.slot-reel {
  border: 2px solid;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  background: rgba(0,0,0,0.35);
  filter: drop-shadow(0 0 10px currentColor);
}
.slot-reel.is-spinning { animation: slotShake 0.08s linear infinite; }
.slot-reel.is-stopped { animation: slotStop 0.4s cubic-bezier(.2,.7,.2,1); }
@keyframes slotShake {
  0%, 100% { transform: translateY(-3px); }
  50% { transform: translateY(3px); }
}
@keyframes slotStop {
  0% { transform: translateY(-30px) scale(0.9); }
  60% { transform: translateY(6px) scale(1.05); }
  100% { transform: none; }
}
.slot-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.slot-info {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 14px;
  letter-spacing: 0.04em;
}
.slot-spin {
  border: 3px solid;
  padding: 12px 22px;
  font-size: 14px;
  letter-spacing: 0.08em;
  cursor: none;
  box-shadow: 4px 4px 0 currentColor;
  transition: transform 0.05s, box-shadow 0.05s;
}
.slot-spin:hover:not(:disabled) { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 currentColor; }
.slot-spin:active:not(:disabled) { transform: translate(2px,2px); box-shadow: 1px 1px 0 currentColor; }
.slot-result {
  text-align: center;
  padding: 10px;
  font-size: 14px;
  letter-spacing: 0.08em;
  border: 2px solid;
  box-sizing: border-box;
  min-height: 46px;
  white-space: nowrap;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.slot-paytable {
  font-size: 15px;
  display: grid;
  gap: 4px;
  padding-top: 6px;
  border-top: 1px solid currentColor;
  opacity: 0.85;
}

/* Disable system cursor on interactive elements when pixel cursor active */
button, a { cursor: none; }
