/* The dark Territory World pages: /intro, /exercises and /activities. */
:root { --bg: #0f151d; --panel: #18212c; --line: #2c3a4a; --text: #e9eef4; --muted: #9aa8b8;
        --blue: #3b82e0; --blue-dark: #2f6cc0; --good: #3fb37f; --bad: #e0605a; --focus: #f0b429; color-scheme: dark; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 16px/1.55 Arial, Helvetica, sans-serif; }
main { max-width: 960px; margin: 0 auto; padding: 40px 32px 56px; }
h1 { margin: 0 0 6px; font-size: 32px; line-height: 1.2; }
h2 { margin: 0 0 6px; font-size: 22px; }
p { margin: 0 0 14px; }
a { color: #8dbdf7; text-underline-offset: 3px; }
.muted { color: var(--muted); }
.back { display: inline-block; margin-bottom: 14px; font-size: 15px; }
video { display: block; width: 100%; height: auto; margin: 22px 0 28px; background: #000; border-radius: 6px; }
.buttons { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
button, .btn { display: inline-flex; align-items: center; justify-content: center; font: 700 17px Arial, Helvetica, sans-serif;
               min-height: 48px; padding: 10px 26px; border-radius: 6px; border: 1px solid var(--blue); background: var(--blue);
               color: #fff; cursor: pointer; text-decoration: none; }
button:hover, .btn:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
button.quiet, .btn.quiet { background: transparent; color: var(--text); border-color: var(--line); font-weight: 400; font-size: 15px; min-height: 44px; padding: 8px 16px; }
button.quiet:hover, .btn.quiet:hover { background: var(--panel); }
button:disabled { opacity: .55; cursor: wait; }
button:focus-visible, .btn:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
label { display: block; font-weight: 700; margin: 14px 0 6px; }
select, input[type=text] { width: 100%; min-height: 46px; padding: 9px 12px; font: inherit; color: var(--text);
                           background: var(--bg); border: 1px solid var(--line); border-radius: 6px; }

/* Modals */
dialog { width: min(560px, calc(100vw - 32px)); padding: 24px; color: var(--text); background: var(--panel);
         border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.55); }
dialog::backdrop { background: rgba(4,8,12,.72); }
dialog h2 { margin-bottom: 4px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.status { min-height: 1.5em; margin: 12px 0 0; color: var(--muted); text-align: center; }
.status.bad { color: var(--bad); }

/* A password, a box for each letter like typing practice. */
.letters { position: relative; display: flex; justify-content: center; gap: 5px; margin: 18px 0 6px; cursor: text; }
.letters span { width: 30px; height: 42px; display: grid; place-items: center; font: 700 21px/1 "Courier New", monospace;
                background: var(--bg); border: 2px solid var(--line); border-radius: 5px; }
.letters span.filled { border-color: #5b7290; }
.letters span.here { border-color: var(--focus); box-shadow: 0 0 0 2px rgba(240,180,41,.25); }
.letters.ok span { border-color: var(--good); color: var(--good); }
.letters.wrong span { border-color: var(--bad); }
.letters.wrong { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-8px); } 50% { transform: translateX(8px); } 75% { transform: translateX(-4px); } }
.letters input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; border: 0; font-size: 16px; }

/* The sections under the video */
.more { margin-top: 44px; border-top: 1px solid var(--line); }
.more section { display: flex; justify-content: space-between; align-items: center; gap: 12px 24px; padding: 20px 0;
                border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.more h2 { font-size: 19px; margin: 0 0 2px; }
.more p { margin: 0; color: var(--muted); font-size: 15px; }
.more .btn, .more button { min-height: 44px; padding: 8px 20px; font-size: 15px; }

@media (max-width: 600px) {
  main { padding: 24px 16px 40px; }
  h1 { font-size: 27px; }
  dialog { padding: 18px 14px; }
  .letters { gap: 2px; }
  .letters span { width: 18px; height: 32px; font-size: 15px; border-width: 1.5px; border-radius: 4px; }
}
@media (prefers-reduced-motion: reduce) { .letters.wrong { animation: none; } }
