.tl {
  position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: 8px; background: #14261f; color: #fff;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
}
.tl.is-narrow { aspect-ratio: 4 / 3; }
.tl.is-playing .tl-canvas { touch-action: none; } /* dragging steers the astronaut instead of scrolling the page */
.tl-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: manipulation; outline: none; }
.tl-panel {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 16px;
  background: rgba(16, 33, 27, 0.78); text-align: center; z-index: 2;
}
.tl-panel[hidden] { display: none; }
.tl-box { display: grid; justify-items: center; gap: 8px; max-width: 520px; }
.tl-box p { margin: 0; }
.tl-kicker { font-size: 14px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: #c4e86b; }
.tl-title { font-family: "Rubik", system-ui, sans-serif; font-weight: 800; font-size: 48px; line-height: 1.1; color: #fff; }
.tl-text { font-size: 16px; line-height: 1.5; color: #e8e9f3; max-width: 46ch; }
.tl-keys { font-size: 14px; color: #aeb1c8; }
.tl-best { font-size: 14px; font-weight: 600; color: #ffc93c; }
.tl-btn {
  min-height: 48px; padding: 0 32px; margin-top: 8px; border: 0; border-radius: 999px;
  background: #ff6b1a; color: #1f2041; font-family: "Rubik", system-ui, sans-serif; font-weight: 800; font-size: 20px;
  box-shadow: 0 4px 0 #a8461a; cursor: pointer;
}
.tl-btn:hover { filter: brightness(1.06); }
.tl-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #a8461a; }
.tl-btn:focus-visible, .tl-ctl:focus-visible { outline: 3px solid #ffc93c; outline-offset: 3px; }
.tl-goals { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 4px; font-size: 15px; text-align: left; }
.tl-goals li { display: flex; gap: 8px; align-items: center; color: #aeb1c8; }
.tl-goals li::before { content: "\2606"; color: #aeb1c8; font-size: 18px; line-height: 1; }
.tl-goals li.is-done { color: #fff; }
.tl-goals li.is-done::before { content: "\2605"; color: #ffc93c; }
.tl-score { display: flex; gap: 24px; font-size: 16px; color: #e8e9f3; }
.tl-score b { font-family: "Rubik", system-ui, sans-serif; font-size: 22px; color: #fff; }
.tl-ctls { position: absolute; right: 8px; top: 8px; display: flex; gap: 6px; z-index: 3; }
.tl-ctl {
  width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; padding: 0;
  background: rgba(16, 33, 27, 0.6); color: #fff; cursor: pointer;
}
.tl-ctl[hidden] { display: none; }
.tl-ctl svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tl-ctl .i-off { display: none; }
.tl-ctl[aria-pressed="true"] .i-on { display: none; }
.tl-ctl[aria-pressed="true"] .i-off { display: block; }
/* Centred when it fits, scrolls from the top when it doesn't (short landscape phones). */
.tl-panel { display: flex; flex-direction: column; align-items: center; overflow-y: auto; }
.tl-box { margin: auto 0; }
.tl-result { display: grid; justify-items: center; gap: 8px; }
.tl-btn2 {
  min-height: 44px; padding: 0 20px; border: 2px solid rgba(255, 255, 255, 0.55); border-radius: 999px;
  background: transparent; color: #fff; font-family: "Rubik", system-ui, sans-serif; font-weight: 700; font-size: 16px; cursor: pointer;
}
.tl-btn2:hover { background: rgba(255, 255, 255, 0.12); }
.tl-btn2:disabled { opacity: 0.6; cursor: default; }
.tl-btn2:focus-visible, .tl-link:focus-visible, .tl-input:focus-visible { outline: 3px solid #ffc93c; outline-offset: 2px; }
.tl-link { background: none; border: 0; padding: 4px 8px; color: #c4e86b; font-weight: 600; font-size: 15px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.tl-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 4px; }
.tl-actions .tl-btn { margin-top: 0; }
.tl-post { display: grid; justify-items: center; gap: 4px; width: 100%; max-width: 400px; }
.tl-post[hidden] { display: none; }
.tl-post-label { font-size: 14px; color: #aeb1c8; }
.tl-post-row { display: flex; gap: 8px; width: 100%; }
.tl-input {
  flex: 1; min-width: 0; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 2px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.1); color: #fff; font-size: 16px;
}
.tl-input::placeholder { color: #aeb1c8; }
.tl-post-msg { min-height: 20px; font-size: 14px; font-weight: 600; color: #c4e86b; }
.tl-post-msg.is-error { color: #ffc93c; }
.tl-stars { display: none; color: #ffc93c; font-size: 18px; letter-spacing: 2px; }
.tl-board-panel { z-index: 4; background: rgba(16, 33, 27, 0.95); }
.tl-board-box { width: 100%; max-width: 440px; }
.tl-board-title { font-family: "Rubik", system-ui, sans-serif; font-weight: 800; font-size: 28px; color: #fff; }
.tl-board-list { list-style: none; margin: 4px 0 0; padding: 0; width: 100%; max-height: 240px; overflow-y: auto; display: grid; gap: 2px; text-align: left; }
.tl-board-list li { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 4px 12px; border-radius: 8px; font-size: 15px; color: #e8e9f3; }
.tl-board-list li:nth-child(odd) { background: rgba(255, 255, 255, 0.06); }
.tl-board-list li.is-me { background: rgba(196, 232, 107, 0.22); color: #fff; font-weight: 600; }
.tl-board-list li.is-note { display: block; text-align: center; background: none; color: #aeb1c8; }
.tl-rank { font-family: "Rubik", system-ui, sans-serif; font-weight: 800; color: #ffc93c; }
.tl-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-pts { font-family: "Rubik", system-ui, sans-serif; font-weight: 700; }
.tl-board-me { font-size: 14px; color: #c4e86b; min-height: 20px; }
/* Full screen: the game keeps its shape, centred on a dark backdrop. "is-pseudo" fills the browser window where
   real full screen isn't allowed (iPhone). */
.tl-full.is-full { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; width: 100%; height: 100%; background: #0f1f19; }
.tl-full.is-pseudo { position: fixed; inset: 0; z-index: 2147483000; width: 100vw; height: 100vh; height: 100dvh; }
.tl-full.is-full .tl { width: min(100%, calc(100vh * 16 / 9)); border-radius: 0; }
.tl-full.is-full .tl.is-narrow { width: min(100%, calc(100vh * 4 / 3)); }
.tl-full.is-pseudo .tl { width: min(100%, calc(100dvh * 16 / 9)); }
.tl-full.is-pseudo .tl.is-narrow { width: min(100%, calc(100dvh * 4 / 3)); }
.tl-rotate { display: none; margin: 0; color: #aeb1c8; font-size: 15px; text-align: center; padding: 0 16px; }
@media (orientation: portrait) and (pointer: coarse) { .tl-full.is-full .tl-rotate { display: block; } }
html.tl-lock, html.tl-lock body { overflow: hidden; }
.tl-cover-top { font-size: 15px; font-weight: 600; color: #c4e86b; }
.tl-cover-top[hidden] { display: none; }

.tl.is-narrow .tl-title { font-size: 30px; }
.tl.is-narrow .tl-goals, .tl.is-narrow .tl-post-label, .tl.is-narrow .tl-board-panel .tl-keys { display: none; }
.tl.is-narrow .tl-stars { display: inline; }
.tl.is-short .tl-goals, .tl.is-short .tl-post-label, .tl.is-short .tl-text, .tl.is-short .tl-kicker { display: none; }
.tl.is-short .tl-stars { display: inline; }
.tl.is-short .tl-title { font-size: 32px; }
.tl.is-short .tl-box { gap: 6px; }
.tl.is-short .tl-panel { padding: 8px; }
.tl.is-narrow .tl-btn2 { min-height: 40px; padding: 0 14px; font-size: 15px; }
.tl.is-narrow .tl-input { min-height: 40px; }
.tl.is-narrow .tl-board-title { font-size: 22px; }
.tl.is-narrow .tl-board-list { max-height: none; }
.tl.is-narrow .tl-board-panel { place-items: start center; }
.tl.is-narrow .tl-text, .tl.is-narrow .tl-kicker { display: none; }
.tl.is-narrow .tl-goals { font-size: 13px; gap: 2px; }
.tl.is-narrow .tl-btn { min-height: 44px; font-size: 18px; }
.tl.is-narrow .tl-panel { padding: 8px; }
.tl.is-narrow .tl-box { gap: 4px; }
.tl.is-tiny .tl-goals { display: none; }

/* Phones: the result screen is short, so keep it compact and leave room for the corner buttons. */
.tl.is-narrow .tl-panel { padding: 48px 8px 6px; }
.tl.is-narrow .tl-title { font-size: 24px; }
.tl.is-narrow .tl-score { gap: 12px; font-size: 14px; }
.tl.is-narrow .tl-score b { font-size: 18px; }
.tl.is-narrow .tl-post-msg:empty { display: none; }
.tl.is-narrow .tl-actions .tl-btn { min-height: 40px; padding: 0 20px; font-size: 17px; }
.tl.is-narrow .tl-actions [data-tl-open-board] { display: none !important; } /* the trophy button does the same */
.tl.is-narrow .tl-box { width: 100%; }
.tl.is-narrow .tl-post { max-width: 100%; }
.tl.is-narrow .tl-post-row .tl-btn2 { padding: 0 12px; flex: none; }

/* Real or Hoax: the corner buttons sit top-right, above the REAL / HOAX buttons' row. */
.tl.is-narrow .tl-ctl { width: 34px; height: 34px; }
.tl.is-narrow .tl-ctl svg { width: 17px; height: 17px; }
