/* Shared by every page: fonts, the night palette, header, footer, buttons, tabs, chips, medals, sprite tiles,
   game-icon tiles, the night sky and the motion switch. Look: "별밤 모험" from the Claude Design canvas
   (README: 디자인). Every page sits on the same night sky: gold = the thing to do, moon blue = what is chosen,
   mint = all good. Jua (bundled in fonts/jua, linked from each page) is the display face; Pretendard (bundled) is everything else and the fallback. */
@font-face { font-family: Pretendard; src: url("fonts/Pretendard-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Pretendard; src: url("fonts/Pretendard-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --ground: #091230;
  --card: #111c40;
  --card-in: #0d1738;
  --tray: #0b1434;
  --line: #24335f;
  --line-soft: #1b2850;
  --text: #f1f4ff;
  --text-2: #b4bedf;
  --text-3: #8f9ac2;
  --gold: #ffc94a;
  --gold-ink: #2a1a00;
  --gold-text: #ffd77a;
  --moon: #95aaff;
  --moon-ink: #0a1230;
  --mint: #6ee7b7;
  --rose: #ff8fa3;
  --discord: #5865f2;
  --display: Jua, Pretendard, "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  --radius: 24px;
  --shadow: 0 24px 56px #03081a73;
  --header: 76px;
  --wrap: 1200px;  /* the one content width: header, hero, every page and the footer line up on it (wider on big screens, below) */
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* the hidden attribute wins over any display rule */
html {
  scroll-padding-top: 24px;
  /* faint stars on the ground under every page */
  background-color: var(--ground);
  background-image: radial-gradient(1.5px 1.5px at 8% 12%, #ffffff80, transparent 60%), radial-gradient(1px 1px at 23% 64%, #ffffff59, transparent 60%),
    radial-gradient(1.5px 1.5px at 41% 28%, #ffecb473, transparent 60%), radial-gradient(1px 1px at 57% 81%, #ffffff4d, transparent 60%),
    radial-gradient(1.5px 1.5px at 72% 17%, #ffffff73, transparent 60%), radial-gradient(1px 1px at 88% 52%, #ffecb466, transparent 60%);
  background-size: 640px 520px;
}
body {
  margin: 0; color: var(--text); font-family: Pretendard, "Malgun Gothic", "Apple SD Gothic Neo", sans-serif; font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; word-break: keep-all;
}
/* Soft moonlight in the sky beside the content. It stays put while the cards scroll over it, so wide screens never
   show a flat empty ground at the sides. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(50vw 62vh at 0% 60%, #3d55c826 0%, #3d55c800 72%), radial-gradient(46vw 56vh at 100% 30%, #8a5cd021 0%, #8a5cd000 72%);
}
button, a, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; color: inherit; }
a { color: inherit; text-decoration: none; }
.green-link { color: var(--gold-text); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 10px; }
.icon { width: 24px; height: 24px; flex: none; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: fixed; top: -100px; left: 24px; z-index: 100; padding: 14px 20px; background: var(--card); color: var(--text); border: 2px solid var(--gold); border-radius: 12px; }
.skip-link:focus { top: 10px; }
.kicker { display: block; font-size: 12px; font-weight: 700; letter-spacing: 0.18em; color: var(--moon); line-height: 1.4; }
.display { font-family: var(--display); font-weight: 400; }

/* Header: lies over the night sky of each page's top band */
.site-header { position: absolute; top: 0; left: 0; right: 0; z-index: 20; height: var(--header); background: linear-gradient(180deg, #091230d6 0%, #09123073 70%, #09123000 100%); }
.nav-wrap { max-width: calc(var(--wrap) + 48px); height: 100%; margin: auto; display: flex; align-items: center; gap: 28px; padding: 0 24px; }
.brand { flex: none; display: flex; }
.brand img { display: block; width: auto; height: 56px; }
.desktop-nav { flex: 1; min-width: 0; display: flex; align-items: center; gap: 2px; }
.desktop-nav a { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 48px; padding: 0 14px; border-radius: 12px; font-weight: 700; color: #c9d2f0; white-space: nowrap; }
.desktop-nav a::after { content: ""; width: 18px; height: 3px; border-radius: 3px; background: transparent; }
.desktop-nav a:hover { color: #fff; background: #ffffff0f; }
.desktop-nav a[aria-current] { color: #fff; }
.desktop-nav a[aria-current]::after { background: var(--gold); }
.nav-actions { flex: none; display: flex; align-items: center; gap: 8px; }
.lang-switch { display: flex; align-items: center; font-size: 14px; white-space: nowrap; }
.lang-switch button { background: none; border: 0; padding: 0 8px; min-height: 44px; color: var(--text-3); font-weight: 700; }
.lang-switch button[aria-pressed="true"] { color: #fff; }
.lang-switch > span { color: #4a5888; }
.menu-toggle, .mobile-nav { display: none; }

/* Buttons */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 58px; padding: 0 28px; border-radius: 16px; border: 0; position: relative; overflow: hidden; font-weight: 700; font-size: 19px; line-height: 1.2; white-space: nowrap; transition: transform 0.2s, box-shadow 0.2s, background 0.2s; }
.button .icon { width: 22px; height: 22px; stroke-width: 2.4; }
.yellow { background: var(--gold); color: var(--gold-ink); box-shadow: 0 12px 30px #ffc94a52, inset 0 -4px 0 #7a480038; }
.yellow:hover { background: #ffd566; transform: translateY(-1px); }
.button.discord { background: var(--discord); color: #fff; box-shadow: 0 12px 30px #5865f259, inset 0 -4px 0 #14185a40; }
.button.discord:hover { background: #6872f5; transform: translateY(-1px); }
.discord-logo { width: 24px; height: 24px; flex: none; display: block; }
.header-play { min-height: 44px; padding: 0 20px; border-radius: 12px; font-size: 16px; box-shadow: inset 0 -3px 0 #7a480038; }
.header-play .icon { display: none; }
.header-discord { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--discord); flex: none; transition: transform 0.2s, background 0.2s; }
.header-discord:hover { background: #6872f5; transform: translateY(-2px); }
.header-discord img { width: 22px; height: 22px; display: block; }

/* Log in / sign up in the header (or the signed-in ID and log out) */
.auth-links { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.auth-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border: 0; border-radius: 12px; background: none; font-size: 15px; font-weight: 700; color: #dde4ff; }
.auth-link:hover { color: #fff; background: #ffffff0f; }
.auth-link[aria-current] { color: var(--gold-text); }
.auth-link.join { min-height: 42px; padding: 0 16px; border: 1px solid #95aaff80; }
.auth-link.join:hover { border-color: var(--moon); }
.account-chip { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px 0 2px; max-width: 180px; border-radius: 999px; background: #95aaff29; color: var(--text); font-size: 15px; font-weight: 700; }
.account-chip img { width: 40px; height: 40px; flex: none; border-radius: 50%; background: #18254f; image-rendering: pixelated; }
.account-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-chip[aria-current] { box-shadow: inset 0 0 0 1px var(--gold); }

/* Tabs: one look for every tab row on the site (a dark tray, the chosen one a moon-blue pill) */
.tabs, .seg, .ttabs { display: flex; flex-wrap: wrap; gap: 4px; width: fit-content; max-width: 100%; padding: 4px; border-radius: 16px; background: var(--tray); border: 1px solid #1f2c55; }
.tabs button, .seg button, .ttabs button { min-height: 42px; padding: 0 18px; border: 0; border-radius: 12px; background: none; color: var(--text-2); font-size: 15px; font-weight: 700; }
.tabs button:hover, .seg button:hover, .ttabs button:hover:not(:disabled) { color: #fff; background: #ffffff0d; }
.tabs button[aria-selected="true"], .seg button[aria-selected="true"], .ttabs button[aria-selected="true"] { background: var(--moon); color: var(--moon-ink); }
.ttabs button:disabled { cursor: default; }

/* Chips and news tags */
.chip, .example { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 8px; background: #1f2c57; color: var(--text-2); font-family: Pretendard, sans-serif; font-size: 12px; font-weight: 700; line-height: 1.5; letter-spacing: 0; vertical-align: 3px; white-space: nowrap; }
.category, .tag { flex: none; width: 76px; padding: 4px 0; border-radius: 9px; text-align: center; background: #1f2c57; color: var(--text-2); font-size: 13px; font-weight: 700; white-space: nowrap; }
.category.notice, .tag.notice { background: #95aaff29; color: #bcc9ff; }
.category.event, .tag.event { background: #ffc94a29; color: var(--gold-text); }
.category.update, .tag.update { background: #6ee7b724; color: #8ef0c6; }

/* Medals (1-3 gold, silver, bronze) and plain rank numbers */
.medal, .rank-no { flex: none; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: #1b2853; color: var(--text-2); font-family: var(--display); font-size: 18px; font-weight: 400; font-variant-numeric: tabular-nums; }
.m1, .rank-no.r1 { background: linear-gradient(160deg, #ffe08a, #f5b524); color: #4a2e00; }
.m2, .rank-no.r2 { background: linear-gradient(160deg, #f4f7fb, #b9c4d6); color: #2b3850; }
.m3, .rank-no.r3 { background: linear-gradient(160deg, #f6cda6, #c98149); color: #4a2410; }

/* Game sprites: 2x pictures drawn with sharp pixels; an avatar shows head and shoulders in a small tile */
.sprite { image-rendering: pixelated; display: block; max-width: none; }
.avatar { position: relative; flex: none; width: 52px; height: 52px; border-radius: 16px; overflow: hidden; background: radial-gradient(circle at 50% 35%, #33498f 0%, #18254f 72%); box-shadow: inset 0 0 0 1px #2d3f79; }
.avatar > .sprite { position: absolute; left: 50%; top: 3px; transform: translateX(-50%); }
.avatar > .sprite-missing { display: none; }

/* Game-icon tiles. On the night sky (page titles) they are bright; inside dark cards they are dark tinted squares. */
.pix { image-rendering: pixelated; }
.title-icon { width: 40px; height: 40px; flex: none; }
/* item icons are 80px files (2x the game's 40px), so they are only ever shown at 80px or 40px to keep sharp pixels */
.game-icon { width: 96px; height: 96px; border-radius: 26px; display: grid; place-items: center; flex: none; background: radial-gradient(circle at 30% 22%, #fff 0, var(--tint-a) 48%, var(--tint-b) 100%); border: 4px solid #0912308c; box-shadow: 0 16px 34px #03081a80; transition: transform 0.25s; }
.game-icon > .pix { width: 80px; height: 80px; }
.game-icon > .glyph { width: 32px; height: 32px; fill: none; stroke: #7ef0c0; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.game-icon.tint-blue > .glyph { stroke: #b8c6ff; }
.game-icon > .discord-logo { width: 34px; height: 34px; }
.tint-blue { --tint-a: #eaf0ff; --tint-b: #b8c8ff; --dark: #1b2a5c; --dark-line: #2d3f79; }
.tint-gold { --tint-a: #fff3c9; --tint-b: #ffd56b; --dark: #3a2f18; --dark-line: #5b4a22; }
.tint-purple { --tint-a: #efe9ff; --tint-b: #c9b8ff; --dark: #2c2160; --dark-line: #4a3c88; }
.tint-green, .tint-mint, .tint-go { --tint-a: #e4fbf0; --tint-b: #9fe6c4; --dark: #16403b; --dark-line: #23605a; }
.tint-pink { --tint-a: #ffe6f0; --tint-b: #ffb8d0; --dark: #3d1f3a; --dark-line: #6a3563; }
.tint-discord { --tint-a: #939bff; --tint-b: #5865f2; --dark: #5865f2; --dark-line: #5865f2; }
/* the small dark tile used in card headings and lists */
.tile { flex: none; width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: var(--dark, #1b2a5c); border: 1px solid var(--dark-line, #2d3f79); }
.tile > .pix { width: 40px; height: 40px; }

/* Night sky: twinkling stars and shooting stars, made by site.js inside a .sky-fx layer */
.sky-fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.twinkle { position: absolute; left: var(--x); top: var(--y); width: var(--s); height: var(--s); border-radius: 50%; background: #fff; box-shadow: 0 0 6px 1px #cfe2ffcc; opacity: 0.7; animation: twinkle var(--d, 3.6s) ease-in-out var(--delay, 0s) infinite; }
.twinkle.glint { border-radius: 0; background: none; box-shadow: none; filter: drop-shadow(0 0 4px #fff3b8); }
.twinkle.glint::before { content: ""; position: absolute; inset: 0; background: #fff8dc; clip-path: polygon(50% 0, 58% 42%, 100% 50%, 58% 58%, 50% 100%, 42% 58%, 0 50%, 42% 42%); }
.meteor { position: absolute; left: calc(var(--x) - var(--len)); top: var(--y); width: var(--len); height: 2px; border-radius: 2px; transform-origin: 100% 50%; rotate: var(--angle); background: linear-gradient(90deg, #fff0 0%, #cfe4ff55 45%, #fff 100%); opacity: 0; animation: meteor var(--dur) cubic-bezier(0.3, 0.5, 0.6, 1) forwards; }
.meteor::after { content: ""; position: absolute; right: -3px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: #fff; box-shadow: 0 0 10px 4px #d9ebff, 0 0 24px 9px #9fc6ff66; }
@keyframes twinkle { 0%, 100% { opacity: 0.25; scale: 0.7; } 50% { opacity: 1; scale: 1.15; } }
@keyframes meteor { 0% { opacity: 0; translate: 0 0; scale: 0.25 1; } 10% { opacity: 1; } 35% { scale: 1 1; } 70% { opacity: 1; } 100% { opacity: 0; translate: var(--dx) var(--dy); scale: 1 1; } }
@keyframes kenBurns { from { scale: 1; translate: 0 0; } to { scale: 1.035; translate: -12px 6px; } }
@keyframes moonGlow { from { opacity: 0.65; } to { opacity: 1; } }

/* Motion switch, and cards that rise in as they scroll into view (site.js adds .reveal-ready; without JS they just show) */
.motion-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid #95aaff4d; background: #091230b8; color: #dde4ff; font-size: 14px; font-weight: 700; backdrop-filter: blur(6px); }
.motion-toggle .icon { width: 16px; height: 16px; color: var(--gold); stroke-width: 2.6; }
.motion-toggle:disabled { cursor: default; color: var(--text-2); }
[data-reveal] { transition: opacity 0.7s ease var(--delay, 0s), translate 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) var(--delay, 0s), transform 0.2s, box-shadow 0.2s, border-color 0.2s; }
.reveal-ready:not(.motion-off) [data-reveal]:not(.shown) { opacity: 0; translate: 0 28px; }
.motion-off *, .motion-off *::before, .motion-off *::after { animation: none !important; transition: none !important; }
.motion-off .meteor { display: none; }
.motion-off .twinkle { opacity: 0.75; }

/* Footer. Above it the lake village shows faintly in the page's last gap, so every page ends on the same night view
   (it sits under the cards, and a page's own night scene covers it). */
footer.site-footer { position: relative; background: #060c22; color: var(--text-2); padding: 48px 24px 40px; font-size: 15px; }
footer.site-footer::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 260px; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, #060c2200 45%, #060c22 100%), linear-gradient(#09123099, #09123099), url("img/night-bg.webp") center 66% / max(100%, 1672px) auto no-repeat;
  -webkit-mask-image: linear-gradient(180deg, #0000 0%, #000 55%); mask-image: linear-gradient(180deg, #0000 0%, #000 55%);
}
.footer-wrap { max-width: var(--wrap); margin: auto; display: flex; flex-direction: column; gap: 24px; }
.footer-top { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 20px; }
.footer-brand { display: flex; align-items: center; gap: 16px; }
.footer-brand img { height: 64px; width: auto; display: block; }
.footer-brand b { display: block; font-family: var(--display); font-weight: 400; font-size: 24px; letter-spacing: 0.02em; color: var(--text); }
.footer-brand p { margin: 0; }
.footer-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 10px; }
.footer-actions a { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 16px; border-radius: 14px; font-weight: 700; }
.footer-actions .discord { background: var(--discord); color: #fff; }
.footer-actions .discord img { width: 22px; height: 22px; }
.footer-actions .top-link { border: 1px solid #2d3f79; color: #dde4ff; }
.footer-actions .top-link:hover { border-color: var(--moon); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 0 24px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.footer-nav a { display: inline-flex; align-items: center; min-height: 44px; color: #dde4ff; }
.footer-nav a:hover { color: var(--gold-text); }
.footer-rights { margin: 0; font-size: 13px; color: var(--text-3); }

@media (min-width: 1680px) { :root { --wrap: 1320px; } }
@media (min-width: 2200px) { :root { --wrap: 1440px; } }
@media (max-width: 1400px) {
  .header-discord { display: none; }  /* Discord stays in the page itself and the footer */
}
/* Six menu items plus login / sign-up stop fitting on one line below about 1280px (English or a long ID first),
   so the menu button takes over there and the account links move into its panel. */
@media (max-width: 1280px) {
  .desktop-nav, .auth-links { display: none; }
  .nav-wrap { gap: 12px; }
  .nav-actions { margin-left: auto; }
  .menu-toggle { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid #95aaff4d; border-radius: 12px; background: #111c40cc; color: var(--text); padding: 0; }
  .menu-toggle .icon { width: 22px; height: 22px; }
  .mobile-nav:not([hidden]) { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; position: absolute; left: 10px; right: 10px; top: calc(100% - 6px); z-index: 30; padding: 10px; border-radius: 20px; background: var(--card); border: 1px solid #2d3f79; box-shadow: 0 24px 48px #00000080; }
  .mobile-nav a, .mobile-nav button { display: flex; align-items: center; min-height: 48px; padding: 0 14px; border-radius: 12px; border: 0; background: var(--card-in); color: #dde4ff; font-weight: 700; text-align: left; }
  .mobile-nav a:hover, .mobile-nav button:hover { background: #172451; }
  .mobile-nav a[aria-current] { background: #95aaff2e; color: #fff; }
  .mobile-nav .auth-item { justify-content: center; border: 1px solid #95aaff73; background: transparent; }
  .mobile-nav .auth-item.join, .mobile-nav .auth-item.mine { background: var(--moon); color: var(--moon-ink); border-color: var(--moon); }
}
@media (max-width: 700px) {
  :root { --header: 64px; }
  .nav-wrap { padding: 0 10px 0 14px; gap: 8px; }
  .brand img { height: 44px; }
  .nav-actions { gap: 6px; }
  .lang-switch button { padding: 0 4px; font-size: 13px; }
  .header-play { padding: 0 14px; font-size: 15px; }
  footer.site-footer { padding: 32px 18px 28px; }
  .footer-brand img { height: 52px; }
  .footer-brand b { font-size: 20px; }
  .footer-actions { margin-left: 0; width: 100%; }
  .footer-actions .discord { flex: 1; justify-content: center; }
  .footer-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 8px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
