/* Arrow Maze — base theme. Off-white/beige + black, blocky + timeless. */
:root {
  --bg: #f1ebda;
  --bg-2: #e7dfca;
  --ink: #15130f;
  --ink-soft: #6c665a;
  --line: #15130f;
  --card: #fbf9f3;
  --shadow: 0 6px 0 rgba(21, 19, 15, 0.16);
  --shadow-press: 0 2px 0 rgba(21, 19, 15, 0.16);
  --radius: 22px;
  --bar-h: 88px;
  --display: 'Archivo Black', 'Arial Black', system-ui, sans-serif;
  --body: 'Space Grotesk', ui-monospace, 'Segoe UI', system-ui, sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  overscroll-behavior: none;
  user-select: none;
  touch-action: manipulation;
}
body {
  display: flex;
  justify-content: center;
}

/* --- Native iOS: nudge the UI text down a touch. Web build is untouched
 * (the class is only added inside the Capacitor app — see main.js boot). --- */
html.platform-ios .screen-title { font-size: 20px; }
html.platform-ios .btn { font-size: 15px; }
html.platform-ios .icon-btn { font-size: 18px; }
html.platform-ios .pill { font-size: 14px; }
html.platform-ios .brand-text { font-size: 29px; }
html.platform-ios .btn-tile .tile-label { font-size: 19px; }
html.platform-ios .btn-tile.tile-account .tile-label { font-size: 17px; }
html.platform-ios .level-cell .lvl-num { font-size: 17px; }
html.platform-ios .home-slogan,
html.platform-ios .muted { font-size: 12px; }

#app {
  width: 100%;
  max-width: 480px;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

/* ---- Screen container --------------------------------------------------- */
#screen {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: calc(10px + env(safe-area-inset-top)) calc(14px + env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) calc(14px + env(safe-area-inset-left));
  position: relative;
}
.screen-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.screen-title {
  font-family: var(--display);
  font-size: 22px;
  margin: 0;
  letter-spacing: 0.5px;
}
.spacer {
  width: 44px;
}
.scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ---- Buttons (bubbly) --------------------------------------------------- */
.btn {
  position: relative;
  overflow: hidden;
  font-family: var(--display);
  font-size: 16px;
  letter-spacing: 0.5px;
  color: var(--ink);
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 14px 20px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.15s ease;
  -webkit-user-select: none;
  user-select: none;
}
.btn:active {
  transform: translateY(4px) scale(0.98);
  box-shadow: var(--shadow-press);
}
.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.btn-ghost {
  background: transparent;
  box-shadow: none;
  border-width: 3px;
}
.btn-ghost:active {
  transform: scale(0.96);
}
.btn-pill {
  background: var(--card);
}
.btn-wide {
  width: 100%;
}
.btn.disabled,
.btn:disabled {
  opacity: 0.4;
  pointer-events: none;
}
.icon-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

/* ripple */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  transform: scale(0);
  animation: ripple 0.6s ease-out;
  pointer-events: none;
}
.btn-primary .ripple {
  background: rgba(244, 241, 234, 0.35);
}
.btn-tile.tile-light .ripple {
  background: rgba(0, 0, 0, 0.12);
}

/* ---- Pills / coins ------------------------------------------------------ */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--display);
  font-size: 15px;
  background: var(--card);
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  padding: 0 13px;
  height: 44px;
  box-sizing: border-box;
  box-shadow: var(--shadow-press);
}
.coin-dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffc24d, #e0701b);
  border: 2px solid var(--ink);
  display: inline-block;
  flex: 0 0 auto;
}
/* Inline coin (e.g. inside a shop price button) — matches the top-right pill. */
.coin-inline {
  width: 14px;
  height: 14px;
  border-width: 1.5px;
  vertical-align: -2px;
  margin-left: 3px;
}

/* ---- HOME --------------------------------------------------------------- */
.home {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
/* Centered brand, with coins + settings tucked into the top-right corner. */
.home-top {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 10px 0 4px;
  min-height: 64px;
}
.home-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  color: var(--ink);
}
.brand-mark {
  width: 76px;
  height: 64px;
  display: inline-block;
  animation: bob 2.6s ease-in-out infinite;
}
.brand-text {
  font-family: var(--display);
  font-size: 32px;
  line-height: 0.9;
  margin: 0;
  letter-spacing: 1.5px;
}
.home-top-right {
  position: absolute;
  top: 8px;
  right: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 2-column tile grid that fills the remaining space. */
.home-grid {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 1fr;
  gap: 14px;
  align-content: stretch;
  margin-top: 16px;
  min-height: 0;
}
.home-slogan {
  text-align: center;
  font-size: 13px;
  color: var(--ink-soft);
  letter-spacing: 0.3px;
  padding: 10px 0 4px;
  flex: 0 0 auto;
}
.btn-tile {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  text-align: left;
  padding: 16px 16px 14px;
  min-height: 94px;
  border-radius: var(--radius);
  background: var(--card);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.btn-tile .tile-label {
  font-family: var(--display);
  font-size: 21px;
  line-height: 0.96;
  letter-spacing: 0.5px;
}
/* Checkerboard of solid black / white tiles across the whole menu grid. */
.btn-tile.tile-light {
  background: var(--card);
  color: var(--ink);
}
.btn-tile.tile-light .tile-label {
  color: var(--ink);
}
.btn-tile.tile-dark {
  background: var(--ink);
  color: var(--card);
}
.btn-tile.tile-dark .tile-label {
  color: var(--card);
}
/* Account tile shows the chosen username in UPPERCASE (display only — the name
 * is stored exactly as typed). Keep long names contained inside the tile. */
.btn-tile.tile-account .tile-label {
  font-size: 19px;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-height: 2.9em;
  overflow: hidden;
}
.tile-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-family: var(--display);
  font-size: 10px;
  letter-spacing: 1px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  border: 2px solid var(--ink);
}
/* SOON badge tinted to match the coin colour. */
.btn-tile.tile-mode .tile-badge,
.btn-tile.tile-arena .tile-badge {
  background: radial-gradient(circle at 35% 30%, #ffc24d, #e0701b);
  color: var(--ink);
  border-color: rgba(0, 0, 0, 0.35);
}
/* Crank 90s level-select note: how the tap-to-spin controls work. */
.crank-note {
  padding: 0 6px 12px;
}

/* ---- LEVEL SELECT ------------------------------------------------------- */
.level-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.level-cell {
  aspect-ratio: 1;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: var(--card);
  font-family: var(--display);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-press);
}
.level-cell .lvl-num {
  font-size: 19px;
}
.level-cell .lvl-tries {
  font-size: 10px;
  letter-spacing: 0.2px;
  color: #e0701b;
}
.level-cell.done .lvl-tries {
  color: #f3b15a;
}
.level-cell.done {
  background: var(--ink);
  color: var(--bg);
}
.level-cell.locked {
  opacity: 0.45;
}
.level-cell.paid .lvl-num {
  opacity: 0.35;
}
.level-cell.premium-band {
  border-style: dashed;
}
.lvl-lock {
  position: absolute;
  font-size: 14px;
  bottom: 4px;
}
.paid-promo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 3px dashed var(--ink);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: var(--bg-2);
}
.muted {
  color: var(--ink-soft);
  font-size: 13px;
}
.muted.small {
  font-size: 12px;
}
.center {
  text-align: center;
}

/* ---- GAME --------------------------------------------------------------- */
.game-screen {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.game-caption {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 6px;
}
.game-title {
  font-family: var(--display);
  font-size: 16px;
}
.game-hint {
  font-size: 13px;
  color: var(--ink-soft);
  min-height: 16px;
  padding: 0 6px;
}
.game-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.game-canvas {
  display: block;
  border-radius: 16px;
  touch-action: none;
  box-shadow: 0 4px 0 rgba(21, 19, 15, 0.12);
}
.bottom-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 4px 2px;
}
.game-stats {
  display: flex;
  align-items: center;
  gap: 16px;
}
.bar-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.game-settings {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}
.gs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 2px;
  border-bottom: 2px solid rgba(21, 19, 15, 0.1);
}
.gs-row:last-child {
  border-bottom: none;
}
.gs-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.gs-label {
  font-family: var(--display);
  font-size: 16px;
}
.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.05;
}
.stat label {
  font-size: 11px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stat b {
  font-family: var(--display);
  font-size: 17px;
}
.hearts {
  display: flex;
  gap: 4px;
  font-size: 20px;
}
.heart {
  color: #d23b3b;
}
.heart.empty {
  color: rgba(21, 19, 15, 0.18);
}

/* ---- DAILY -------------------------------------------------------------- */
.daily-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg-2);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  padding: 12px 16px;
}
.streak {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--display);
}
.daily-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 9px;
}
.daily-cell {
  aspect-ratio: 0.92;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-press);
}
.daily-cell .d-day {
  font-family: var(--display);
  font-size: 18px;
}
.daily-cell .d-idx {
  font-size: 9px;
  color: var(--ink-soft);
}
.daily-cell.today {
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--shadow);
}
.daily-cell.today .d-idx {
  color: rgba(244, 241, 234, 0.7);
}
.daily-cell.done .d-check {
  position: absolute;
  top: 3px;
  right: 5px;
  color: #0e8f6e;
  font-size: 12px;
}
.daily-cell.future {
  opacity: 0.4;
}

/* ---- SHOP --------------------------------------------------------------- */
.shop-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.skin-card {
  border: 3px solid var(--ink);
  border-radius: 20px;
  background: var(--card);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  box-shadow: var(--shadow-press);
}
.skin-card.is-selected {
  box-shadow: var(--shadow);
  background: var(--bg-2);
}
/* Locked coin skin: dim the preview so the progression reads at a glance. */
.skin-card.is-locked .skin-preview {
  opacity: 0.45;
  filter: grayscale(0.4);
}
.skin-preview {
  aspect-ratio: 1.5;
  border-radius: 13px;
  border: 2.5px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
}
.skin-arrow {
  width: 38%;
  height: 60%;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.2));
}
.skin-name {
  font-family: var(--display);
  font-size: 14px;
  text-align: center;
}
.skin-card .btn {
  font-size: 14px;
  padding: 10px;
}

/* ---- ACCOUNT / SETTINGS ------------------------------------------------- */
.account,
.settings {
  gap: 16px;
}
.lead {
  font-size: 15px;
  line-height: 1.4;
}
.field {
  width: 100%;
  font-family: var(--body);
  font-size: 16px;
  padding: 14px 16px;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: var(--card);
  color: var(--ink);
}
/* Account: profile up top, auth pushed to the bottom for an even page. */
.account {
  padding-bottom: 6px;
}
.account-auth {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 8px;
}
.account-auth .lead {
  margin: 0 0 2px;
}
.account-card {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--bg-2);
}
.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: 22px;
}
.sync-note {
  line-height: 1.4;
}
.account-card-info {
  min-width: 0;
}
.account-card-info strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Change-name row: input grows, Save button hugs its label. */
.field-label {
  display: block;
  font-family: var(--display);
  letter-spacing: 0.5px;
  margin: 2px 0 -4px;
}
.name-editor {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.name-editor .field {
  flex: 1 1 auto;
  min-width: 0;
}
.name-editor .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* Secret-code skin: unowned = a dark mystery card with a big "?". */
.skin-preview.skin-mystery {
  background: #15130f;
  display: flex;
  align-items: center;
  justify-content: center;
}
.skin-mystery .mystery-q {
  font-family: var(--display);
  font-size: 34px;
  color: var(--bg);
  opacity: 0.85;
}
.code-row {
  margin-top: 4px;
}

/* Email + Google sign-in buttons: a clean white "social" surface with an icon,
 * keeping the app's bold outline + shadow so they still fit the look. */
.btn-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #fff;
  color: #1f1f1f;
  font-family: var(--display);
}
.btn-social svg {
  flex: 0 0 auto;
}
.btn-social .ripple {
  background: rgba(0, 0, 0, 0.1);
}
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid rgba(21, 19, 15, 0.1);
  padding: 12px 2px;
  font-family: var(--display);
  font-size: 16px;
}
.toggle {
  width: 58px;
  height: 32px;
  border-radius: 999px;
  border: 3px solid var(--ink);
  background: var(--card);
  position: relative;
  cursor: pointer;
  padding: 0;
}
.toggle .knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ink);
  transition: left 0.18s ease;
}
.toggle.on {
  background: var(--ink);
}
.toggle.on .knob {
  left: 30px;
  background: var(--bg);
}

/* ---- MULTIPLAYER (coming soon) ----------------------------------------- */
.coming-soon {
  align-items: center;
  text-align: center;
  gap: 14px;
  padding-top: 16px;
}
.cs-hero {
  width: 130px;
  height: 130px;
  border-radius: 28px;
  border: 3px solid var(--ink);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
.cs-hero-arrow {
  width: 56px;
  height: 56px;
  display: inline-block;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.25));
  animation: bob 2.6s ease-in-out infinite;
}
.cs-badge {
  font-family: var(--display);
  letter-spacing: 1px;
  background: var(--ink);
  color: var(--bg);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
}
.coming-soon h3 {
  font-family: var(--display);
  font-size: 30px;
  margin: 4px 0;
}
.cs-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cs-list li {
  font-family: var(--display);
  font-size: 15px;
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  padding: 8px 14px;
  background: var(--card);
}

/* ---- Overlays / dialogs ------------------------------------------------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(21, 19, 15, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.overlay.show {
  opacity: 1;
}
.dialog {
  width: 100%;
  max-width: 360px;
  background: var(--bg);
  border: 4px solid var(--ink);
  border-radius: 26px;
  padding: 22px;
  box-shadow: 0 10px 0 rgba(21, 19, 15, 0.25);
  text-align: center;
  transform: translateY(12px) scale(0.96);
  animation: pop-in 0.28s cubic-bezier(0.2, 1.4, 0.4, 1) forwards;
}
.dialog-title {
  font-family: var(--display);
  font-size: 26px;
  margin: 2px 0 6px;
}
.dialog-sub {
  color: var(--ink-soft);
  margin: 0 0 14px;
  font-size: 14px;
}
.dialog-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}
.win-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.win-tries {
  font-family: var(--display);
  font-size: 20px;
  color: var(--ink);
}
.win-tries .big {
  color: #e0701b;
}
/* Trophy-skin banner inside the win dialog (all-50 / all-150 rewards). */
.win-trophy {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--card);
  text-align: left;
}
.win-trophy-prev {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  overflow: hidden;
}
.win-trophy-arrow {
  display: block;
  width: 28px;
  height: 28px;
}
.win-trophy-text strong {
  font-family: var(--display);
  font-size: 14px;
}
.win-reward {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--display);
  font-size: 20px;
}

/* purchase + paywall */
.buy-body,
.paywall-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
}
.buy-price {
  font-family: var(--display);
  font-size: 26px;
}
.buy-id {
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 13px;
}
.paywall-art {
  font-size: 46px;
}
.paywall-list {
  text-align: left;
  margin: 0;
  padding-left: 20px;
  line-height: 1.6;
  font-size: 15px;
}

/* ad overlay */
.ad-overlay {
  background: rgba(21, 19, 15, 0.82);
}
.ad-box {
  width: 100%;
  max-width: 340px;
  background: var(--bg);
  border: 4px solid var(--ink);
  border-radius: 24px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.ad-tag {
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: 1.5px;
  color: var(--ink-soft);
}
.ad-art {
  width: 110px;
  height: 110px;
  border-radius: 22px;
  background: var(--bg-2);
  border: 3px dashed var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  animation: breathe 2.4s ease-in-out infinite;
}
.ad-name {
  font-family: var(--display);
  font-size: 16px;
}
.ad-count {
  font-family: var(--display);
  font-size: 22px;
}

/* toast */
#toast-host {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(20px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 80;
  pointer-events: none;
}
.toast {
  background: var(--ink);
  color: var(--bg);
  font-family: var(--display);
  font-size: 14px;
  padding: 11px 18px;
  border-radius: 999px;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.show {
  opacity: 1;
  transform: none;
}

/* ---- Splash / startup screen ------------------------------------------- */
/* Boot overlays are OPAQUE from the first paint so the home UI never flashes
   through underneath; they only ever fade OUT (via .hide). */
.splash {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.5s ease;
}
.splash.hide {
  opacity: 0;
}
.vesous-intro {
  position: fixed;
  inset: 0;
  z-index: 210;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.5s ease;
}
.vesous-intro.hide {
  opacity: 0;
}
.vesous-mark {
  width: min(74vw, 340px);
  animation: pop-in 0.6s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.splash-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: pop-in 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.splash-arrow {
  width: 110px;
  height: 94px;
  display: inline-block;
  color: var(--ink);
  animation: bob 2.2s ease-in-out infinite;
}
.splash-title {
  font-family: var(--display);
  font-size: 46px;
  line-height: 0.9;
  margin: 6px 0 0;
  letter-spacing: 1px;
}
.splash-slogan {
  color: var(--ink-soft);
  font-size: 15px;
  letter-spacing: 0.3px;
  margin: 4px 0 0;
}

/* ---- Level one-shot checkmark ------------------------------------------ */
.level-cell .lvl-check {
  position: absolute;
  top: 3px;
  right: 6px;
  font-size: 15px;
  color: #1fa06a;
}
.level-cell.done .lvl-check {
  color: #37d98f;
}

/* ---- Daily: month calendar --------------------------------------------- */
.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.cal-title {
  font-family: var(--display);
  font-size: 18px;
}
.cal-dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 11px;
  font-family: var(--display);
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.cal-blank {
  aspect-ratio: 1;
}
.cal-cell {
  aspect-ratio: 1;
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-press);
}
.cal-day {
  font-family: var(--display);
  font-size: 15px;
}
.cal-cell.today {
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--shadow);
}
.cal-cell.done {
  border-color: #1fa06a;
}
.cal-cell.done .d-check {
  position: absolute;
  top: 2px;
  right: 4px;
  color: #1fa06a;
  font-size: 11px;
}
.cal-cell.today.done .d-check {
  color: #37d98f;
}
.cal-cell.future {
  opacity: 0.38;
}
.cal-cell.missed {
  opacity: 0.6;
}

/* ---- Account profile ---------------------------------------------------- */
.profile {
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background: var(--bg-2);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.profile-top {
  display: flex;
  align-items: center;
  gap: 14px;
}
.char-preview {
  width: 74px;
  height: 74px;
  flex: 0 0 auto;
  border: 3px solid var(--ink);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Avatar doubles as the "change skin" button. */
.char-edit {
  position: relative;
  cursor: pointer;
  padding: 0;
}
.char-edit-badge {
  position: absolute;
  right: -8px;
  bottom: -8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--card);
  border: 2.5px solid var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.skin-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-height: 52vh;
  overflow-y: auto;
  padding: 4px 2px;
}
.char-arrow {
  width: 42%;
  height: 60%;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.2));
}
.profile-meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 0;
}
.profile-name {
  font-family: var(--display);
  font-size: 18px;
}
.profile-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
}
.profile-stat b {
  font-family: var(--display);
}
.skin-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.skin-chip {
  width: 46px;
  height: 46px;
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  box-shadow: var(--shadow-press);
}
.skin-chip.on {
  box-shadow: 0 0 0 3px var(--ink) inset, var(--shadow-press);
}
.chip-arrow {
  width: 48%;
  height: 64%;
}
.skin-chip-more {
  background: var(--card);
  font-family: var(--display);
  font-size: 22px;
}
/* Account "Select skin" rail — horizontal scroller of owned skins. */
.profile-skins-label {
  font-family: var(--display);
  font-size: 14px;
  margin-top: 8px;
}
.skin-rail {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  overflow-x: auto;
  padding: 6px 2px 10px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.skin-rail-card {
  flex: 0 0 auto;
  width: 92px;
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  background: var(--card);
  padding: 7px 7px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  scroll-snap-align: start;
  box-shadow: var(--shadow-press);
  position: relative;
}
.skin-rail-card.on {
  box-shadow: 0 0 0 3px var(--ink) inset, var(--shadow);
  background: var(--bg-2);
}
.skin-rail-prev {
  width: 100%;
  height: 62px;
  border-radius: 9px;
  border: 2px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.skin-rail-arrow {
  width: 44%;
  height: 60%;
}
.skin-rail-name {
  font-family: var(--display);
  font-size: 11px;
  text-align: center;
  line-height: 1.05;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.skin-rail-tick {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--card);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--card);
}
.subtle-ad {
  text-align: left;
  background: transparent;
  border: 2px dashed var(--ink);
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
  width: 100%;
}
.subtle-ad strong {
  color: var(--ink);
}

/* ---- Shop sections ------------------------------------------------------ */
.shop-section {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.shop-section h3 {
  font-family: var(--display);
  font-size: 16px;
  margin: 0;
}
/* ---- Interstitial popup box (30s spot, skippable after 5s) ---------------
 * The classic little ad dialog: shows at level ad-breaks + daily completion. */
.adbox-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.adbox-art {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 110px;
  border: 2px dashed var(--ink);
  border-radius: 14px;
  font-size: 30px;
  opacity: 0.5;
}
.adbox-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.adbox-tag {
  font-family: var(--display);
  font-size: 11px;
  letter-spacing: 1.5px;
  padding: 2px 8px;
  border: 2px solid var(--ink);
  border-radius: 999px;
}
.adbox-count {
  font-family: var(--display);
  font-size: 26px;
  font-variant-numeric: tabular-nums;
}

/* ---- Simulated full-screen ad break (countdown placeholder) --------------
 * Marks every spot where a real AdMob ad will play in the published app. */
.ad-sim {
  position: fixed;
  inset: 0;
  z-index: 90; /* above dialogs — a real interstitial covers everything */
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0b0d12;
  color: #f2f4f8;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.ad-sim.show {
  opacity: 1;
}
.ad-sim-inner {
  position: relative;
  width: min(420px, 88vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  padding: 28px 20px;
}
.ad-sim-badge {
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: 2px;
  padding: 4px 10px;
  border: 2px solid #f7c948;
  border-radius: 999px;
  color: #f7c948;
}
.ad-sim-art {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 130px;
  margin-top: 6px;
  border: 2px dashed rgba(242, 244, 248, 0.4);
  border-radius: 14px;
  font-size: 38px;
  opacity: 0.6;
}
.ad-sim-title {
  font-family: var(--display);
  font-size: 22px;
  margin: 4px 0 0;
}
.ad-sim-sub {
  font-size: 13px;
  margin: 0;
  opacity: 0.65;
}
.ad-sim-count {
  font-family: var(--display);
  font-size: 44px;
  line-height: 1;
  margin-top: 6px;
  color: #f7c948;
  font-variant-numeric: tabular-nums;
}
.ad-sim-count.done {
  font-size: 22px;
  color: #7ee08a;
}
.ad-sim-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(242, 244, 248, 0.15);
  overflow: hidden;
}
.ad-sim-fill {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: #f7c948;
}
.ad-sim-action {
  margin-top: 8px;
}
.ad-sim-close {
  position: absolute;
  top: 0;
  right: 0;
  width: 38px;
  height: 38px;
  border: 2px solid rgba(242, 244, 248, 0.4);
  border-radius: 50%;
  background: transparent;
  color: #f2f4f8;
  font-size: 15px;
  cursor: pointer;
}
/* Rewarded-ad CTA above the premium store. */
.ad-reward {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 62px;
  text-align: left;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: var(--card);
  padding: 12px 14px;
  cursor: pointer;
  box-shadow: var(--shadow-press);
}
.ad-reward:active {
  transform: translateY(2px);
}
.ad-reward-play {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  padding-left: 2px;
}
.ad-reward-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  gap: 2px;
  line-height: 1.2;
}
.ad-reward-text strong {
  font-family: var(--display);
  font-size: 15px;
}
.ad-reward-sub {
  font-size: 11px;
  opacity: 0.6;
}
.ad-reward-amt {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--display);
  font-size: 16px;
}
.shop-section .coin-dot {
  width: 18px;
  height: 18px;
}
.sect-badge {
  font-family: var(--display);
  font-size: 11px;
  letter-spacing: 1px;
  background: var(--ink);
  color: var(--bg);
  padding: 3px 8px;
  border-radius: 7px;
}

/* ---- Reset confirmation ------------------------------------------------- */
.reset-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.reset-field {
  text-align: center;
  letter-spacing: 4px;
  text-transform: uppercase;
  font-family: var(--display);
}
