@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: dark;
  --bg: #0c1420;
  --surface: #121f2e;
  --surface-deep: #101b29;
  --line: #2a3849;
  --text: #f5f1e6;
  --muted: #b1becb;
  --accent: #f3b96f;
  --blue: #a8c5e0;
  --display: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  --body: Inter, system-ui, sans-serif;
  --mono: ui-monospace, Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font: 400 16px/1.65 var(--body); margin: 0; }
[hidden] { display: none !important; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1, h2 { font-family: var(--display); font-weight: 700; line-height: .99; }
h3 { font-size: 1.04rem; line-height: 1.37; }
a { color: var(--accent); text-underline-offset: 4px; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.wrap { max-width: 1240px; width: calc(100% - 100px); margin-inline: auto; }
.skip-link { position: absolute; z-index: 3; top: 8px; left: 24px; background: var(--surface); padding: .6em 1em; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }

.site-header { background: var(--bg); border-bottom: 1px solid var(--line); }
.header-inner, .footer-inner { display: flex; align-items: center; justify-content: space-between; column-gap: 22px; }
.header-inner { min-height: 76px; }
.brand { display: inline-flex; width: fit-content; align-items: center; gap: 10px; color: var(--text); font-size: 1.07rem; font-weight: 800; letter-spacing: -.04em; text-decoration: none; white-space: nowrap; }
.brand img { display: block; border: 1px solid #584832; border-radius: 7px; }
.brand-domain { color: var(--accent); }
.site-nav, .site-footer nav { display: flex; gap: clamp(12px, 3vw, 40px); flex-wrap: wrap; }
.site-nav a, .site-footer nav a { display: inline-flex; min-height: 44px; align-items: center; color: var(--muted); font-size: .87rem; font-weight: 600; text-decoration: none; }
.site-nav a:hover, .site-footer nav a:hover { color: var(--text); }
.header-play { display: inline-flex; min-height: 44px; padding: 0 16px; align-items: center; gap: 9px; border: 1px solid #6d583b; border-radius: 6px; color: var(--accent); font-weight: 700; font-size: .88rem; text-decoration: none; }
.header-play:hover { background: #28251f; }
.play-icon { display: inline-block; width: .72em; height: .78em; background: currentColor; clip-path: polygon(0 0, 100% 50%, 0 100%); flex: 0 0 auto; }

.hero {
  border-bottom: 1px solid var(--line);
  background: radial-gradient(ellipse at 82% 15%, #1b2c40 0%, transparent 67%), var(--bg);
  padding: clamp(48px, 7vw, 100px) 0 clamp(40px, 6vw, 82px);
}
.hero-grid { display: grid; grid-template-columns: .92fr 1.08fr; align-items: center; gap: clamp(34px, 5.2vw, 76px); }
.hero-label { display: flex; align-items: center; gap: 12px; margin-bottom: 13px; color: var(--accent); font: 700 .73rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: .15em; }
.hero-label::before { content: ''; width: 24px; border-top: 1px solid currentColor; }
.hero h1 { font-size: clamp(3.6rem, 6.55vw, 7rem); letter-spacing: -.035em; }
.hero h1 span { display: block; color: var(--accent); }
.hero-intro { color: var(--muted); margin-top: 19px; max-width: 45ch; font-size: clamp(.98rem, 1.25vw, 1.13rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px 23px; align-items: center; margin-top: 26px; scroll-margin-top: 26px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; gap: 11px; padding: 0 16px; text-decoration: none; font-size: .87rem; font-weight: 800; border: 1px solid transparent; border-radius: 6px; }
.button-primary { color: #1c1712; background: var(--accent); }
.button-primary:hover { background: #ffd193; }
.text-link { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration-color: #82735b; font-size: .88rem; font-weight: 700; }
.text-link:hover, .text-link span { color: var(--accent); }
.game-facts { display: flex; flex-wrap: wrap; gap: 11px 23px; margin-top: 25px; padding-top: 15px; border-top: 1px solid var(--line); }
.game-facts dt { color: var(--muted); font: .69rem/1.65 var(--mono); letter-spacing: .065em; text-transform: uppercase; }
.game-facts dd { color: var(--text); font-size: .81rem; font-weight: 600; }

.player { overflow: hidden; background: var(--surface-deep); border: 1px solid #3a4b5d; border-radius: 10px; scroll-margin-top: 18px; box-shadow: 0 18px 54px #050b13a0; }
.player-top, .player-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 46px; padding: 0 14px; }
.player-top h2 { font: 700 .84rem/1.4 var(--body); }
.player-top { border-bottom: 1px solid var(--line); }
.player-bottom { border-top: 1px solid var(--line); font-size: .77rem; color: var(--muted); }
.player-bottom a { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; flex: none; font-weight: 600; text-decoration: none; }
.player-bottom a:hover { text-decoration: underline; }
.player-stage { position: relative; min-height: 178px; aspect-ratio: 16 / 10; isolation: isolate; background: #101b29; }
.player-stage::before { position: absolute; content: ''; z-index: -1; inset: 0; background: linear-gradient(140deg, #0b142338, #0d18294d 45%, #0a101ac9), url('../images/terrain.webp') center / cover no-repeat; }
.player-launch, .player-loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.player-launch { color: var(--text); text-decoration: none; }
.player-launch:focus-visible { outline-offset: -5px; }
.player-round { display: grid; place-items: center; width: 72px; height: 72px; border: 1px solid #f7d4ab; border-radius: 50%; background: var(--accent); color: #201a15; box-shadow: 0 0 0 9px #e4a55f20; transition: transform .18s ease; }
.player-round .play-icon { margin-left: 5px; font-size: 1.8rem; }
.player-launch:hover .player-round { transform: scale(1.08); }
.player-label, .player-loading span:last-child { padding: .28em .75em; border-radius: 4px; background: #0d1725ee; font-size: .82rem; font-weight: 700; }
.fullscreen { display: inline-grid; place-items: center; width: 44px; height: 44px; margin-right: -10px; padding: 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.fullscreen:hover { color: var(--accent); }
.fullscreen span { width: 16px; height: 16px; border: 2px solid currentColor; clip-path: polygon(0 0, 35% 0, 35% 16%, 65% 16%, 65% 0, 100% 0, 100% 35%, 84% 35%, 84% 65%, 100% 65%, 100% 100%, 65% 100%, 65% 84%, 35% 84%, 35% 100%, 0 100%, 0 65%, 16% 65%, 16% 35%, 0 35%); }
.player iframe { display: block; width: 100%; height: 100%; position: absolute; inset: 0; border: 0; }
.player:fullscreen { display: flex; flex-direction: column; border: 0; border-radius: 0; }
.player:fullscreen .player-stage { flex: 1; aspect-ratio: auto; }
.spinner { width: 36px; height: 36px; border: 2px solid #f3b96f50; border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }

.topics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.topic { min-height: 84px; display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 13px; padding: 12px 15px; background: var(--surface-deep); border: 1px solid var(--line); border-radius: 7px; color: var(--text); text-decoration: none; }
.topic:hover { border-color: #957751; background: var(--surface); }
.topic strong, .topic small { display: block; }
.topic strong { font-size: .91rem; }
.topic small { color: var(--muted); font-size: .76rem; }
.topic-icon { display: grid; place-items: center; height: 40px; border-radius: 6px; background: #332a20; color: var(--accent); font-size: 1.31rem; }
.unit-icon { background: #243143; color: var(--blue); }
.strategy-icon { background: #213830; color: #addcc1; }
.topic-arrow { color: var(--muted); }

.guide-section { padding-block: clamp(46px, 6vw, 80px); border-bottom: 1px solid var(--line); scroll-margin-top: 18px; }
.guide-section:last-child { border-bottom: 0; }
.section-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .87fr); gap: 16px 34px; align-items: end; margin-bottom: 26px; }
.section-head h2, .legal h1 { font-size: clamp(2.8rem, 4.1vw, 4.4rem); letter-spacing: -.02em; }
.section-head p, .section-note, .map-card p, .field-note p, .steps p, .example-grid p, .faq-list p, .legal p { color: var(--muted); }
.section-head p { max-width: 53ch; }
.map-grid, .example-grid { display: grid; gap: 14px; }
.map-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.map-card, .example-grid article { background: var(--surface-deep); border: 1px solid var(--line); border-radius: 7px; padding: clamp(17px, 2.5vw, 27px); }
.map-card { border-top: 2px solid #6f5941; }
.map-card:nth-child(2) { border-top-color: #536d86; }
.map-card:nth-child(3) { border-top-color: #4e7a65; }
.map-card h3 { font-family: var(--display); font-size: 1.83rem; }
.map-card p, .example-grid p { margin-top: 8px; }
.guide-figure {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  align-items: center;
  gap: clamp(16px, 3vw, 36px);
  margin: 20px 0 0;
  background: var(--surface-deep);
  border: 1px solid var(--line);
  border-radius: 7px;
}
.guide-figure a { display: block; border-radius: 6px 0 0 6px; overflow: hidden; }
.guide-figure a:focus-visible { outline-offset: -4px; }
.guide-figure img { display: block; width: 100%; height: auto; }
.guide-figure figcaption { padding: 14px 24px 14px 0; color: var(--muted); }
.guide-figure figcaption strong { display: block; margin-bottom: 6px; color: var(--text); }
.field-note { display: grid; grid-template-columns: minmax(150px, .44fr) 1fr; gap: 7px 18px; padding: 17px 20px; margin-top: 18px; border-left: 2px solid var(--accent); background: var(--surface); border-radius: 0 7px 7px 0; }
.field-note strong { color: var(--accent); }
.unit-table { border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: var(--surface-deep); }
.unit-list > div, .unit-head { display: grid; grid-template-columns: minmax(115px, .6fr) 1.15fr 1.45fr; gap: 8px 18px; padding: 13px 19px; border-bottom: 1px solid var(--line); }
.unit-list > div:last-child { border-bottom: 0; }
.unit-list dd { color: var(--muted); }
.unit-list dt { color: var(--text); font-weight: 700; }
.unit-head { color: var(--accent); background: var(--surface); font: 700 .74rem/1.5 var(--mono); text-transform: uppercase; letter-spacing: .04em; }
.section-note { margin-top: 18px; }
.section-note strong { color: var(--text); }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps > li { display: grid; grid-template-columns: 38px 1fr; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); counter-increment: step; }
.steps > li::before { content: counter(step, decimal-leading-zero); display: grid; place-items: center; height: 36px; border: 1px solid #6d583b; border-radius: 5px; color: var(--accent); font: 700 .8rem var(--mono); }
.steps p { margin-top: 5px; }
.example-grid { margin-top: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
kbd { font: .8em var(--mono); background: var(--bg); color: var(--text); border: 1px solid #4a5564; padding: 1px 5px; border-radius: 4px; }
.faq-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; align-items: start; }
.faq-list details { border: 1px solid var(--line); border-radius: 6px; background: var(--surface-deep); }
.faq-list summary { display: flex; align-items: center; justify-content: space-between; min-height: 55px; gap: 9px; padding: 11px 16px; cursor: pointer; color: var(--text); font-size: .93rem; font-weight: 700; list-style: none; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: '+'; color: var(--accent); font: 1.2rem var(--mono); }
.faq-list details[open] summary::after { content: '−'; }
.faq-list p { padding: 0 16px 15px; }
.site-footer { background: var(--surface-deep); border-top: 1px solid var(--line); }
.footer-inner { padding: 29px 0; }
.footer-inner p { margin-top: 8px; color: var(--muted); font-size: .84rem; }
.legal { min-height: 57vh; max-width: 780px; padding-block: clamp(40px, 7vw, 90px); }
.legal h2 { font-size: 2rem; margin-top: 24px; margin-bottom: 9px; }
.legal h1 + p { margin-top: 17px; }
.legal p + p { margin-top: 12px; }
.legal-date { font-size: .86rem; }

@media (max-width: 960px) {
  .wrap { width: calc(100% - 58px); }
  .hero-grid { gap: 26px; }
  .hero h1 { font-size: clamp(3.3rem, 8vw, 5.35rem); }
  .hero-intro { margin-top: 13px; }
  .player-bottom { flex-wrap: wrap; row-gap: 0; }
  .topic { gap: 8px; padding-inline: 10px; }
}
@media (max-width: 760px) {
  .wrap { width: calc(100% - 36px); }
  .hero-grid, .section-head { grid-template-columns: 1fr; }
  .hero h1 span { display: inline; }
  .hero { padding-block: 35px 29px; }
  .topic { grid-template-columns: 34px 1fr; }
  .topic-icon { height: 34px; }
  .topic-arrow { display: none; }
  .map-grid { grid-template-columns: 1fr; }
  .guide-figure { grid-template-columns: 1fr; gap: 0; }
  .guide-figure a { border-radius: 6px 6px 0 0; }
  .guide-figure figcaption { padding: 14px 16px; }
}
@media (max-width: 530px) {
  .header-inner { display: grid; grid-template-columns: 1fr auto; padding: 10px 0 3px; gap: 0 9px; }
  .site-nav { grid-row: 2; grid-column: 1 / -1; justify-content: space-between; gap: 0 12px; }
  .site-nav a { padding: 0 3px; }
  .header-play { grid-column: 2; grid-row: 1; }
  .hero h1 { font-size: clamp(2.8rem, 11.9vw, 3.6rem); }
  .hero-actions { margin-top: 19px; }
  .game-facts { column-gap: 13px; margin-top: 15px; }
  .game-facts dd { font-size: .75rem; }
  .player-bottom { padding-block: 7px 2px; }
  .player-bottom a { min-height: 44px; }
  .topics, .faq-list, .example-grid, .field-note { grid-template-columns: 1fr; }
  .topics { gap: 8px; }
  .topic { min-height: 59px; grid-template-columns: 34px 1fr auto; }
  .topic-arrow { display: inline; }
  .unit-list > div { grid-template-columns: 1fr; gap: 2px; padding: 13px; }
  .unit-head { display: none; }
  .footer-inner { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
