/* Kneecap Riddle — shared styles for every page.
   Puzzle pages load this plus puzzle.css. */

:root {
  --field:    #0a2740;
  --field-lo: #06192b;
  --rule:     #1b4a70;
  --print:    #d8e7f2;
  --print-dim:#7fa3bf;
  --brass:    #e8b04b;

  --panel: #06202f;  /* the sheet content sits on */
  --raise: #0e2c47;  /* buttons */
  --sink:  #01090f;  /* inputs */
  --edge:  #2f6288;  /* input and plate borders */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  padding: 2rem 1.25rem 5rem;
  background-color: var(--field);
  background-image:
    linear-gradient(var(--rule) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--print);
  font-family: "Newsreader", Georgia, serif;
  font-weight: 300;
}

/* The sheet: an opaque plate over the grid, with a second rule set in
   from the edge the way a drawing plate is bordered. */
.sheet {
  position: relative;
  width: min(46rem, 100%);
  margin: 0 auto;
  padding: 2rem;
  border: 1px solid var(--edge);
  background: var(--panel);
}

.sheet::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid var(--rule);
  pointer-events: none;
}

.sheet > * { position: relative; }

@media (min-width: 40rem) {
  .sheet { padding: 3rem 3.25rem; }
}

/* Title block across the top of the plate: site name on the left, which
   is also the way home, and what you are looking at on the right. */
.plate {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 2.5rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--rule);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--print-dim);
}

.plate a { color: inherit; text-decoration: none; }
.plate a:hover, .plate a:focus-visible { color: var(--brass); }

h1 {
  font-size: 2.6rem;
  font-weight: 300;
  font-style: italic;
  line-height: 1.1;
  margin: 0 0 1.25rem;
}

.lede {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--print-dim);
  margin: 0 0 2.75rem;
  max-width: 32rem;
}

/* ---- buttons ---- */

.menu {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  align-items: flex-start;
}

.btn, button {
  padding: 0.7rem 1.7rem;
  border: 1px solid var(--rule);
  background: var(--raise);
  color: var(--print);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}

.btn { display: inline-block; }

.btn:hover, .btn:focus-visible,
button:hover:not(:disabled), button:focus-visible:not(:disabled) {
  background: var(--brass);
  border-color: var(--brass);
  color: var(--field-lo);
  outline: none;
}

button:disabled { opacity: 0.4; cursor: default; }

/* ---- forms ---- */

form { max-width: 24rem; }
form[hidden] { display: none; }

label { display: block; margin-bottom: 1.3rem; }

.label-text {
  display: block;
  margin-bottom: 0.4rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--print-dim);
}

input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--edge);
  background: var(--sink);
  color: var(--print);
  font-family: "IBM Plex Mono", monospace;
  font-size: 1rem;
}

input:focus {
  outline: none;
  border-color: var(--brass);
  box-shadow: 0 0 0 1px var(--brass);
}

.hint {
  display: block;
  margin-top: 0.4rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.66rem;
  line-height: 1.6;
  color: var(--print-dim);
}

/* ---- tabs ---- */

.tabs { display: flex; gap: 0.4rem; margin-bottom: 1.75rem; }

.tab {
  padding: 0.5rem 1.3rem;
  background: var(--sink);
  color: var(--print-dim);
  font-size: 0.72rem;
}

.tab[aria-selected="true"] {
  background: var(--raise);
  border-color: var(--edge);
  color: var(--print);
}

/* ---- table ---- */

table {
  width: 100%;
  border-collapse: collapse;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.85rem;
}

th {
  text-align: left;
  padding: 0 0 0.7rem;
  border-bottom: 1px solid var(--edge);
  font-weight: 500;
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--print-dim);
}

td { padding: 0.85rem 0; border-bottom: 1px solid var(--rule); }

th:not(:first-child), td:not(:first-child) { text-align: right; }

/* ---- odds and ends ---- */

.mono, .status {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  color: var(--print-dim);
}

.message {
  margin: 1.4rem 0 0;
  min-height: 1.4em;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  line-height: 1.6;
}

.message.good { color: var(--brass); }

.note {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  line-height: 1.8;
  color: var(--print-dim);
}

.note a { color: var(--brass); }

dl { margin: 0 0 2.25rem; }

dt {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--print-dim);
  margin-bottom: 0.3rem;
}

dd { margin: 0 0 1.4rem; font-family: "IBM Plex Mono", monospace; }

.stat { color: var(--brass); }
