:root {
  --bg: #0b0714;
  --panel: #150d24;
  --line: #2a1d44;
  --text: #e9e4f5;
  --dim: #9a90b3;
  --cyan: #3fe6ff;
  --magenta: #ff3fd0;
  --yellow: #ffd84a;
  --red: #ff5a5a;
  --green: #4dff9a;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
header {
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
  padding: 0.9rem 1.5rem; border-bottom: 1px solid var(--line);
}
header .brand { font-weight: 800; letter-spacing: 0.12em; color: var(--magenta); text-shadow: 0 0 12px rgba(255, 63, 208, 0.6); }
header nav { display: flex; gap: 1rem; flex: 1; flex-wrap: wrap; }
header form { margin: 0; }
main { max-width: 1000px; margin: 0 auto; padding: 1.5rem; }
h1 { font-size: 1.6rem; margin: 0.2rem 0 1rem; }
h2 { font-size: 1.15rem; margin: 2rem 0 0.6rem; color: var(--cyan); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 1.2rem; }
.narrow { max-width: 420px; margin: 2rem auto; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.8rem; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 0.9rem 1rem; }
.tile .value { font-size: 1.6rem; font-weight: 700; color: var(--yellow); }
.tile .label { color: var(--dim); font-size: 0.85rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--line); }
th { color: var(--dim); font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.good { color: var(--green); }
.ok { color: var(--yellow); }
.bad { color: var(--red); }
.dim { color: var(--dim); }
label { display: block; margin: 0.8rem 0 0.25rem; color: var(--dim); }
input[type=text], input[type=email], input[type=password] {
  width: 100%; padding: 0.6rem 0.7rem; border-radius: 8px; border: 1px solid var(--line);
  background: #0e0918; color: var(--text); font-size: 1rem;
}
input.code { font-size: 1.6rem; letter-spacing: 0.3em; text-transform: uppercase; text-align: center; }
button {
  margin-top: 1rem; padding: 0.6rem 1.1rem; border-radius: 8px; border: 1px solid var(--cyan);
  background: transparent; color: var(--cyan); font-size: 1rem; cursor: pointer;
}
button:hover { background: rgba(63, 230, 255, 0.12); }
button.link { margin: 0; padding: 0; border: 0; color: var(--cyan); font-size: inherit; }
button.danger { border-color: var(--red); color: var(--red); }
.error { color: var(--red); margin: 0.6rem 0; }
.notice { color: var(--green); margin: 0.6rem 0; }
.chart { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding: 0.6rem; }
.chart .bar { flex: 1; background: linear-gradient(var(--magenta), var(--cyan)); border-radius: 3px 3px 0 0; min-height: 2px; }
.chart .bar.empty { background: var(--line); }
.chart.weeks { position: relative; }
.chart .bar.goal { background: linear-gradient(var(--yellow), var(--green)); }
.goal-line { position: absolute; left: 0.6rem; right: 0.6rem; border-top: 1px dashed var(--yellow); opacity: 0.7; }
.hist { display: flex; align-items: flex-end; gap: 4px; height: 140px; }
.hist div { flex: 1; text-align: center; font-size: 0.75rem; color: var(--dim); }
.hist .fill { background: var(--cyan); border-radius: 3px 3px 0 0; margin-bottom: 4px; }
.row { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.row input[type=text] { width: auto; flex: 1; }
footer { text-align: center; color: var(--dim); padding: 2rem; font-size: 0.85rem; }
@media (max-width: 600px) {
  main { padding: 1rem; }
  .hide-small { display: none; }
}

/* ---- front page: the synthwave factory floor ------------------------------------------------ */
.button {
  display: inline-block; padding: 0.7rem 1.4rem; border-radius: 999px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; font-size: 0.9rem; color: #12051f; background: linear-gradient(90deg, var(--yellow), var(--magenta));
  box-shadow: 0 0 18px rgba(255, 63, 208, 0.55);
}
.button:hover { text-decoration: none; filter: brightness(1.12); }
.button.steam { background: linear-gradient(90deg, var(--cyan), #6f8cff 45%, var(--magenta)); }
.button.ghost { background: transparent; color: var(--cyan); border: 2px solid var(--cyan); box-shadow: 0 0 14px rgba(63, 230, 255, 0.35); }

body.landing { background: #0a0614; position: relative; }
body.landing main { position: relative; z-index: 3; min-height: 420px; } /* the footer stays below the scene */
body.landing footer { position: relative; z-index: 3; }
body.landing header { position: absolute; top: 0; left: 0; right: 0; z-index: 5; border-bottom: 0; background: transparent; }

/* The scene is a backdrop: the title, buttons and the first stats sit on top of it, and its floor
   fades into the page. --horizon is how far up from the scene's bottom the floor meets the sky. */
.scene {
  --horizon: 44%;
  position: absolute; top: 0; left: 0; right: 0; height: 940px; overflow: hidden; isolation: isolate; z-index: 0;
  clip-path: inset(0); /* overflow alone doesn't always clip the tilted grid: it leaked below the scene */
  background: linear-gradient(#12051f 0%, #2a0b3d 30%, #5b1650 calc(94% - var(--horizon)),
    #3a0d3d calc(100% - var(--horizon)), #07040f calc(100.2% - var(--horizon)));
}
.scene::after { /* the floor running out into the dark */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 34%; z-index: 3; pointer-events: none;
  background: linear-gradient(rgba(10, 6, 20, 0), #0a0614 70%);
}
/* Stars: dots from two tiled layers, twinkling slowly. */
.sky {
  position: absolute; inset: 0 0 var(--horizon) 0;
  background-image:
    radial-gradient(1.5px 1.5px at 20px 30px, #fff, transparent), radial-gradient(1px 1px at 140px 80px, #ffd9f6, transparent),
    radial-gradient(1.2px 1.2px at 250px 20px, #fff, transparent), radial-gradient(1px 1px at 330px 140px, #bff6ff, transparent),
    radial-gradient(1.6px 1.6px at 90px 170px, #fff, transparent), radial-gradient(1px 1px at 200px 220px, #ff9be8, transparent);
  background-size: 360px 240px; opacity: 0.85; animation: twinkle 6s ease-in-out infinite alternate;
}
.sky::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(1px 1px at 60px 50px, #fff, transparent), radial-gradient(1.4px 1.4px at 170px 120px, #9ff0ff, transparent),
    radial-gradient(1px 1px at 280px 90px, #fff, transparent);
  background-size: 310px 190px; animation: twinkle 4s ease-in-out infinite alternate-reverse;
}
@keyframes twinkle { from { opacity: 0.45; } to { opacity: 1; } }

/* The sun: yellow into pink, its lower half cut into thinning stripes. */
.sun {
  position: absolute; left: 50%; bottom: var(--horizon); width: min(38vw, 320px); aspect-ratio: 1; transform: translate(-50%, 45%);
  border-radius: 50%; z-index: 0;
  background: linear-gradient(#fffbe0 0%, #ffe98a 35%, #ffb36b 58%, #ff5fc4 82%, #ff3fd0 100%);
  -webkit-mask-image: linear-gradient(#000 34%, transparent 34%, transparent 36%, #000 36%, #000 43%, transparent 43%, transparent 45.5%, #000 45.5%, #000 51%, transparent 51%, transparent 54%, #000 54%, #000 58%, transparent 58%, transparent 62%, #000 62%);
          mask-image: linear-gradient(#000 34%, transparent 34%, transparent 36%, #000 36%, #000 43%, transparent 43%, transparent 45.5%, #000 45.5%, #000 51%, transparent 51%, transparent 54%, #000 54%, #000 58%, transparent 58%, transparent 62%, #000 62%);
}
.sun-glow { /* outside the sun: its stripe mask would clip a shadow */
  position: absolute; left: 50%; bottom: var(--horizon); width: min(70vw, 620px); aspect-ratio: 1.6; transform: translate(-50%, 30%); z-index: 0;
  background: radial-gradient(closest-side, rgba(255, 214, 140, 0.55), rgba(255, 63, 208, 0.28) 55%, transparent);
}
.hills {
  position: absolute; left: -2%; width: 104%; bottom: var(--horizon); height: 30%; z-index: 1; object-fit: fill;
  filter: drop-shadow(0 0 6px rgba(255, 79, 224, 0.75));
}
/* The floor: a flat SVG with the perspective drawn in (static/floor.svg, made by a script), its
   lines rolling toward you. No CSS 3D: some GPUs composited the old tilted grid past the fade. */
.floor { position: absolute; left: 0; right: 0; bottom: 0; height: var(--horizon); z-index: 2; overflow: hidden; }
.floor::before { /* the glowing horizon line */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; z-index: 1;
  background: #6ff3ff; box-shadow: 0 0 18px 4px rgba(63, 230, 255, 0.8);
}
.grid { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.floor::after { /* fades the far grid into the haze */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(rgba(10, 6, 20, 0.85), rgba(10, 6, 20, 0) 45%);
}

/* Tall enough that the stats start on the floor, under the sun (the horizon is 56% down the scene). */
.hero-text { position: relative; z-index: 4; text-align: center; padding: 120px 16px 0; min-height: 556px; box-sizing: border-box; }
.kicker { margin: 0 0 0.6rem; color: var(--cyan); letter-spacing: 0.35em; text-transform: uppercase; font-size: 0.8rem; text-shadow: 0 0 10px rgba(63, 230, 255, 0.8); }
.neon {
  margin: 0.2rem 0 1.4rem; font-size: clamp(2.6rem, 10vw, 6.2rem); line-height: 1; font-weight: 900; font-style: italic;
  letter-spacing: 0.04em; color: #fff;
  text-shadow: 0 0 4px #fff, 0 0 12px var(--magenta), 0 0 28px var(--magenta), 0 0 60px rgba(255, 63, 208, 0.7);
}
.neon span { font-size: 0.42em; vertical-align: super; margin-left: 0.15em; color: var(--yellow); text-shadow: 0 0 10px var(--yellow), 0 0 26px #ff9a3f; }
.tagline { margin: 0 auto; font-size: 1.15rem; letter-spacing: 0.04em; max-width: 34rem; color: #f3dcff; text-shadow: 0 1px 8px #000; }
.cta { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; margin: 0; }
.cta.left { justify-content: flex-start; margin: 1rem 0; }

/* The numbers */
.floor-stats { position: relative; z-index: 3; padding-top: 1.8rem; }
.big-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.big-tile {
  border-radius: 14px; padding: 1.2rem 1.3rem; background: linear-gradient(160deg, #1d0f33, #0f0820);
  border: 1px solid var(--accent); box-shadow: 0 0 22px -6px var(--accent), inset 0 0 30px -18px var(--accent);
}
.big-tile.cyan { --accent: var(--cyan); }
.big-tile.magenta { --accent: var(--magenta); }
.big-tile.yellow { --accent: var(--yellow); }
.big-tile .value { font-size: clamp(2rem, 6vw, 2.8rem); font-weight: 900; font-style: italic; color: #fff; font-variant-numeric: tabular-nums;
  text-shadow: 0 0 14px var(--accent); line-height: 1.1; }
.big-tile .label, .small-tiles .label { color: var(--dim); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.78rem; margin-top: 0.3rem; }
.value small { font-size: 0.5em; font-style: normal; color: var(--dim); margin-left: 0.1em; }
.small-tiles { margin-bottom: 1.2rem; }
.small-tiles .value { color: var(--cyan); font-variant-numeric: tabular-nums; }
.panel.glow { box-shadow: 0 0 26px -12px var(--magenta); margin-bottom: 1rem; }
.panel h3 { margin: 0 0 0.8rem; font-size: 1rem; color: var(--yellow); }
.bars + h3 { margin-top: 1.4rem; }
.days { display: flex; align-items: flex-end; gap: 3px; height: 130px; }
.day { flex: 1; border-radius: 3px 3px 0 0; background: linear-gradient(var(--magenta), var(--cyan)); box-shadow: 0 0 8px rgba(255, 63, 208, 0.5); }
.day.none { background: var(--line); box-shadow: none; }
.axis { display: flex; justify-content: space-between; color: var(--dim); font-size: 0.75rem; margin-top: 0.3rem; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 1rem; }
.two-col .panel { margin-bottom: 0; }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.65rem; }
.bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.2rem 0.6rem; align-items: center; }
.bars .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars .num { color: var(--dim); font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.bars .track { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bars .fill { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--cyan), var(--magenta)); box-shadow: 0 0 8px var(--magenta); }
.bars.hard .fill { background: linear-gradient(90deg, var(--red), var(--magenta)); }
.bars.easy .fill { background: linear-gradient(90deg, var(--cyan), var(--green)); }
.panel.join { margin-top: 1rem; border-color: var(--magenta); }
.small { font-size: 0.85rem; }

@media (max-width: 600px) {
  .scene { height: 820px; --horizon: 40%; }
  .hero-text { padding-top: 84px; min-height: 510px; }
  body.landing main { min-height: 340px; }
  .sun { width: 62vw; }
  .big-tiles { grid-template-columns: 1fr 1fr; gap: 0.7rem; }
  .big-tile { padding: 0.9rem; }
}
@media (prefers-reduced-motion: reduce) {
  .sky, .sky::after { animation: none; }
}

.profile { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.profile img { border-radius: 8px; }
.profile-name { font-size: 1.2rem; font-weight: 700; }
.me-avatar { border-radius: 50%; }
.signin .button { margin: 0.4rem 0; }

/* ---- my shifts --------------------------------------------------------------------------------- */
.tagline b { color: #fff; }
.tagline .streak { color: var(--yellow); white-space: nowrap; }

.goal { margin-bottom: 1rem; }
.goal-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.goal h2 { margin: 0; color: var(--yellow); font-size: 1.1rem; }
.goal-count { margin: 0; color: var(--dim); }
.goal-count b { font-size: 1.9rem; color: #fff; font-style: italic; text-shadow: 0 0 12px var(--cyan); }
.goal-track { height: 14px; border-radius: 7px; background: var(--line); overflow: hidden; margin: 0.7rem 0 0.4rem; }
.goal-fill { height: 100%; border-radius: 7px; background: linear-gradient(90deg, var(--cyan), var(--magenta)); box-shadow: 0 0 14px var(--magenta); }
.goal-fill.done { background: linear-gradient(90deg, var(--yellow), var(--green)); box-shadow: 0 0 14px var(--green); }

.two-col + .two-col { margin-top: 1rem; }
.weeks-chart { position: relative; }
.weeks-chart .goal-line { left: 0; right: 0; z-index: 1; pointer-events: none; }
.day.hit { background: linear-gradient(var(--yellow), var(--green)); box-shadow: 0 0 8px rgba(77, 255, 154, 0.5); }

.list-title { margin: 2rem 0 0.8rem; color: var(--cyan); }
.shifts { display: grid; gap: 0.5rem; margin-bottom: 1rem; }
.shift {
  display: grid; grid-template-columns: 4.2rem minmax(0, 1fr) auto auto auto; gap: 1rem; align-items: center;
  padding: 0.75rem 1rem; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.shift:hover { text-decoration: none; border-color: var(--magenta); box-shadow: 0 0 16px -6px var(--magenta); }
.shift-when { display: flex; flex-direction: column; line-height: 1.2; }
.shift-when b { color: var(--cyan); }
.shift-what { display: flex; flex-wrap: wrap; gap: 0.2rem 0.6rem; align-items: baseline; }
.shift-num { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; font-variant-numeric: tabular-nums; }
.tag { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--yellow); border: 1px solid var(--yellow); border-radius: 999px; padding: 0 0.45rem; }
.pill { min-width: 4.2rem; text-align: center; padding: 0.25rem 0.6rem; border-radius: 999px; font-weight: 700; font-variant-numeric: tabular-nums; border: 1px solid currentColor; }
.pill.good { color: var(--green); box-shadow: 0 0 10px -3px var(--green); }
.pill.ok { color: var(--yellow); }
.pill.bad { color: var(--red); }
.first-shift h2 { margin-top: 0; color: var(--yellow); }

@media (max-width: 600px) {
  .shift { grid-template-columns: 3.6rem minmax(0, 1fr) auto auto; gap: 0.6rem; }
}
.more-shifts { margin-bottom: 1rem; }
.more-shifts summary { cursor: pointer; color: var(--cyan); padding: 0.4rem 0 0.8rem; }
@media (max-width: 600px) { .small-tiles { grid-template-columns: 1fr 1fr; } }

/* ---- every page: the shared layout ---------------------------------------------------------- */
.neon a { color: inherit; text-decoration: none; }
.back { display: table; margin: 0 0 1rem; padding: 0.35rem 0.9rem; border-radius: 999px; color: var(--dim);
  background: rgba(10, 6, 20, 0.85); border: 1px solid var(--line); font-size: 0.9rem; }
.narrow-panel { max-width: 560px; margin-left: auto; margin-right: auto; }
.two-col { margin-bottom: 1rem; }
.panel table { margin-top: 0.2rem; }
.panel p:last-child, .panel ul:last-child { margin-bottom: 0; }
ul.plain { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.45rem; }
.danger-zone { border-color: rgba(255, 90, 90, 0.45); }
.danger-zone h3 { color: var(--red); }
.notice { text-align: center; }

/* ---- a shift: arrows to its neighbours, and the graph from the game ------------------------- */
.shift-nav { display: grid; grid-template-columns: 1fr auto 1fr; gap: 0.6rem; align-items: center; margin-bottom: 1rem; }
.shift-nav .back { margin: 0; }
.shift-nav > :first-child { justify-self: start; }
.shift-nav > :last-child { justify-self: end; }
.run-graph { display: block; width: 100%; height: 220px; }
.graph-legend { display: flex; gap: 1.4rem; flex-wrap: wrap; margin: 0.5rem 0 0; font-weight: 600; }
.graph-legend .heart { color: #ff294d; }
.graph-legend .intensity { color: #ffd11f; }
.swatch { display: inline-block; width: 0.7em; height: 0.7em; border-radius: 3px; margin-right: 0.5em; vertical-align: 0.05em; }
