/* Shared style for the Amber web pages (start page, reset page). */
:root {
  color-scheme: dark;
  --bg: #15120f;
  --panel: #1f1a16;
  --field: #221d18;
  --line: #5a4c3d;
  --line-soft: #3a3129;
  --text: #e8dfd2;
  --muted: #a99a88;
  --accent: #8a5a2b;
  --accent-hover: #a06a35;
  --ok: #6fb4ff;   /* blue */
  --bad: #ffa040;  /* orange: colour-blind safe pair, never red/green */
}

* { box-sizing: border-box; }
a { color: #e0b083; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at top, #241d17 0%, var(--bg) 60%);
  color: var(--text);
  font: 16px/1.5 Georgia, "Times New Roman", serif;
}

main { width: min(380px, calc(100% - 32px)); padding: 32px 0; }

.brand { margin: 0 0 4px; font-size: 2.4rem; letter-spacing: .12em; text-align: center; }
.tagline { margin: 0 0 28px; text-align: center; color: var(--muted); font-size: .95rem; }

h1 { font-size: 1.5rem; margin: 0 0 1rem; letter-spacing: .02em; }

.card { background: var(--panel); border: 1px solid var(--line-soft); border-radius: 6px; padding: 20px; }

.tabs { display: flex; margin: -20px -20px 20px; border-bottom: 1px solid var(--line-soft); }
.tabs button {
  flex: 1; width: auto; padding: 12px; background: none; border: 0; border-bottom: 2px solid transparent;
  border-radius: 0; color: var(--muted); font: inherit; cursor: pointer;
}
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent-hover); }

label { display: block; margin-bottom: 1rem; font-size: .9rem; }
input {
  display: block; width: 100%; margin-top: .3rem; padding: .6rem;
  background: var(--field); color: inherit; border: 1px solid var(--line); border-radius: 4px; font: inherit;
}
input:focus { outline: 2px solid var(--accent-hover); outline-offset: 1px; }

button {
  width: 100%; padding: .7rem; background: var(--accent); color: #fff;
  border: 0; border-radius: 4px; font: inherit; cursor: pointer;
}
button:hover { background: var(--accent-hover); }
button:disabled { opacity: .6; cursor: wait; }
button.secondary { background: transparent; border: 1px solid var(--line); color: var(--text); }
button.secondary:hover { background: var(--field); }
button.link { width: auto; padding: 0; background: none; color: var(--muted); text-decoration: underline; font-size: .9rem; }

.error { color: var(--bad); }
.success { color: var(--ok); }
.hint { font-size: .85rem; color: var(--muted); }
.message:empty { display: none; }
.message { margin: 0 0 1rem; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 1rem; }

dl { margin: 0 0 1.2rem; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; }
dt { color: var(--muted); }
dd { margin: 0; word-break: break-word; }

.badge { display: inline-block; padding: 1px 8px; border: 1px solid var(--accent-hover); border-radius: 10px; font-size: .8rem; color: #e0b083; }

.invite { margin-top: 1rem; padding: 12px; background: var(--field); border: 1px dashed var(--line); border-radius: 4px; font-size: .9rem; }
.invite code { font-size: 1.2rem; letter-spacing: .1em; }
.invite input { font-size: .8rem; }

section + section { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line-soft); }
h2 { margin: 0 0 .8rem; font-size: 1.1rem; }

.status { display: flex; justify-content: center; gap: 20px; margin: 20px 0 0; font-size: .85rem; color: var(--muted); }
.status span { display: inline-flex; align-items: center; gap: 6px; cursor: default; }
.status i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.status .ok i { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.status .bad { color: var(--bad); }
.status .bad i { background: var(--bad); box-shadow: 0 0 6px var(--bad); border-radius: 1px; }  /* square: not only colour */
.status .ok::after { content: "✓"; color: var(--ok); }
.status .bad::after { content: "✕"; }

.characters { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.characters li { display: flex; flex-direction: column; padding: 10px 12px; background: var(--field); border: 1px solid var(--line); border-radius: 4px; }
.characters span { font-size: .85rem; color: var(--muted); }

[hidden] { display: none !important; }

/* World page (admin): wider, cards in a grid */
main.wide { width: min(1920px, calc(100% - 32px)); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.grid > .card + .card { margin-top: 0; padding-top: 20px; }
.grid.world { grid-template-columns: minmax(300px, 1fr) minmax(0, 3fr); }
@media (max-width: 900px) { .grid.world { grid-template-columns: 1fr; } }
.days { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 24px; }
.grid .span { grid-column: 1 / -1; }
.grid .card form + form { margin-top: 1.2rem; }
.big { font-size: 1.4rem; margin: 0 0 .3rem; }
h3 { margin: 1.2rem 0 .6rem; font-size: 1rem; }
select { display: block; width: 100%; margin-top: .3rem; padding: .6rem; background: var(--field); color: inherit; border: 1px solid var(--line); border-radius: 4px; font: inherit; }
table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; font-size: .9rem; }
th { text-align: left; font-weight: normal; color: var(--muted); padding: 4px 6px; }
td { padding: 2px 6px; }
td input { margin: 0; padding: .35rem .5rem; min-width: 4.5em; }
td.count { color: var(--muted); text-align: center; }
.scroll { overflow-x: auto; }
.mix-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 32px; }
table.ranges th { color: var(--text); white-space: nowrap; }
table.ranges thead th { color: var(--muted); }
.readout { font-size: 1.3rem; }
.readout dt { font-size: 1rem; align-self: center; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 1rem; }
.actions button { width: auto; flex: 1 1 auto; }
.now { padding: 12px 16px; background: var(--field); border: 1px solid var(--line-soft); border-radius: 4px; }
.now p { margin: 0; }
.forecast { list-style: none; margin: 0; padding: 0; }
.forecast li { padding: 4px 0; border-bottom: 1px solid var(--line-soft); }
.forecast .when { display: inline-block; width: 3.5em; color: var(--muted); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); font-size: .9rem; }
dialog { width: min(420px, calc(100% - 32px)); padding: 20px; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 6px; }
dialog::backdrop { background: rgb(0 0 0 / .6); }
.spaced { margin-top: 1.5rem; }

/* Tuning page */
.tuning + .tuning { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--line-soft); }
.tuning-head { display: flex; align-items: center; gap: 8px; }
.tuning .hint { margin: .2rem 0; }
.tuning-line { display: flex; align-items: center; gap: 8px; }
.tuning-line input { width: 7rem; margin: 0; }
.tuning-line button { width: auto; padding: .5rem .9rem; }
.tuning-line .unit { color: var(--muted); min-width: 3.5rem; }
.history { margin: 0; padding-left: 1.2rem; display: grid; gap: 4px; font-size: .9rem; }
.centered { text-align: center; }

/* Link that looks like a button; admin tiles */
a.button { display: block; padding: .7rem; text-align: center; text-decoration: none; border-radius: 4px; color: var(--text); }
a.button.secondary { border: 1px solid var(--line); }
a.button.secondary:hover { background: var(--field); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.tile { display: flex; flex-direction: column; gap: 6px; padding: 20px; background: var(--panel); border: 1px solid var(--line-soft); border-radius: 6px; color: var(--text); text-decoration: none; }
.tile:hover { border-color: var(--accent-hover); }
.tile span { font-size: .9rem; color: var(--muted); }
