:root {
  color-scheme: dark;
  --background: #080f0e;
  --surface: #101917;
  --border: #2c4440;
  --text: #eef8f2;
  --muted: #bdccc5;
  --accent: #8ee2bd;
  --display: "Songti TC", "Noto Serif TC", "PMingLiU", Georgia, serif;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif;
  background: var(--background);
  color: var(--text);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; line-height: 1.6; }
a { color: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.2; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.container { width: min(74rem, calc(100% - 3rem)); margin-inline: auto; }
.skip-link { position: fixed; z-index: 5; top: 0; left: 1rem; padding: .75rem 1rem; background: var(--background); transform: translateY(-120%); }
.skip-link:focus { transform: none; }
.masthead { border-bottom: 1px solid var(--border); background: #0a1210; }
.masthead-inner { min-height: 4.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; gap: .65rem; align-items: center; text-decoration: none; font-size: 1.125rem; font-weight: 700; letter-spacing: .1em; }
.brand img { object-fit: contain; }
.nav-link { display: block; padding: .65rem 0; color: var(--muted); text-decoration: none; }
.nav-link:hover { color: var(--accent); }

.home-hero, .legend-hero { position: relative; isolation: isolate; overflow: hidden; display: grid; align-items: center; border-bottom: 1px solid var(--border); background: #122620; }
.home-hero { min-height: clamp(30rem, 48vw, 40rem); }
.legend-hero { min-height: clamp(22rem, 37vw, 33rem); align-items: end; }
.hero-image { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.home-hero .hero-image { object-position: center; }
.legend-hero .hero-image { object-position: 55% center; }
.home-hero::after, .legend-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.home-hero::after { background: linear-gradient(90deg, #08120f 0%, #08120fe8 20%, #08120f8c 42%, transparent 72%), linear-gradient(0deg, #08120f75, transparent 26%); }
.legend-hero::after { background: linear-gradient(0deg, #08120ff5 0%, #08120f66 60%, #08120f10 100%), linear-gradient(90deg, #08120fc9, transparent 72%); }
.home-hero-content { padding-block: 5rem; }
.legend-hero-content { padding-block: 5rem 3.5rem; }
.eyebrow { color: var(--accent); font-size: .875rem; letter-spacing: .18em; font-weight: 700; }
h1 { margin-top: .7rem; font-family: var(--display); font-size: clamp(4rem, 8vw, 7rem); font-weight: 800; letter-spacing: .055em; }
.hero-description { font-size: clamp(1.05rem, 1.6vw, 1.3rem); color: #dceae3; width: min(100%, 23rem); margin-top: 1.15rem; text-wrap: pretty; }
.home-hero .button { margin-top: 2rem; }

.button { display: inline-flex; min-height: 2.95rem; justify-content: center; align-items: center; text-align: center; padding: .65rem 1.35rem; border: 1px solid transparent; border-radius: .3rem; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; transition: background-color 150ms, border-color 150ms; }
.primary { color: #092017; background: #8de1b9; }
.primary:hover { background: #b8f3d5; }
.secondary { color: var(--accent); border-color: #648478; background: #152821; }
.secondary:hover { border-color: var(--accent); background: #1d382b; }

.games { padding-block: 3.6rem 5rem; scroll-margin-top: 1rem; }
.games h2, .entry-option h2 { font-size: clamp(1.6rem, 3vw, 2.125rem); font-family: var(--display); }
.game-card { margin-top: 1.35rem; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); min-height: 16rem; border: 1px solid var(--border); border-radius: .6rem; background: var(--surface); text-decoration: none; overflow: hidden; transition: border-color 150ms, background-color 150ms; }
.game-card:hover { border-color: #548878; background: #14211c; }
.game-card-art { position: relative; min-width: 0; min-height: 100%; }
.game-card-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 58% center; }
.game-card-copy { padding: clamp(1.35rem, 4vw, 3rem); }
.game-card h3 { margin-top: .55rem; font-family: var(--display); font-size: clamp(2.2rem, 4vw, 3.2rem); }
.game-card-copy > p:not(.eyebrow) { margin-top: .75rem; color: var(--muted); }
.card-link { display: inline-block; margin-top: 1.35rem; color: var(--accent); font-weight: 700; text-underline-offset: .25em; }
.game-card:hover .card-link { text-decoration: underline; }

.legend-entry { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; padding-top: 2rem; }
.entry-option { display: flex; align-items: flex-start; flex-direction: column; min-height: 12rem; padding: 1.6rem; background: var(--surface); border: 1px solid var(--border); border-radius: .6rem; }
.entry-option > p { color: var(--muted); margin: .65rem 0 1.3rem; }
.entry-option .button { margin-top: auto; }
.service-status { color: var(--muted); margin-block: 1rem 3rem; font-size: .9rem; }
.service-status:target { color: var(--text); }
.availability-dialog { width: min(28rem, calc(100% - 2rem)); border: 1px solid var(--border); border-radius: .6rem; color: var(--text); background: var(--surface); padding: 1.65rem; }
.availability-dialog::backdrop { background: #030807cf; }
.availability-dialog p { margin: .75rem 0 1.5rem; color: var(--muted); }

@media (max-width: 42rem) {
  .container { width: calc(100% - 2rem); }
  .masthead-inner { min-height: 3.8rem; }
  .home-hero { min-height: clamp(27rem, 115vw, 33rem); align-items: end; }
  .home-hero .hero-image { object-position: 76% center; }
  .home-hero::after { background: linear-gradient(0deg, #08120ffa 0%, #08120fe8 36%, #08120f30 85%), linear-gradient(90deg, #08120f66 0%, transparent 75%); }
  .home-hero-content { padding-block: 3rem 2.25rem; }
  h1 { font-size: clamp(3rem, 12vw, 4.6rem); }
  .home-hero .button { margin-top: 1.45rem; }
  .games { padding-block: 2.65rem 3rem; }
  .game-card { grid-template-columns: minmax(0, 1fr); }
  .game-card-art { aspect-ratio: 16 / 8; }
  .legend-hero .hero-image { object-position: 62% center; }
  .legend-hero-content { padding-block: 3.75rem 2.3rem; }
  .legend-entry { grid-template-columns: minmax(0, 1fr); gap: .8rem; padding-top: 1.2rem; }
  .entry-option { min-height: unset; padding: 1.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
