/* Shared CoinEasy header and footer.
   Sub orange #FF8A1F is only the top bar and card rules, never small text on cream. */
@font-face {
  font-family: "Pretendard";
  src: url("/assets/brand/fonts/PretendardVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

html.ce-has-chrome {
  --ce-chrome-h: 58px;
  scroll-padding-top: 66px;
}

html.ce-has-chrome[data-ce-chrome="immersive"] {
  --ce-chrome-h: 44px;
  --ce-chrome-foot: 46px;
}

.ce-site-header,
.ce-site-footer,
.ce-bridge,
.result-places {
  --ce-orange: #FF6A00;
  --ce-orange-sub: #FF8A1F;
  --ce-cream: #FFF8EF;
  --ce-ink: #1A1714;
  --ce-muted: #6B645B;
  --ce-line: #E5CFBB;
  box-sizing: border-box;
  font-family: Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  letter-spacing: -0.02em;
  color: var(--ce-ink);
}

.ce-site-header *,
.ce-site-footer *,
.ce-bridge *,
.result-places * {
  box-sizing: border-box;
}

.ce-site-header {
  position: sticky;
  top: 0;
  z-index: 32;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  min-height: var(--ce-chrome-h);
  padding: 8px 16px;
  background: var(--ce-cream);
  border-top: 3px solid var(--ce-orange-sub);
  border-bottom: 1px solid var(--ce-line);
}

.ce-site-logo {
  display: inline-flex;
  align-items: center;
  flex: none;
  text-decoration: none;
}

.ce-site-logo img {
  display: block;
  height: 28px;
  width: auto;
  max-width: none;
}

.ce-site-menu {
  display: none;
  margin-left: auto;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--ce-ink);
  border-radius: 999px;
  background: #fff;
  color: var(--ce-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
}

.ce-site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 2px;
  margin: 0;
  padding: 0;
}

.ce-site-nav a {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 40px;
  padding: 4px 8px;
  border-radius: 10px;
  color: var(--ce-ink);
  text-decoration: none;
  touch-action: manipulation;
}

.ce-site-nav b,
.ce-site-footer b,
.ce-bridge b,
.result-places b {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.ce-site-nav small,
.ce-site-footer small,
.ce-bridge small,
.result-places small {
  color: var(--ce-muted);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.2;
}

.ce-site-nav a[aria-current="page"] {
  background: #fff;
  box-shadow: inset 0 -2px 0 var(--ce-orange);
}

.ce-site-nav a[aria-current="page"] b {
  color: var(--ce-orange);
}

.ce-site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 22px;
  margin-top: 28px;
  padding: 22px 16px 32px;
  background: var(--ce-cream);
  border-top: 1px solid var(--ce-line);
}

.ce-site-footer p {
  flex: 1 1 240px;
  margin: 0;
  color: var(--ce-ink);
  font-size: 13px;
  line-height: 1.55;
}

.ce-site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.ce-site-footer nav a {
  color: var(--ce-ink);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.ce-bridge {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: min(1100px, calc(100% - 32px));
  margin: 18px auto;
}

.ce-bridge a,
.result-places a {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 72px;
  padding: 14px 16px;
  background: var(--ce-cream);
  color: var(--ce-ink);
  text-decoration: none;
  border: 1px solid var(--ce-line);
  border-top: 3px solid var(--ce-orange-sub);
  border-radius: 16px;
}

.result-places {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.result-places b,
.ce-bridge b {
  font-size: 16px;
}

.ce-site-header a:focus-visible,
.ce-site-header button:focus-visible,
.ce-site-footer a:focus-visible,
.ce-bridge a:focus-visible,
.result-places a:focus-visible {
  outline: 3px solid var(--ce-orange);
  outline-offset: 2px;
}

/* University keeps its own sticky header. Sit it under this bar. */
html.ce-has-chrome .top {
  top: var(--ce-chrome-h);
}

@media (max-width: 980px) {
  .ce-site-header {
    flex-wrap: wrap;
  }

  .ce-site-menu {
    display: inline-flex;
    align-items: center;
  }

  .ce-site-nav {
    display: none;
    position: absolute;
    z-index: 2;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    max-height: min(70vh, 520px);
    overflow: auto;
    padding: 8px;
    background: var(--ce-cream);
    border-bottom: 1px solid var(--ce-line);
    touch-action: pan-y;
  }

  .ce-site-header {
    position: sticky;
  }

  .ce-site-header.is-open .ce-site-nav {
    display: flex;
  }

  .ce-site-nav a {
    min-height: 48px;
    padding: 8px 10px;
  }

  .result-places,
  .ce-bridge {
    grid-template-columns: 1fr;
  }
}

/* Gosiwon is a full-viewport world. Keep the bar thin and move its HUD clear. */
html[data-ce-chrome="immersive"] .ce-site-header,
html[data-ce-chrome="immersive"] .ce-site-footer {
  position: fixed;
  left: 0;
  right: 0;
}

html[data-ce-chrome="immersive"] .ce-site-header {
  top: 0;
  z-index: 13;
  min-height: calc(var(--ce-chrome-h) + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
}

html[data-ce-chrome="immersive"] .ce-site-header.is-open {
  z-index: 16;
}

html[data-ce-chrome="immersive"] .ce-site-footer {
  bottom: 0;
  z-index: 11;
  margin: 0;
  padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
  gap: 8px 12px;
}

html[data-ce-chrome="immersive"] .ce-site-footer p {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

html[data-ce-chrome="immersive"] .ce-site-nav {
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
}

html[data-ce-chrome="immersive"] #hudTop {
  top: calc(var(--ce-chrome-h) + env(safe-area-inset-top) + 8px);
}

html[data-ce-chrome="immersive"] #wx {
  top: calc(var(--ce-chrome-h) + env(safe-area-inset-top) + 8px);
}

html[data-ce-chrome="immersive"] #wxSrc {
  top: calc(var(--ce-chrome-h) + env(safe-area-inset-top) + 50px);
}

html[data-ce-chrome="immersive"] #hint {
  top: calc(var(--ce-chrome-h) + env(safe-area-inset-top) + 48px);
}

html[data-ce-chrome="immersive"] #bar {
  bottom: calc(var(--ce-chrome-foot) + max(68px, env(safe-area-inset-bottom) + 60px));
}

html[data-ce-chrome="immersive"] #joy {
  bottom: calc(var(--ce-chrome-foot) + max(16px, env(safe-area-inset-bottom)));
}

@media (max-width: 600px) {
  html[data-ce-chrome="immersive"] #wx {
    top: calc(var(--ce-chrome-h) + env(safe-area-inset-top) + 46px);
  }

  html[data-ce-chrome="immersive"] #wxSrc {
    top: calc(var(--ce-chrome-h) + env(safe-area-inset-top) + 82px);
  }

  html[data-ce-chrome="immersive"] body.inOrbit:not(.orbitToolsOpen) #bar {
    bottom: calc(var(--ce-chrome-foot) + max(12px, env(safe-area-inset-bottom)));
  }

  html[data-ce-chrome="immersive"] .ce-site-nav {
    position: fixed;
    top: calc(var(--ce-chrome-h) + env(safe-area-inset-top));
    right: 0;
    bottom: var(--ce-chrome-foot);
    left: 0;
    flex-wrap: wrap;
    overflow: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.ce-has-chrome {
    scroll-behavior: auto;
  }
}
