:root {
  --ink: #130e36;
  --ink-2: #1d1748;
  --panel: #221b55;
  --line: #3a3078;
  --text: #ffffff;
  --muted: #b9b3dc;
  --sun: #fd7d12;
  --coral: #ff6b5a;
  --mint: #3ddc97;
  --danger: #ff8a7d;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--ink);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }
/* Anything marked hidden stays hidden, whatever display its class sets. */
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(120% 60% at 50% -10%, #3d3a8f 0%, rgba(61, 58, 143, 0) 70%),
    var(--ink);
  background-attachment: fixed;
}
img { max-width: 100%; display: block; }
a { color: var(--sun); }

main {
  max-width: 480px;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 20px max(32px, env(safe-area-inset-bottom));
  display: grid;
  gap: 20px;
}

/* Top bar */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 22px; letter-spacing: -0.02em; color: var(--text); text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
/* Share (home top bar): a tinted bar button, 44px tall so it's easy to tap. */
button.share {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  min-height: 44px; padding: 0 2px; border-radius: 10px;
  background: none; color: var(--sun); font-size: 17px; font-weight: 600;
}
button.share svg { width: 16px; height: 18px; flex: none; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--sun); text-decoration: none; font-size: 17px; font-weight: 600; padding: 8px 0; }
.back svg { width: 12px; height: 20px; }

.hello h1 { margin: 0; font-size: 30px; line-height: 1.1; letter-spacing: -0.02em; }
.hello p { margin: 6px 0 0; color: var(--muted); font-size: 16px; }

/* The launcher: apps as Home Screen icons, each with its developer. */
.apps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px 12px; padding: 4px 0; }
.app { display: grid; justify-items: center; gap: 6px; text-decoration: none; color: var(--text); text-align: center; }
.app .tile {
  width: 100%; max-width: 72px; aspect-ratio: 1; border-radius: 22%;
  display: grid; place-items: center; overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  transition: transform 0.12s ease;
}
.app:active .tile { transform: scale(0.94); }
.app .tile svg { width: 100%; height: 100%; display: block; }
.app .name { font-size: 13px; font-weight: 600; line-height: 1.15; }
.app .by { font-size: 11px; color: var(--muted); line-height: 1.1; margin-top: -3px; }

/* Panels */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  display: grid;
  gap: 12px;
}
.panel h2 { margin: 0; font-size: 19px; letter-spacing: -0.01em; }
.panel p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.45; }
.panel .lead { color: var(--text); font-size: 17px; }

form { display: grid; gap: 12px; }
label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--muted); }
input {
  font: inherit;
  font-size: 17px;
  color: var(--text);
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--ink-2);
  width: 100%;
}
input::placeholder { color: #7f78ad; }
input:focus { outline: 2px solid var(--sun); outline-offset: 1px; border-color: transparent; }
input.plate { text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

button {
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  padding: 14px 16px;
  border-radius: 14px;
  border: 0;
  cursor: pointer;
  background: var(--sun);
  color: var(--ink);
}
button:disabled { opacity: 0.55; cursor: default; }
button.secondary { background: transparent; color: var(--text); border: 1px solid var(--line); }
button.wallet { background: #000; color: #fff; border: 1px solid #4a4a4a; }
button.small { font-size: 15px; padding: 9px 12px; border-radius: 11px; }
button.link {
  background: none; color: var(--sun); padding: 0; font-size: 15px; font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px; border-radius: 0;
}
button.google {
  background: #fff; color: #1f1f1f;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > button { flex: 1; }

.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

.status { margin: 0; min-height: 1.3em; color: var(--muted); font-size: 15px; }
.status.error { color: var(--danger); }
.status.ok { color: var(--mint); }

footer { text-align: center; color: var(--muted); font-size: 14px; }
footer button.link { font-size: 14px; }

/* Install hint (Safari, before WalletPlay is on the Home Screen) */
.install { display: flex; gap: 12px; align-items: center; }
.install img { width: 44px; height: 44px; border-radius: 11px; flex: none; }
.install p { color: var(--text); }
.install svg { width: 16px; height: 18px; vertical-align: -3px; }

/* The One */
.app-head { display: flex; align-items: center; gap: 14px; }
.app-head .tile { width: 60px; height: 60px; border-radius: 22%; overflow: hidden; flex: none; box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.app-head .tile svg { width: 100%; height: 100%; display: block; }
.app-head h1 { margin: 0; font-size: 28px; letter-spacing: -0.02em; line-height: 1.1; }
.app-head .by { color: var(--muted); font-size: 14px; }

.where { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; color: var(--muted); font-size: 14px; }
.where strong { color: var(--text); font-weight: 600; }

.today { padding: 0; overflow: hidden; gap: 0; }
.today .photo { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--ink-2); }
.today .body { padding: 16px 18px 18px; display: grid; gap: 10px; }
.today .kicker { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sun); }
.today .car { margin: 0; font-size: 26px; line-height: 1.1; letter-spacing: -0.02em; }
.facts { display: flex; gap: 8px; flex-wrap: wrap; }
.fact { font-size: 13px; font-weight: 600; padding: 5px 10px; border-radius: 99px; background: var(--ink-2); color: var(--muted); border: 1px solid var(--line); }
.fact.hot { background: rgba(255, 107, 90, 0.16); color: #ffb4aa; border-color: rgba(255, 107, 90, 0.4); }
.fact.good { background: rgba(61, 220, 151, 0.14); color: #9af0c9; border-color: rgba(61, 220, 151, 0.4); }

.spot {
  width: 100%; border-radius: 20px; padding: 20px 16px; font-size: 22px;
  background: linear-gradient(135deg, var(--sun), #ffa53d);
  display: grid; gap: 4px; justify-items: center;
  box-shadow: 0 10px 24px rgba(253, 125, 18, 0.3);
}
.spot small { font-size: 14px; font-weight: 600; opacity: 0.8; }

.result { text-align: center; justify-items: center; }
.result .big { font-size: 44px; line-height: 1; }
.result h2 { font-size: 24px; }

.mycar { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; }
.mycar img { width: 96px; height: 72px; object-fit: cover; border-radius: 12px; background: var(--ink-2); }
.mycar .label { font-size: 17px; font-weight: 700; }
.mycar .meta { color: var(--muted); font-size: 14px; }
.preview { width: 100%; max-height: 220px; object-fit: cover; border-radius: 12px; }
.note { font-size: 14px !important; }
.stat { display: flex; justify-content: space-between; align-items: center; }
.stat strong { font-size: 28px; color: var(--sun); }

/* A plain vertical stack of blocks with the page spacing. */
.stack { display: grid; gap: 20px; }

/* A panel that folds to its title row (the WalletPlay card on the home page). */
details.fold { gap: 0; }
details.fold summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
details.fold summary::-webkit-details-marker { display: none; }
details.fold summary h2 { flex: 1; }
details.fold .hint { color: var(--mint); font-size: 14px; font-weight: 600; }
details.fold .chev { width: 14px; height: 8px; color: var(--muted); transition: transform 0.2s ease; }
details.fold[open] .chev { transform: rotate(180deg); }
details.fold .fold-body { display: grid; gap: 12px; padding-top: 12px; }

/* Google's Add to Google Wallet badge: shown at its own size and shape. */
button.gwallet { background: none; padding: 0; border-radius: 25px; justify-self: center; line-height: 0; }
button.gwallet img { height: 50px; width: auto; }

/* Wider pages (developer portal, app review). */
main.wide { max-width: 760px; }
.list { display: grid; gap: 14px; }
.item { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: grid; gap: 10px; }
.item header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.item h3 { margin: 0; font-size: 17px; }
.item p { margin: 0; }
.row-left { display: flex; align-items: center; gap: 10px; }
.appicon { width: 40px; height: 40px; border-radius: 22%; }
.meta { color: var(--muted); font-size: 14px; }
.pill { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--ink-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.pill.live { color: #9af0c9; border-color: rgba(61, 220, 151, 0.4); }
.pill.rejected { color: #ffb4aa; border-color: rgba(255, 107, 90, 0.4); }
textarea { font: inherit; font-size: 16px; color: var(--text); padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--ink-2); width: 100%; min-height: 70px; resize: vertical; }
select { font: inherit; font-size: 16px; color: var(--text); padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--ink-2); width: 100%; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); }
label.check input { width: 20px; height: 20px; padding: 0; }
label.file input { padding: 8px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-items: end; }
.product { padding: 10px; border: 1px dashed var(--line); border-radius: 12px; }
details.submit summary { cursor: pointer; font-weight: 700; color: var(--sun); }
details.submit form { margin-top: 12px; }
.rules { margin: 0; padding-left: 20px; color: var(--muted); display: grid; gap: 6px; }
pre.code { margin: 0; padding: 12px; border-radius: 12px; background: #0c0924; color: #d9d4ff; font-size: 13px; overflow-x: auto; white-space: pre; }
code { background: #0c0924; padding: 1px 5px; border-radius: 5px; }
iframe.preview { width: 100%; height: 520px; border: 1px solid var(--line); border-radius: 12px; background: #000; }

/* The play page: a developer's app fills the screen under a thin bar. */
body.playing { background: #000; }
.play { display: flex; flex-direction: column; height: 100dvh; }
.play-bar { display: flex; align-items: center; gap: 14px; padding: max(8px, env(safe-area-inset-top)) 14px 8px; background: var(--ink); }
.play-title { display: grid; line-height: 1.15; }
.play-title span { color: var(--muted); font-size: 12px; }
.play-status { padding: 0 14px; background: var(--ink); }
.play-status:empty { display: none; }
.play iframe { flex: 1; width: 100%; border: 0; background: #000; }
.sheet { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); display: grid; align-items: end; z-index: 10; }
.sheet-body { background: var(--ink); border-radius: 20px 20px 0 0; padding: 16px 16px max(20px, env(safe-area-inset-bottom)); display: grid; gap: 12px; max-height: 90dvh; overflow: auto; }

.app .tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.devlink { text-align: center; margin: 0; font-size: 14px; }
