/* The morning style of the game (the map style comes with Issue #95).
   The tokens of the specification live here for now; the style file
   of the map is a separate JSON file later. */

/* The tokens of the morning (the spec, section 2.1). The map has its
   own style file; these are the tokens of the page itself. */
:root {
  --bg1: #f3f7f8;
  --bg2: #e6edef;
  --paper: var(--bg1);
  --ink: #2f4a52;
  --ink2: #6a8088;
  --muted: var(--ink2);
  --line: rgba(60, 90, 100, 0.14);
  --me: #e87c62;
  --guild: #84beb0;
  --teal: #3d807c;
  --fog: #f3f6f7;
  --street: #d3dcdf;
  --block: #eff2ee;
  --park: #bcd6c4;
  --water: #bcd7e1;
  --card: rgba(255, 255, 255, 0.62);
  --radius: 18px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  /* The cold white of the morning, with a little light in the corner. */
  background:
    radial-gradient(120% 80% at 85% 0%, #fbf3dc 0%, rgba(251, 243, 220, 0) 45%),
    linear-gradient(180deg, var(--bg1), var(--bg2));
  background-attachment: fixed;
  color: var(--ink);
  font-family: "Nunito", "Avenir Next", system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

/* The paper of the whole page: a fine grain, multiplied over
   everything (the spec, section 2.2). */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  mix-blend-mode: multiply;
  z-index: 40;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .45  0 0 0 0 .5  0 0 0 0 .55  0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top));
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  font-weight: 800;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--ink);
}

.nav {
  display: flex;
  gap: 14px;
  margin-left: auto;
  flex-wrap: wrap;
}

.nav a { color: var(--muted); text-decoration: none; font-size: 15px; }
.nav a:hover { color: var(--ink); }

.logout button {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

/* The cards are frosted glass (the spec, section 2.2): white at 62%,
   a blur of 14 px behind, a white line and a light on the top edge. */
/* The pages that are the screen itself: the map takes the whole
   width, the way the prototype does. */
.page-wide {
  max-width: none;
  padding: 0;
}

.card {
  background: var(--card);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(60, 90, 110, 0.12), inset 0 1px 0 #fff;
  padding: 20px;
  margin-bottom: 18px;
}

h1 { font-size: 24px; margin: 0 0 8px; }
h2 { font-size: 16px; margin: 22px 0 8px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.lead { margin: 0 0 16px; color: var(--muted); }
.hint { color: var(--muted); font-size: 14px; }
.muted { color: var(--muted); }
.error { color: #8c2f2f; }
.note { color: var(--me); }

/* The six bicycles of the settings page. */
.bike-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.bike {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
}

.bike.chosen { border-color: var(--me); box-shadow: 0 0 0 2px var(--me) inset; }
.bike input { position: absolute; opacity: 0; pointer-events: none; }
.bike img { image-rendering: auto; }
.bike-name { font-weight: 800; }
.bike small { color: var(--muted); font-size: 11px; text-align: center; }

.form { display: grid; gap: 6px; }
.form label { font-size: 13px; color: var(--muted); }
.form input[type="text"], .form input[type="email"], .form input[type="file"] {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.form button {
  margin-top: 10px;
  font: inherit;
  font-weight: 700;
  padding: 11px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--me);
  color: #fff;
}

.list { margin: 0; padding-left: 20px; }
.list li { margin: 6px 0; }

.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding: 6px 0;
}
.table td { padding: 8px 0; border-bottom: 1px solid var(--line); }

.state {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 13px;
  border: 1px solid var(--line);
}
.state-valid { background: #e6f0eb; border-color: #cfe0d8; }
.state-processing { background: #f2f0e6; border-color: #e2dfcd; }
.state-invalid { background: #f4e9e8; border-color: #e6d3d1; }
.state-needs_review { background: #eeeaf3; border-color: #ddd5e6; }

.rides { list-style: none; margin: 0; padding: 0; }
.rides li { display: flex; gap: 10px; align-items: center; padding: 6px 0; }
.rides .when { color: var(--muted); font-size: 14px; }
.rides .source { color: var(--muted); font-size: 13px; margin-left: auto; }

.footer {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px 40px;
  color: var(--muted);
  font-size: 13px;
}
.attribution { font-size: 12px; }

@media (prefers-color-scheme: dark) {
  :root {
    --bg1: #14171a;
    --bg2: #0f1214;
    --paper: var(--bg1);
    --ink: #ecebe6;
    --ink2: #97968d;
    --muted: var(--ink2);
    --line: #33332f;
    --card: rgba(34, 34, 32, 0.72);
  }
  .form input[type="text"], .form input[type="email"], .form input[type="file"] { background: #191917; }
}
