
/* The game screen (play page only). Colours come from the site's style.css settings. */
body.ta-play {
  --green: var(--g);
  --green-dim: var(--gd);
  --green-faint: var(--gf);
  --game-fs: 25px;       /* game text size (the screen has its own size, bigger than the website's) */
  --bar-h: 48px;         /* height of the slim top bar */
}
html:has(body.ta-play), body.ta-play { margin: 0; height: 100%; background: var(--bg); }
body.ta-play {
  font-family: var(--font);
  font-size: var(--game-fs);
  line-height: 1.25;
  color: var(--txt);     /* descriptions in off-white, easier to read */
  overflow: hidden;
}
/* green for the bits that stand out: room names, the title, what you type, the cursor */
body.ta-play .room-name, body.ta-play .title-name, body.ta-play #prompt, body.ta-play .centre { color: var(--g); }

/* ---------- slim top bar ---------- */
.ta-playbar { display: flex; align-items: center; gap: var(--sp-5); height: var(--bar-h); padding: 0 max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter))); /* lines up with the 1200px column */ border-bottom: var(--line); font-size: var(--fs-s); line-height: var(--lh-ui); }
.ta-playbar .ta-logo { font-size: var(--fs-s); }
.ta-playbar .ta-logo .ta-cursor { display: none; }
.ta-playbar__game { color: var(--c); letter-spacing: var(--ls-caps); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ta-playbar__right { margin-left: auto; display: flex; align-items: center; gap: var(--sp-5); white-space: nowrap; }
.ta-playbar__status { color: var(--gd); }
.ta-playbar a, .ta-playbar a:visited { color: var(--g); }
.ta-playbar__back, .ta-playbar__back:visited { text-decoration: none; border: 1px solid var(--gd); padding: var(--sp-1) var(--sp-3); letter-spacing: var(--ls-caps); text-transform: uppercase; font-size: var(--fs-xs); }
.ta-playbar__back:hover { border-color: var(--g); }

/* ---------- bug report box ---------- */
.ta-modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: var(--gutter); background: rgba(0, 0, 0, .85); }
.ta-modal[hidden] { display: none; }
.ta-modal__box { width: 100%; max-width: 560px; max-height: 100%; overflow-y: auto; background: var(--bg); border: var(--line-strong); padding: var(--sp-6); font-size: var(--fs-m); line-height: var(--lh-body); }
.ta-modal__title { font-size: var(--fs-h3); margin-bottom: var(--sp-3); }
.ta-modal__text { font-size: var(--fs-s); color: var(--txt); }
.ta-modal__status { min-height: 1.3em; color: var(--g); font-size: var(--fs-s); margin: var(--sp-3) 0 0; }
.ta-modal__buttons { display: flex; gap: var(--sp-3); margin-top: var(--sp-4); }
.ta-modal .ta-label:first-of-type { margin-top: var(--sp-4); }

/* ---------- the game screen ---------- */
body.ta-play * { box-sizing: border-box; }
/* undo the website's text, form and pre styles inside the game screen */
/* (:where keeps these weak, so the game's own classes below still win) */
:where(body.ta-play #crt) p { font-size: inherit; line-height: inherit; margin: 0 0 .55em; }
:where(body.ta-play #crt) pre { background: none; padding: 0; margin: .5em 0 .4em; color: inherit; font-family: inherit; line-height: 1.02; overflow-x: auto; }
body.ta-play #crt #cmd { min-height: 0; padding: 0; border: 0; outline: none; background: transparent; color: transparent; font-size: 16px; }
#crt {
  position: relative;
  max-width: var(--max);
  height: calc(100vh - var(--bar-h));
  height: calc(100dvh - var(--bar-h));
  margin: 0 auto;
  padding: 30px var(--gutter) 24px;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
#output {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--green-faint) transparent;
}
#output::-webkit-scrollbar { width: 6px; }
#output::-webkit-scrollbar-thumb { background: var(--green-faint); }
.txt { margin: 0 0 .55em; white-space: pre-wrap; word-wrap: break-word; }
.art {
  margin: .5em 0 .4em;
  font-family: inherit;
  font-size: .9em;
  line-height: 1.02;
  white-space: pre;
  overflow-x: auto;
}
.title-art { font-size: .95em; }
canvas.pic { display: block; width: min(960px, 100%); height: auto; aspect-ratio: 2 / 1; image-rendering: pixelated; image-rendering: crisp-edges; margin: .3em auto .6em; } /* centred; 960px keeps every pixel the same size */
canvas.pic.title { margin: .5em auto .8em; }
.title-name { text-align: center; font-size: 1.9em; letter-spacing: .35em; margin: .2em 0 0; text-transform: uppercase; }
.title-sub { text-align: center; color: var(--green-dim); margin: .2em 0 1.2em; }
.room-name { margin: .2em 0 .35em; letter-spacing: .12em; text-transform: uppercase; }
.echo { margin: .9em 0 .35em; color: var(--green-dim); }
.exits, .note { color: var(--green-dim); }
.centre { text-align: center; }
@keyframes blink { 50% { opacity: 0; } }
#prompt {
  position: relative;
  margin-top: .4em;
  padding-top: .35em;
  white-space: pre-wrap;
  word-break: break-all;
  min-height: 1.6em;
}
#prompt.hidden { visibility: hidden; }
#cursor {
  display: inline-block;
  width: .55em;
  height: 1em;
  background: var(--green);
  vertical-align: -0.12em;
  animation: blink 1s steps(1) infinite;
}
#cmd {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  font-size: 16px;
  border: 0;
  background: transparent;
  color: transparent;
  caret-color: transparent;
}

@media (max-width: 1024px) {
  body.ta-play { --game-fs: 23px; }
}
@media (max-width: 900px) {
  body.ta-play { --game-fs: 22px; }
  .ta-playbar__status { display: none; }
  #crt { padding: 26px var(--gutter) 20px; }
}
@media (max-width: 700px) {
  body.ta-play { --game-fs: 20px; }
  .ta-playbar__game { display: none; }
  #crt { padding: 30px var(--gutter) 16px; }
  .art { font-size: .8em; }
  .title-art { font-size: .78em; }
}
@media (max-width: 400px) {
  body.ta-play { --game-fs: 18px; }
  .ta-playbar .ta-logo { font-size: var(--fs-xs); }
  #crt { padding: 30px var(--gutter) 12px; }
  .art { font-size: .7em; }
  .title-art { font-size: .66em; }
}
#bugbtn { position: absolute; top: 8px; right: var(--gutter); background: none; border: 0; padding: 4px 0; color: var(--green-dim); font: inherit; font-size: .62em; letter-spacing: .12em; cursor: pointer; z-index: 2; }
#bugbtn:hover, #bugbtn:focus-visible { color: var(--green); text-decoration: underline; outline: none; }
@media (max-width: 700px) { #bugbtn { top: 6px; } }
