/* =========================================================
   SLINGSHOT DUMMY — Responsive Arcade Pinball Layout & HUD
   Works cleanly in BOTH Portrait & Landscape on Mobile + Desktop!
   ========================================================= */

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

:root {
  --glass-bg: rgba(14, 16, 26, 0.72);
  --glass-border: rgba(255, 255, 255, 0.18);
  --accent-red: #d93829;
  --accent-gold: #ffd166;
  --font-px: 'Press Start 2P', 'Courier New', monospace;
  --font-ui: 'Silkscreen', 'Courier New', monospace;
  --sat: env(safe-area-inset-top, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
}

* {
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 50% 25%, #1c2238 0%, #0b0d16 70%);
  font-family: var(--font-ui);
  color: #f8fafc;
  touch-action: none;
  overscroll-behavior: none;
}

.game-viewport {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(64px + var(--sat)) calc(12px + var(--sar)) calc(28px + var(--sab)) calc(12px + var(--sal));
}

.canvas-stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#gameCanvas {
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 480 / 288;
  width: auto;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.65), 0 0 0 2px rgba(255, 209, 102, 0.35);
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  touch-action: none;
  cursor: crosshair;
}

.bottom-hint {
  position: fixed;
  bottom: calc(6px + var(--sab));
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: #94a3b8;
  letter-spacing: 0.4px;
  white-space: nowrap;
  pointer-events: none;
}

/* Top Floating HUD */
.hud-top {
  position: fixed;
  top: calc(8px + var(--sat));
  left: calc(10px + var(--sal));
  right: calc(10px + var(--sar));
  z-index: 10;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

.hud-left, .hud-right {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  pointer-events: auto;
}
.hud-left { flex-direction: column; gap: 4px; }
.hud-sub-row { display: flex; flex-wrap: wrap; gap: 5px; }

.hud-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 9px;
  background: var(--glass-bg);
  border: 1.5px solid var(--glass-border);
  backdrop-filter: blur(8px);
  white-space: nowrap;
}
.arena-pill { color: var(--accent-gold); }
.targets-pill { color: #74c0fc; }
.aura-pill { color: var(--accent-gold); }
.aura-pill.aura-negative { color: #ff6b6b; border-color: rgba(255, 107, 107, 0.45); }
.diff-pill.mode-easy { color: #ffb3d9; border-color: rgba(255, 143, 199, 0.6); }
.diff-pill.mode-normal { color: #7ee081; border-color: rgba(126, 224, 129, 0.5); }
.diff-pill.mode-hard { color: #ff6b6b; border-color: rgba(255, 107, 107, 0.55); }
.diff-pill.mode-ultimate { color: #e0aaff; border-color: rgba(199, 125, 255, 0.65); }

.hud-icon-btn {
  width: 34px; height: 34px;
  border-radius: 9px;
  border: 1.5px solid var(--glass-border);
  background: var(--glass-bg);
  color: #fff; font-size: 15px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.hud-icon-btn:active { transform: scale(0.92); }

.troll-toast {
  position: fixed;
  top: calc(74px + var(--sat));
  left: 50%;
  transform: translate(-50%, -10px);
  z-index: 14;
  max-width: min(440px, 84vw);
  padding: 7px 14px;
  background: rgba(14, 17, 28, 0.88);
  border: 2px solid rgba(255, 209, 102, 0.6);
  border-radius: 10px;
  font-size: 11px;
  color: #fff6db;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
}
.troll-toast.visible { opacity: 1; transform: translate(-50%, 0); }

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(9, 11, 18, 0.8);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  width: 100%;
  max-width: 520px;
  max-height: 90dvh;
  overflow-y: auto;
  text-align: center;
  background: #171a26;
  border: 3px solid #f4ecd8;
  border-radius: 14px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.65), 6px 6px 0 #090a10;
  padding: 20px 22px;
}
.modal-card.small { max-width: 340px; }

.title-tag { font-family: var(--font-px); font-size: 9px; color: var(--accent-gold); margin-bottom: 10px; }
.pixel-title { font-family: var(--font-px); font-size: clamp(19px, 4vw, 28px); margin: 0 0 8px; color: #fff6e5; text-shadow: 3px 3px 0 var(--accent-red); }
.pixel-subtitle { font-family: var(--font-px); font-size: 14px; margin: 4px 0 12px; color: #fff6e5; }
.title-footnote { font-size: 11px; color: #a8b2cc; margin-bottom: 14px; }

.tier-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: rgba(0, 0, 0, 0.34); border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px; padding: 6px 10px; margin-bottom: 12px;
}
.tier-badge { font-size: 10px; color: #7ee081; }

.diff-selector { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 12px; }
@media (max-width: 480px) { .diff-selector { grid-template-columns: repeat(2, 1fr); } }
.diff-card {
  background: #23273b; border: 2.5px solid #485073; border-radius: 10px;
  padding: 8px 4px; color: #e2e8f0; cursor: pointer; text-align: center; box-shadow: 3px 3px 0 #090a10;
}
.diff-card.active[data-diff="easy"] { background: #421c38; border-color: #ff8fc7; color: #fff; }
.diff-card.active[data-diff="normal"] { background: #1c3627; border-color: #7ee081; color: #fff; }
.diff-card.active[data-diff="hard"] { background: #3d1b20; border-color: #ff6b6b; color: #fff; }
.diff-card.active[data-diff="ultimate"] { background: #34154d; border-color: #c77dff; color: #fff; }
.diff-name { font-family: var(--font-px); font-size: 9px; margin-bottom: 5px; }
.diff-troll { font-size: 8px; color: #cbd5e1; }

.easy-troll-banner {
  margin-bottom: 12px; padding: 7px 10px;
  background: rgba(255, 143, 199, 0.14); border: 2px dashed #ff8fc7;
  border-radius: 8px; font-size: 10px; color: #ffd6eb;
}

.modal-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.modal-stack { display: flex; flex-direction: column; gap: 9px; }

.pixel-btn {
  font-family: var(--font-px); font-size: 11px; padding: 12px 18px;
  border: 3px solid #f4ecd8; border-radius: 8px; background: #282e45;
  color: #fff6e5; cursor: pointer; box-shadow: 3px 3px 0 #090a10;
}
.pixel-btn.primary { background: var(--accent-red); }
.pixel-btn.danger-btn { background: #8f1d1d; border-color: #ff8787; }
.pixel-btn:hover { filter: brightness(1.12); }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-px); font-size: 11px; color: var(--accent-gold);
  margin-bottom: 12px; border-bottom: 2px solid rgba(255, 255, 255, 0.15); padding-bottom: 8px;
}
.tiny-link {
  background: transparent; border: 1.5px solid var(--accent-gold); border-radius: 6px;
  color: var(--accent-gold); font-family: var(--font-ui); font-size: 10px; padding: 3px 8px; cursor: pointer;
}
.tiny-link.prem-locked { border-color: #a78bfa; color: #c4b5fd; background: rgba(124, 92, 255, 0.14); }
.tiny-link.prem-ready { border-color: #ffd166; color: #161822; background: #ffd166; font-weight: 700; }
.tiny-link.danger-link { border-color: #ff6b6b; color: #ff8787; }

.world-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 7px; margin-bottom: 14px; max-height: 52dvh; overflow-y: auto; text-align: left;
}
.world-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; background: #24293d; border: 2px solid #485073;
  border-radius: 8px; color: #fff; cursor: pointer; font-family: var(--font-ui); font-size: 11px;
}
.world-item.boss-item { border-color: #ff9f1c; }
.world-item:hover:not(.locked) { border-color: var(--accent-gold); background: #2f3652; }
.world-item.locked { opacity: 0.45; cursor: not-allowed; }
.world-item .w-meta { font-size: 9px; color: #9ba6c7; margin-top: 2px; }
.world-item .w-stat-line { font-size: 9px; color: var(--accent-gold); margin-top: 3px; }
.world-item .w-badge { font-family: var(--font-px); font-size: 7px; padding: 4px 6px; border-radius: 5px; background: #141724; color: #7ee081; }
.world-item.locked .w-badge { color: #ff7b7b; }

.modal-stats {
  font-size: 12px; line-height: 1.7; color: #d7e0f5; margin-bottom: 14px;
  background: rgba(0, 0, 0, 0.3); padding: 10px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.1);
}
.victory-quote { font-size: 11px; color: var(--accent-gold); font-style: italic; margin-bottom: 14px; }

.auth-tabs-row { display: flex; justify-content: center; gap: 8px; margin-bottom: 10px; }
.game-auth-form { display: flex; flex-direction: column; gap: 8px; }
.g-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.game-auth-form input {
  background: #0d101a; border: 2px solid #485073; border-radius: 7px; padding: 8px 10px;
  color: #fff; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 13px;
}
.coppa-hint { font-size: 10px; color: #9aa6c4; line-height: 1.4; }
.auth-err-msg { min-height: 14px; font-size: 11px; color: #ff6b6b; }
.acct-actions-row { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.delete-acct-box { margin-top: 12px; padding-top: 10px; border-top: 1px dashed rgba(255, 107, 107, 0.45); }
.delete-warn { font-size: 10px; color: #fca5a5; }

.acct-stats-scroll { margin-top: 10px; max-height: 150px; overflow-y: auto; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 6px; background: rgba(8, 10, 18, 0.55); }
.acct-stats-table { width: 100%; border-collapse: collapse; font-size: 10px; text-align: left; }
.acct-stats-table th, .acct-stats-table td { padding: 5px 6px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); white-space: nowrap; }
.acct-stats-table th { position: sticky; top: 0; background: #141826; color: var(--accent-gold); font-size: 9px; }
.acct-stats-empty { margin-top: 8px; font-size: 10px; color: #9ba6c7; }

.legal-footer { margin-top: 12px; display: flex; justify-content: center; gap: 8px; font-size: 10px; color: #64748b; }
.legal-link { font-size: 10px; color: #94a3b8; text-decoration: underline; }
.legal-link:hover { color: var(--accent-gold); }
