:root {
  --bg: #10140e;
  --bg-glow: #243024;
  --panel: #1a2016;
  --panel-edge: #313a2a;
  --text: #f3f0e6;
  --muted: #a3aa96;
  --gold: #e2b657;
  --open: #9ddeaf;
  --late: #e39a72;
  --unsure: #b7b3c7;
  --idle-edge: #3c4636;
  --danger: #e7b3a4;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, var(--bg-glow), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  line-height: 1.4;
}

button, select { font: inherit; color: inherit; }

.parallax {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.layer {
  position: absolute;
  inset: -140px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  will-change: transform;
}

.layer-bg {
  z-index: 1;
  inset: -16px;
  background-image: url("/static/parallax/bg.webp");
}

.layer-cloud1,
.layer-island,
.layer-cloud2 {
  background-size: 60% auto;
  background-position: center 28%;
}

.layer-cloud1 { z-index: 2; background-image: url("/static/parallax/cloud1.webp"); opacity: 0.82; }
.layer-island { z-index: 3; background-image: url("/static/parallax/island.webp"); }
.layer-cloud2 { z-index: 4; background-image: url("/static/parallax/cloud2.webp"); background-size: 72% auto; opacity: 0.82; }
.layer-fog { z-index: 5; background-image: url("/static/parallax/fog.webp"); }

.page {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 16px;
  max-width: 1156px;
  margin: 0 auto;
  padding: 36px 20px 0;
}

.column {
  flex: 1;
  min-width: 0;
  max-width: 980px;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 0;
  padding: 0 0 72px;
}

.side-ad {
  display: block;
  flex: none;
  width: 160px;
}

.bottom-ad {
  display: none;
  width: 728px;
  max-width: 100%;
  margin: 0 auto 36px;
  overflow-x: auto;
}

h1, .lede, .eyebrow {
  text-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  .layer { transform: none; }
}

.mast {
  display: flex;
  align-items: stretch;
  gap: 16px;
  margin-bottom: 22px;
}

.top {
  flex: 1;
  padding: 18px 20px;
  border: 1px solid rgba(243, 240, 230, 0.16);
  border-radius: 16px;
  background: rgba(16, 20, 14, 0.58);
  backdrop-filter: blur(12px);
}

.legend-box {
  flex: none;
  display: flex;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid rgba(243, 240, 230, 0.16);
  border-radius: 16px;
  background: rgba(16, 20, 14, 0.58);
  backdrop-filter: blur(12px);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-copy {
  min-width: 0;
}

h1 img,
.logo {
  display: block;
  flex: none;
  height: 112px;
  width: auto;
}

h1 {
  margin: 0;
  flex: none;
}

.for-classic {
  display: block;
  color: var(--text);
  font-family: Georgia, "Iowan Old Style", serif;
  font-style: italic;
  font-size: 22px;
  line-height: 1.2;
  text-decoration: none;
}

.for-classic:hover,
.for-classic:visited {
  color: var(--text);
}

.lede {
  margin: 6px 0 0;
  color: var(--muted);
}

.note {
  margin: 4px 0 0;
  color: #7e8672;
  font-size: 12px;
  font-style: italic;
}

.boss-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.world {
  margin: 0;
  padding: 6px 10px;
  border: 1px solid var(--panel-edge);
  border-radius: 999px;
  color: var(--text);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.panel {
  background: rgba(26, 32, 22, 0.46);
  border: 1px solid rgba(243, 240, 230, 0.18);
  border-radius: 16px;
  padding: 20px;
  backdrop-filter: blur(8px);
}

.boss-row {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  gap: 18px;
  align-items: end;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

select {
  appearance: none;
  background: #12170f url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23a3aa96' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") right 12px center no-repeat;
  border: 1px solid var(--panel-edge);
  border-radius: 8px;
  padding: 10px 36px 10px 12px;
  font-size: 16px;
}

select:focus-visible, .channel:focus-visible, .clear:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.map {
  margin: 0;
  font-size: 16px;
}

.window {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.status {
  min-height: 1.4em;
  margin: 16px 0 12px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
}

.slot { position: relative; }

.channel {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 10px 8px;
  border-radius: 10px;
  border: 1px solid var(--idle-edge);
  background: #141a12;
  cursor: pointer;
}

.channel .line {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-variant-numeric: tabular-nums;
}

.channel:hover { background: #1c2418; }

.channel .num {
  font-size: 15px;
  font-weight: 650;
}

.channel .time {
  font-size: 14px;
  color: var(--muted);
}

.channel .hint {
  height: 1.4em;
  line-height: 1.4;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.channel.waiting {
  border-color: var(--gold);
  background: #231e10;
}

.channel.waiting .time { color: var(--gold); }

.channel.open {
  border-color: var(--open);
  background: #172216;
}

.channel.open .time { color: var(--open); }

.channel.estimated {
  border-style: dashed;
  border-color: var(--unsure);
  background: #1a1c22;
}

.channel.estimated .time { color: var(--unsure); }

.channel:disabled { opacity: 0.7; cursor: progress; }

.clear {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
}

.clear:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 13px;
}

.legend li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid var(--idle-edge);
  background: #141a12;
}

.swatch.waiting { border-color: var(--gold); background: #231e10; }
.swatch.open { border-color: var(--open); background: #172216; }
.swatch.estimated {
  border-style: dashed;
  border-color: var(--unsure);
  background: #1a1c22;
}

.quiet {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 860px) {
  h1 img,
  .logo { height: 84px; }
  .mast { flex-direction: column; }
  .legend { flex-direction: row; flex-wrap: wrap; }
  .boss-row { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(4, 1fr); }
  .panel { padding: 16px; }
  .wrap { padding-bottom: 20px; }
  .side-ad { display: none; }
  .bottom-ad { display: block; }
}
