/*
 * Twisted Soul Studios website.
 * Colours come from the studio's TS logo (16 October 2026): true black, bone-white stone, blood red and its ember.
 * The navy and the violet smoke were the old crescent logo's and went with it (the sheet as it was:
 * art-source/site-before-2026-10-16.css).
 * Cinzel for headings (the flared Roman capitals of the logo's STUDIOS), Poppins for reading text.
 */
@font-face { font-family: "Cinzel"; font-weight: 400 900; src: url("/fonts/Cinzel.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Poppins"; font-weight: 500; src: url("/fonts/Poppins-Medium.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Poppins"; font-weight: 600; src: url("/fonts/Poppins-SemiBold.ttf") format("truetype"); font-display: swap; }

:root {
  color-scheme: dark;
  --void: #07070a;
  --night: #0e0c0d;
  --panel: #171314;
  --line: #ffffff1c;
  --silver: #ece6dc;
  --mute: #a69e96;
  --blood: #e10600;
  --blood-deep: #7a0303;
  --blood-soft: #ff8a80;
  --ember: #3a0607;
  --head: "Cinzel", "Palatino Linotype", Georgia, serif;
  --body: "Poppins", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-tap-highlight-color: #e0122f33; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--void); color: var(--silver); font: 500 16px/1.65 var(--body); overflow-wrap: break-word; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
a, button, select, label, summary { touch-action: manipulation; }
h1, h2, h3 { text-wrap: balance; }
:focus-visible { outline: 3px solid var(--blood-soft); outline-offset: 3px; }
.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }
.skip { position: absolute; left: 12px; top: -80px; z-index: 10; padding: 12px 18px; border-radius: 8px; background: #fff; color: #000; font-weight: 600; }
.skip:focus { top: 12px; }

/* ---- top bar ---- */
.top { position: sticky; top: 0; z-index: 5; background: #07070ae6; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font: 700 17px/1.1 var(--head); letter-spacing: 0.08em; text-transform: uppercase; }
.brand img { width: 46px; height: 46px; }
.top nav { display: flex; gap: 4px; }
.top nav a { padding: 14px 16px; border-radius: 8px; text-decoration: none; font: 600 15px/1 var(--body); color: var(--mute); transition: color 0.15s, background-color 0.15s; }
.top nav a:hover { color: #fff; background: #ffffff12; }
.top nav a[aria-current="page"] { color: #fff; box-shadow: inset 0 -2px 0 var(--blood); border-radius: 8px 8px 0 0; }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 26px; border: 1px solid transparent; border-radius: 10px; text-decoration: none; cursor: pointer; font: 700 15px/1 var(--head); letter-spacing: 0.1em; text-transform: uppercase; transition: background-color 0.15s, border-color 0.15s, translate 0.08s; }
.btn:active { translate: 0 1px; }
.btn.red { background: linear-gradient(180deg, #e8160c, var(--blood-deep)); color: #fff; box-shadow: inset 0 1px 0 #ffffff40, 0 10px 30px #e1060038; }
.btn.red:hover { background: linear-gradient(180deg, #ff2a1e, #9a0606); }
.btn.line { border-color: #ffffff40; color: var(--silver); background: #ffffff0a; }
.btn.line:hover { border-color: #fff; background: #ffffff17; }
.btn[disabled] { opacity: 0.5; cursor: default; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

/* ---- home: the animated logo and what the studio is ---- */
.hero { position: relative; overflow: hidden; text-align: center; padding: clamp(28px, 6vh, 64px) 0 clamp(40px, 8vh, 80px); background: radial-gradient(ellipse 70% 62% at 50% 30%, var(--ember) 0%, #120707 44%, var(--void) 80%); }
.hero .wrap { position: relative; display: flex; flex-direction: column; align-items: center; }
/* The logo's size is the site's; how it moves is the studio's (studio-logo/studio-logo.css): the same as every
   game's loading screen. Its box is 3 by 2 and the logo fills it. */
.hero .tss-logo { width: min(640px, 90vw, 88vh); margin-bottom: clamp(8px, 2vh, 20px); }
.hero h1 { margin: 0; max-width: 16ch; font: 700 clamp(30px, 5vw, 54px) / 1.1 var(--head); letter-spacing: 0.02em; color: #fff; }
.hero p { max-width: 54ch; margin: 18px 0 30px; color: var(--mute); font-size: clamp(15px, 1.6vw, 18px); }
.hero .actions { justify-content: center; }
.logo-motion { margin-top: 26px; padding: 10px 14px; border: 0; border-radius: 8px; background: none; color: var(--mute); font: 500 13.5px/1 var(--body); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.logo-motion:hover { color: #fff; }
/* The logo held still, by the button under it. The logo is the studio's mark and plays for
   everyone, whatever a device's own setting for less movement (the studio's standard, and the
   movement is small: the mark's breath, its aura and a shimmer); the button is how a visitor stops it. */
.logo-still .tss-logo, .logo-still .tss-logo * { animation: none; }

/* ---- sections ---- */
section.band { padding: clamp(48px, 9vh, 96px) 0; border-top: 1px solid var(--line); }
section.band.alt { background: var(--night); }
h2 { margin: 0 0 14px; font: 700 clamp(26px, 3.4vw, 40px) / 1.15 var(--head); letter-spacing: 0.02em; color: #fff; }
.lede { max-width: 62ch; margin: 0 0 28px; color: var(--mute); }
.page-head { padding: clamp(36px, 7vh, 72px) 0 clamp(24px, 4vh, 40px); background: radial-gradient(ellipse 60% 120% at 50% 0%, var(--ember), var(--void) 75%); }
.page-head h1 { margin: 0 0 10px; font: 700 clamp(32px, 5vw, 52px) / 1.1 var(--head); color: #fff; }
.page-head p { max-width: 62ch; margin: 0; color: var(--mute); }
section[id], .game[id], h2[id] { scroll-margin-top: 84px; }

/* ---- the games ----
   Each game is its vertical lobby tile (3:4, as Stake Engine shows it; made by make-tiles.py), its words under it.
   Four to a row on a wide screen, two on a phone. One game alone is laid out wide, its tile beside its words.
   Every game shares its row's lines (grid subgrid, 2 November 2026): tile, status, name, buttons, the "About this game"
   dropdown, so the buttons of a row stand level whatever a name's length, and opening a dropdown moves no button. */
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: clamp(26px, 3vw, 36px) clamp(16px, 2.4vw, 28px); }
h2 + .games { margin-top: 26px; }
.game { display: grid; align-content: start; gap: 18px; min-width: 0; }
.game:not(:only-child) { grid-row: span 5; grid-template-rows: subgrid; row-gap: 0; }
.game:not(:only-child) .game-text { display: contents; }
.game:not(:only-child) .plate { margin-bottom: 18px; }
.game:only-child { grid-column: 1 / -1; grid-template-columns: minmax(220px, 340px) 1fr; gap: clamp(22px, 4vw, 52px); align-items: center; }
.game .plate { position: relative; overflow: hidden; border-radius: 12px; background: var(--panel); box-shadow: 0 0 0 1px #ffffff1f, 0 26px 60px #000b; transition: translate 0.2s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.2s; }
.game .plate img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
/* the tile is the game's way in (site.js makes it a link to the demo): it lifts under the pointer */
.game .plate a { display: block; border-radius: inherit; }
@media (hover: hover) {
  .game .plate:has(a):hover { translate: 0 -4px; box-shadow: 0 0 0 1px #e1060099, 0 30px 64px #000d; }
}
.game h2, .game h3 { margin: 0 0 8px; font: 700 clamp(21px, 2vw, 26px) / 1.15 var(--head); letter-spacing: 0.02em; color: #fff; }
.game .actions { display: grid; grid-template-columns: 1fr; align-content: start; gap: 10px; }
.game .actions .btn { min-height: 46px; padding: 0 12px; font-size: 14px; }
.game .actions .btn.off { cursor: default; color: var(--mute); border-color: var(--line); background: none; }
.game .status { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font: 600 13.5px/1.2 var(--body); color: var(--silver); }
/* the game's words: a dropdown under the buttons, shut until it is asked for */
.about { margin-top: 6px; }
.about summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; border-bottom: 1px solid var(--line); list-style: none; cursor: pointer; color: var(--silver); font: 600 14px/1.2 var(--body); transition: color 0.15s, border-color 0.15s; }
.about summary::-webkit-details-marker { display: none; }
.about summary::after { content: ""; flex: none; width: 8px; height: 8px; margin: -3px 4px 0 0; border-right: 2px solid var(--blood-soft); border-bottom: 2px solid var(--blood-soft); rotate: 45deg; transition: rotate 0.2s cubic-bezier(0.23, 1, 0.32, 1), margin 0.2s cubic-bezier(0.23, 1, 0.32, 1); }
.about[open] summary::after { rotate: 225deg; margin-top: 3px; }
@media (hover: hover) {
  .about summary:hover { color: #fff; border-color: #ffffff4d; }
}
.about p { margin: 0; padding-top: 12px; color: var(--mute); max-width: 52ch; font-size: 15px; line-height: 1.6; }
@supports (interpolate-size: allow-keywords) {
  .about { interpolate-size: allow-keywords; }
  .about::details-content { block-size: 0; overflow: hidden; transition: block-size 0.22s cubic-bezier(0.23, 1, 0.32, 1), content-visibility 0.22s allow-discrete; }
  .about[open]::details-content { block-size: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .about::details-content, .about summary::after { transition: none; }
}
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--blood); }
.status.development { color: var(--mute); }
.status.development::before { background: var(--blood); box-shadow: 0 0 0 3px #e1060033; }
@media (max-width: 560px) {
  .games { grid-template-columns: 1fr 1fr; }
  .game .actions .btn { padding: 0 8px; font-size: 13px; letter-spacing: 0.06em; }
  .about p { font-size: 14px; }
}
.soon { margin: 0; color: var(--mute); }

/* ---- home: how demo mode works ---- */
.split { display: grid; grid-template-columns: 1fr 1.25fr; gap: clamp(24px, 5vw, 72px); align-items: start; }
.points { margin: 0; display: grid; }
.points > div { padding: 18px 0; border-top: 1px solid var(--line); }
.points > div:last-child { border-bottom: 1px solid var(--line); }
.points dt { font: 700 18px/1.3 var(--head); letter-spacing: 0.02em; color: #fff; }
.points dd { margin: 4px 0 0; color: var(--mute); max-width: 56ch; }
.points a { color: var(--silver); text-underline-offset: 3px; }
.points a:hover { color: #fff; }

/* ---- a game's own page: a bar that says what it is, and the game under it ---- */
body.play { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.playbar { flex: none; display: flex; align-items: center; gap: 6px 18px; min-height: 52px; padding: 4px max(14px, env(safe-area-inset-right)) 4px max(14px, env(safe-area-inset-left)); border-bottom: 1px solid var(--line); background: var(--void); font-size: 14px; }
.playbar a, .playbar button { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--silver); font: 600 14px/1 var(--body); text-decoration: none; cursor: pointer; transition: background-color 0.15s, border-color 0.15s; }
.playbar a:hover, .playbar button:hover { background: #ffffff14; color: #fff; }
.playbar .back { border-color: #ffffff33; }
.playbar .back::before { content: ""; width: 8px; height: 8px; margin-right: 9px; border-left: 2px solid; border-bottom: 2px solid; rotate: 45deg; }
.playing { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 14px; }
.playing h1 { margin: 0; font: 700 17px/1.3 var(--head); letter-spacing: 0.06em; text-transform: uppercase; color: #fff; }
.playing p { margin: 0; color: var(--mute); font-size: 13.5px; line-height: 1.35; }
.playbar-actions { flex: none; display: flex; gap: 4px; }
.playbar #full { border-color: #ffffff33; }
body.play main { flex: 1; min-height: 0; background: #000; }
body.play iframe { display: block; width: 100%; height: 100%; border: 0; }
/* ?sfx=1: the game and, beside it, the column its sound desk stands in (play.js; the desk is the game's own) */
body.play.sound-desk main { display: flex; }
body.play.sound-desk iframe { flex: 1; min-width: 0; width: auto; }
#soundDeskHost { flex: none; width: 340px; height: 100%; overflow: hidden; border-left: 1px solid var(--line); background: #121016; }
#soundDeskHost.sd-shut { width: auto; }
@media (max-width: 900px) { #soundDeskHost { width: 280px; } }
/* in the game's place while its demo server starts: one heading and one line, in the middle */
body.play main:has(.wait:not([hidden])) { display: grid; place-items: center; }
.wait { max-width: 34rem; padding: 24px max(20px, env(safe-area-inset-right)) 24px max(20px, env(safe-area-inset-left)); text-align: center; }
.wait h2 { margin: 0 0 10px; font: 700 clamp(20px, 3.4vw, 28px)/1.25 var(--head); letter-spacing: 0.06em; text-transform: uppercase; color: #fff; }
.wait p { margin: 0; color: var(--mute); }
/* a narrow or a short window (a phone on its side): the bar keeps to one line, and the game says the rest */
@media (max-width: 960px), (max-height: 520px) {
  .playing p { display: none; }
  .playbar { gap: 6px 8px; min-height: 48px; }
}
/* a phone held upright: the three buttons fill the bar, so the game's name is kept for screen readers only (the game shows it) */
@media (max-width: 520px) {
  .playing h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* ---- feedback form ---- */
.form { display: grid; gap: 20px; width: min(680px, 100%); }
.field { display: grid; gap: 7px; }
.field > span, legend { font-weight: 600; font-size: 14.5px; color: #fff; padding: 0; }
.field small { color: var(--mute); font-size: 13px; }
input[type="text"], input[type="password"], textarea, select {
  width: 100%; padding: 13px 14px; border: 1px solid #ffffff33; border-radius: 10px; background-color: var(--panel); color: #fff; font: 500 16px/1.5 var(--body);
}
textarea { min-height: 170px; resize: vertical; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; border-color: var(--blood-soft); box-shadow: 0 0 0 3px #e0122f66; }
fieldset { margin: 0; padding: 0; border: 0; display: grid; gap: 9px; }
.choice { display: flex; flex-wrap: wrap; gap: 10px; }
.choice label { position: relative; cursor: pointer; }
.choice input { position: absolute; inset: 0; opacity: 0; }
.choice span { display: block; padding: 11px 18px; border: 1px solid #ffffff33; border-radius: 10px; background: var(--panel); font-weight: 600; font-size: 15px; }
.choice input:checked + span { border-color: var(--blood); background: #e0122f26; color: #fff; }
.choice input:focus-visible + span { outline: 3px solid var(--blood-soft); outline-offset: 2px; }
.trap { position: absolute; left: -5000px; }
.note { padding: 16px 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); }
.note.good { border-color: #2ec866; }
.note.bad { border-color: var(--blood); }
.note h2 { margin: 0 0 6px; font: 700 18px/1.3 var(--head); color: #fff; }
.note p { margin: 0 0 10px; color: var(--mute); }
.note pre { margin: 0 0 12px; padding: 12px; max-height: 240px; overflow: auto; border-radius: 8px; background: var(--void); white-space: pre-wrap; font: 13px/1.5 Consolas, monospace; color: var(--silver); }
[hidden] { display: none !important; }

/* ---- inbox ---- */
.inbox { display: grid; gap: 14px; }
.item { padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.item header { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; margin-bottom: 8px; color: var(--mute); font-size: 13px; }
.item header b { color: #fff; font: 700 15px/1 var(--head); letter-spacing: 0.06em; text-transform: uppercase; }
.item p { margin: 0; white-space: pre-wrap; }

/* ---- footer ---- */
footer { padding: 36px 0 44px; border-top: 1px solid var(--line); color: var(--mute); font-size: 14px; }
footer p { margin: 0 0 6px; max-width: 70ch; }

@media (max-width: 820px) {
  .game:only-child { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .brand span { display: none; }
  .top nav a { padding: 14px 11px; }
}
