:root {
  color-scheme: light;
  --ink: #1d302b;
  --ink-soft: #50635d;
  --muted: #687a73;
  --line: #dfe7df;
  --paper: #f4f6f2;
  --surface: #ffffff;
  --green: #176c51;
  --green-dark: #0e543e;
  --mint: #dff2e7;
  --orange: #f5b866;
  --shadow: 0 16px 40px rgb(32 61 49 / 8%);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 82% 4%, rgb(219 239 224 / 62%), transparent 28rem),
    var(--paper);
}

button, a { font: inherit; }
a { color: inherit; }

.skip-link {
  position: fixed;
  z-index: 5;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.8rem 1rem;
  transform: translateY(-160%);
  border-radius: 0.65rem;
  color: #fff;
  background: var(--green-dark);
}
.skip-link:focus { transform: translateY(0); }

:focus-visible {
  outline: 3px solid #ba641f;
  outline-offset: 4px;
}

.site-header {
  height: 76px;
  border-bottom: 1px solid rgb(212 224 213 / 76%);
  background: rgb(255 255 255 / 80%);
}

.header-inner,
.page-shell {
  width: min(100% - 48px, 1120px);
  margin-inline: auto;
}

.header-inner {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: space-between;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.68rem;
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 780;
  letter-spacing: -0.035em;
  text-decoration: none;
}

.wordmark-mark,
.footer-mark {
  display: inline-grid;
  width: 2rem;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 0.72rem;
  color: #fff;
  background: var(--green);
  font-size: 1.14rem;
  font-weight: 800;
  letter-spacing: -0.06em;
}

.header-note {
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 620;
}

.page-shell { padding-top: 54px; }

.intro {
  position: relative;
  display: flex;
  min-height: 230px;
  overflow: hidden;
  align-items: center;
  justify-content: space-between;
  padding: 37px 52px;
  border: 1px solid #dfeadf;
  border-radius: 1.3rem;
  background: linear-gradient(112deg, #edf6ee 4%, #e7f2e7 62%, #e5f0df 100%);
}

.intro-copy { position: relative; z-index: 1; }
.eyebrow,
.section-kicker {
  margin: 0;
  color: var(--green);
  font-size: 0.73rem;
  font-weight: 780;
  letter-spacing: 0.11em;
}

.eyebrow { display: flex; align-items: center; gap: 0.55rem; }
.eyebrow-dot { width: 7px; height: 7px; border-radius: 50%; background: #e79543; }

h1, h2, h3, p { margin-top: 0; }

h1 {
  margin: 1rem 0 0.6rem;
  font-size: clamp(2.1rem, 4.4vw, 3.05rem);
  font-weight: 760;
  letter-spacing: -0.07em;
  line-height: 1.13;
}

.intro-description {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.7;
}

.intro-art {
  position: absolute;
  top: 50%;
  right: 80px;
  width: 182px;
  height: 182px;
  transform: translateY(-50%);
}

.art-orbit {
  position: absolute;
  inset: 13px;
  border: 1px solid rgb(23 108 81 / 16%);
  border-radius: 50%;
}

.orbit-two { inset: 31px; border-style: dashed; border-color: rgb(23 108 81 / 23%); }
.art-core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 64px;
  height: 64px;
  transform: translate(-50%, -50%) rotate(-9deg);
  border: 1px solid rgb(23 108 81 / 12%);
  border-radius: 22px;
  background: linear-gradient(145deg, #fff, #d8eddd);
  box-shadow: 0 12px 22px rgb(26 82 57 / 12%);
}

.art-core::before,
.art-core::after {
  position: absolute;
  top: 21px;
  width: 7px;
  height: 12px;
  border-radius: 50%;
  background: var(--green);
  content: "";
}
.art-core::before { left: 18px; }
.art-core::after { right: 18px; }
.art-spark { position: absolute; color: #df9851; font-size: 1.3rem; }
.spark-one { top: 17px; right: 16px; }
.spark-two { bottom: 20px; left: 7px; color: var(--green); font-size: 1rem; }

.library { padding-top: 47px; }
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 19px;
}

.section-kicker { margin-bottom: 0.44rem; font-size: 0.7rem; }
h2 { margin: 0; font-size: 1.45rem; font-weight: 740; letter-spacing: -0.055em; }
.section-caption { margin: 0 0 0.12rem; color: var(--muted); font-size: 0.83rem; }

.game-region { min-height: 198px; }
.game-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.game-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
  box-shadow: 0 5px 17px rgb(32 61 49 / 4%);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.game-card:hover {
  transform: translateY(-3px);
  border-color: #b6d5c0;
  box-shadow: var(--shadow);
}

.game-card-link {
  display: flex;
  min-height: 187px;
  flex-direction: column;
  align-items: flex-start;
  padding: 21px;
  border-radius: inherit;
  text-decoration: none;
}

.game-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 15px;
  color: var(--green);
  background: var(--mint);
}

.game-icon svg { width: 31px; height: 31px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.2; }
.game-title { overflow-wrap: anywhere; margin: 18px 0 0; font-size: 1.09rem; font-weight: 720; letter-spacing: -0.035em; line-height: 1.4; }
.game-action { margin-top: auto; padding-top: 12px; color: var(--green); font-size: 0.78rem; font-weight: 700; }
.game-action::after { padding-left: 0.38rem; content: "↗"; }

.state-panel {
  display: flex;
  min-height: 198px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  padding: 24px;
  border: 1px dashed #d4ded5;
  border-radius: 1rem;
  color: var(--ink-soft);
  background: rgb(255 255 255 / 54%);
  text-align: center;
}

.state-panel p { max-width: 34rem; margin: 0; font-size: 0.95rem; line-height: 1.6; }
.state-symbol { display: block; width: 31px; height: 31px; color: var(--green); }
.loading-symbol { border: 3px solid #d8e8dc; border-top-color: var(--green); border-radius: 50%; animation: rotate 850ms linear infinite; }
[data-state="empty"] .state-symbol { position: relative; width: 34px; height: 28px; border: 2px solid #8fa89a; border-radius: 7px 7px 10px 10px; }
[data-state="empty"] .state-symbol::before { position: absolute; top: -8px; left: 8px; width: 14px; height: 6px; border: 2px solid #8fa89a; border-bottom: 0; border-radius: 5px 5px 0 0; content: ""; }
[data-state="error"] .state-symbol { display: grid; place-items: center; color: #9b5825; }
[data-state="error"] .state-symbol::before { font-size: 1.7rem; font-weight: 750; content: "!"; }

.retry-button {
  min-height: 42px;
  margin-top: 0.25rem;
  padding: 0.58rem 1.05rem;
  border: 1px solid var(--green);
  border-radius: 0.65rem;
  color: #fff;
  background: var(--green);
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 690;
}
.retry-button:hover { background: var(--green-dark); }
.retry-button:disabled { cursor: wait; opacity: 0.68; }

.site-footer {
  display: flex;
  min-height: 104px;
  align-items: center;
  gap: 0.72rem;
  margin-top: 48px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.79rem;
}
.footer-mark { width: 1.35rem; font-size: 0.8rem; border-radius: 0.45rem; }
.site-footer p { margin: 0; }

[hidden] { display: none !important; }

@keyframes rotate { to { transform: rotate(360deg); } }

@media (max-width: 760px) {
  .header-inner, .page-shell { width: min(100% - 36px, 640px); }
  .page-shell { padding-top: 35px; }
  .intro { min-height: 207px; padding: 32px; }
  .intro-art { right: 24px; opacity: 0.65; transform: translateY(-50%) scale(0.84); transform-origin: center right; }
  .intro-copy { max-width: 72%; }
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .library { padding-top: 38px; }
}

@media (max-width: 520px) {
  .site-header { height: 66px; }
  .header-inner, .page-shell { width: min(100% - 32px, 440px); }
  .wordmark { gap: 0.53rem; font-size: 0.95rem; }
  .wordmark-mark { width: 1.8rem; }
  .header-note { font-size: 0.77rem; }
  .page-shell { padding-top: 22px; }
  .intro { min-height: 202px; padding: 27px 23px; border-radius: 1rem; }
  .intro-copy { max-width: 100%; }
  .intro-art { top: auto; right: 2px; bottom: -57px; opacity: 0.2; transform: scale(0.78); }
  h1 { margin-top: 0.85rem; font-size: 2.2rem; }
  .intro-description { max-width: 22rem; font-size: 0.9rem; }
  .eyebrow { font-size: 0.62rem; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 0.55rem; margin-bottom: 15px; }
  .section-caption { font-size: 0.78rem; }
  .game-grid { grid-template-columns: 1fr; gap: 12px; }
  .game-card-link { min-height: 144px; padding: 17px; }
  .game-icon { width: 42px; height: 42px; border-radius: 13px; }
  .game-icon svg { width: 27px; height: 27px; }
  .game-title { margin-top: 13px; font-size: 1rem; }
  .game-action { padding-top: 9px; }
  .state-panel { min-height: 190px; padding: 20px 16px; }
  .site-footer { min-height: 86px; margin-top: 32px; font-size: 0.73rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

.header-login {
  margin-left: auto;
  padding: 6px 14px;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: inherit;
  font-size: 0.9rem;
  text-decoration: none;
}
.header-login[hidden] { display: none; }
