/* The website's look for the preview. style.css, renderer.js and index.html are copied from the app on deploy
   (deploy/preview.js); this file is not, and deploy.sh adds its <link> back.
   body:where(...) keeps specificity low, so the app's other window styles and layouts still win. */
:root {
  --bg: #0f1245;
  --card: #1c2064;
  --line: #373d92;
  --text: #f6f5ff;
  --muted: #b9bdf2;
  --accent: #6d74f5;
  --accent-2: #a77bf0;
  --good: #5ef2b0;
}
body { font-size: 12.5px; }
body:where([data-look="default"]) { background: radial-gradient(760px 520px at 62% 0%, color-mix(in srgb, #4b52d6 var(--room, 80%), transparent), transparent), var(--bg); }
/* a picked theme brings its own colours, so the indigo light steps back */
body[style*="--bg"] { --room: 0%; }
.titlebar { height: 40px; font-size: 13px; font-weight: 700; }
.titlebar::before { content: ""; width: 28px; height: 28px; background: url(../namechecker.webp) center / contain no-repeat; }
.gear { margin-right: 0; font-size: 17px; }
main { padding-top: 2px; }

body:where([data-look="default"]) .card { border-color: transparent; border-radius: 18px; background: color-mix(in srgb, var(--card) 82%, transparent); }
body:where([data-look="default"]) :is(.segmented, .segmented button, .ghost, select, .primary, .tile .actions button, .checkbar input, input[type="password"]) { border-radius: 99px; }
body:where([data-look="default"]) :is(textarea, .row .ghost.wide) { border-radius: 14px; }
body:where([data-look="default"]) .primary { padding: 11px; font-size: 14px; color: var(--bg); background: var(--text); box-shadow: 0 5px 0 var(--accent); }
body:where([data-look="default"]) .primary.stop { color: #fff; background: #c72e46; box-shadow: 0 5px 0 #7d1427; }
.primary { margin-bottom: 4px; }
.ghost { font-weight: 600; }

/* the numbers read as one scoreboard */
.stat { padding: 8px 14px; }
.stat strong { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
body:where([data-look="default"]) .stat.good { background: var(--good); }
body:where([data-look="default"]) .stat.good :is(.label, strong) { color: var(--bg); }

/* every found name is a little name badge */
#free { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 8px; }
.tile { animation: badge .45s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes badge { from { opacity: 0; scale: .6; rotate: -8deg; } }
body:where([data-look="default"]) .tile { border: 0; border-radius: 14px; padding: 6px 9px 9px; background: var(--text); color: var(--bg); box-shadow: inset 0 -3px 0 var(--good); }
body:where([data-look="default"]) .tile::before { content: ""; justify-self: center; width: 24px; height: 4px; border-radius: 4px; background: var(--bg); opacity: .5; }
body:where([data-look="default"]) .tile :is(small, .pop) { color: color-mix(in srgb, var(--bg) 75%, var(--text)); }
body:where([data-look="default"]) .tile .pop { background: color-mix(in srgb, var(--bg) 10%, transparent); }
body:where([data-look="default"]) .tile .pop.hot { background: var(--good); color: var(--bg); }
body:where([data-look="default"]) .tile small.unsure { color: color-mix(in srgb, var(--warn) 45%, var(--bg)); }
body:where([data-look="default"]) .tile .name { font-size: 18px; color: var(--bg); }
body:where([data-look="default"]) .tile .actions button { background: color-mix(in srgb, var(--bg) 10%, transparent); color: var(--bg); }
body:where([data-look="default"]) .tile .actions button:hover { background: var(--bg); color: var(--text); }
body:where([data-look="default"]) .tile :focus-visible { outline-color: var(--bg); }
body[data-layout="list"] .tile::before { display: none; }
#settingsDialog { border-radius: 20px; }

/* narrow (phones): one column and a page that scrolls */
@media (max-width: 640px) {
  body, body[data-layout] { height: auto; min-height: 100vh; overflow: auto; }
  main, body[data-layout] main { display: flex; flex-direction: column; flex: none; }
  body[data-layout="mirrored"] .controls { order: 0; }
  .scroll { flex: none; overflow: visible; }
  .stats { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
  .panel.grow { flex: none; height: 360px; }
  .panel header { flex-wrap: wrap; gap: 6px; }
  .columns { grid-template-columns: 1fr; }
  .tile .actions button { padding: 5px 9px; font-size: 11px; }
}
