/* ═══════════════════════════════════════════════════
   FISCAL FURY v5 — styles.css
   Web-safe fonts only · No external dependencies
   ═══════════════════════════════════════════════════ */

:root {
  /* Palette */
  --c-cyan:   #00e5b4;
  --c-gold:   #f5c518;
  --c-green:  #1adb6e;
  --c-red:    #ff3d3d;
  --c-blue:   #3d9aff;
  --c-dark:   #030518;
  --c-panel:  rgba(3, 5, 24, .94);
  --c-border: rgba(0, 229, 180, .18);

  /* Safe-area */
  --st: env(safe-area-inset-top,    0px);
  --sb: env(safe-area-inset-bottom, 0px);

  /* Typography — retro terminal stack, zero external load */
  --font-mono: 'Courier New', Courier, 'Lucida Console', Monaco, monospace;
}

/* ── RESET ── */
*, *::before, *::after {
  margin: 0; padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html, body {
  width: 100%; height: 100%;
  background: var(--c-dark);
  overflow: hidden;
  touch-action: none;
  font-family: var(--font-mono);
  font-size: 14px;
  color: #e0eeff;
}

/* ── CANVAS ── */
#gc {
  position: fixed;
  inset: 0;
  width: 100%; height: 100%;
  display: block;
  z-index: 1;
}

/* ── UTILITY ── */
.hidden  { display: none !important; }
.off     { display: none !important; }

/* ── HUD ── */
#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}
.hud-tl {
  position: absolute;
  top: calc(10px + var(--st));
  left: 14px;
}
.hud-score {
  font-size: clamp(28px, 6vw, 40px);
  font-weight: bold;
  color: #fff;
  line-height: 1;
  letter-spacing: .05em;
  text-shadow: 0 0 14px rgba(0, 229, 180, .55);
}
.hud-coins {
  font-size: 12px;
  color: var(--c-gold);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
  letter-spacing: .05em;
}
.coin-ico { font-size: 14px; }

.hud-tr {
  position: absolute;
  top: calc(10px + var(--st));
  right: 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}
.hud-lives { display: flex; gap: 4px; }
.heart {
  font-size: 17px;
  transition: opacity .15s, transform .15s;
}
.heart.lost { opacity: .15; transform: scale(.65); }

.hud-grade {
  font-size: 9px;
  color: rgba(255, 255, 255, .4);
  letter-spacing: 2px;
  text-transform: uppercase;
  text-align: right;
}
.grade-bar-wrap {
  width: 70px; height: 4px;
  background: rgba(255, 255, 255, .1);
  border-radius: 2px;
  overflow: hidden;
}
.grade-bar-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--c-gold), var(--c-green));
  border-radius: 2px;
  transition: width .4s ease;
}

.hud-time {
  position: absolute;
  top: calc(10px + var(--st));
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: rgba(255, 255, 255, .35);
  letter-spacing: 2px;
}
.obj-mini {
  position: absolute;
  top: calc(38px + var(--st));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}
.obj-pip {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .15);
  transition: background .3s;
}
.obj-pip.done   { background: var(--c-green); }
.obj-pip.active { background: var(--c-gold);  }

.hud-bc {
  position: absolute;
  bottom: calc(12px + var(--sb));
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
}
.combo-display {
  font-size: 30px;
  font-weight: bold;
  color: var(--c-gold);
  text-shadow: 0 0 20px var(--c-gold);
  opacity: 0;
  transform: scale(.8);
  transition: opacity .2s, transform .2s;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.combo-display.show { opacity: 1; transform: scale(1); }

.powerup-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, .5);
  margin-top: 6px;
  pointer-events: all;
}
.pu-icon    { font-size: 24px; filter: drop-shadow(0 0 8px currentColor); }
.pu-tap-hint { font-size: 10px; color: rgba(255, 255, 255, .3); }

/* ── MUTE BUTTON ── */
.mute-btn {
  position: fixed;
  top: calc(10px + var(--st));
  left: 50%;
  margin-left: 50px;
  width: 34px; height: 34px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .4);
  border: 1px solid rgba(255, 255, 255, .1);
  color: rgba(255, 255, 255, .5);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
}

/* ── TUTORIAL ── */
#tutorial {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: calc(180px + var(--sb));
}
.tut-bubble {
  background: rgba(3, 5, 24, .9);
  border: 1px solid rgba(0, 229, 180, .3);
  border-radius: 14px;
  padding: 12px 20px;
  text-align: center;
  font-size: 14px;
  color: #fff;
  max-width: 280px;
  animation: tutPulse 1.5s ease-in-out infinite;
}
@keyframes tutPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 229, 180, .3); }
  50%       { box-shadow: 0 0 0 8px transparent; }
}
.tut-hi { color: var(--c-cyan); }

/* ── OVERLAYS ── */
.ov {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background: rgba(2, 4, 18, .93);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 20px 16px;
  overflow-y: auto;
  gap: 0;
}

/* ── SPLASH ── */
.logo {
  font-size: clamp(52px, 13vw, 80px);
  font-weight: bold;
  letter-spacing: .15em;
  color: var(--c-gold);
  text-shadow: 0 0 30px rgba(245, 197, 24, .5), 0 0 80px rgba(245, 197, 24, .2);
  line-height: 1;
  text-align: center;
  margin-bottom: 4px;
  margin-top: 12px;
  text-transform: uppercase;
}
.logo-sub {
  font-size: 10px;
  letter-spacing: 4px;
  color: rgba(0, 229, 180, .5);
  text-transform: uppercase;
  margin-bottom: 20px;
  text-align: center;
}
.grade-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: rgba(245, 197, 24, .08);
  border: 1px solid rgba(245, 197, 24, .2);
  border-radius: 40px;
  margin-bottom: 16px;
}
.grade-emoji { font-size: 28px; }
.grade-name {
  font-size: 18px;
  font-weight: bold;
  color: var(--c-gold);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.grade-xp {
  font-size: 10px;
  color: rgba(255, 255, 255, .35);
  margin-top: 2px;
  letter-spacing: .05em;
}
.daily-objs { width: 100%; max-width: 340px; margin-bottom: 14px; }
.daily-title {
  font-size: 10px;
  letter-spacing: 3px;
  color: rgba(255, 255, 255, .3);
  text-transform: uppercase;
  margin-bottom: 8px;
  text-align: center;
}
.obj-list { display: flex; flex-direction: column; gap: 6px; }
.obj-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 10px;
  font-size: 12px;
  color: rgba(255, 255, 255, .5);
}
.obj-item.done { border-color: rgba(26, 219, 110, .3); color: var(--c-green); }
.obj-check { font-size: 16px; flex-shrink: 0; }
.obj-prog {
  margin-left: auto;
  font-size: 10px;
  color: rgba(255, 255, 255, .3);
  flex-shrink: 0;
}
.best-score {
  font-size: 12px;
  color: rgba(255, 255, 255, .25);
  margin-bottom: 12px;
  letter-spacing: .05em;
}
.best-score span { color: var(--c-gold); }

.btn-play {
  width: 100%;
  max-width: 280px;
  padding: 18px;
  border-radius: 16px;
  border: none;
  background: linear-gradient(135deg, #c89000, var(--c-gold));
  color: #000;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: bold;
  letter-spacing: .3em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 0 40px rgba(245, 197, 24, .4);
  transition: transform .1s, box-shadow .1s;
  -webkit-appearance: none;
  margin-bottom: 14px;
}
.btn-play:active { transform: scale(.97); box-shadow: 0 0 20px rgba(245, 197, 24, .2); }

.controls-hint {
  font-size: 11px;
  color: rgba(255, 255, 255, .2);
  letter-spacing: .05em;
  text-align: center;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}
.mute-inline {
  background: none;
  border: none;
  color: rgba(255, 255, 255, .4);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, .1);
}

/* ── LEADERBOARD ── */
.lb-wrap { width: 100%; max-width: 340px; margin-bottom: 18px; }
.lb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.lb-title {
  font-size: 10px;
  letter-spacing: 3px;
  color: rgba(255, 255, 255, .3);
  text-transform: uppercase;
}
.lb-tab { display: flex; gap: 4px; }
.lb-tab-btn {
  font-size: 9px;
  padding: 3px 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: none;
  color: rgba(255, 255, 255, .3);
  cursor: pointer;
  font-family: var(--font-mono);
  letter-spacing: 1px;
  transition: all .2s;
}
.lb-tab-btn.active {
  background: rgba(245, 197, 24, .15);
  border-color: rgba(245, 197, 24, .4);
  color: var(--c-gold);
}
.lb-list { display: flex; flex-direction: column; gap: 4px; }
.lb-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 8px;
}
.lb-row.rank-1 { background: rgba(245, 197, 24, .08); border-color: rgba(245, 197, 24, .25); }
.lb-row.rank-2 { background: rgba(200, 200, 200, .05); border-color: rgba(200, 200, 200, .15); }
.lb-row.rank-3 { background: rgba(180, 100, 0, .07); border-color: rgba(180, 100, 0, .2); }
.lb-rank {
  font-size: 18px;
  font-weight: bold;
  color: rgba(255, 255, 255, .2);
  width: 22px;
  flex-shrink: 0;
  text-align: center;
}
.lb-row.rank-1 .lb-rank { color: var(--c-gold); }
.lb-row.rank-2 .lb-rank { color: #bbb; }
.lb-row.rank-3 .lb-rank { color: #cd7f32; }
.lb-medal { font-size: 14px; width: 18px; flex-shrink: 0; }
.lb-info { flex: 1; min-width: 0; }
.lb-score { font-size: 14px; color: #fff; }
.lb-meta {
  font-size: 10px;
  color: rgba(255, 255, 255, .3);
  display: flex;
  gap: 6px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
}
.lb-new-badge {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(26, 219, 110, .2);
  border: 1px solid rgba(26, 219, 110, .35);
  color: var(--c-green);
  letter-spacing: 1px;
  flex-shrink: 0;
}
.lb-empty {
  text-align: center;
  padding: 16px;
  font-size: 12px;
  color: rgba(255, 255, 255, .2);
  border: 1px dashed rgba(255, 255, 255, .08);
  border-radius: 10px;
}

/* ── SHARED BUTTONS ── */
.btn {
  -webkit-appearance: none;
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: bold;
  letter-spacing: .1em;
  text-transform: uppercase;
  transition: transform .1s;
}
.btn:active { transform: scale(.97); }
.btn-g       { background: linear-gradient(135deg, #007a40, var(--c-green)); color: #000; }
.btn-y       { background: linear-gradient(135deg, #c89000, var(--c-gold));  color: #000; }
.btn-outline {
  background: none;
  border: 1px solid rgba(255, 255, 255, .18);
  color: rgba(255, 255, 255, .6);
  font-size: 12px;
}
.btn-ad {
  background: rgba(255, 220, 0, .08);
  border: 1px solid rgba(255, 220, 0, .25);
  color: rgba(255, 220, 0, .8);
  font-size: 12px;
  letter-spacing: .05em;
}
.btn-sm { padding: 11px; font-size: 12px; border-radius: 10px; }

/* ── PAUSE ── */
.pause-wrap {
  width: 100%;
  max-width: 310px;
  background: var(--c-panel);
  border: 1px solid rgba(0, 229, 180, .2);
  border-radius: 20px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pause-title {
  font-size: 32px;
  font-weight: bold;
  color: var(--c-cyan);
  letter-spacing: .2em;
  text-align: center;
  text-transform: uppercase;
}
.pause-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1px;
  background: rgba(255, 255, 255, .06);
  border-radius: 10px;
  overflow: hidden;
}
.ps { background: rgba(3, 5, 24, .8); padding: 10px; text-align: center; }
.ps-v { font-size: 18px; color: #fff; }
.ps-l { font-size: 9px; color: rgba(255, 255, 255, .3); letter-spacing: 1px; margin-top: 2px; }

/* ── RESULTS ── */
.res-wrap {
  width: 100%;
  max-width: 340px;
  background: var(--c-panel);
  border: 1px solid rgba(245, 197, 24, .25);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 0 50px rgba(245, 197, 24, .08);
}
.res-header {
  padding: 22px 20px 16px;
  background: linear-gradient(135deg, #0e0a00, #1a1400);
  text-align: center;
  border-bottom: 1px solid rgba(245, 197, 24, .12);
}
.res-score {
  font-size: 56px;
  font-weight: bold;
  color: #fff;
  line-height: 1;
  letter-spacing: .05em;
}
.res-best { font-size: 11px; color: rgba(255, 255, 255, .3); }
.res-best span { color: var(--c-gold); }
.res-humor {
  font-size: 12px;
  color: rgba(255, 255, 255, .4);
  line-height: 1.5;
  margin-top: 10px;
  font-style: italic;
}
.res-body { padding: 16px 20px; }
.res-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}
.rs {
  padding: 10px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 10px;
  text-align: center;
}
.rs-v { font-size: 20px; color: var(--c-gold); }
.rs-l { font-size: 10px; color: rgba(255, 255, 255, .3); margin-top: 2px; }
.grade-progress { margin-bottom: 14px; }
.gp-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: rgba(255, 255, 255, .35);
  margin-bottom: 5px;
}
.gp-bar {
  height: 6px;
  background: rgba(255, 255, 255, .08);
  border-radius: 3px;
  overflow: hidden;
}
.gp-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--c-gold), var(--c-green));
  border-radius: 3px;
  transition: width .8s cubic-bezier(.4, 0, .2, 1);
}
.achievements-earned {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.ach-chip {
  padding: 5px 10px;
  border-radius: 20px;
  background: rgba(245, 197, 24, .1);
  border: 1px solid rgba(245, 197, 24, .25);
  font-size: 11px;
  color: var(--c-gold);
  display: flex;
  align-items: center;
  gap: 5px;
}
.res-footer {
  padding: 0 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── AD OVERLAY ── */
.ad-wrap {
  width: 100%;
  max-width: 350px;
  background: var(--c-panel);
  border: 1px solid rgba(255, 220, 0, .3);
  border-radius: 20px;
  overflow: hidden;
}
.ad-top {
  background: linear-gradient(135deg, #1a1600, #2a2200);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ad-top-title {
  font-size: 20px;
  font-weight: bold;
  color: var(--c-gold);
  letter-spacing: .2em;
}
.ad-top-tag {
  font-size: 9px;
  color: rgba(255, 200, 0, .4);
  letter-spacing: 2px;
  text-transform: uppercase;
}
.ad-content {
  padding: 28px 24px;
  text-align: center;
  background: linear-gradient(160deg, #0c0a00, #1a1600);
}
.ad-sponsor {
  font-size: 9px;
  color: rgba(255, 200, 0, .35);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.ad-icon {
  font-size: 56px;
  display: block;
  margin-bottom: 12px;
  animation: adPulse 2s ease-in-out infinite;
}
@keyframes adPulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.07); }
}
.ad-brand {
  font-size: 24px;
  font-weight: bold;
  color: var(--c-gold);
  letter-spacing: .15em;
  margin-bottom: 6px;
  text-transform: uppercase;
}
.ad-copy { font-size: 13px; color: rgba(255, 200, 0, .5); line-height: 1.6; }
.ad-reward-pill {
  margin: 12px 20px 0;
  padding: 10px;
  border-radius: 10px;
  background: rgba(0, 229, 180, .08);
  border: 1px solid rgba(0, 229, 180, .2);
  text-align: center;
  font-size: 13px;
  color: var(--c-cyan);
}
.ad-prog-wrap {
  margin: 14px 20px 0;
  background: rgba(255, 255, 255, .08);
  border-radius: 20px;
  height: 6px;
  overflow: hidden;
}
.ad-prog-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #aa8800, var(--c-gold));
  border-radius: 20px;
  transition: width .1s linear;
}
.ad-prog-lbl {
  font-size: 10px;
  color: rgba(255, 200, 0, .4);
  text-align: center;
  margin-top: 7px;
  padding: 0 20px;
  letter-spacing: .05em;
}
.ad-footer {
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#adWatchBtn {
  padding: 15px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #aa8800, var(--c-gold));
  color: #000;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
  font-family: var(--font-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}
#adWatchBtn:disabled { opacity: .35; cursor: not-allowed; }
.btn-ad-cancel {
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 200, 0, .15);
  background: none;
  color: rgba(255, 200, 0, .35);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
}

/* ── ACHIEVEMENT POPUP ── */
#achPop {
  position: fixed;
  top: calc(70px + var(--st));
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(3, 5, 24, .97);
  border: 1px solid rgba(245, 197, 24, .4);
  border-radius: 12px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transition: all .35s;
  z-index: 200;
  pointer-events: none;
  box-shadow: 0 0 25px rgba(245, 197, 24, .2);
}
#achPop.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.ach-icon { font-size: 26px; }
.ach-title {
  font-size: 15px;
  font-weight: bold;
  color: var(--c-gold);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.ach-desc { font-size: 11px; color: rgba(255, 255, 255, .4); margin-top: 2px; }

/* ── GRADE UP ── */
#gradeUp {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 90;
  opacity: 0;
  transition: opacity .4s;
}
#gradeUp.show { opacity: 1; }
.gu-label {
  font-size: 12px;
  letter-spacing: 5px;
  color: var(--c-gold);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.gu-name {
  font-size: clamp(28px, 8vw, 48px);
  font-weight: bold;
  color: #fff;
  text-shadow: 0 0 30px var(--c-gold);
  letter-spacing: .15em;
  text-transform: uppercase;
}

/* ── TOAST ── */
#toast {
  position: fixed;
  top: calc(60px + var(--st));
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: rgba(3, 5, 24, .96);
  border: 1px solid var(--c-green);
  border-radius: 10px;
  padding: 9px 18px;
  font-size: 12px;
  color: var(--c-green);
  box-shadow: 0 0 18px rgba(26, 219, 110, .25);
  opacity: 0;
  transition: all .3s;
  z-index: 200;
  white-space: nowrap;
  pointer-events: none;
  letter-spacing: .05em;
}
#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 0; }
