/*!
 * 심야오락실 — 게임 소개 패널 (게임 페이지) · 플레이 화면 게임 설명 · 공통 하단 링크
 * ---------------------------------------------------------------------------
 * 1) 각 게임 페이지: <section id="arcade-about" class="aa"> ... </section>
 *    - 게임 화면을 가리지 않도록 기본은 접혀 있고, 좌상단 [ⓘ 게임 소개] 버튼으로 연다.
 *    - 글은 모두 HTML에 정적으로 들어 있어 자바스크립트 없이도 문서에 남는다.
 * 2) play.html: <article class="aa aa-flow"> 안에 스크롤해 내려가며 읽는 형태로 쓴다.
 * 3) 푸터 링크(.aa-links)는 모든 페이지에서 같은 모양으로 쓴다.
 */

/* ---------- 공통 글꼴/색 ---------- */
.aa {
  --aa-bg: #07060a;
  --aa-panel: #16131e;
  --aa-line: #2a2436;
  --aa-text: #efeaf6;
  --aa-muted: #a49bb4;
  --aa-cyan: #3df0ff;
  --aa-pink: #ff3d8e;
  --aa-amber: #ffc857;
  color: var(--aa-text);
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, -apple-system, sans-serif;
  line-height: 1.75;
  letter-spacing: normal;
  text-align: left;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

/* 게임 페이지 안에서는 전역 user-select/touch-action 규칙을 되돌린다 */
.aa, .aa * {
  -webkit-user-select: text !important;
  user-select: text !important;
  touch-action: auto !important;
  -webkit-touch-callout: default !important;
  box-sizing: border-box !important;
}

/* ---------- 1) 게임 페이지: 접히는 패널 ----------
   play.html 의 소개 글도 id="arcade-about" 을 쓰지만 .aa-flow 가 붙어 있어 아래 규칙에서 빠진다. */
#arcade-about.aa:not(.aa-flow) {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147482000 !important;
  display: none !important;
  padding: 0 !important;
  margin: 0 !important;
  background: rgba(5, 4, 9, 0.985) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
#arcade-about.aa.is-open:not(.aa-flow) { display: block !important; }

#arcade-about:not(.aa-flow) .aa-inner {
  position: relative;
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 56px 20px calc(64px + env(safe-area-inset-bottom, 0px)) 20px;
}

#arcade-about:not(.aa-flow) .aa-close {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: 16px;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(61, 240, 255, 0.42);
  background: rgba(16, 14, 26, 0.9);
  color: #d6ecff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  padding: 8px 11px;
  border-radius: 8px;
  cursor: pointer;
}
#arcade-about:not(.aa-flow) .aa-close:hover { border-color: rgba(61, 240, 255, 0.9); }

/* ---------- 2) 플레이 화면: 흐름형 설명 ---------- */
.aa-flow {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 12px;
}

/* ---------- 제목/본문 ---------- */
.aa .aa-kicker {
  margin: 0 0 10px !important;
  font-family: "Press Start 2P", ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--aa-pink);
}
.aa h1 {
  margin: 0 0 10px !important;
  font-size: clamp(22px, 4.4vw, 30px);
  line-height: 1.32;
  font-weight: 800;
  color: var(--aa-text);
  text-shadow: 0 0 18px rgba(61, 240, 255, 0.16);
}
.aa .aa-meta {
  margin: 0 0 22px !important;
  padding: 0 0 14px !important;
  border-bottom: 1px solid var(--aa-line);
  color: var(--aa-amber);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.aa h2 {
  margin: 26px 0 8px !important;
  font-size: 15px;
  font-weight: 800;
  color: var(--aa-cyan);
  letter-spacing: 0.01em;
}
.aa p {
  margin: 0 0 13px !important;
  font-size: 15px;
  color: #ddd6e8;
}
.aa strong { color: #fff; }
.aa ul {
  margin: 0 0 14px !important;
  padding-left: 18px !important;
  list-style: disc;
}
.aa li {
  margin: 0 0 7px !important;
  font-size: 14.5px;
  color: #d3ccdf;
}
.aa.aa-page, .aa.aa-flow { background: transparent !important; }
.aa.aa-flow .aa-inner, .aa.aa-flow > * { width: 100%; }

/* ---------- 하단 링크 ---------- */
.aa-links {
  margin: 26px 0 0 !important;
  padding: 16px 0 0 !important;
  border-top: 1px solid var(--aa-line);
  font-size: 13px !important;
  color: #6f6880 !important;
  line-height: 2 !important;
}
.aa-links a {
  color: var(--aa-cyan) !important;
  text-decoration: none !important;
  padding: 2px 1px;
}
.aa-links a:hover { text-decoration: underline !important; }
.aa-links .aa-dot { color: #3b3548; padding: 0 3px; }

/* ---------- 플레이 화면 하단 푸터 ---------- */
.site-foot {
  border-top: 1px solid #2a2436;
  background: #0a0810;
  padding: 22px 16px calc(28px + env(safe-area-inset-bottom, 0px));
  color: #9a93a8;
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.9;
}
.site-foot .site-foot-in {
  width: min(760px, 100%);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  align-items: center;
  justify-content: space-between;
}
.site-foot a {
  color: #c9c2d6;
  text-decoration: none;
  padding: 2px 0;
}
.site-foot a:hover { color: #3df0ff; }
.site-foot .site-foot-links { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.site-foot .site-foot-copy { color: #6f6880; font-size: 12px; }

/* ---------- 좁은 화면 ---------- */
@media (max-width: 480px) {
  #arcade-about:not(.aa-flow) .aa-inner { padding: 52px 16px 56px; }
  .aa h1 { font-size: 21px; }
  .aa p { font-size: 14.5px; }
  .aa li { font-size: 14px; }
}

/* ---------- 공통 상단 버튼이 없는 게임용 대체 버튼 ---------- */
#aa-fab {
  position: fixed !important;
  z-index: 2147483000 !important;
  top: calc(env(safe-area-inset-top, 0px) + 8px) !important;
  right: calc(env(safe-area-inset-right, 0px) + 8px) !important;
  left: auto !important;
  bottom: auto !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: auto !important;
  height: 27px !important;
  margin: 0 !important;
  padding: 0 9px !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  border: 1px solid rgba(64, 232, 255, 0.42) !important;
  border-radius: 8px !important;
  background: rgba(10, 9, 16, 0.62) !important;
  color: #d6ecff !important;
  font-family: 'Pretendard', 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif !important;
  font-size: 11.5px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  letter-spacing: 0.01em !important;
  white-space: nowrap !important;
  cursor: pointer;
  opacity: 0.86;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45) !important;
  backdrop-filter: blur(3px) saturate(1.2);
  -webkit-backdrop-filter: blur(3px) saturate(1.2);
  touch-action: manipulation;
}
#aa-fab:hover { opacity: 1; border-color: rgba(64, 232, 255, 0.85) !important; }

/* ---------- 플레이 화면(play.html) 좁은 폭 보정 ----------
   '게임 소개 ↓' 링크가 붙으면서 390px 폰에서 제목·전체화면 버튼이 눌리던 것을 막는다. */
#arcade-about.aa-flow { scroll-margin-top: 64px; }
.playbar button#fs { white-space: nowrap; }

@media (max-width: 900px) {
  .playbar { gap: 8px; padding: 0 10px; }
  .playbar > a:first-child { flex: 0 0 auto; font-size: 12px; }
  .playbar h1 {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
  }
  .playbar .langpick-host { flex: 0 0 auto; }
  .playbar-about { flex: 0 0 auto; margin-left: 0; padding: 5px 7px; font-size: 11px !important; }
  .playbar button#fs { flex: 0 0 auto; white-space: nowrap; padding: 6px 8px; font-size: 12px; }
}

@media (max-width: 430px) {
  /* 아주 좁은 화면에서는 '게임 소개' 링크를 숨긴다(게임 페이지는 ⓘ, 플레이 화면은 바로 아래 글로 대신) */
  .playbar-about { display: none; }
}
