/* Ludea staging app. House style from the approved gathering screens (D-097, D-099):
   painted cover behind, dark glass panels, gold for actions, teal for AI. Per-game palettes. */
:root {
  --ink: #e9eef5; --muted: #a9b6c6; --deep: #06121f;
  --panel: rgba(10, 26, 44, .82); --panel2: rgba(16, 38, 62, .9); --line: rgba(160, 200, 235, .18);
  --shade: 4, 12, 22;
  --gold: #f2b65a; --gold2: #ffd38a; --teal: #57c4c9; --danger: #ff8a7a;
  --display: "Exo 2", system-ui, sans-serif; --body: "Atkinson Hyperlegible", system-ui, sans-serif;
  --art: radial-gradient(120% 90% at 20% 30%, #1d4f73 0%, #0b2740 45%, #06121f 100%);
}
.pal-warm { --muted: #c9b39c; --deep: #1a0f0a; --panel: rgba(38, 24, 16, .84); --panel2: rgba(52, 33, 21, .9); --line: rgba(240, 200, 150, .2); --shade: 24, 14, 9;
  --art: radial-gradient(120% 90% at 25% 30%, #8a4a22 0%, #3a2014 50%, #1a0f0a 100%); }
.pal-rust { --muted: #cfb0a2; --deep: #1c0d0a; --panel: rgba(44, 20, 14, .84); --panel2: rgba(60, 28, 19, .9); --line: rgba(240, 170, 140, .2); --shade: 28, 13, 10;
  --art: radial-gradient(120% 90% at 25% 30%, #a3482a 0%, #4a1d12 50%, #1c0d0a 100%); }
.pal-sand { --muted: #d2bf9f; --deep: #1b130b; --panel: rgba(44, 30, 18, .84); --panel2: rgba(60, 42, 24, .9); --line: rgba(240, 210, 160, .2); --shade: 27, 19, 11;
  --art: radial-gradient(120% 90% at 25% 30%, #b0662f 0%, #5a3418 50%, #1b130b 100%); }

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--deep); color: var(--ink); font: 16px/1.5 var(--body); }
body { min-height: 100vh; }
button, input { font: inherit; }
a { color: var(--gold2); }
.boot { padding: 40px; color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- shared pieces ---------- */
.brand { display: inline-flex; align-items: center; text-decoration: none; line-height: 0; }
.brand .logo { height: 30px; width: auto; display: block; }
.auth .brand .logo, .signin .brand .logo { height: 40px; }
.envtag { font: 700 10.5px var(--display); letter-spacing: .1em; padding: 2px 7px; border-radius: 999px; background: rgba(87, 196, 201, .18); color: var(--teal); margin-left: 8px; vertical-align: 2px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 13px 16px; backdrop-filter: blur(6px); }
.card h2, .h2 { font: 600 13px var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin: 0 0 10px; }
.btn { font: 700 15px var(--display); padding: 9px 14px; border-radius: 11px; border: 1px solid var(--line); background: rgba(255, 255, 255, .06); color: var(--ink); cursor: pointer; }
.btn:hover { background: rgba(255, 255, 255, .12); }
.btn.gold, .start { border: 0; background: linear-gradient(180deg, var(--gold2), var(--gold)); color: #2a1606; box-shadow: 0 6px 24px rgba(242, 182, 90, .3); }
.btn.gold:hover { filter: brightness(1.05); }
.btn.small { font-size: 13px; padding: 6px 10px; border-radius: 9px; }
.btn[disabled] { opacity: .6; cursor: default; }
.start { font: 700 17px var(--display); padding: 11px 16px; border-radius: 12px; cursor: pointer; width: 100%; }
.muted { color: var(--muted); }
.err { color: var(--danger); min-height: 1.4em; margin: 6px 0 0; font-size: 14px; }
input[type=text], input[type=email], input[type=password], input[type=search] {
  width: 100%; font-size: 16px; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0, 0, 0, .3); color: var(--ink); }
input:focus-visible, button:focus-visible { outline: 2px solid var(--gold2); outline-offset: 2px; }
label.f { display: grid; gap: 4px; font-weight: 700; margin-bottom: 10px; }
label.f small { font-weight: 400; color: var(--muted); }

.av { width: 42px; height: 42px; border-radius: 50%; margin: 0 auto 6px; display: grid; place-items: center; font: 700 19px var(--display); color: #1d1206; flex: none; }
.av.bot { background: radial-gradient(circle at 40% 35%, #9fe3e6, #2c7f93) !important; color: #04202a; }
.av.sm { width: 30px; height: 30px; font-size: 13px; margin: 0; }
.badge { position: absolute; top: 6px; right: 6px; font: 700 10.5px var(--display); letter-spacing: .08em; padding: 2px 7px; border-radius: 999px; background: #2c7f93; color: #e8fbfc; }
.badge.you { right: auto; left: 6px; background: var(--gold); color: #2a1606; }
.badge.host { position: static; background: rgba(255, 211, 138, .2); color: var(--gold2); }
.chip { display: inline-block; font: 600 12px var(--display); letter-spacing: .04em; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .1); color: var(--ink); margin: 0 4px 4px 0; }
.chip.st-created { background: rgba(255, 211, 138, .18); color: var(--gold2); }
.chip.st-playing { background: rgba(87, 196, 201, .2); color: var(--teal); }
.chip.st-paused { background: rgba(255, 255, 255, .14); color: var(--ink); }
.chip.st-bots_only { background: rgba(87, 196, 201, .12); color: var(--muted); }
.chip.st-finished { background: rgba(255, 255, 255, .06); color: var(--muted); }
.stars { color: var(--gold2); letter-spacing: 2px; } .stars i { color: rgba(255, 255, 255, .22); font-style: normal; }
.meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.level { display: inline-flex; align-items: center; gap: 7px; color: #cfe3f2; }
.bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.bars i { width: 4px; border-radius: 1px; background: rgba(255, 255, 255, .2); }
.bars i:nth-child(1) { height: 30%; } .bars i:nth-child(2) { height: 47%; } .bars i:nth-child(3) { height: 65%; } .bars i:nth-child(4) { height: 82%; } .bars i:nth-child(5) { height: 100%; }
.bars i.on { background: #6fd0e8; }
.rating { color: var(--gold2); white-space: nowrap; }
.rating.new { color: #cfe3f2; border: 1px solid rgba(255, 255, 255, .25); border-radius: 999px; padding: 1px 9px; font-size: 12px; }

/* ---------- sign in ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--art); position: relative; overflow: hidden; }
.auth .box { position: relative; z-index: 2; background: rgba(6, 16, 30, .72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, .12); border-radius: 18px; padding: 24px 24px 18px; box-shadow: 0 20px 60px rgba(0, 0, 0, .45); }
.welcome, .welcome .slides, .welcome .slide, .welcome .shade { position: absolute; inset: 0; }
.welcome { z-index: 0; }
.welcome .slide { background: center / cover no-repeat; opacity: 0; transform: scale(1.04); transition: opacity 1.6s ease, transform 7.5s linear; }
.welcome .slide.on { opacity: 1; transform: scale(1.12); }
.welcome.still .slide, .welcome.still .slide.on { transform: none; transition: opacity 1.2s ease; }
.welcome .shade { background: radial-gradient(ellipse at center, rgba(4, 10, 20, .1) 0%, rgba(4, 10, 20, .55) 80%), linear-gradient(180deg, rgba(4, 10, 20, .15), rgba(4, 10, 20, .4)); }
.welcome .dots { position: absolute; z-index: 3; left: 0; right: 0; bottom: 18px; display: flex; justify-content: center; gap: 8px; }
.welcome .dot { width: 9px; height: 9px; padding: 0; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .35); cursor: pointer; }
.welcome .dot.on { background: var(--gold2); width: 22px; border-radius: 5px; }
.welcome .dot:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.auth .box { width: min(420px, 100%); }
.auth h1 { font: 700 34px/1.1 var(--display); margin: 10px 0 4px; color: #fff; }
.auth .tabs { display: flex; gap: 6px; margin: 14px 0; }
.auth .tabs button[aria-pressed=true] { background: var(--gold); color: #2a1606; border-color: transparent; }
.note { font-size: 13px; color: var(--muted); margin-top: 12px; }

/* ---------- My games ---------- */
.home { max-width: 1200px; margin: 0 auto; padding: 22px 32px 60px; }
.topbar { display: flex; align-items: center; gap: 14px; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; }
.topbar .me { display: flex; align-items: center; gap: 10px; }
.home h1 { font: 700 30px var(--display); margin: 8px 0 14px; }
.home h2.sec { font: 600 13px var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin: 26px 0 10px; }
.search { max-width: 420px; }
.gplist { display: grid; gap: 10px; }
.gp { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; padding: 10px 12px; }
.gp .thumb { width: 64px; height: 44px; border-radius: 8px; background: var(--art) center/cover; }
.gp .t { font-weight: 700; } .gp .sub { color: var(--muted); font-size: 13.5px; }
.gp .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.seatdots { display: inline-flex; gap: 3px; vertical-align: middle; margin-left: 6px; }
.seatdots i { width: 10px; height: 10px; border-radius: 50%; background: #2c7f93; display: inline-block; }
.seatdots i.h { background: var(--gold); }
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.game { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.game .art { aspect-ratio: 16 / 9; background: var(--art) center 30%/cover; position: relative; }
.game .art .ttl { position: absolute; left: 14px; right: 14px; bottom: 10px; font: 700 21px/1.1 var(--display); color: #fff; text-shadow: 0 2px 14px rgba(0, 0, 0, .7); }
.game .art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,.65) 100%); }
.game .art .ttl { z-index: 1; }
.game .body { padding: 10px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.game .syn { font-size: 13.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }
.game .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; }
.empty { color: var(--muted); padding: 12px 2px; }

/* ---------- gathering (D-097 A), from gathering_house2.html ---------- */
.screen { position: relative; min-height: 100vh; overflow: hidden; }
.bg { position: absolute; inset: 0; background: var(--art); background-position: center 30%; background-size: cover; background-repeat: no-repeat; filter: saturate(1.05); }
.bg::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(var(--shade), .25) 0%, rgba(var(--shade), .55) 45%, rgba(var(--shade), .92) 70%),
              linear-gradient(180deg, rgba(var(--shade), 0) 55%, rgba(var(--shade), .95) 100%); }
.screen > .brand { position: absolute; top: 24px; left: 32px; z-index: 2; }
.back { position: absolute; top: 18px; right: 24px; z-index: 2; }
.wrap { position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, 1fr); gap: 28px; max-width: 1280px; margin: 0 auto; padding: 60px 32px 18px; height: 100vh; min-height: 640px; }
.left { display: flex; flex-direction: column; justify-content: flex-end; gap: 14px; padding-bottom: 6px; }
.wrap h1 { font: 700 clamp(36px, 4.6vw, 58px)/1.02 var(--display); margin: 0; color: #fff; text-shadow: 0 2px 24px rgba(0, 0, 0, .6); }
.tag { font: 600 14px var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.heroes { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.heroes img, .heroes .av { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--gold); object-fit: cover; margin: 0; }
.heroes span { color: var(--muted); font-size: 14px; }
.right { display: flex; flex-direction: column; gap: 10px; justify-content: center; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.right > * { flex: none; }
.syn2 { margin: 0 0 8px; font-size: 14.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.syn2.open { -webkit-line-clamp: unset; }
dd.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; } dd.clamp.open { -webkit-line-clamp: unset; }
dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; margin: 0; font-size: 13.5px; } dt { color: var(--muted); } dd { margin: 0; }
.seats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.seat { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 20px 8px 7px; text-align: center; position: relative; transition: border-color .3s; }
.seat.flash { border-color: var(--gold2); }
.seat .name { font-weight: 700; } .seat .sub { color: var(--muted); font-size: 12.5px; }
.host { display: grid; gap: 8px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row label { font-weight: 700; } .row small { display: block; color: var(--muted); font-weight: 400; }
.tog { position: relative; width: 48px; height: 28px; border-radius: 999px; background: rgba(255, 255, 255, .18); border: 0; cursor: pointer; flex: none; }
.tog::after { content: ""; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left .15s; }
.tog[aria-pressed=true] { background: var(--teal); } .tog[aria-pressed=true]::after { left: 24px; }
.pw { display: flex; gap: 8px; } .pw input { flex: 1; }
.hostnote { font: 600 11.5px var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.waitnote { color: var(--muted); margin: 2px 0; }
.links { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- opening B ---------- */
.stage { max-width: 1100px; margin: 0 auto; padding: 90px 32px 40px; position: relative; }
.stage h1 { font: 700 clamp(30px, 3.6vw, 46px)/1.05 var(--display); margin: 0 0 6px; color: #fff; }
.stage .lead { color: var(--muted); margin: 0 0 18px; max-width: 70ch; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.person { display: flex; gap: 12px; align-items: flex-start; }
.person img, .person .av { width: 64px; height: 64px; border-radius: 50%; border: 2px solid var(--gold); object-fit: cover; margin: 0; font-size: 24px; }
.person .nm { font: 700 18px var(--display); } .person p { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.role { margin: 18px 0; font-size: 18px; border-left: 3px solid var(--gold); padding: 6px 14px; background: var(--panel); border-radius: 0 12px 12px 0; }
.steps { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.howto { margin-top: 16px; }
.howto ol { margin: 6px 0 0; padding-left: 20px; } .howto li { margin: 4px 0; }

/* ---------- play (chapters on the pilot engine) ---------- */
.playbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 8px 16px; background: rgba(var(--shade), .96); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.playbar .gt { font: 700 16px var(--display); }
.playbar .team { display: flex; gap: 4px; align-items: center; }
.playbar .sp { flex: 1; }
.frame { width: 100%; height: calc(100vh - 54px); border: 0; display: block; background: #000; }
.cover-msg { min-height: 100vh; display: grid; place-items: center; padding: 24px; text-align: center; position: relative; }
.cover-msg .card { max-width: 520px; position: relative; }
.cover-msg h1 { font: 700 30px var(--display); margin: 0 0 8px; }

/* ---------- dialog and toast ---------- */
dialog { border: 1px solid var(--line); border-radius: 16px; background: var(--panel2); color: var(--ink); padding: 20px; width: min(440px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0, 0, 0, .6); }
dialog h2 { font: 700 20px var(--display); margin: 0 0 10px; }
dialog .acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
#toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--line); padding: 10px 16px; border-radius: 12px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; max-width: calc(100vw - 32px); }
#toast.on { opacity: 1; }

@media (max-height: 700px) { .wrap { height: auto; } .right { overflow: visible; } }
@media (max-width: 900px) {
  .wrap { grid-template-columns: 1fr; padding: 80px 16px 20px; height: auto; min-height: auto; }
  .right { overflow: visible; }
  .left { min-height: 40vh; }
  .bg::after { background: linear-gradient(180deg, rgba(var(--shade), .2) 0%, rgba(var(--shade), .85) 45%, rgba(var(--shade), .97) 100%); }
  .home { padding: 16px 16px 40px; }
  .stage { padding: 80px 16px 30px; }
  .screen > .brand { left: 16px; }
  .back { right: 16px; }
}
@media (max-width: 560px) {
  .gp { grid-template-columns: 1fr; }
  .gp .thumb { display: none; }
  .gp .acts { justify-content: flex-start; }
}
/* Keep browser-autofilled fields in the dark theme */
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus { -webkit-text-fill-color: #eaf2f8; -webkit-box-shadow: 0 0 0 1000px #0b1626 inset; caret-color: #eaf2f8; transition: background-color 9999s; }
