:root {
  --black: #07080c;
  --ink: #111318;
  --copper: #c7792f;
  --copper-hi: #ffc58a;
  --copper-grad: linear-gradient(90deg, #7a3f14 0%, #e59a52 30%, #ffd0a0 48%, #d7843d 65%, #6d3510 100%);
  --coral: #ff4b44;
  --good: #3ddc84;
  --bad: #ff4b44;
  --glass: rgba(10, 11, 16, 0.62);
  --glass-border: rgba(255, 255, 255, 0.12);
  --font: 'Barlow Condensed', 'Arial Narrow', Impact, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  margin: 0;
  height: 100%;
  background: var(--black);
  color: #fff;
  font-family: var(--font);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  overscroll-behavior: none;
}

#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

#fade {
  position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none;
  transition: opacity 0.18s ease; z-index: 40;
}
#fade.on { opacity: 1; }

button { font-family: inherit; }

/* ---------- screens ---------- */
.screen {
  position: fixed; inset: 0; z-index: 20;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: opacity 0.35s ease, visibility 0.35s;
}
.screen.show { opacity: 1; visibility: visible; }

.brand { display: flex; align-items: center; gap: 14px; }
.brand .x { font-size: 28px; font-weight: 500; opacity: 0.7; }
.logo-duracell { height: 30px; filter: brightness(0) invert(1); }
.logo-laliga { height: 34px; }
.brand.small .logo-duracell { height: 20px; }
.brand.small .logo-laliga { height: 24px; }
.brand.small .x { font-size: 20px; }

.title {
  margin: 10px 0 0; font-weight: 900; font-style: italic; letter-spacing: 0.5px;
  font-size: clamp(34px, 7vw, 64px); line-height: 0.95; text-transform: uppercase;
}
.title span {
  background: var(--copper-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* loading */
#loading {
  background: radial-gradient(ellipse at 50% 40%, #1b1f2e 0%, #07080c 70%);
  gap: 8px; text-align: center; padding: 24px;
}
.load-bar { width: min(320px, 70vw); height: 10px; border-radius: 6px; background: #1d2029; margin-top: 26px; overflow: hidden; border: 1px solid #2a2e3a; }
.load-bar i { display: block; height: 100%; width: 0%; background: var(--copper-grad); transition: width 0.2s; }
.load-text { opacity: 0.7; font-size: 16px; letter-spacing: 1px; text-transform: uppercase; font-weight: 700; margin: 8px 0 0; }

/* ---------- menu ---------- */
.panel-screen { justify-content: flex-end; align-items: stretch; pointer-events: none; }
.panel-screen.show .menu-panel { pointer-events: auto; }
.menu-panel {
  position: relative;
  margin: 0; padding: 18px 16px calc(14px + var(--safe-bottom));
  max-height: 64vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: linear-gradient(180deg, rgba(7, 8, 12, 0.72) 0%, rgba(7, 8, 12, 0.94) 22%, #07080c 100%);
  border-top: 1px solid var(--glass-border);
  border-radius: 22px 22px 0 0;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  scrollbar-width: none;
}
.menu-panel::-webkit-scrollbar { display: none; }
.menu-panel .title { font-size: clamp(30px, 8vw, 50px); margin-top: 6px; }
.intro { margin: 8px 0 0; max-width: 520px; font-size: 17px; font-weight: 500; line-height: 1.3; color: #d9dbe2; }
.intro b { color: #fff; font-weight: 800; }

@media (min-aspect-ratio: 1/1) and (min-width: 760px) {
  .panel-screen { justify-content: center; align-items: flex-start; }
  .menu-panel {
    margin-left: max(24px, 4vw); width: min(560px, 48vw); max-height: 92vh;
    border-radius: 22px; border: 1px solid var(--glass-border);
    background: linear-gradient(180deg, rgba(7, 8, 12, 0.86), rgba(7, 8, 12, 0.94));
    backdrop-filter: blur(6px);
    padding: 24px 22px;
  }
}

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; opacity: 0; transition: opacity 0.3s; }
#hud.show { opacity: 1; }
.hud-top {
  position: absolute; left: 0; right: 0; top: calc(8px + var(--safe-top));
  display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 0 10px;
}
.hud-card {
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: 14px;
  padding: 6px 12px; display: flex; align-items: center; gap: 10px;
  backdrop-filter: blur(4px); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
.hud-card small { display: block; font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; opacity: 0.65; line-height: 1; }
.hud-card b { display: block; font-size: 28px; font-weight: 900; font-style: italic; line-height: 1; }
.score-card b { min-width: 60px; }
.timer-card { flex-direction: column; gap: 4px; padding: 6px 16px 8px; align-items: stretch; text-align: center; }
.timer-card b { font-size: 34px; letter-spacing: 1px; }
.tbar { height: 5px; width: 92px; background: rgba(255, 255, 255, 0.12); border-radius: 3px; overflow: hidden; }
.tbar i { display: block; height: 100%; width: 100%; background: var(--copper-grad); transform-origin: left; }
.timer-card.low b { color: var(--bad); animation: pulse 0.5s infinite alternate; }
.goals-card { text-align: right; }
.streak-batt {
  display: flex; gap: 3px; padding: 3px; border: 2px solid #d9d9df; border-radius: 5px; position: relative; height: 26px;
}
.streak-batt::after { content: ''; position: absolute; right: -6px; top: 7px; width: 4px; height: 9px; background: #d9d9df; border-radius: 0 2px 2px 0; }
.streak-batt i { width: 8px; background: rgba(255, 255, 255, 0.1); border-radius: 2px; transition: background 0.2s, box-shadow 0.2s; }
.streak-batt i.on { background: var(--copper-hi); box-shadow: 0 0 8px var(--copper); }
.streak-batt.full i { background: #fff; box-shadow: 0 0 12px #ffc58a; }

@keyframes pulse { from { transform: scale(1); } to { transform: scale(1.08); } }

/* aim overlay */
#aim { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
#aim .scale-bg { stroke: rgba(255, 75, 68, 0.75); stroke-width: 10; stroke-linecap: round; }
#aim .scale-in { stroke: rgba(61, 220, 132, 0.95); stroke-width: 10; stroke-linecap: butt; }
#aim .marker { fill: #fff; stroke: #111; stroke-width: 2; filter: url(#glow); }
#aim .aim-line { stroke: #fff; stroke-width: 3; stroke-dasharray: 8 6; filter: url(#glow); opacity: 0.95; }
#aim .aim-line.locked { stroke: var(--copper-hi); stroke-dasharray: none; }
#aim #reticle circle.ret-outer { fill: none; stroke: #fff; stroke-width: 3; }
#aim #reticle circle.ret-dot { fill: var(--copper-hi); }
#aim #reticle line { stroke: #fff; stroke-width: 3; stroke-linecap: round; }
#aim #reticle.locked circle.ret-outer, #aim #reticle.locked line { stroke: var(--copper-hi); }
#aim g, #aim line { transition: opacity 0.2s; }
#aim .hidden { opacity: 0; }

/* power meter – a Duracell battery */
.power {
  --pt: translateY(-50%);
  position: absolute; right: max(14px, 3vw); top: 50%; transform: var(--pt) scale(0.9);
  display: flex; flex-direction: column; align-items: center; opacity: 0; transition: opacity 0.2s, transform 0.2s;
}
.power.show { opacity: 1; transform: var(--pt) scale(1); }
.power-nub { width: 18px; height: 8px; background: #d9d9df; border-radius: 3px 3px 0 0; }
.power-body {
  position: relative; width: 46px; height: min(38vh, 260px); border-radius: 10px; overflow: hidden;
  background: #0d0d0f; border: 3px solid #d9d9df; box-shadow: 0 8px 26px rgba(0, 0, 0, 0.5);
}
.power-sweet { position: absolute; left: 0; right: 0; background: rgba(61, 220, 132, 0.28); border-top: 2px solid rgba(61, 220, 132, 0.9); border-bottom: 2px solid rgba(61, 220, 132, 0.9); }
.power-fill {
  position: absolute; left: 0; right: 0; bottom: 0; height: 0%;
  background: linear-gradient(0deg, #6d3510 0%, #d7843d 40%, #ffd0a0 80%, #fff 100%);
  box-shadow: 0 0 18px rgba(255, 197, 138, 0.8);
}
.power-label {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-90deg);
  font-weight: 900; font-style: italic; font-size: 16px; letter-spacing: 2px; color: #fff; mix-blend-mode: difference; white-space: nowrap;
}

/* prompt */
#prompt {
  position: absolute; left: 50%; bottom: calc(18px + var(--safe-bottom)); transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px; transition: opacity 0.2s;
}
#prompt.hidden { opacity: 0; }
#prompt b {
  font-size: 22px; font-weight: 900; font-style: italic; letter-spacing: 1px; text-transform: uppercase;
  padding: 8px 22px; border-radius: 999px; background: rgba(10, 11, 16, 0.72); border: 1px solid rgba(255, 197, 138, 0.5);
  box-shadow: 0 0 22px rgba(199, 121, 47, 0.35); white-space: nowrap;
}
#prompt b em { font-style: italic; color: var(--copper-hi); }
.steps { display: flex; gap: 6px; }
.steps i { width: 26px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.2); }
.steps i.on { background: var(--copper-hi); }
.steps i.done { background: #fff; }

/* banner + popups */
#banner {
  position: absolute; left: 0; right: 0; top: 30%; text-align: center;
  font-size: clamp(56px, 14vw, 120px); font-weight: 900; font-style: italic; line-height: 1;
  text-shadow: 0 6px 30px rgba(0, 0, 0, 0.6); opacity: 0; transform: scale(0.6);
}
#banner.show { animation: bannerIn 1.1s cubic-bezier(.2, 1.4, .4, 1) forwards; }
#banner.goal { background: var(--copper-grad); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 18px rgba(0,0,0,0.6)); text-shadow: none; }
#banner.bad { color: #fff; }
#banner small { display: block; font-size: 0.28em; letter-spacing: 2px; color: #fff; margin-top: 4px; -webkit-text-fill-color: #fff; }
@keyframes bannerIn {
  0% { opacity: 0; transform: scale(0.5) skewX(-8deg); }
  18% { opacity: 1; transform: scale(1.08) skewX(-8deg); }
  30% { transform: scale(1) skewX(-8deg); }
  80% { opacity: 1; transform: scale(1) skewX(-8deg); }
  100% { opacity: 0; transform: scale(1.05) skewX(-8deg); }
}
#popups { position: absolute; inset: 0; }
.popup {
  position: absolute; left: 50%; top: 54%; transform: translate(-50%, 0);
  font-size: 34px; font-weight: 900; font-style: italic; white-space: nowrap;
  color: var(--copper-hi); text-shadow: 0 3px 12px rgba(0, 0, 0, 0.7);
  animation: popUp 1.4s ease-out forwards;
}
.popup.small { font-size: 24px; color: #fff; }
.popup.info { top: 22%; font-size: 24px; color: #fff; padding: 6px 16px; border-radius: 999px; background: rgba(10, 11, 16, 0.75); border: 1px solid rgba(255, 197, 138, 0.5); animation: popInfo 2.2s ease-out forwards; }
@keyframes popUp { 0% { opacity: 0; transform: translate(-50%, 20px) scale(0.8); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.1); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -60px) scale(1); } }
@keyframes popInfo { 0% { opacity: 0; transform: translate(-50%, -10px); } 12% { opacity: 1; transform: translate(-50%, 0); } 85% { opacity: 1; } 100% { opacity: 0; } }

#countdown {
  position: absolute; left: 0; right: 0; top: 38%; text-align: center;
  font-size: clamp(80px, 22vw, 180px); font-weight: 900; font-style: italic; line-height: 1;
  text-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}
#countdown span { display: inline-block; animation: count 0.9s ease-out forwards; }
#countdown span.go { background: var(--copper-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
@keyframes count { 0% { opacity: 0; transform: scale(1.8); } 25% { opacity: 1; transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: scale(0.9); } }

.icon-btn {
  position: absolute; left: 12px; bottom: calc(16px + var(--safe-bottom)); pointer-events: auto;
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--glass-border);
  background: var(--glass); color: #fff; display: grid; place-items: center; cursor: pointer;
}
.icon-btn.muted { color: #888; }

/* ---------- streak overlay ---------- */
#streak {
  position: fixed; left: 0; right: 0; top: 50%; transform: translateY(-50%); z-index: 15; pointer-events: none;
  display: flex; justify-content: center; opacity: 0;
}
#streak.show { animation: streakIn 2.3s ease-out forwards; }
.streak-inner {
  position: relative; width: 100%; padding: 18px 12px 16px; text-align: center; overflow: hidden;
  background: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(8,8,10,0.92) 18%, rgba(8,8,10,0.92) 82%, rgba(0,0,0,0) 100%);
  border-top: 3px solid; border-bottom: 3px solid; border-image: var(--copper-grad) 1;
}
.streak-inner::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 220, 170, 0.35) 50%, transparent 70%);
  transform: translateX(-100%); animation: shine 1.2s 0.2s ease-in-out;
}
.streak-logo { height: clamp(34px, 8vw, 64px); filter: brightness(0) invert(1) drop-shadow(0 0 12px rgba(255, 197, 138, 0.6)); }
.streak-title {
  font-size: clamp(36px, 10vw, 84px); font-weight: 900; font-style: italic; line-height: 1; margin-top: 4px;
  background: var(--copper-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.streak-pts { font-size: clamp(26px, 6vw, 44px); font-weight: 900; font-style: italic; margin-top: 2px; }
.bolt { position: absolute; left: 50%; top: -6px; transform: translateX(-50%); font-size: 30px; filter: drop-shadow(0 0 8px #ffc58a); }
@keyframes streakIn {
  0% { opacity: 0; transform: translateY(-50%) scaleY(0.2); }
  10% { opacity: 1; transform: translateY(-50%) scaleY(1.05); }
  16% { transform: translateY(-50%) scaleY(1); }
  85% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-50%) scaleY(1); }
}
@keyframes shine { to { transform: translateX(100%); } }

/* ---------- game over ---------- */
#over { background: radial-gradient(ellipse at 50% 30%, rgba(20, 22, 32, 0.7), rgba(5, 6, 9, 0.92)); padding: 16px; }
.over-card {
  width: min(440px, 100%); text-align: center; padding: 22px 20px 20px;
  background: linear-gradient(180deg, #14161e, #0b0c11); border: 1px solid var(--glass-border); border-radius: 22px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6); position: relative; overflow: hidden;
}
.over-card::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: var(--copper-grad); }
.over-card h2 { margin: 6px 0 0; font-size: 26px; font-weight: 800; font-style: italic; text-transform: uppercase; letter-spacing: 1px; opacity: 0.85; }
.over-score small { display: block; font-size: 14px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; opacity: 0.6; margin-top: 10px; }
.over-score b {
  display: block; font-size: 84px; font-weight: 900; font-style: italic; line-height: 1;
  background: var(--copper-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.over-newbest { min-height: 22px; font-size: 20px; font-weight: 900; font-style: italic; color: var(--good); letter-spacing: 1px; }
.over-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 6px; }
.over-stats div { background: rgba(255, 255, 255, 0.05); border-radius: 12px; padding: 10px 4px; }
.over-stats b { display: block; font-size: 28px; font-weight: 900; font-style: italic; }
.over-stats small { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.6; }
.over-note { margin: 8px 0 0; font-size: 15px; color: #c8cad2; min-height: 1.2em; }
.over-note.ok { color: var(--good); font-weight: 700; }
.over-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.btn {
  padding: 13px 18px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06); color: #fff; font-size: 20px; font-weight: 800; font-style: italic;
  text-transform: uppercase; letter-spacing: 1px; cursor: pointer; transition: transform 0.1s;
}
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--copper-grad); color: #1a0d04; border: none; }

@media (max-width: 420px) {
  .hud-card { padding: 5px 9px; gap: 7px; }
  .hud-card b { font-size: 24px; }
  .timer-card b { font-size: 28px; }
  .tbar { width: 72px; }
  .streak-batt { height: 22px; }
  .streak-batt i { width: 6px; }
  #prompt b { font-size: 19px; padding: 7px 18px; }
  .power-body { width: 40px; }
}

#over { overflow-y: auto; justify-content: safe center; }

@media (max-height: 560px) {
  .over-card { padding: 14px 16px 14px; }
  .over-card h2 { font-size: 20px; margin-top: 2px; }
  .over-score small { margin-top: 4px; }
  .over-score b { font-size: 60px; }
  .over-stats { margin: 6px 0 2px; }
  .over-stats div { padding: 6px 4px; }
  .over-stats b { font-size: 22px; }
  .over-actions { flex-direction: row; margin-top: 10px; }
  .over-actions .btn { flex: 1; padding: 10px 12px; font-size: 17px; }
  .menu-panel .title { font-size: 34px; }
  .intro { font-size: 15px; }
}

/* portrait: the battery lies on its side above the prompt so it never covers the aim scales */
@media (max-aspect-ratio: 4/5) {
  .power {
    --pt: translate(-50%, 50%) rotate(90deg);
    right: auto; top: auto; left: 50%; bottom: calc(150px + var(--safe-bottom));
  }
  .power-body { height: min(62vw, 280px); }
}

/* ---------- auth + lobby ---------- */
.hidden { display: none !important; }
.tabs { display: flex; gap: 6px; margin: 14px 0 12px; background: rgba(255,255,255,0.06); padding: 4px; border-radius: 14px; width: 100%; max-width: 420px; }
.tab { flex: 1; padding: 10px; border-radius: 10px; border: 0; background: none; color: #c8cad2; font: italic 800 18px var(--font); text-transform: uppercase; letter-spacing: 1px; cursor: pointer; }
.tab.on { background: var(--copper-grad); color: #1a0d04; }
.auth-form { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.auth-form label span { display: block; font-size: 14px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: #c8cad2; margin-bottom: 4px; }
.auth-form input {
  width: 100%; padding: 13px 14px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.16); background: rgba(255,255,255,0.06);
  color: #fff; font: 600 18px var(--font); letter-spacing: 0.3px; outline: none; user-select: text; -webkit-user-select: text;
}
.auth-form input:focus { border-color: var(--copper-hi); box-shadow: 0 0 0 3px rgba(199,121,47,0.25); }
.auth-form input.bad { border-color: var(--bad); }
.auth-form .btn { margin-top: 4px; }
.form-err { min-height: 1.1em; margin: 0; color: var(--bad); font-weight: 700; font-size: 15px; }
.btn[disabled] { opacity: 0.6; pointer-events: none; }
.btn.big { width: 100%; max-width: 420px; font-size: 30px; padding: 16px; margin-top: 10px; box-shadow: 0 10px 30px rgba(199,121,47,0.35); }
.btn.gold { background: #ffc20e; color: #111; border: none; }
.link-btn { background: none; border: 0; color: #c8cad2; font: 700 15px var(--font); text-transform: uppercase; letter-spacing: 1px; cursor: pointer; padding: 6px; }
.lobby-top { width: 100%; max-width: 520px; display: flex; justify-content: space-between; align-items: center; }
.hello { margin: 10px 0 0; font-size: 18px; color: #d9dbe2; font-weight: 600; word-break: break-all; }
.stats-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; max-width: 420px; margin-top: 12px; }
.stats-row div { background: rgba(255,255,255,0.05); border-radius: 12px; padding: 8px; }
.stats-row small { display: block; font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; opacity: 0.6; }
.stats-row b { font-size: 30px; font-weight: 900; font-style: italic; }
.entry-card { width: 100%; max-width: 420px; margin-top: 8px; padding: 10px 12px; border-radius: 12px; border: 1px dashed rgba(255,194,14,0.5); background: rgba(255,194,14,0.07); font-size: 16px; }
.entry-card.done { border-style: solid; }
.entry-card b { color: #ffc20e; font-size: 22px; font-style: italic; }
.rules { width: 100%; max-width: 420px; margin-top: 10px; text-align: left; background: rgba(255,255,255,0.04); border-radius: 12px; padding: 8px 12px; }
.rules summary { cursor: pointer; font-weight: 800; font-style: italic; text-transform: uppercase; letter-spacing: 1px; color: var(--copper-hi); }
.rules ul { margin: 8px 0 2px; padding-left: 18px; display: grid; gap: 4px; color: #c8cad2; font-size: 15px; }
.rules b { color: #fff; }
.sub { margin: 14px 0 6px; font-size: 18px; font-weight: 800; font-style: italic; text-transform: uppercase; letter-spacing: 1px; color: var(--copper-hi); }
.games-list { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 6px; }
.game-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,0.05); text-align: left; }
.game-row .g { font-size: 24px; font-weight: 900; font-style: italic; min-width: 44px; }
.game-row .meta { flex: 1; font-size: 14px; color: #aeb2bf; line-height: 1.2; }
.game-row .btn { padding: 8px 12px; font-size: 14px; }
.game-row .tag { font-size: 12px; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: #ffc20e; color: #111; text-transform: uppercase; }
.game-row .tag.muted { background: rgba(255,255,255,0.12); color: #c8cad2; }
.empty { color: #8f94a3; font-size: 15px; }
.over-actions .btn.gold { font-size: 18px; }

.modal { position: fixed; inset: 0; z-index: 50; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,0.6); }
.modal.show { display: flex; }
.modal-card { width: min(420px, 100%); background: #14161e; border: 1px solid var(--glass-border); border-radius: 18px; padding: 20px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.6); }
.modal-card h3 { margin: 0 0 8px; font-size: 24px; font-style: italic; font-weight: 900; text-transform: uppercase; }
.modal-card p { font-size: 17px; color: #d9dbe2; line-height: 1.35; }
.modal-card b { color: #ffc20e; }
.modal-actions { display: flex; gap: 8px; margin-top: 14px; }
.modal-actions .btn { flex: 1; }

#toast {
  position: fixed; left: 50%; top: calc(14px + var(--safe-top)); transform: translate(-50%, -150%); z-index: 60;
  max-width: min(92vw, 460px); padding: 10px 16px; border-radius: 12px; background: #1d2029; border: 1px solid rgba(255,255,255,0.15);
  font-weight: 700; font-size: 16px; transition: transform 0.25s ease; text-align: center;
}
#toast.show { transform: translate(-50%, 0); }
#toast.err { border-color: rgba(255,75,68,0.6); }
