/* QuickPlayroom — the hub, sign-in, account and legal pages.
   Each game carries its own stylesheet; this one never reaches into them. */

:root {
  --paper:   #F6F1E7;
  --paper-2: #EFE8DA;
  --card:    #FFFDF8;
  --ink:     #1D1B16;
  --ink-2:   #57534A;
  --line:    #DDD4C3;
  --tomato:  #D94A24;
  --mustard: #F2B134;
  --teal:    #1F7A74;
  --ok-bg:   #E3F1E8;
  --ok-ink:  #1E5B3A;
  --err-bg:  #FBE5DF;
  --err-ink: #8E2A12;
  --focus:   #1F7A74;
  --shadow:  0 1px 0 rgba(29,27,22,.06), 0 8px 24px -12px rgba(29,27,22,.25);

  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --body:    "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono:    ui-monospace, "SFMono-Regular", Consolas, monospace;

  --gutter: 20px;
  --wrap: 1120px;
  --radius: 18px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:   #16140F;
    --paper-2: #1E1B15;
    --card:    #221F18;
    --ink:     #F3EDE1;
    --ink-2:   #B5AE9F;
    --line:    #3A352B;
    --tomato:  #FF7A52;
    --mustard: #F5BF55;
    --teal:    #4CC3B8;
    --ok-bg:   #173327;
    --ok-ink:  #A8E3BF;
    --err-bg:  #3A1C14;
    --err-ink: #FFB8A3;
    --focus:   #4CC3B8;
    --shadow:  0 1px 0 rgba(0,0,0,.3), 0 10px 30px -14px rgba(0,0,0,.7);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--body);
  min-height: 100vh;
  display: flex; flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(34px, 6vw, 60px); font-weight: 800; }
h2 { font-size: clamp(24px, 3vw, 30px); font-weight: 700; }
h3 { font-size: 20px; font-weight: 700; }
p { margin: 0 0 1em; }
code { font: 500 .88em var(--mono); background: var(--paper-2); padding: .1em .35em; border-radius: 5px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 760px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }
.muted { color: var(--ink-2); }
.eyebrow { font: 600 13px/1 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--tomato); margin-bottom: 14px; }
.lede { font-size: clamp(18px, 2vw, 21px); color: var(--ink-2); max-width: 44em; }

/* ---------------------------------------------------------------- header */

.site-head { border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 5; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-logo { width: 36px; height: 36px; flex: none; display: block; filter: drop-shadow(0 3px 6px rgba(214,36,110,.25)); transition: transform .2s ease; }
.brand:hover .brand-logo { transform: rotate(-6deg) scale(1.05); }
@media (prefers-reduced-motion: reduce) { .brand-logo { transition: none; } }
.brand-word { font: 700 21px/1 var(--display); letter-spacing: -.03em; }
.brand-word b { font-weight: 800; color: var(--tomato); }
.head-nav { display: flex; align-items: center; gap: 6px; }
.head-nav > a:not(.btn):not(.who) { padding: 8px 12px; border-radius: 10px; text-decoration: none; font-weight: 500; color: var(--ink-2); }
.head-nav > a:not(.btn):not(.who):hover, .head-nav > a[aria-current="page"]:not(.who) { color: var(--ink); background: var(--paper-2); }
.who { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; font-weight: 600; margin-left: 6px; }
.who:hover, .who[aria-current="page"] { background: var(--paper-2); }
.who-name { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--mustard); color: #1D1B16; font: 800 15px/1 var(--display);
}
.avatar-big { width: 72px; height: 72px; font-size: 34px; flex: none; }

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 12px; border: 2px solid var(--ink);
  background: var(--ink); color: var(--paper);
  font: 600 16px/1 var(--body); text-decoration: none; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 3px 0 var(--tomato); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn-small { padding: 8px 14px; font-size: 15px; margin-left: 6px; }
.btn-quiet { background: transparent; color: var(--ink); }
.btn-danger { background: var(--tomato); border-color: var(--tomato); color: #fff; }
.btn-danger:hover { box-shadow: 0 3px 0 var(--ink); }

/* ------------------------------------------------------------------ home */

.hero { padding: clamp(48px, 9vw, 104px) 0 clamp(28px, 4vw, 48px); }
.shelf { margin-bottom: clamp(56px, 8vw, 96px); }
.hero h1 { max-width: 19ch; }
.hl { color: var(--tomato); }

.shelf-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; border-top: 2px solid var(--ink); padding-top: 18px; margin-bottom: 24px; }
.shelf-head h2 { margin: 0; }
.shelf-head p { margin: 0; color: var(--ink-2); }
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 24px; }

.game-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease; }
.game-card:not(.soon):hover { transform: translateY(-3px); box-shadow: 0 1px 0 rgba(29,27,22,.06), 0 18px 34px -16px rgba(29,27,22,.4); }
.game-link { display: flex; flex-direction: column; height: 100%; text-decoration: none; }
.game-art { aspect-ratio: 1200 / 630; background: var(--card-accent, var(--ink)); overflow: hidden; }
.game-art img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.game-card:hover .game-art img { transform: scale(1.03); }
.game-body { padding: 20px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.game-body h3 { font-size: 24px; margin-bottom: 8px; }
.game-body p { color: var(--ink-2); font-size: 16px; }
.game-body .btn { align-self: flex-start; margin-top: auto; }
.tags { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font: 600 12px/1 var(--body); letter-spacing: .04em; padding: 6px 10px; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); }

.soon { background: transparent; border: 2px dashed var(--line); box-shadow: none; display: grid; place-items: center; min-height: 280px; }
.soon-inner { text-align: center; padding: 32px; max-width: 30ch; }
.soon-inner p { color: var(--ink-2); font-size: 16px; }
.soon-dots { display: inline-flex; gap: 8px; margin-bottom: 18px; }
.soon-dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--tomato); animation: bob 1.4s ease-in-out infinite; }
.soon-dots i:nth-child(2) { background: var(--mustard); animation-delay: .15s; }
.soon-dots i:nth-child(3) { background: var(--teal); animation-delay: .3s; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) {
  .soon-dots i { animation: none; }
  .btn, .game-card, .game-art img { transition: none; }
}

.why { margin: clamp(56px, 8vw, 96px) 0 clamp(48px, 7vw, 80px); padding: clamp(28px, 4vw, 44px); background: var(--paper-2); border-radius: var(--radius); }
.why-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 24px 32px; margin: 8px 0 20px; }
.why-grid h3 { font-size: 19px; margin-bottom: 6px; }
.why-grid p { color: var(--ink-2); margin: 0; font-size: 16px; }
.why-note { margin: 0; font-size: 15px; color: var(--ink-2); }

/* --------------------------------------------------------------- sign in */

.auth-card { margin: clamp(40px, 8vw, 88px) auto; max-width: 480px; background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: clamp(24px, 5vw, 40px); box-shadow: var(--shadow); }
.auth-card h1 { font-size: clamp(30px, 5vw, 38px); }
.auth-card .lede { font-size: 17px; }
.providers { display: grid; gap: 12px; margin: 24px 0; }
.providers-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 0; }
.provider {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 52px; padding: 0 20px; border-radius: 12px;
  font: 600 16px/1 var(--body); text-decoration: none;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  transition: background .12s ease, border-color .12s ease;
}
.provider:hover { border-color: var(--ink-2); }
.provider-icon { width: 20px; height: 20px; display: inline-grid; place-items: center; flex: none; }
.provider-icon svg { width: 20px; height: 20px; }
/* Each provider in the colours its own brand guidelines ask for. */
.provider-google { background: #fff; color: #1F1F1F; border-color: #747775; }
.provider-google:hover { background: #F8F9FA; }
.provider-microsoft { background: #fff; color: #5E5E5E; border-color: #8C8C8C; }
.provider-microsoft:hover { background: #F3F3F3; }
.provider-discord { background: #5865F2; color: #fff; border-color: #5865F2; }
.provider-discord:hover { background: #4752C4; border-color: #4752C4; }
.provider-facebook { background: #1877F2; color: #fff; border-color: #1877F2; }
.provider-facebook:hover { background: #166FE5; }
.provider-apple { background: #000; color: #fff; border-color: #000; }
@media (prefers-color-scheme: dark) {
  .provider-google { background: #131314; color: #E3E3E3; border-color: #8E918F; }
  .provider-google:hover { background: #1F1F20; }
  .provider-microsoft { background: #2F2F2F; color: #fff; border-color: #2F2F2F; }
  .provider-apple { background: #fff; color: #000; border-color: #fff; }
}
.provider-compact { min-height: 44px; font-size: 15px; padding: 0 16px; }
.fine { font-size: 14px; color: var(--ink-2); margin: 0 0 10px; }

.notice, .alert, .flash { padding: 14px 18px; border-radius: 12px; font-weight: 500; }
.notice { background: var(--paper-2); }
.alert { background: var(--err-bg); color: var(--err-ink); }
.flash { background: var(--ok-bg); color: var(--ok-ink); }
main > .alert, main > .flash { margin: 0 0 24px; }

/* --------------------------------------------------------------- account */

.account-head { display: flex; align-items: center; gap: 20px; padding: clamp(36px, 6vw, 64px) 0 28px; }
.account-head h1 { margin: 0 0 4px; font-size: clamp(32px, 5vw, 48px); overflow-wrap: anywhere; }
.account-head .eyebrow { margin-bottom: 8px; }
.account-head .muted { margin: 0; }
.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 20px; margin-bottom: 72px; align-items: start; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 26px; }
.panel h2 { font-size: 22px; margin-bottom: 12px; }
.panel > :last-child { margin-bottom: 0; }
.welcome { margin-bottom: 20px; border: 2px solid var(--mustard); }
.danger { border-color: color-mix(in srgb, var(--tomato) 45%, var(--line)); }
.row { display: flex; flex-wrap: wrap; gap: 10px; }
.row form { margin: 0; }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.inline-form label { flex-basis: 100%; font-weight: 500; }
input {
  font: 500 16px/1.2 var(--body); color: var(--ink); background: var(--paper);
  border: 2px solid var(--line); border-radius: 12px; padding: 11px 14px; min-width: 0; flex: 1 1 200px;
}
input:focus { border-color: var(--focus); outline: none; }
.methods { list-style: none; padding: 0; margin: 0 0 16px; }
.method { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.method:last-child { border-bottom: 0; }
.method .provider-icon { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); }
.method .provider-discord { color: #fff; }
.method-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.method-text span { color: var(--ink-2); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.method form { margin: 0; }
.stat-list { list-style: none; padding: 0; margin: 0 0 12px; }
.stat-list li { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.stat-nums { color: var(--ink-2); }
.stat-nums b { color: var(--ink); font-family: var(--display); font-size: 20px; }

/* ----------------------------------------------------------------- prose */

.prose { padding: clamp(40px, 7vw, 72px) 0 80px; }
.prose h1 { font-size: clamp(36px, 6vw, 52px); }
.prose h2 { margin-top: 2em; padding-top: .6em; border-top: 1px solid var(--line); }
.prose h3 { margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .5em; }
.prose li::marker { color: var(--tomato); }
.prose .lede { margin-bottom: 1.6em; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.toc a { font-size: 14px; font-weight: 500; text-decoration: none; padding: 6px 12px; border-radius: 999px; background: var(--paper-2); }
.toc a:hover { background: var(--line); }
table { width: 100%; border-collapse: collapse; margin: 0 0 1.2em; font-size: 15px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; background: var(--paper-2); }
.prose table { display: block; overflow-x: auto; }

/* ---------------------------------------------------------------- footer */

.site-foot { border-top: 1px solid var(--line); padding: 28px 0 36px; margin-top: 24px; font-size: 15px; }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; align-items: center; }
.foot-brand { margin: 0; font-family: var(--display); font-weight: 700; }
.foot-brand span { font-family: var(--body); font-weight: 400; color: var(--ink-2); }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-foot nav a { color: var(--ink-2); text-decoration: none; }
.site-foot nav a:hover { color: var(--ink); text-decoration: underline; }

@media (max-width: 400px) {
  .head-nav > a[href="/about"] { display: none; }
}
@media (max-width: 560px) {
  :root { --gutter: 16px; }
  .head-nav { gap: 2px; }
  .head-nav > a:not(.btn):not(.who) { font-size: 15px; }
  .btn-small { padding: 8px 12px; margin-left: 2px; white-space: nowrap; }
  .head-nav > a:not(.btn):not(.who) { padding: 8px; }
  .who-name { display: none; }
  .who { padding: 3px; }
  .brand-word { font-size: 19px; }
  .account-head { flex-direction: column; align-items: flex-start; }
}

/* ------------------------------------------------------ forms (accounts) */

.stack { display: grid; gap: 14px; margin: 20px 0 0; }
.field { display: grid; gap: 6px; }
.field > span { font-weight: 600; font-size: 15px; }
.field small { color: var(--ink-2); font-size: 13px; line-height: 1.45; }
.field input { width: 100%; flex: none; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); }
.check input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--teal); }
.btn-wide { width: 100%; }
.split { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.or { display: flex; align-items: center; gap: 12px; color: var(--ink-2); font-size: 14px; margin: 24px 0 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-card .providers { margin: 16px 0 20px; }
.auth-card .notice { font-size: 14px; margin: 0; }
.recovery-code { text-align: center; margin: 20px 0; }
.recovery-code code {
  display: inline-block; font-size: clamp(20px, 5vw, 28px); letter-spacing: .08em;
  padding: 14px 18px; border: 2px dashed var(--mustard); border-radius: 12px; background: var(--paper);
  user-select: all;
}
.panel details { border-top: 1px solid var(--line); padding: 10px 0; }
.panel details:last-of-type { padding-bottom: 0; }
.panel summary { cursor: pointer; font-weight: 600; }
.panel details .stack { margin-top: 12px; }
.panel details p { margin: 10px 0; }

.nav-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px; border-radius: 999px; background: var(--tomato); color: #fff; font: 700 11px/1 var(--body); vertical-align: 2px; }
.nav-badge[hidden] { display: none; }
.head-nav > a { white-space: nowrap; }
@media (max-width: 480px) {
  /* The logo already goes home; make room for Friends and the avatar. */
  .head-nav > a[href="/"] { display: none; }
  .brand-word { font-size: 18px; }
}
