:root {
  color-scheme: dark;
  --bg: #080a0f;
  --panel: #10141d;
  --panel-strong: #171c28;
  --ink: #f4f0e7;
  --muted: #a7afbd;
  --gold: #d8b667;
  --gold-soft: rgba(216, 182, 103, .18);
  --violet: #9380df;
  --line: rgba(255, 255, 255, .1);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); }

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 16% 2%, rgba(128, 99, 42, .18), transparent 31rem),
    radial-gradient(circle at 90% 58%, rgba(72, 55, 133, .15), transparent 34rem),
    linear-gradient(160deg, #0c0f16 0%, #07090d 70%);
  color: var(--ink);
  font-family: Inter, Pretendard, "Noto Sans KR", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

a { color: inherit; }

.hub {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(48px, 8vw, 104px) 0 32px;
}

.hub__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 52px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--gold);
  font: 800 .78rem/1.3 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: .16em;
}

h1 {
  max-width: 760px;
  margin: 0;
  font: 700 clamp(2.35rem, 6vw, 5.15rem)/.99 Georgia, "Times New Roman", serif;
  letter-spacing: -.045em;
}

.intro {
  max-width: 620px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.75;
}

.network-status {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8, 10, 15, .7);
  color: var(--muted);
  font-size: .88rem;
}

.network-status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d9a441;
  box-shadow: 0 0 14px rgba(217, 164, 65, .6);
}

.network-status.is-online .network-status__dot { background: #59d58c; box-shadow: 0 0 14px rgba(89, 213, 140, .65); }
.network-status.is-offline .network-status__dot { background: #e26e6e; box-shadow: 0 0 14px rgba(226, 110, 110, .55); }

.game-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.section-heading {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.section-heading h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: .03em;
}

.section-heading > span {
  color: #717a89;
  font: 800 .75rem/1 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: .12em;
}

.game-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(24, 29, 41, .95), rgba(12, 15, 22, .98));
  box-shadow: 0 28px 70px rgba(0, 0, 0, .25);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: rgba(216, 182, 103, .4);
  box-shadow: 0 34px 80px rgba(0, 0, 0, .38);
}

.game-card__link { display: block; height: 100%; text-decoration: none; }
.game-card__link:focus-visible { outline: 3px solid var(--gold); outline-offset: -5px; border-radius: 24px; }

.game-card__visual {
  position: relative;
  height: 210px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px),
    radial-gradient(circle at 50% 45%, rgba(216, 182, 103, .2), transparent 34%),
    #0d1119;
  background-size: 32px 32px, 32px 32px, auto, auto;
}

.game-card--dungeon .game-card__visual {
  background:
    linear-gradient(rgba(255, 255, 255, .022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .022) 1px, transparent 1px),
    radial-gradient(circle at 55% 38%, rgba(147, 128, 223, .25), transparent 34%),
    #0d1119;
  background-size: 32px 32px, 32px 32px, auto, auto;
}

.game-card__number {
  position: absolute;
  top: 18px;
  left: 20px;
  color: rgba(255, 255, 255, .24);
  font: 800 .78rem/1 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: .12em;
}

.crown-mark, .dice-mark {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: var(--gold);
  font: 400 5.4rem/1 Georgia, serif;
  filter: drop-shadow(0 0 28px rgba(216, 182, 103, .35));
}

.dice-mark { color: #b4a5ef; transform: translate(-50%, -56%) rotate(45deg); }

.card-pair { position: absolute; inset: 0; }
.card-pair i {
  position: absolute;
  width: 82px;
  height: 116px;
  display: grid;
  place-items: end center;
  padding-bottom: 11px;
  border: 1px solid rgba(216, 182, 103, .34);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(62, 49, 27, .46), rgba(13, 16, 23, .85));
  color: rgba(240, 213, 147, .5);
  font: 800 .62rem/1 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: .09em;
}
.card-pair i:first-child { left: calc(50% - 114px); top: 47px; transform: rotate(-9deg); }
.card-pair i:last-child { right: calc(50% - 114px); top: 47px; transform: rotate(9deg); }

.dungeon-path { position: absolute; inset: 0; }
.dungeon-path:before {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  top: 50%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(180, 165, 239, .45), transparent);
}
.dungeon-path i {
  position: absolute;
  top: calc(50% - 7px);
  width: 14px;
  height: 14px;
  border: 2px solid rgba(180, 165, 239, .66);
  border-radius: 50%;
  background: #111521;
  box-shadow: 0 0 16px rgba(147, 128, 223, .25);
}
.dungeon-path i:nth-child(1) { left: 19%; }
.dungeon-path i:nth-child(2) { left: 34%; top: calc(50% - 30px); }
.dungeon-path i:nth-child(3) { right: 34%; top: calc(50% + 16px); }
.dungeon-path i:nth-child(4) { right: 19%; }

.game-card__content { padding: 24px 25px 26px; }
.game-card__meta { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--gold); font-size: .8rem; font-weight: 800; }
.game-card--dungeon .game-card__meta { color: #b4a5ef; }
.game-state { color: #778190; font-size: .76rem; font-weight: 700; }
.game-state.is-online { color: #62d994; }
.game-state.is-offline { color: #e08080; }
.game-card h3 { margin: 14px 0 10px; font: 700 clamp(1.7rem, 4vw, 2.5rem)/1 Georgia, serif; letter-spacing: -.025em; }
.game-card p { min-height: 3.4em; margin: 0; color: var(--muted); font-size: .96rem; line-height: 1.7; }
.game-card__action { display: flex; align-items: center; justify-content: space-between; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); font-size: .92rem; font-weight: 800; }
.game-card__action b { color: var(--gold); font-size: 1.25rem; transition: transform .2s ease; }
.game-card:hover .game-card__action b { transform: translateX(4px); }
.game-card--dungeon .game-card__action b { color: #b4a5ef; }

.hub__footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: #727b89;
  font-size: .78rem;
  letter-spacing: .05em;
}

@media (max-width: 760px) {
  .hub { width: min(100% - 24px, 580px); padding-top: 40px; }
  .hub__header { display: block; margin-bottom: 38px; }
  .network-status { margin-top: 24px; }
  .game-grid { grid-template-columns: 1fr; }
  .game-card__visual { height: 180px; }
  .hub__footer { display: grid; }
}

@media (prefers-reduced-motion: reduce) {
  .game-card, .game-card__action b { transition: none; }
}
