/* ChoresOfDuty Arcade — shared premium theme.
   Dark, polished, playful-but-classy. Mobile-first and touch-friendly so the same
   pages feel native once wrapped as an iOS/Android app. */

:root {
  --bg:        #0c0f1a;
  --bg-2:      #141a2e;
  --card:      #1a2038;
  --card-2:    #20284a;
  --line:      #2b3358;
  --text:      #eef1ff;
  --muted:     #9aa3c7;
  --accent:    #7c5cff;   /* violet */
  --accent-2:  #19d3c5;   /* teal   */
  --gold:      #ffcc4d;   /* points */
  --danger:    #ff5d73;
  --radius:    18px;
  --shadow:    0 10px 40px rgba(0,0,0,.45);
  --font:      'Baloo 2', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

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

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(124,92,255,.18), transparent 60%),
    radial-gradient(1000px 500px at -10% 10%, rgba(25,211,197,.12), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  /* respect phone notches / safe areas when wrapped natively */
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

a { color: inherit; text-decoration: none; }

/* ---- App header (shared by arcade + games) ---- */
.app-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px clamp(16px, 4vw, 32px);
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(to bottom, rgba(12,15,26,.92), rgba(12,15,26,.6));
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.app-header .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .2px; }
.app-header .brand .logo {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; font-size: 20px; box-shadow: var(--shadow);
}
.app-header .spacer { flex: 1; }

/* points pill */
.points-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  background: linear-gradient(135deg, rgba(255,204,77,.16), rgba(255,204,77,.06));
  border: 1px solid rgba(255,204,77,.35);
  color: var(--gold); font-weight: 800; font-variant-numeric: tabular-nums;
}
.points-pill .coin { font-size: 18px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.4)); }

/* buttons */
.btn {
  appearance: none; border: 0; cursor: pointer; font-family: var(--font);
  font-weight: 800; font-size: 15px; color: #0c0f1a;
  padding: 11px 18px; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: var(--shadow); transition: transform .08s ease, filter .15s ease;
  touch-action: manipulation;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.btn.gold  { background: linear-gradient(135deg, var(--gold), #ffb020); }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: grayscale(.3); }

/* layout */
.wrap { max-width: 1040px; margin: 0 auto; padding: clamp(20px, 5vw, 44px) clamp(16px, 4vw, 32px); }
.hero h1 { font-size: clamp(30px, 6vw, 48px); margin: .2em 0 .1em; line-height: 1.1; }
.hero p  { color: var(--muted); font-size: clamp(15px, 2.5vw, 19px); max-width: 60ch; margin: 0; }
.gradient-text { background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* game grid */
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin-top: 28px; }
.game-card {
  display: flex; flex-direction: column;
  background: linear-gradient(160deg, var(--card), var(--card-2));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
  transition: transform .14s ease, border-color .14s ease;
}
.game-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.game-card .thumb { font-size: 44px; line-height: 1; margin-bottom: 12px; }
.game-card h3 { margin: 0 0 4px; font-size: 19px; }
.game-card p  { margin: 0 0 14px; color: var(--muted); font-size: 14px; flex: 1; }
.game-card .cost { color: var(--gold); font-weight: 800; }
.coming-soon { opacity: .55; }

/* modal / dialog */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(6,8,16,.66); backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 20px;
}
.dialog {
  width: min(420px, 92vw);
  background: linear-gradient(160deg, var(--card), var(--card-2));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow);
}
.dialog h2 { margin: 0 0 6px; }
.dialog p  { color: var(--muted); margin: 0 0 18px; }
.field { display: block; margin-bottom: 12px; }
.field input {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  background: #0e1326; border: 1px solid var(--line); color: var(--text);
  font-family: var(--font); font-size: 16px;
}
.field input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.dialog .row { display: flex; gap: 10px; margin-top: 6px; }
.dialog .row .btn { flex: 1; }
.error { color: var(--danger); font-size: 14px; min-height: 18px; margin: 4px 0 0; }

/* small print */
.note { color: var(--muted); font-size: 13px; }
.demo-banner {
  margin: 0; padding: 8px clamp(16px,4vw,32px);
  background: rgba(25,211,197,.1); border-bottom: 1px solid var(--line);
  color: var(--accent-2); font-size: 13px; font-weight: 700; text-align: center;
}

/* full-screen game stage */
.stage { display: grid; place-items: center; padding: 16px; }
canvas.game { width: 100%; max-width: 480px; aspect-ratio: 3 / 4; background: #0a0e1c; border: 1px solid var(--line); border-radius: var(--radius); touch-action: none; box-shadow: var(--shadow); }
.hud { display: flex; gap: 16px; justify-content: center; margin: 10px 0 0; color: var(--muted); font-weight: 700; }
.hud b { color: var(--text); }
