/*
======================================================================
  GAME TOOLS  -  LOOK AND FEEL  (tools/shared/tools.css)
======================================================================
  The look of the tools list (tools/index.html), each game's tools page (5150 now, other games
  later) and any simple tool page: the same cyberpunk console style as
  the 5150 Character Generator, in its Amber terminal colours, on the
  black scales background, with hazard-stripe dividers.

  These pages load ONLY this file (not the main site's css/style.css),
  so the tools area has its own look. To change a colour everywhere in
  the tools area, change it in section 1.

  (The Character Generator has its own, bigger file, characters.css,
  with its colour scheme choices. Keep the two looking alike.)
======================================================================
*/


/* ------------------------------------------------------------------
   1. FONTS AND COLOURS
   Fonts are free for commercial use (SIL Open Font License; the
   licences sit next to them in tools/shared/fonts/).
------------------------------------------------------------------ */
@font-face {
  font-family: "Orbitron";
  src: url("fonts/Orbitron.ttf") format("truetype");
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: "Share Tech Mono";
  src: url("fonts/ShareTechMono.ttf") format("truetype");
  font-display: swap;
}

:root {
  --font-heading: "Orbitron", "Segoe UI", sans-serif;     /* titles          */
  --font-text:    "Share Tech Mono", Consolas, monospace; /* everything else */

  /* Amber terminal (the same colours as the Character Generator's default). */
  --ink:      #ffb347;                  /* glowing amber: titles, links, buttons */
  --ink-dim:  #d29a52;                  /* quieter amber                         */
  --accent:   #f4f4f2;                  /* white highlights (hovers, labels)     */
  --glow:     rgba(255, 179, 71, 0.42); /* the soft glow around titles           */
  --text:     #e4e8ec;                  /* main words                            */
  --soft:     #a3aab3;                  /* labels and small print                */
  --frame:    #555a61;                  /* plain grey frame lines                */
  --panel:    rgba(12, 14, 17, 0.9);    /* the boxes' dark background            */
  --well:     #07080a;                  /* inside typing boxes                   */
}


/* ------------------------------------------------------------------
   2. THE PAGE
------------------------------------------------------------------ */
* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-text);
  font-size: 17px;
  line-height: 1.5;
  /* The main site's black scales picture, darkened. The path is from
     this file (tools/shared/) up to the site's images folder. */
  background-color: #0b0c0d;
  background-image:
    linear-gradient(rgba(8, 9, 10, 0.72), rgba(8, 9, 10, 0.72)),
    url("../../images/texture-scales.jpg");
  background-size: auto, cover;
  background-attachment: fixed;
}

a { color: var(--ink); text-underline-offset: 0.2em; }
a:hover { color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* The middle column everything sits in. */
.tools-page {
  max-width: 60rem;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

/* The top: logo (tools list only), trail of links, big title, intro. */
.tools-crest { display: block; width: 120px; margin: 0 auto 12px; }
.tools-crest img { display: block; width: 100%; height: auto; }

.tool-trail { margin: 0 0 6px; font-size: 14px; color: var(--soft); }

h1 {
  margin: 0 0 10px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(26px, 5vw, 40px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  text-shadow: 0 0 12px var(--glow);
}
.intro { margin: 0 0 18px; max-width: 46rem; }


/* ------------------------------------------------------------------
   3. HAZARD-STRIPE DIVIDER
   The picture is made from the user's tools/2045.jpg by
   tools/5150/scripts/make-hazard-strip.py. Change "height" to make
   the strip thicker or thinner.
------------------------------------------------------------------ */
.hazard-strip {
  height: 16px;
  margin: 18px 0;
  background: #111 url("images/hazard-strip.jpg") repeat-x left center;
  background-size: auto 100%;
  border-top: 1px solid var(--frame);
  border-bottom: 1px solid var(--frame);
}


/* ------------------------------------------------------------------
   4. A GAME SYSTEM AND ITS LIST OF TOOLS
   (on the tools list and each game's tools page)
------------------------------------------------------------------ */
.system {
  background: var(--panel);
  border: 1px solid var(--frame);
  padding: 14px 16px 6px;
  margin-bottom: 18px;
}
.system h2 {
  margin: 0 0 4px;
  font-family: var(--font-heading);
  font-size: 22px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}
.system h2 a { text-decoration: none; }
.system h2 a:hover { text-shadow: 0 0 10px var(--glow); }
.system > p { margin: 0 0 10px; color: var(--soft); }

.tool-list { list-style: none; margin: 10px 0; padding: 0; }
.tool-list li {
  border: 1px solid #3c4148;
  border-left: 3px solid var(--ink);
  background: rgba(0, 0, 0, 0.45);
  padding: 10px 14px;
  margin-bottom: 10px;
}
.tool-list h2,
.tool-list h3 {
  margin: 0 0 4px;
  font-family: var(--font-heading);
  font-size: 17px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.tool-list h2 a,
.tool-list h3 a { color: var(--ink); }
.tool-list h2 a:hover,
.tool-list h3 a:hover { color: var(--accent); text-shadow: 0 0 10px var(--glow); }
.tool-list p { margin: 0; }

/* A tool that is not built yet: dimmer, with a grey edge. */
.tool-list li.not-ready { border-left-color: var(--frame); }
.tool-list li.not-ready h2,
.tool-list li.not-ready h3,
.tool-list li.not-ready p { color: var(--soft); }

/* The "Coming soon" label beside a tool's name. */
.status-label {
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px;
  padding: 1px 6px;
  font-family: var(--font-text);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--soft);
  border: 1px solid var(--frame);
}

/* Small print and the links at the bottom of the page. */
.small-print { font-size: 14px; color: var(--soft); }
.page-links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 10px; }


/* ------------------------------------------------------------------
   5. DICE RESULTS (for future tools)
------------------------------------------------------------------ */
.roll-result {
  background: var(--panel);
  border: 1px solid var(--frame);
  padding: 12px 14px;
  margin: 14px 0;
}
/* One die face, drawn as a small square with the number in it. */
.die {
  display: inline-grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  margin: 0 0.3rem 0.3rem 0;
  font-weight: 700;
  color: var(--ink);
  background: #120c05;
  border: 1px solid var(--ink);
}
/* A die that passed a test glows; one that didn't is grey (never red). */
.die.passed { background: var(--ink); color: #0a0703; box-shadow: 0 0 8px var(--glow); }
.die.failed { color: var(--soft); border-color: var(--frame); }


/* ------------------------------------------------------------------
   6. TABLES OF RESULTS (for future tools)
   On a phone, a wide table scrolls sideways inside its own box.
------------------------------------------------------------------ */
.table-scroll { overflow-x: auto; margin: 14px 0; }
.rules-table { width: 100%; border-collapse: collapse; }
.rules-table th,
.rules-table td {
  text-align: left;
  vertical-align: top;
  padding: 6px 10px;
  border-bottom: 1px solid #3c4148;
}
.rules-table th {
  font-family: var(--font-heading);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
}
/* The row matching the latest roll is lit up. */
.rules-table tr.is-rolled td { background: rgba(255, 179, 71, 0.16); color: var(--accent); }


/* ------------------------------------------------------------------
   7. FORM BOXES AND BUTTONS (for future tools)
------------------------------------------------------------------ */
.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 4px; color: var(--soft); }
.field input,
.field select,
.field textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--well);
  border: 1px solid #5d636b;
  border-radius: 2px;
  padding: 6px 8px;
}
.field input[type="number"] { max-width: 7rem; }

/* Puts several boxes side by side, dropping to one per line on phones. */
.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0 14px;
}

button, .button {
  display: inline-block;
  font-family: var(--font-text);
  font-size: 15px;
  color: #0a0703;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 2px;
  padding: 7px 12px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
}
button:hover, .button:hover { background: var(--accent); border-color: var(--accent); color: #0a0703; }


/* ------------------------------------------------------------------
   8. HELP PAGES (each tool's "Full instructions", e.g.
   5150/characters/help.html): a contents list, then one boxed
   section per topic.
------------------------------------------------------------------ */
.version-tag {
  display: inline-block;
  vertical-align: middle;
  margin-left: 6px;
  padding: 1px 7px;
  font-family: var(--font-text);
  font-weight: normal;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: none;
  text-shadow: none;
  color: var(--soft);
  border: 1px solid var(--frame);
}
.help-contents {
  background: var(--panel);
  border: 1px solid var(--frame);
  padding: 10px 16px;
  margin-bottom: 18px;
}
.help-contents ol { margin: 6px 0; padding-left: 1.4em; columns: 2 16rem; column-gap: 2rem; }
.help-contents li { margin-bottom: 3px; }
.help-section {
  background: var(--panel);
  border: 1px solid var(--frame);
  border-left: 3px solid var(--ink);
  padding: 12px 16px 6px;
  margin-bottom: 16px;
  scroll-margin-top: 12px;
}
.help-section h2 {
  margin: 0 0 8px;
  font-family: var(--font-heading);
  font-size: 18px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
}
.help-section h3 {
  margin: 14px 0 4px;
  font-family: var(--font-heading);
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.help-section p, .help-section ul, .help-section ol { margin: 0 0 10px; }
.help-section li { margin-bottom: 4px; }
/* A button's name, written the way it looks on the tool. */
.btn-name {
  display: inline-block;
  padding: 0 6px;
  font-size: 0.9em;
  color: #0a0703;
  background: var(--ink);
  border-radius: 2px;
  white-space: nowrap;
}
/* A handy hint inside a section. */
.tip { padding: 8px 12px; border: 1px dashed var(--frame); color: var(--soft); }
.tip b { color: var(--accent); font-weight: normal; }


/* ------------------------------------------------------------------
   9. PHONES
------------------------------------------------------------------ */
@media (max-width: 600px) {
  body { font-size: 16px; }
  .system { padding: 12px 12px 4px; }
  .tool-list li { padding: 9px 11px; }
}
