@font-face {
  font-family: Anton;
  src: url("./anton.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@layer reset, base, components, responsive;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  body, h1, h2, h3, p { margin: 0; }
  img { display: block; max-width: 100%; height: auto; }
  button, input, textarea { font: inherit; }
  [hidden] { display: none !important; }
}

@layer base {
  :root {
    color-scheme: dark;
    --bg: #070f14;
    --surface: #101c23;
    --raised: #182933;
    --ink: #fffdf7;
    --muted: #c4d0d7;
    --line: #34434b;
    --accent: #ffce00;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--ink);
  }
  body { min-width: 320px; line-height: 1.6; }
  a { color: inherit; text-underline-offset: .25em; }
  a, button { -webkit-tap-highlight-color: transparent; }
  :focus-visible { outline: 3px solid var(--accent); outline-offset: 5px; }
  h1, h2, h3 {
    font-family: Anton, Impact, "Arial Narrow", sans-serif;
    font-weight: 400;
    line-height: 1.12;
    letter-spacing: .005em;
    text-transform: uppercase;
    text-wrap: balance;
  }
  h1 { font-size: clamp(3rem, 6vw, 5rem); }
  h2 { font-size: clamp(1.65rem, 3vw, 2.35rem); }
  p { color: var(--muted); }
  p + p { margin-top: 1rem; }
  ::selection { background: var(--accent); color: #070f14; }
}

@layer components {
  .container, .header-inner { width: min(1280px, calc(100% - 64px)); margin-inline: auto; }
  .eyebrow { font-size: .75rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: .9rem; }
  .summary { font-size: 1rem; line-height: 1.65; max-width: 62ch; }
  .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .65rem;
    min-height: 48px;
    padding: .85rem 1.25rem;
    border: 1px solid transparent;
    border-radius: 5px;
    text-decoration: none;
    font-family: Anton, Impact, sans-serif;
    font-weight: 400;
    text-transform: uppercase;
    font-size: 1.03rem;
    letter-spacing: .02em;
    line-height: 1.3;
    text-align: center;
    transition: background-color 140ms, border-color 140ms, transform 140ms;
    cursor: pointer;
  }
  .button:hover { transform: translateY(-2px); }
  .secondary { border-color: #677680; background: #0b141b; color: var(--ink); }
  .secondary:hover { background: #22333e; border-color: #c2d1da; }
  .kofi { background: #72a5f2; color: #202020; border-color: #72a5f2; }
  .kofi:hover { background: #94baf5; border-color: #94baf5; }
  .kofi img { width: 30px; height: auto; flex-shrink: 0; }

  .site-header { background: #03090d; position: sticky; top: 0; z-index: 20; box-shadow: 0 4px 20px #0004; }
  .header-inner { min-height: 90px; display: flex; align-items: center; gap: 1.5rem; }
  .brand { text-decoration: none; font-family: Anton, Impact, sans-serif; font-size: 1.7rem; line-height: 1; text-transform: uppercase; color: var(--accent); flex-shrink: 0; }
  .header-inner .brand { display: flex; align-items: center; gap: 12px; }
  .brand .brand-mascot { width: 70px; height: 70px; object-fit: contain; }
  .brand .brand-wordmark { width: 190px; height: auto; }
  .footer-brand { display: inline-block; }
  .footer-brand .brand-wordmark { width: 240px; }
  .header-inner nav { margin-left: auto; display: flex; align-items: center; gap: 1.4rem; font-family: Anton, Impact, sans-serif; text-transform: uppercase; font-size: .95rem; }
  .header-inner nav a { text-decoration: none; padding-block: .65rem; }
  .header-inner nav a:hover { color: var(--accent); }
  .header-actions { display: flex; align-items: center; gap: .65rem; }
  .header-actions .button { font-size: .9rem; padding-inline: .9rem; min-height: 60px; }
  .header-action { min-width: 150px; }
  .game-nav { border-top: 1px solid #1c2a32; border-bottom: 1px solid #384750; background: #0c1720; }
  .game-nav > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .game-nav a { display: flex; justify-content: center; align-items: center; gap: .8rem; padding: .7rem .6rem; font-family: Anton, Impact, sans-serif; font-size: 1rem; text-align: center; line-height: 1.3; text-transform: uppercase; text-decoration: none; border-bottom: 3px solid transparent; }
  .game-nav a + a { border-left: 1px solid #293840; }
  .game-nav a:hover, .game-nav [aria-current] { color: var(--accent); background: #18232b; border-bottom-color: var(--accent); }
  .skip-link { position: fixed; left: 1rem; top: -100px; z-index: 99; background: var(--accent); color: #070f14; padding: 1rem; }
  .skip-link:focus { top: 1rem; }

  .purchase-wrap { padding-block: clamp(48px, 6vw, 80px); }
  .purchase-card, .policy-card {
    width: min(100%, 880px);
    margin-inline: auto;
    padding: clamp(24px, 4vw, 42px);
    border: 1px solid var(--line);
    border-top: 4px solid var(--accent);
    border-radius: 8px;
    background: var(--surface);
  }
  .purchase-card > .summary { margin-top: 1rem; }
  .policy-card > p:not(.eyebrow) { max-width: 76ch; margin-top: 1.5rem; }
  .price { display: flex; align-items: baseline; flex-wrap: wrap; gap: .25rem 1rem; margin-top: 1.5rem; padding-block: 1rem; border-block: 1px solid var(--line); }
  .price strong { font-family: Anton, Impact, sans-serif; font-size: 2rem; font-weight: 400; text-transform: uppercase; }
  .price span { color: var(--muted); font-size: .85rem; }
  .expectations { margin-top: 1.75rem; }
  .expectations h2 { font-size: 1.5rem; }
  .expectations ul { display: grid; gap: .65rem; padding-left: 1.25rem; margin-block: 1rem 0; color: var(--muted); }
  .expectations li::marker { color: var(--accent); }
  .expectations strong { color: var(--ink); }
  .steps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 0; margin: 1.75rem 0; list-style: none; }
  .steps li { display: flex; min-height: 62px; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid #42525c; border-radius: 7px; background: #0c171e; color: #9dadb6; }
  .steps b { display: grid; width: 32px; height: 32px; flex: 0 0 32px; place-items: center; border-radius: 50%; background: #34434b; color: white; }
  .steps .active { border-color: var(--accent); background: #29250f; color: white; }
  .steps .active b { background: var(--accent); color: #080d10; }
  .steps .complete { border-color: #168c38; background: #082b19; color: #c9fbd4; }
  .steps .complete b { background: #20a84b; }
  .account { display: flex; align-items: center; gap: 16px; margin: 24px 0 4px; padding: 18px; border: 1px solid #168c38; border-radius: 7px; background: #082b19; }
  .identity { min-width: 0; }
  .identity strong, .identity small { display: block; overflow-wrap: anywhere; }
  .identity small { color: #8ce9a5; }
  .identity strong { margin: 4px 0; font-size: 1.2rem; }
  .identity a { color: var(--muted); font-size: .82rem; overflow-wrap: anywhere; }
  .avatar-placeholder { position: relative; display: grid; width: 72px; height: 72px; flex: 0 0 72px; place-items: center; overflow: hidden; border-radius: 5px; background: #34434b; color: #9dadb6; font-size: 2rem; }
  .avatar { position: absolute; inset: 0; }
  .action-panel { margin-top: 18px; padding: clamp(20px, 4vw, 30px); border: 1px solid #42525c; border-radius: 8px; background: #0c171e; }
  .action-panel h2 { font-size: clamp(1.65rem, 3vw, 2.2rem); }
  .action-panel > p { margin-top: .8rem; }
  .action-panel form { margin-top: 1.2rem; }
  .purchase { background: #00ff08; color: #080d10; box-shadow: 0 3px 0 #0005; }
  .purchase:hover { background: #68ff68; }
  .purchase:disabled { background: #65727a; color: #d9e0e4; cursor: default; transform: none; }
  .steam-button { display: inline-block; padding: 0; border: 0; background: transparent; line-height: 0; cursor: pointer; }
  .steam-button img { width: 180px; height: 35px; }
  .stripe-badge { display: inline-block; padding-top: 18px; }
  .stripe-badge img { border-radius: 4px; background: white; }
  .fine { margin-top: .6rem; color: #9dadb6; font-size: .78rem; }
  .text-button { padding: 10px 0; border: 0; background: transparent; color: #d4e2ea; text-decoration: underline; text-underline-offset: .25em; cursor: pointer; }
  .text-button:hover { color: var(--accent); }
  .notice { padding: 14px 16px; border-left: 4px solid var(--accent); border-radius: 4px; background: #29250f; color: #fff7c8; }
  .notice:empty { display: none; }
  .reference { margin-top: 20px; }
  .reference label { display: block; margin-bottom: 8px; font-weight: 700; }
  .reference textarea { width: 100%; padding: 12px; resize: vertical; border: 1px solid #52636c; border-radius: 5px; background: #071017; color: #d4e0e7; font: 12px ui-monospace, SFMono-Regular, Consolas, monospace; }
  #copy-status { margin-left: .8rem; color: #8ce9a5; font-size: .8rem; }
  #delayed-help { margin-top: 1.2rem; padding: 14px 16px; border: 1px solid #b27330; border-radius: 5px; background: #30200d; color: #ffe1b8; }
  .policy-links { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem 1.4rem; margin-top: 1.5rem; font-size: .85rem; }
  .policy-links a:not(.button), .support-note a { font-weight: 700; }
  .policy-links a:hover, .support-note a:hover { color: var(--accent); }
  .support-note { margin-top: 1rem; font-size: .82rem; }

  .site-footer { background: #03090d; padding-block: 40px 20px; border-top: 1px solid var(--line); }
  .footer-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 2rem; }
  .footer-grid p { margin-top: 1rem; font-size: .85rem; }
  .footer-grid nav { display: flex; flex-direction: column; align-items: flex-start; gap: .8rem; font-size: .85rem; }
  .footer-grid nav a { text-decoration: none; }
  .footer-grid nav a:hover { color: var(--accent); }
  .support-link { display: inline-flex; align-items: center; gap: .65rem; }
  .platform-mark { padding: 28px; margin: 16px 0 0 -28px; width: max-content; }
  .platform-mark img { width: 169px; height: 50px; }
  .footer-bottom { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 24px; display: flex; justify-content: space-between; gap: 2rem; color: #a2b2bd; font-size: .7rem; }
  .footer-bottom span:last-child { max-width: 650px; }
}

@layer responsive {
  @media (max-width: 1050px) {
    .header-inner { display: grid; grid-template-columns: 1fr auto; gap: 8px 20px; padding-block: 8px; }
    .header-inner nav { gap: 1.5rem; }
    .header-actions { grid-column: 1 / -1; justify-content: flex-end; }
    .header-actions .button { min-height: 42px; padding-block: .6rem; }
  }
  @media (max-width: 700px) {
    .container, .header-inner { width: calc(100% - 32px); }
    .header-inner { gap: 8px 12px; }
    .brand .brand-mascot { width: 52px; height: 52px; }
    .brand .brand-wordmark { width: clamp(124px, 35vw, 170px); }
    .header-inner .brand { gap: 8px; }
    .header-inner nav { font-size: .77rem; margin-left: auto; }
    .header-inner nav a:first-child, .header-inner nav a:last-child { display: none; }
    .header-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
    .header-actions .button { min-width: 0; min-height: 48px; padding: .6rem .5rem; font-size: .8rem; gap: .4rem; }
    .header-actions .kofi img { width: 24px; height: auto; }
    .footer-brand .brand-wordmark { width: 240px; }
    .game-nav .container { width: 100%; }
    .game-nav a { font-size: .74rem; min-height: 51px; padding: .5rem .45rem; }
    .steps { grid-template-columns: 1fr; }
    .purchase { width: 100%; }
    .account { align-items: flex-start; }
    .identity strong { font-size: 1rem; }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; gap: 1rem; }
  }
  @media (max-width: 360px) {
    .game-nav a { font-size: .68rem; }
    .purchase-card, .policy-card { padding: 22px; }
    .avatar-placeholder { width: 58px; height: 58px; flex-basis: 58px; }
  }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
  }
}
