/* ArcadeOwl — Dress Up & Beauty shared engine styles (self-contained, no deps). */
:root {
  --ao-bg: #1a0f1f;
  --ao-bg2: #2a1530;
  --ao-panel: rgba(255, 255, 255, 0.07);
  --ao-panel-line: rgba(255, 255, 255, 0.14);
  --ao-fg: #fff4fb;
  --ao-muted: #e7c6e0;
  --ao-faint: #b58fb0;
  --ao-accent: #ff5db1;
  --ao-accent2: #b06bff;
  --ao-gold: #ffd166;
  --ao-good: #46e8a8;
  --ao-bad: #ff6b8b;
  --ao-radius: 16px;
  --ao-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  color: var(--ao-fg);
  font-family: ui-rounded, "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  background:
    radial-gradient(1100px 600px at 18% -8%, rgba(176, 107, 255, 0.30), transparent 60%),
    radial-gradient(900px 600px at 110% 115%, rgba(255, 93, 177, 0.28), transparent 60%),
    linear-gradient(160deg, var(--ao-bg2), var(--ao-bg));
}
#app { position: fixed; inset: 0; display: flex; flex-direction: column; }

/* ---- HUD ---- */
.ao-hud {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: rgba(0, 0, 0, 0.28);
  border-bottom: 1px solid var(--ao-panel-line);
  backdrop-filter: blur(8px);
  font-size: 14px;
  z-index: 5;
}
.ao-hud .ao-title {
  font-weight: 800;
  letter-spacing: 0.2px;
  margin-right: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ao-hud .ao-title .ao-emoji { font-size: 18px; }
.ao-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--ao-panel);
  border: 1px solid var(--ao-panel-line);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ao-stat b { font-size: 15px; }
.ao-stat .ao-k { color: var(--ao-faint); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }

/* ---- Stage ---- */
.ao-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 12px;
  gap: 12px;
  overflow: auto;
}
.ao-row { display: flex; gap: 12px; flex-wrap: wrap; }
.ao-panel {
  background: var(--ao-panel);
  border: 1px solid var(--ao-panel-line);
  border-radius: var(--ao-radius);
  padding: 12px;
  box-shadow: var(--ao-shadow);
}
.ao-grow { flex: 1 1 0; min-width: 0; }

/* ---- Buttons & chips ---- */
.ao-btn {
  appearance: none;
  border: 1px solid var(--ao-panel-line);
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.03));
  color: var(--ao-fg);
  font: inherit;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .15s ease, background .15s ease;
}
.ao-btn:hover { transform: translateY(-1px); }
.ao-btn:active { transform: translateY(1px) scale(.98); }
.ao-btn.ao-primary {
  background: linear-gradient(135deg, var(--ao-accent), var(--ao-accent2));
  border-color: transparent;
  box-shadow: 0 8px 22px rgba(255, 93, 177, .35);
}
.ao-btn.ao-gold {
  background: linear-gradient(135deg, #ffd166, #ff9a3d);
  color: #3a2400;
  border-color: transparent;
}
.ao-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.ao-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--ao-panel-line);
  background: var(--ao-panel);
  cursor: pointer;
  font-weight: 600;
  transition: transform .08s ease, border-color .15s ease, background .15s ease;
}
.ao-chip:hover { transform: translateY(-1px); }
.ao-chip.ao-on { border-color: var(--ao-accent); background: rgba(255, 93, 177, .18); }

/* ---- Swatches / palette ---- */
.ao-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.ao-swatch {
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 2px solid rgba(255,255,255,.25);
  cursor: pointer;
  transition: transform .08s ease, box-shadow .12s ease;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.15);
}
.ao-swatch:hover { transform: scale(1.08); }
.ao-swatch.ao-on { border-color: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.35); transform: scale(1.06); }

/* ---- Avatar / canvas frame ---- */
.ao-canvaswrap {
  position: relative;
  display: grid;
  place-items: center;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255,255,255,.10), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(0,0,0,.12));
  border-radius: var(--ao-radius);
  border: 1px solid var(--ao-panel-line);
  overflow: hidden;
}
.ao-canvaswrap svg, .ao-canvaswrap canvas { display: block; max-width: 100%; height: auto; }

/* ---- Toast / overlay ---- */
.ao-toast {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%);
  background: rgba(0,0,0,.7);
  border: 1px solid var(--ao-panel-line);
  padding: 8px 16px; border-radius: 999px;
  font-weight: 700; pointer-events: none; opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
  z-index: 30; white-space: nowrap;
}
.ao-toast.ao-show { opacity: 1; transform: translateX(-50%) translateY(4px); }

.ao-overlay {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: rgba(10, 4, 12, .72);
  backdrop-filter: blur(4px);
  z-index: 40; padding: 20px;
}
.ao-card {
  width: min(440px, 100%);
  background: linear-gradient(180deg, rgba(42,21,48,.96), rgba(26,15,31,.96));
  border: 1px solid var(--ao-panel-line);
  border-radius: 20px;
  padding: 24px;
  text-align: center;
  box-shadow: var(--ao-shadow);
}
.ao-card h2 { margin: 0 0 6px; font-size: 24px; }
.ao-card p { margin: 6px 0; color: var(--ao-muted); }
.ao-card .ao-big { font-size: 44px; font-weight: 900; margin: 8px 0; color: var(--ao-gold); font-variant-numeric: tabular-nums; }
.ao-card .ao-stars { font-size: 30px; letter-spacing: 4px; }
.ao-actions { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }

/* ---- Leaderboard ---- */
.ao-lb { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 14px; }
.ao-lb th, .ao-lb td { padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--ao-panel-line); }
.ao-lb th { color: var(--ao-faint); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.ao-lb tr.ao-me td { color: var(--ao-gold); font-weight: 800; }
.ao-lb td:last-child, .ao-lb th:last-child { text-align: right; }

/* ---- Progress / target ---- */
.ao-bar { height: 10px; border-radius: 999px; background: rgba(0,0,0,.35); overflow: hidden; border: 1px solid var(--ao-panel-line); }
.ao-bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--ao-accent), var(--ao-accent2)); transition: width .25s ease; }

.ao-label { font-size: 12px; color: var(--ao-faint); text-transform: uppercase; letter-spacing: .6px; margin: 0 0 6px; }
.ao-center { text-align: center; }
.ao-muted { color: var(--ao-muted); }
.ao-hide { display: none !important; }

/* tiles grid (memory, quiz, sort, spot) */
.ao-grid { display: grid; gap: 8px; }
.ao-tile {
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  border: 1px solid var(--ao-panel-line);
  background: var(--ao-panel);
  display: grid; place-items: center;
  font-size: clamp(22px, 7vw, 40px);
  cursor: pointer;
  transition: transform .12s ease, background .2s ease, opacity .3s ease;
}
.ao-tile:hover { transform: translateY(-2px); }
.ao-tile.ao-face { background: linear-gradient(135deg, var(--ao-accent), var(--ao-accent2)); }
.ao-tile.ao-done { opacity: .35; pointer-events: none; }

.ao-confetti { position: absolute; inset: 0; pointer-events: none; z-index: 35; }

@media (max-width: 560px) {
  .ao-hud { font-size: 13px; gap: 6px; padding: 8px 10px; }
  .ao-stat { padding: 3px 8px; }
  .ao-stage { padding: 10px; gap: 10px; }
}
