/* Corgos Games — the hub's look (the UI standard: corpus projects/games-hub/docs/games-hub-ui-standard.md).
   Dark first on a warm night, cream type, corgi orange the one primary, rounded display type
   with no web font to fetch, chunky pill buttons that sink when pressed, short springs. */
:root {
  color-scheme: dark light;
  --night: #1e1a2e;
  --raised: #2a2440;
  --raised-2: #352e52;
  --line: rgba(255, 246, 230, 0.12);
  --text: #fff6e6;
  --quiet: rgba(255, 246, 230, 0.7);
  --orange: #f08a24;
  --orange-deep: #c96a14;
  --on-orange: #1e1a2e;
  --gold: #ffd166;
  --green: #3ab795;
  --red: #f25f5c;
  --round: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-card: 16px;
  --r-panel: 24px;
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}
@media (prefers-color-scheme: light) {
  :root {
    --night: #fbf1de;
    --raised: #fffaf0;
    --raised-2: #f3e5cb;
    --line: rgba(43, 33, 29, 0.12);
    --text: #2b211d;
    --quiet: rgba(43, 33, 29, 0.68);
    --shadow: 0 10px 30px rgba(120, 80, 40, 0.14);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--night);
  color: var(--text);
  font: 16px/1.5 var(--body);
  display: flex;
  flex-direction: column;
}
main { flex: 1; width: min(1120px, 100%); margin: 0 auto; padding: 8px 16px 48px; outline: none; }
a { color: inherit; }
img { display: block; }
h1, h2, h3, .big { font-family: var(--round); font-weight: 800; letter-spacing: -0.01em; line-height: 1.15; margin: 0; }
h1 { font-size: clamp(30px, 6vw, 46px); }
h2 { font-size: clamp(22px, 4vw, 28px); margin: 40px 0 14px; }
h3 { font-size: 20px; }
p { margin: 0; }
.quiet { color: var(--quiet); }
.num { font-variant-numeric: tabular-nums; }

/* ——— the bar ——— */
.bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 16px;
  height: 64px; padding: 0 16px;
  padding-top: env(safe-area-inset-top);
  background: color-mix(in srgb, var(--night) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 800 20px/1 var(--round); }
.brand img { width: 40px; height: 40px; border-radius: 12px; }
.nav { display: flex; gap: 4px; margin-left: 12px; }
.nav a {
  text-decoration: none; font: 700 15px/1 var(--round); color: var(--quiet);
  padding: 10px 14px; border-radius: 999px; transition: background 150ms, color 150ms;
}
.nav a:hover { color: var(--text); background: var(--raised); }
.nav a[aria-current="page"] { color: var(--text); background: var(--raised-2); }
.who { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px 0 4px;
  border-radius: 999px; background: var(--raised); text-decoration: none;
  font: 700 15px/1 var(--round); box-shadow: inset 0 0 0 1px var(--line);
}
.chip img { width: 36px; height: 36px; border-radius: 50%; }
.chip .lvl { font-size: 12px; color: var(--on-orange); background: var(--gold); border-radius: 999px; padding: 3px 7px; }
@media (max-width: 720px) {
  .bar { height: auto; min-height: 60px; flex-wrap: wrap; row-gap: 0; padding-bottom: 8px; padding-top: max(8px, env(safe-area-inset-top)); }
  .brand span { display: none; }
  .nav { order: 3; width: 100%; margin: 4px 0 0; justify-content: space-between; }
  .nav a { flex: 1; text-align: center; padding: 10px 6px; font-size: 14px; }
  .chip .name { max-width: 7em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ——— buttons ——— */
.btn {
  -webkit-appearance: none; appearance: none; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  font: 800 16px/1 var(--round); text-decoration: none;
  color: var(--on-orange); background: var(--orange);
  box-shadow: inset 0 -4px 0 var(--orange-deep);
  transition: transform 160ms var(--spring), box-shadow 120ms, filter 120ms;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(2px); box-shadow: inset 0 -2px 0 var(--orange-deep); }
.btn:focus-visible, .swatch:focus-visible, .tab:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.btn.ghost { color: var(--text); background: var(--raised-2); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.22); }
.btn.small { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn.danger { background: var(--red); box-shadow: inset 0 -4px 0 #b8403d; color: #fff; }
.btn[disabled] { opacity: 0.5; cursor: default; transform: none; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ——— the corgi ——— */
.corgi { position: relative; aspect-ratio: 1; border-radius: 28%; overflow: hidden; background: var(--raised-2); box-shadow: var(--shadow); }
.corgi img { position: absolute; inset: 0; width: 100%; height: 100%; }
.corgi.round { border-radius: 50%; }
.pop { animation: pop 360ms var(--spring); }
@keyframes pop { from { transform: scale(0.92); } to { transform: scale(1); } }

/* ——— the front page ——— */
.hero {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; align-items: center;
  margin-top: 16px; padding: 28px; border-radius: var(--r-panel);
  background: radial-gradient(120% 140% at 0% 0%, #3b2a5c 0%, var(--raised) 55%), var(--raised);
  box-shadow: var(--shadow); overflow: hidden;
}
@media (prefers-color-scheme: light) { .hero { background: radial-gradient(120% 140% at 0% 0%, #ffe3c2 0%, var(--raised) 60%); } }
.hero p.lead { font-size: 18px; color: var(--quiet); margin: 12px 0 22px; max-width: 32em; }
.hero .me { display: grid; grid-template-columns: 140px 1fr; gap: 18px; align-items: center; }
.hero .me .corgi { width: 140px; }
@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; padding: 20px; }
  .hero .me { grid-template-columns: 96px 1fr; }
  .hero .me .corgi { width: 96px; }
}
.levelbar { height: 12px; border-radius: 999px; background: var(--raised-2); overflow: hidden; margin: 8px 0 4px; }
.levelbar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--orange), var(--gold)); transition: width 600ms var(--spring); }

.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 18px; }
.game {
  display: flex; flex-direction: column; border-radius: var(--r-panel); overflow: hidden;
  background: var(--raised); box-shadow: var(--shadow); text-decoration: none;
  transition: transform 220ms var(--spring);
}
.game:hover { transform: translateY(-4px); }
.game .art { position: relative; aspect-ratio: 16 / 10; background: var(--coat); display: grid; place-items: center; overflow: hidden; }
.game .art::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.06) 0 22px, transparent 22px 44px); }
.game .art img { position: absolute; top: 9%; left: 50%; height: 82%; width: auto; aspect-ratio: 1; transform: translateX(-50%); border-radius: 22%; box-shadow: 0 0 0 6px var(--orange), 0 12px 28px rgba(0, 0, 0, 0.35); object-fit: cover; }
.game .body { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.game .body p { color: var(--quiet); }
.game .go { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font: 700 12px/1 var(--round); padding: 6px 10px; border-radius: 999px; background: var(--raised-2); color: var(--quiet); }
.tag.free { background: color-mix(in srgb, var(--green) 24%, transparent); color: var(--text); }
.game.coming { background: repeating-linear-gradient(-45deg, var(--raised) 0 18px, color-mix(in srgb, var(--raised-2) 70%, var(--raised)) 18px 36px); }
.game.coming .art { background: transparent; }
.game.coming .art .soon { font: 800 54px/1 var(--round); color: var(--gold); transform: rotate(-6deg); }

/* ——— panels, lists ——— */
.panel { background: var(--raised); border-radius: var(--r-panel); padding: 22px; box-shadow: var(--shadow); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 18px; align-items: start; }
.people { display: grid; gap: 10px; }
.person { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--r-card); background: var(--raised-2); text-decoration: none; }
.person .corgi { width: 52px; flex: none; border-radius: 50%; box-shadow: none; }
.person .who2 { flex: 1; min-width: 0; }
.person .who2 b { font-family: var(--round); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .who2 small { color: var(--quiet); }
.empty { display: grid; grid-template-columns: 72px 1fr; gap: 14px; align-items: center; padding: 16px; border-radius: var(--r-card); background: var(--raised-2); color: var(--quiet); }
.empty .corgi { width: 72px; box-shadow: none; }
label.field { display: grid; gap: 6px; font: 700 14px/1.2 var(--round); color: var(--quiet); }
input, select {
  font: 600 17px/1.2 var(--body); color: var(--text); background: var(--night);
  border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; min-height: 48px; width: 100%;
}
.hint { font-size: 13px; color: var(--quiet); min-height: 1.2em; }
.hint.bad { color: var(--red); }
.hint.good { color: var(--green); }
.stack { display: grid; gap: 16px; }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; }
.suggest button { font: 700 13px/1 var(--round); border: 0; border-radius: 999px; padding: 8px 12px; background: var(--raised-2); color: var(--text); cursor: pointer; }

/* ——— the wardrobe ——— */
.wardrobe { display: grid; grid-template-columns: minmax(240px, 380px) 1fr; gap: 24px; align-items: start; }
@media (max-width: 760px) { .wardrobe { grid-template-columns: 1fr; } .wardrobe .preview { width: min(300px, 80vw); margin: 0 auto; } }
.preview { position: sticky; top: 84px; display: grid; gap: 14px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tab { border: 0; cursor: pointer; font: 800 15px/1 var(--round); padding: 12px 16px; border-radius: 999px; background: var(--raised-2); color: var(--quiet); }
.tab[aria-selected="true"] { background: var(--orange); color: var(--on-orange); }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; }
.swatch {
  position: relative; border: 0; padding: 0; cursor: pointer; background: none; color: var(--text);
  display: grid; gap: 6px; text-align: center; font: 700 13px/1.2 var(--round);
}
.swatch .corgi { border-radius: 22%; box-shadow: 0 0 0 3px transparent; transition: box-shadow 150ms, transform 200ms var(--spring); }
.swatch:hover .corgi { transform: scale(1.04); }
.swatch[aria-pressed="true"] .corgi { box-shadow: 0 0 0 4px var(--orange); }
.swatch.locked .corgi { filter: grayscale(0.85) brightness(0.6); }
.swatch .lock { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, 0.6); color: #fff; }
.swatch .rar { font-size: 11px; color: var(--quiet); }
.r-rare { color: #6ec1ff !important; } .r-epic { color: #c79bff !important; } .r-legendary { color: var(--gold) !important; }

/* ——— the profile ——— */
.profile { display: grid; grid-template-columns: 260px 1fr; gap: 28px; align-items: center; margin-top: 16px; }
.profile .corgi { width: 260px; }
@media (max-width: 720px) { .profile { grid-template-columns: 1fr; text-align: center; } .profile .corgi { width: 200px; margin: 0 auto; } .profile .row { justify-content: center; } }
.handle { font: 700 18px/1 var(--round); color: var(--quiet); margin: 6px 0 10px; }
.motto { font: italic 600 18px/1.4 var(--body); margin-bottom: 16px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.stat { padding: 14px; border-radius: var(--r-card); background: var(--raised-2); }
.stat b { font: 800 28px/1 var(--round); display: block; }
.stat span { color: var(--quiet); font-size: 14px; }

/* ——— achievements ——— */
.medals { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 12px; }
.medal { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center; padding: 14px; border-radius: var(--r-card); background: var(--raised-2); }
.medal.off { opacity: 0.55; }
.medal .disc { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font: 800 22px/1 var(--round); color: #2b211d; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.2); }
.t-bronze { background: linear-gradient(160deg, #f0b27a, #b9733d); }
.t-silver { background: linear-gradient(160deg, #f1f3f6, #a9b0bb); }
.t-gold { background: linear-gradient(160deg, #ffe38a, #e0a92a); }
.t-crown { background: linear-gradient(160deg, #ffd166, #f08a24); }
.medal b { font-family: var(--round); }
.medal small { display: block; color: var(--quiet); }
.medal .gives { color: var(--gold); font-weight: 700; }

/* ——— toasts, footer ——— */
.toasts { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: 8px; z-index: 50; width: min(92vw, 420px); }
.toast { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 18px; background: var(--raised-2); color: var(--text); box-shadow: var(--shadow); animation: rise 420ms var(--spring); font-weight: 600; }
.toast.win { background: linear-gradient(120deg, #3b2a5c, #5a3a2a); color: #fff6e6; }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; }
.foot { text-align: center; padding: 28px 16px calc(28px + env(safe-area-inset-bottom)); color: var(--quiet); font-size: 14px; }
.notice { margin: 16px 0 0; padding: 14px 16px; border-radius: var(--r-card); background: color-mix(in srgb, var(--red) 22%, var(--raised)); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
