:root {
  color-scheme: light;
  --bg: #faf8f1;
  --surface: #fff;
  --surface-soft: #edf5ee;
  --text: #24342f;
  --muted: #52665f;
  --accent: #087e6a;
  --coral: #bc5137;
  --line: #d9e3dc;
  --cyan: var(--accent);
  --gold: var(--coral);
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
body.portal { margin: 0; background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.55; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }
img { max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.13; letter-spacing: -.035em; }
h1 { font-size: clamp(34px, 4.5vw, 55px); }
h2 { font-size: clamp(25px, 3vw, 32px); }
h3 { font-size: 21px; }
p { color: var(--muted); }
.skip-link { position: absolute; left: 16px; top: -100px; z-index: 5; padding: 10px 16px; border-radius: 8px; background: var(--surface); color: var(--text); }
.skip-link:focus { top: 12px; }
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.site-header-inner { display: flex; align-items: center; gap: 36px; min-height: 76px; max-width: 1180px; margin: 0 auto; padding: 15px 24px; }
.brand { flex-shrink: 0; color: var(--text); text-decoration: none; font-size: 23px; font-weight: 850; letter-spacing: -.055em; }
.brand span { color: var(--accent); }
.site-nav { display: flex; align-items: center; gap: 24px; margin-right: auto; }
.site-nav a { color: var(--muted); font-size: 14px; font-weight: 650; text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--accent); }
.site-header [data-auth-slot] { flex-shrink: 0; min-height: 0; max-width: 190px; }
.site-header .chaoschemy-auth { gap: 8px; flex-wrap: nowrap; font-size: 12px; }
.site-header .chaoschemy-auth button { border: 1px solid var(--line); color: var(--muted); background: var(--surface); border-radius: 8px; }
.site-header .chaoschemy-auth button:hover { background: var(--surface-soft); border-color: var(--accent); }
.site-header .chaoschemy-auth .status { max-width: 130px; overflow: hidden; text-overflow: ellipsis; background: transparent; border: 0; padding: 0; }
.site-header .chaoschemy-auth a { font-weight: 600; }
.page-shell { max-width: 1180px; margin: 0 auto; padding: 38px 24px 64px; }
.page-heading { max-width: 780px; margin-bottom: 30px; }
.page-heading h1 { margin-bottom: 13px; }
.page-heading p { max-width: 740px; margin-bottom: 0; font-size: 17px; }
.eyebrow { margin-bottom: 11px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.lead { font-size: 18px; line-height: 1.6; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 46px; padding: 12px 19px; border: 1px solid transparent; border-radius: 10px; color: var(--text); font-size: 14px; font-weight: 750; text-decoration: none; cursor: pointer; transition: background .15s ease, transform .15s ease; }
.button.primary { background: var(--accent); color: #fff; }
.button.primary:hover { background: #066b5b; transform: translateY(-1px); }
.button.secondary { border-color: var(--line); background: var(--surface); color: var(--text); }
.button.secondary:hover { background: var(--surface-soft); border-color: var(--accent); }
.button.small { min-height: 40px; padding: 9px 14px; font-size: 13px; }
.text-link { color: var(--accent); font-size: 14px; font-weight: 700; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.hero { display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: 54px; margin: 4px 0 46px; }
.hero-copy h1 { margin-bottom: 18px; }
.hero-copy .lead { max-width: 490px; margin-bottom: 22px; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.hero-note { margin: 13px 0 0; font-size: 12px; }
.hero-pick { overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: 0 9px 0 #e3eadf; }
.hero-pick-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 17px; }
.hero-pick-top p { margin: 0; color: var(--text); font-size: 14px; font-weight: 750; }
.hero-pick-top span { color: var(--muted); font-size: 11px; }
.hero-cover { display: block; width: 100%; height: 190px; object-fit: cover; background: #152332; }
.challenge-preview { padding: 15px 17px 17px; }
.challenge-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.challenge-preview-head .eyebrow { margin: 0; color: var(--coral); font-size: 10px; }
.challenge-preview-status { color: var(--muted); font-size: 10px; }
.challenge-preview h2 { margin: 0 0 7px; font-size: 22px; }
.challenge-preview p { margin-bottom: 10px; font-size: 13px; line-height: 1.5; }
.challenge-preview-effect { display: inline-block; color: var(--text); font-size: 12px; font-weight: 750; }
.hero-pick .pick-action { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.hero-pick .pick-action .text-link { font-size: 12px; }
.hero-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0; margin: 26px 0 0; list-style: none; color: var(--muted); font-size: 12px; }
.hero-flow li + li::before { content: '→'; margin-right: 8px; color: var(--coral); }
.hero-flow strong { color: var(--text); font-weight: 650; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin: 42px 0 18px; }
.section-head h2 { margin: 0 0 6px; }
.section-head p { margin: 0; font-size: 14px; }
.category-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.category-link { display: flex; align-items: center; gap: 15px; padding: 21px 19px; border: 1px solid var(--line); border-radius: 14px; color: var(--text); background: var(--surface); text-decoration: none; }
.category-link:hover { border-color: var(--accent); background: var(--surface-soft); }
.category-icon { display: grid; flex: 0 0 47px; place-items: center; width: 47px; height: 47px; border-radius: 12px; background: #e2f0e9; color: var(--accent); font-size: 24px; }
.category-link:nth-child(2) .category-icon { color: #a14d24; background: #ffead7; }
.category-link:nth-child(3) .category-icon { color: #535f9a; background: #e9eafb; }
.category-link h3 { margin: 0 0 5px; font-size: 17px; }
.category-link p { margin: 0; font-size: 12px; }
.category-link .arrow { margin-left: auto; color: var(--accent); font-size: 22px; }
.game-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.game-card { display: flex; flex-direction: column; overflow: hidden; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.game-card:hover { border-color: #91b4a3; }
.game-cover { display: block; overflow: hidden; background: #e4eee5; }
.game-cover img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: center; transition: transform .2s ease; }
.game-cover:hover img { transform: scale(1.025); }
.game-card-body { display: flex; flex-direction: column; flex: 1; padding: 19px; }
.card-meta { display: flex; justify-content: space-between; gap: 8px; margin: 0 0 10px; color: var(--muted); font-size: 10px; font-weight: 700; }
.game-card h3 { margin: 0 0 10px; font-size: 23px; }
.card-edition { margin: -3px 0 10px; color: var(--muted); font-size: 12px; font-weight: 650; }
.card-description { margin: 0 0 14px; font-size: 13px; line-height: 1.6; }
.ai-role { margin-top: auto; margin-bottom: 13px; color: var(--accent); font-size: 11px; font-weight: 750; }
.ai-role::before { content: '✦'; margin-right: 5px; }
.card-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.card-actions .button { min-height: 44px; }
.card-actions .text-link { display: inline-flex; align-items: center; min-height: 44px; touch-action: manipulation; }
.guide-link { padding: 0 2px; }
.source-link { margin-left: auto; min-width: 44px; justify-content: flex-end; color: var(--muted); font-size: 11px; font-weight: 600; }
.collection-note { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; padding: 18px 21px; border: 1px solid var(--line); border-radius: 13px; background: #f0eee4; }
.collection-note p { margin: 0; font-size: 13px; }
.collection-note strong { color: var(--text); }
.info-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.info-card { padding: 23px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.info-card h3 { font-size: 19px; margin-bottom: 10px; }
.info-card p { margin-bottom: 0; font-size: 13px; line-height: 1.7; }
.video-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.catalog-page .video-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.video-card { min-width: 0; }
.video-preview { position: relative; display: block; overflow: hidden; border-radius: 14px; aspect-ratio: 16 / 10; background: #1b242a; }
.video-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview-play { position: absolute; bottom: 12px; left: 12px; padding: 5px 9px; border-radius: 6px; background: rgba(255,255,255,.95); color: #24342f; font-size: 11px; font-weight: 750; }
.video-card h3 { margin: 13px 0 5px; font-size: 18px; }
.video-card p { margin: 0 0 7px; font-size: 12px; }
.video-card .text-link { font-size: 12px; }
.catalog-toolbar { padding: 20px; margin-bottom: 23px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.catalog-toolbar-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.category-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.category-filter { padding: 9px 12px; min-height: 40px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; }
.category-filter:hover { background: var(--surface-soft); }
.category-filter[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: #fff; }
.search-field { position: relative; flex: 0 0 240px; }
.search-field label { display: block; margin-bottom: 6px; font-size: 11px; font-weight: 700; color: var(--muted); }
.search-field input { width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid #bacbc0; border-radius: 8px; background: var(--bg); color: var(--text); font-size: 13px; }
.catalog-toolbar-bottom { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 15px; }
.result-count { margin: 0; color: var(--muted); font-size: 12px; }
.clear-search { border: 0; padding: 0; background: none; color: var(--accent); font-size: 12px; text-decoration: underline; cursor: pointer; }
.empty-catalog { padding: 34px; border: 1px dashed #b7c9ba; border-radius: 16px; text-align: center; background: var(--surface); }
.empty-catalog h2 { font-size: 23px; margin-bottom: 8px; }
.empty-catalog p { margin-bottom: 0; font-size: 14px; }
.notice { padding: 18px 22px; margin: 24px 0; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); }
.notice p { margin: 0; font-size: 13px; }
.support-panel, .support-callout { margin-top: 26px; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: #fff0df; }
.support-panel p, .support-callout p { font-size: 14px; }
.faq-panel { margin-top: 18px; }
.faq-panel details { padding: 16px 0; border-top: 1px solid var(--line); }
.faq-panel summary { cursor: pointer; font-size: 15px; font-weight: 700; }
.faq-panel details p { margin: 10px 0 0; max-width: 800px; font-size: 14px; }
.site-footer { border-top: 1px solid var(--line); padding: 27px 0 4px; margin-top: 48px; display: flex; justify-content: space-between; gap: 25px; }
.site-footer p { margin: 0; font-size: 12px; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 18px; max-width: 700px; }
.footer-links a { color: var(--muted); font-size: 11px; text-decoration: none; }
.footer-links a:hover { color: var(--accent); text-decoration: underline; }
.share-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 30px; }
.share-row button { border: 0; background: none; padding: 0; font-size: 12px; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.share-status { color: var(--muted); font-size: 11px; }
@media (max-width: 950px) {
  .hero { gap: 28px; }
  .catalog-toolbar-top { flex-direction: column; align-items: stretch; gap: 15px; }
  .search-field { flex-basis: auto; }
  .catalog-page .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-link { padding: 16px 13px; gap: 10px; }
  .category-icon { flex-basis: 35px; width: 35px; height: 35px; font-size: 20px; }
  .category-link .arrow { display: none; }
}
@media (max-width: 700px) {
  .site-header-inner { flex-wrap: wrap; gap: 12px; padding: 13px 18px; }
  .site-nav { order: 3; flex-basis: 100%; gap: 20px; }
  .site-nav a { font-size: 12px; }
  .site-header [data-auth-slot] { margin-left: auto; max-width: 170px; }
  .site-header .chaoschemy-auth { font-size: 11px; }
  .page-shell { padding: 26px 18px 44px; }
  .hero { grid-template-columns: 1fr; gap: 24px; margin-bottom: 35px; }
  .hero-copy h1 { max-width: 560px; font-size: 39px; margin-bottom: 13px; }
  .hero-copy .lead { margin-bottom: 16px; font-size: 16px; }
  .hero-flow { margin-top: 16px; }
  .hero-cover { height: 175px; }
  .hero-pick { box-shadow: 0 6px 0 #e3eadf; }
  .category-grid { grid-template-columns: 1fr; gap: 10px; }
  .category-link { padding: 15px 17px; }
  .category-icon { flex-basis: 42px; width: 42px; height: 42px; }
  .category-link .arrow { display: block; }
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
  .game-card-body { padding: 15px; }
  .card-meta { flex-direction: column; gap: 3px; }
  .game-card h3 { font-size: 20px; }
  .info-grid { grid-template-columns: 1fr; gap: 12px; }
  .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .section-head { margin-top: 32px; align-items: flex-start; }
  .section-head > .text-link { font-size: 12px; white-space: nowrap; }
  .site-footer { flex-direction: column; gap: 16px; }
  .footer-links { justify-content: flex-start; }
  .catalog-toolbar { padding: 16px; }
}
@media (max-width: 480px) {
  h1 { font-size: 34px; }
  .hero-copy h1 { font-size: 35px; }
  .hero-actions .button { min-height: 44px; font-size: 13px; padding: 10px 14px; }
  .hero-actions .text-link { font-size: 12px; }
  .hero-flow { gap: 5px; font-size: 10px; }
  .hero-flow li + li::before { margin-right: 5px; }
  .hero-cover { height: 150px; }
  .challenge-preview { padding: 13px 15px 15px; }
  .challenge-preview h2 { font-size: 21px; }
  .challenge-preview p { font-size: 12px; }
  .hero-pick-top { padding: 11px 15px; }
  .game-grid { grid-template-columns: 1fr; gap: 19px; }
  .card-meta { flex-direction: row; }
  .game-cover img { aspect-ratio: 16 / 9; }
  .game-card-body { padding: 18px; }
  .video-grid, .catalog-page .video-grid { grid-template-columns: 1fr; }
  .video-card { display: grid; grid-template-columns: 128px minmax(0, 1fr); column-gap: 13px; }
  .video-preview { grid-row: 1 / 4; aspect-ratio: 1 / 1; }
  .video-card h3 { margin-top: 3px; font-size: 16px; }
  .video-card p { font-size: 11px; }
  .preview-play { bottom: 7px; left: 7px; font-size: 9px; padding: 4px 6px; }
  .category-filter { font-size: 11px; padding: 8px 10px; }
  .page-heading p { font-size: 15px; }
  .collection-note { padding: 16px 18px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
