/* platform.css
   The PLATFORM theme: a friendly-daylight (parchment + forest) skin for the platform
   chrome only, scoped to the .platform-screen wrapper so it overrides whatever
   experience theme is active WITHOUT touching the experiences themselves. Inside an
   adventure the pack's own theme rules; the storefront, the platform header and the
   platform login wear this calm parchment-and-forest frame so each experience's own
   colours pop against it. Every colour is a theme variable so existing components
   (cards, buttons, chips) restyle automatically inside the scope. No em/en dashes. */

.platform-screen {
  /* Bold, modern platform identity: crisp neutral surfaces, one confident
     emerald accent, generous space and depth. Each pack keeps its own theme;
     this is the premium hub they all sit inside. */
  --parchment: #eef2f6;
  --cream: #ffffff;
  --ink: #131a24;
  --ink-soft: #475260;
  --forest: #0fa57a;
  --accent: #0fa57a;
  --accent-strong: #0b8c66;
  --accent-soft: #e7f6f1;
  --accent-grad: linear-gradient(135deg, #14b386 0%, #0b8c66 100%);
  --gold: #0fa57a;
  --gold-bright: #0b8c66;
  --gold-dim: #d7dee6;
  --amber: #d97706;
  --rune-red: #c2410c;
  --navy: #0f1622;
  --near-black: #0b101a;
  --panel: #ffffff;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 12px 28px rgba(16, 24, 40, 0.10);

  background: transparent;
  color: var(--ink);
  min-height: 60vh;
  border-radius: var(--radius);
  padding: 1.4rem 1rem 2rem;
  font-family: var(--font-body, system-ui, sans-serif);
}

/* Bold-modern platform chrome uses a clean sans for its headings (the medieval
   serif stays inside the adventures themselves). */
.platform-screen h1:not(.platform-wordmark),
.platform-screen h2,
.platform-screen h3,
.platform-screen .panel-title,
.platform-screen .panel-sub {
  font-family: var(--font-body, system-ui, sans-serif);
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--ink, #131a24);
}

/* The platform wordmark + tagline that head the storefront / platform surfaces. */
.platform-brand { text-align: center; margin: 1.2rem 0 1.8rem; }
.platform-wordmark {
  font-family: var(--font-body, system-ui, sans-serif);
  font-weight: 800;
  font-size: clamp(2.8rem, 11vw, 4.6rem);
  letter-spacing: -0.02em;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 0;
  line-height: 0.95;
}
.platform-tagline {
  color: var(--ink-soft, #475260);
  margin: 0.7rem auto 0;
  max-width: 30rem;
  font-size: 1.02rem;
  line-height: 1.5;
}
/* Optional acronym strip: the bold first letter of each word spells the name. */
.platform-acronym {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.1rem 0.7rem;
  margin: 0.7rem 0 0; font-size: 0.82rem; opacity: 0.8;
}
.platform-acronym .pa-word { white-space: nowrap; }
.platform-acronym .pa-letter { color: var(--forest, #2f6b4f); font-weight: 700; }

/* A subtle "part of TROLLS" mark for an experience's own screens (uses whatever
   theme is active there, so it stays quiet against the pack palette). */
.platform-mark {
  display: inline-flex; align-items: baseline; gap: 0.35rem;
  font-size: 0.78rem; opacity: 0.65; letter-spacing: 0.04em;
}
.platform-mark strong { letter-spacing: 0.12em; }
.title-platform-mark { justify-content: center; margin-top: 1.4rem; }

/* ----- Role-first platform landing ----- */
.platform-landing { max-width: 40rem; margin: 0 auto; }
/* Generated platform hero art behind the landing (set via --landing-hero), softly
   dimmed so the dark text + wordmark stay readable on the light platform theme. */
.platform-landing.has-hero {
  background-image: linear-gradient(180deg, rgba(244,246,250,0.80), rgba(244,246,250,0.93)), var(--landing-hero);
  background-size: cover; background-position: center;
  border-radius: 18px; padding: 1.6rem 1.2rem 2rem; margin-top: 0.5rem;
  box-shadow: 0 12px 40px rgba(16,24,40,0.10);
}
.landing-signin-note { margin: 0.6rem 0 0; font-size: 0.95rem; opacity: 0.8; }
.landing-door {
  display: block; width: 100%; text-align: left; cursor: pointer;
  border: 1px solid var(--gold-dim, #d7dee6); border-radius: var(--radius, 18px);
  background: var(--panel, #ffffff); color: var(--ink, #131a24);
  padding: 1.15rem 1.25rem; margin: 0.7rem 0;
  box-shadow: var(--shadow);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.landing-door:hover {
  transform: translateY(-2px);
  border-color: var(--accent, #0fa57a);
  box-shadow: 0 2px 4px rgba(16,24,40,0.06), 0 18px 38px rgba(15,165,122,0.16);
}
.landing-door-title {
  font-family: var(--font-body, system-ui, sans-serif); font-weight: 700;
  font-size: 1.2rem; letter-spacing: -0.01em; color: var(--ink, #131a24);
}
.landing-door-note { font-size: 0.94rem; color: var(--ink-soft, #475260); margin-top: 0.25rem; line-height: 1.45; }
/* A door with a generated icon lays the icon beside its text. */
.landing-door.has-icon { display: flex; align-items: center; gap: 0.9rem; }
.landing-door.has-icon .landing-door-body { flex: 1 1 auto; min-width: 0; }
.landing-door-icon { width: 52px; height: 52px; flex: 0 0 52px; border-radius: 12px; object-fit: cover; box-shadow: 0 2px 8px rgba(16,24,40,0.12); }
.landing-door-play.has-icon .landing-door-icon { width: 64px; height: 64px; flex-basis: 64px; }
/* The player path is the prominent one: a bold emerald hero card. */
.landing-door-play {
  border: none; color: #fff;
  background: var(--accent-grad, linear-gradient(135deg, #14b386, #0b8c66));
  box-shadow: 0 2px 4px rgba(11,140,102,0.2), 0 16px 36px rgba(15,165,122,0.28);
  padding: 1.5rem 1.35rem;
}
.landing-door-play:hover { box-shadow: 0 2px 4px rgba(11,140,102,0.25), 0 22px 46px rgba(15,165,122,0.36); }
.landing-door-play .landing-door-title { font-size: 1.6rem; color: #fff; }
.landing-door-play .landing-door-note { color: rgba(255,255,255,0.92); }
/* The resume door for a remembered session sits at the very top. */
.landing-door-continue { border-color: var(--accent, #0fa57a); background: var(--accent-soft, #e7f6f1); }
.landing-door-continue .landing-door-title { font-size: 1.4rem; color: var(--accent-strong, #0b8c66); }
/* The secondary doors sit in a responsive grid below. */
.landing-doors { display: grid; gap: 0.7rem; grid-template-columns: 1fr; margin-top: 0.4rem; }
@media (min-width: 32rem) { .landing-doors { grid-template-columns: 1fr 1fr; } }

/* The two secondary login links under the doors (join by code / account login).
   The shared .btn-small uses a theme token that goes pale on the light landing, so
   give them clear, readable, outlined-button styling and stack them centred. */
.platform-landing .landing-access-link,
.platform-landing .landing-account-link {
  display: block; width: 100%; max-width: 24rem; margin: 0.7rem auto 0;
  text-align: center; padding: 12px 14px;
  /* #0b8c66 lands at 4.23:1 on white (just under AA); #0a6b48 clears 4.5:1 at this size. */
  background: #fff; color: #0a6b48;
  border: 1px solid var(--accent, #0fa57a); border-radius: 12px;
  font-weight: 600; font-size: 0.95rem;
}
.platform-landing .landing-access-link:hover,
.platform-landing .landing-account-link:hover { background: var(--accent-soft, #e7f6f1); }

/* ----- Organiser (Game Master) home ----- */
.organiser { max-width: 42rem; margin: 0 auto; }
.org-card { border: 1px solid var(--gold-dim, #d7dee6); border-radius: var(--radius, 18px); background: var(--panel, #ffffff); padding: 1.1rem 1.25rem; margin: 0.8rem 0; box-shadow: var(--shadow); }
.org-games { display: flex; flex-direction: column; gap: 0.7rem; }
.org-game { border: 1px solid var(--gold-dim, #d7dee6); border-radius: 14px; padding: 0.85rem 1rem; background: var(--cream, #ffffff); }
.org-game-head { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: baseline; }
.org-game-name { font-weight: 700; color: var(--accent-strong, #0b8c66); }
.org-game-code { background: var(--accent-soft, rgba(15,165,122,0.12)); color: var(--accent-strong, #0b8c66); padding: 0.1rem 0.45rem; border-radius: 6px; letter-spacing: 0.08em; font-weight: 600; }
.org-game-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.org-code-line { margin-top: 0.4rem; font-weight: 600; color: var(--forest, #2f6b4f); }
/* Invite a specific person by email (My games card + set-up wizard). */
.org-invite-row { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin-top: 0.5rem; }
.org-invite-email { flex: 1 1 12rem; min-width: 10rem; }
.gw-invite-msg { margin-top: 0.4rem; font-size: 0.9rem; color: var(--ink-soft, #475260); }
.org-manage { margin-top: 0.6rem; padding-top: 0.6rem; border-top: 1px dashed var(--gold-dim, #d7dee6); display: flex; flex-direction: column; gap: 0.4rem; }
.org-manage-label { font-size: 0.78rem; font-weight: 700; color: var(--muted, #6a7480); text-transform: uppercase; letter-spacing: 0.04em; }
.org-manage-row { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.org-manage-row .f-input { flex: 1 1 12rem; }
.org-manage-log { display: flex; flex-direction: column; gap: 0.2rem; }
.org-log-line { font-size: 0.82rem; color: var(--muted, #6a7480); }
.org-manage-sublabel { font-size: 0.8rem; font-weight: 600; color: var(--ink, #23303a); margin-top: 0.2rem; }
.org-manage-check { display: flex; align-items: center; gap: 0.3rem; font-size: 0.82rem; color: var(--muted, #6a7480); }
.org-preset-row { gap: 0.3rem; }
.org-preset { font-size: 0.75rem; padding: 0.25rem 0.5rem; }

/* ----- Game set-up wizard (in the organiser home) ----- */
.gw-steps { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.2rem 0 0.9rem; }
.gw-step { font-size: 0.78rem; font-weight: 700; padding: 0.18rem 0.55rem; border-radius: 999px; background: var(--accent-soft, rgba(15,165,122,0.12)); color: var(--muted, #6a7480); border: 1px solid transparent; }
.gw-step.active { background: var(--accent-strong, #0b8c66); color: #fff; }
.gw-step.done { color: var(--accent-strong, #0b8c66); border-color: var(--accent-strong, #0b8c66); background: transparent; }
.gw-body { display: flex; flex-direction: column; gap: 0.55rem; }
.gw-hint { font-size: 0.9rem; color: var(--muted, #6a7480); margin: 0.1rem 0 0; }
.gw-themes { display: flex; flex-direction: column; gap: 0.35rem; margin: 0.3rem 0; }
.gw-check { display: flex; align-items: center; gap: 0.45rem; font-weight: 600; }
.gw-check input { width: 1.15rem; height: 1.15rem; }
.gw-lock { margin-top: 0.55rem; }
.gw-review { list-style: none; padding: 0; margin: 0.4rem 0; display: flex; flex-direction: column; gap: 0.3rem; }
.gw-review li { display: flex; justify-content: space-between; gap: 0.8rem; border-bottom: 1px dashed var(--gold-dim, #d7dee6); padding-bottom: 0.3rem; }
.gw-rk { color: var(--muted, #6a7480); font-weight: 600; }
.gw-rv { font-weight: 700; text-align: right; }
.gw-code-reveal { font-size: 1.15rem; font-weight: 700; margin: 0.4rem 0; display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.gw-issue-row { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.6rem; }
.gw-count { width: 6rem; }
.gw-issued { margin-top: 0.6rem; }
.gw-code-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.3rem; }
.gw-actions { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1rem; }

/* ===== Bold-modern platform chrome: applies to every platform-day screen, ===== *
 * including those not wrapped in .platform-screen (join, register, organiser). *
 * Each adventure keeps its own theme, fonts and chunky amber buttons. */

/* Modern sans headings on the platform (the wordmark keeps its gradient). */
html[data-theme='platform-day'] h1:not(.platform-wordmark),
html[data-theme='platform-day'] h2,
html[data-theme='platform-day'] h3 {
  font-family: var(--font-body, system-ui, sans-serif);
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: none;
}

/* Primary action: flat emerald instead of the chunky amber bevel. */
html[data-theme='platform-day'] .btn-amber {
  background: linear-gradient(135deg, #14b386 0%, #0b8c66 100%);
  color: #fff;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(11, 140, 102, 0.25), 0 10px 24px rgba(15, 165, 122, 0.22);
}
html[data-theme='platform-day'] .btn-amber:active {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(11, 140, 102, 0.25), 0 6px 16px rgba(15, 165, 122, 0.2);
}

/* Secondary actions: clean white with a hairline border.
   NOTE: at platform-day level --ink is a light surface token, so dark text is
   set explicitly here to avoid white-on-white. */
html[data-theme='platform-day'] .btn-small {
  background: #ffffff;
  color: #131a24;
  border: 1px solid #d7dee6;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

/* Inputs: crisp white fields with an emerald focus ring. */
html[data-theme='platform-day'] .f-input,
html[data-theme='platform-day'] input[type='text'],
html[data-theme='platform-day'] input[type='password'],
html[data-theme='platform-day'] input[type='email'],
html[data-theme='platform-day'] input[type='number'],
html[data-theme='platform-day'] select,
html[data-theme='platform-day'] textarea {
  background: #ffffff;
  border: 1px solid #d7dee6;
  border-radius: 12px;
  color: #131a24;
}
html[data-theme='platform-day'] .f-input:focus,
html[data-theme='platform-day'] input:focus,
html[data-theme='platform-day'] select:focus,
html[data-theme='platform-day'] textarea:focus {
  outline: none;
  border-color: var(--forest, #0fa57a);
  box-shadow: 0 0 0 3px rgba(15, 165, 122, 0.16);
}

/* ===== Refinement pass: focus rings, door affordance, motion-safety ===== */
/* Keyboard focus is clearly visible on the platform's interactive surfaces. */
html[data-theme='platform-day'] .landing-door:focus-visible,
html[data-theme='platform-day'] .btn-amber:focus-visible,
html[data-theme='platform-day'] .btn-small:focus-visible {
  outline: 3px solid var(--accent, #0fa57a);
  outline-offset: 2px;
}
/* A quiet chevron signals the doors are tappable, without adding clutter. */
.landing-door { position: relative; padding-right: 2.6rem; }
.landing-door::after {
  content: '\203A';
  position: absolute; right: 1.1rem; top: 50%; transform: translateY(-50%);
  font-size: 1.6rem; line-height: 1; opacity: 0.5;
}
.landing-door-play::after { color: #fff; opacity: 0.85; }
@media (prefers-reduced-motion: reduce) {
  html[data-theme='platform-day'] .landing-door,
  html[data-theme='platform-day'] .btn-amber { transition: none !important; }
  html[data-theme='platform-day'] .landing-door:hover { transform: none !important; }
}

/* ----- Account login + "your experiences" picker (returning multi-experience player) ----- */
.account-login { max-width: 30rem; margin: 0 auto; }
.account-form { display: flex; flex-direction: column; gap: 0.6rem; margin: 0.8rem 0; }
.account-games { display: flex; flex-direction: column; gap: 0.7rem; margin: 0.8rem 0; }
.account-game {
  width: 100%; text-align: left; cursor: pointer;
  border: 1px solid var(--gold-dim, #d7dee6); border-radius: 14px;
  background: var(--panel, #fff); color: var(--ink, #131a24);
  padding: 0.9rem 1.1rem; box-shadow: var(--shadow);
  transition: transform 0.16s ease, border-color 0.16s ease;
}
.account-game:hover:not([disabled]) { transform: translateY(-2px); border-color: var(--accent, #0fa57a); }
.account-game[disabled] { opacity: 0.6; cursor: not-allowed; }
.account-game-name { font-weight: 700; font-size: 1.05rem; color: var(--accent-strong, #0b8c66); }
.account-game-sub { font-size: 0.9rem; color: var(--ink-soft, #475260); margin-top: 0.15rem; }

/* ----- Unified-account redesign (013): marketing homepage, account home, switcher ----- */

/* Marketing homepage: hero, blurb, how-it-works steps, primary CTA. */
.marketing { max-width: 34rem; margin: 0 auto; }
.marketing-hero { margin-bottom: 1rem; }
.marketing-headline { font-size: 1.35rem; font-weight: 800; color: var(--ink, #131a24); margin: 0.7rem 0 0.2rem; line-height: 1.25; }
.marketing-sub { font-size: 1rem; color: var(--ink-soft, #475260); margin: 0; line-height: 1.5; }
.marketing-cta { display: block; width: 100%; margin: 0.4rem 0 1rem; }
.marketing-blurb { font-size: 0.98rem; color: var(--ink, #131a24); line-height: 1.55; margin: 1rem 0; }
.marketing-steps { list-style: none; padding: 0; margin: 1rem 0; display: flex; flex-direction: column; gap: 0.8rem; }
.marketing-step { display: flex; align-items: flex-start; gap: 0.8rem; }
.marketing-step-num {
  flex: 0 0 2rem; width: 2rem; height: 2rem; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800;
  background: var(--accent, #0fa57a); color: #fff;
}
.marketing-step-title { font-weight: 700; color: var(--ink, #131a24); }
.marketing-step-note { font-size: 0.92rem; color: var(--ink-soft, #475260); line-height: 1.45; }
.marketing-secondary { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; margin-top: 1rem; }

/* Post-login account home: role tiles + active-games list with role badges. */
.account-home { max-width: 34rem; margin: 0 auto; }
.account-games-card { margin-bottom: 1rem; }
.account-tiles { margin-top: 0.4rem; }
.account-game-roles { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.35rem; }
.role-badge {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase;
  padding: 0.12rem 0.5rem; border-radius: 999px; color: #fff; background: var(--ink-soft, #475260);
}
.role-badge.role-owner { background: var(--accent-strong, #0b8c66); }
.role-badge.role-gm { background: #6b4fbb; }
.role-badge.role-player { background: #2f6fed; }
.account-logout { display: block; margin: 1rem auto 0; }

/* Header controls: game switcher + player/GM role toggle. */
.app-switcher, .app-role-toggle {
  border: 1px solid var(--gold-dim, #d7dee6); border-radius: 999px;
  background: var(--panel, #fff); color: var(--ink, #131a24);
  font-size: 0.82rem; font-weight: 700; padding: 0.25rem 0.7rem; cursor: pointer;
  max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.app-switcher.hidden, .app-role-toggle.hidden { display: none; }
.app-role-toggle { background: var(--accent, #0fa57a); color: #fff; border-color: transparent; }

/* Top-bar quick navigation (role-scoped: Playing / Running / Admin). */
.quicknav-card { max-width: 28rem; }
.quicknav-section { margin: 0.4rem 0 0.2rem; }
.quicknav-section .menu-section-title { font-size: 0.78rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent-strong, #0b8c66); margin: 0.6rem 0 0.3rem; }
.quicknav-game, .quicknav-link { width: 100%; text-align: left; }
.quicknav-game.is-current { border-color: var(--accent, #0fa57a); }
.quicknav-game-name { font-weight: 700; }
.quicknav-game-roles { font-size: 0.85rem; color: var(--ink-soft, #475260); margin-top: 0.15rem; }
.quicknav-logout { margin-top: 0.6rem; }

/* Logged-out interactive sample. */
.sample-scene { max-width: 34rem; margin: 0 auto; }
.sample-intro { font-size: 1rem; color: var(--ink, #131a24); line-height: 1.55; margin: 0.6rem 0 1rem; }
.sample-panel { margin: 0.6rem 0; padding: 0.7rem 0.9rem; border-radius: 12px; background: var(--panel, #fff); box-shadow: var(--shadow); }
.sample-speaker { font-weight: 800; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--accent-strong, #0b8c66); }
.sample-text { color: var(--ink, #131a24); line-height: 1.5; margin-top: 0.2rem; }
.sample-choice { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.6rem; }
.sample-reply { font-style: italic; color: var(--ink, #131a24); line-height: 1.5; }
.sample-outro { color: var(--ink-soft, #475260); line-height: 1.5; }
