/* 로또보물섬 홈페이지. 앱과 같은 색(에메랄드·골드)과 둥근 카드 모양을 쓴다.
   색은 모두 아래 이름표(변수)로만 쓰고, 휴대폰·컴퓨터가 어두운 화면(다크 모드)이면 아래쪽 값으로 바뀐다. */
:root {
  color-scheme: light dark;
  --emerald-900: #04523d;
  --emerald-700: #06805e;
  --emerald-500: #12a87d;
  --gold: #ffc531;
  --orange: #ff8a1f;
  --coral: #ff6b57;
  --navy: #0e1a2d;
  --radius: 18px;

  --canvas: #f1f5f3;
  --surface: #ffffff;
  --surface-variant: #e7eeea;
  --outline: #dce5e1;
  --ink: #15201c;
  --sub: #5a6762;
  --error: #b3261e;
  --accent-text: #06805e;
  --input-bg: #ffffff;
  --input-border: #b5c2bc;
  --facts-bg: #edf9f4;
  --table-head: #312e33;
  --index-bg: #d7f3e8;
  --index-text: #04523d;
  --bar-fill: #06805e;
  --excluded: #444444;
  --dim-text: #6b7872;
  --card-border: transparent;
  --card-shadow: 0 1px 3px rgb(0 0 0 / 8%);
  --focus: #04523d;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #0f1513;
    --surface: #1a2320;
    --surface-variant: #26312d;
    --outline: #34423c;
    --ink: #e6eeea;
    --sub: #a7b5ae;
    --error: #ffb4ab;
    --accent-text: #5fd3aa;
    --input-bg: #121a17;
    --input-border: #4f6058;
    --facts-bg: #13261f;
    --table-head: #2b3632;
    --index-bg: #1d3b31;
    --index-text: #b9f0db;
    --bar-fill: #2fbf8f;
    --excluded: #6b6b6b;
    --dim-text: #a1aea8;
    --card-border: #26312d;
    --card-shadow: none;
    --focus: #ffc531;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  line-height: 1.5;
}
a { color: var(--accent-text); }
h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.site-header :focus-visible, .panel-green :focus-visible, .panel-violet :focus-visible { outline-color: var(--gold); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 8px; top: 8px; background: var(--surface); color: var(--ink); padding: 8px 12px; z-index: 10; border-radius: 8px; }

/* ── 머리글 ── */
.site-header { background: linear-gradient(135deg, var(--emerald-900), var(--emerald-700)); color: #fff; }
.header-inner { max-width: 960px; margin: 0 auto; padding: 14px 16px 6px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wordmark { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-size: 1.5rem; font-weight: 800; white-space: nowrap; }
.wordmark b { color: var(--gold); font-weight: 800; }
.header-user { display: flex; align-items: center; gap: 8px; font-size: .9rem; min-width: 0; }
.header-user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-user .btn { background: rgb(255 255 255 / 18%); color: #fff; white-space: nowrap; }
.tabs { max-width: 960px; margin: 0 auto; padding: 8px 12px 14px; display: flex; gap: 4px; overflow-x: auto; }
.tabs a { flex: 1 0 auto; text-align: center; padding: 11px 14px; min-height: 44px; border-radius: 999px; color: #fff; text-decoration: none; font-weight: 500; white-space: nowrap; }
.tabs a[aria-current="page"] { background: #fff; color: var(--emerald-700); font-weight: 800; }

/* ── 본문 ── */
.page { max-width: 960px; margin: 0 auto; padding: 16px 14px 32px; display: grid; gap: 14px; outline: none; }
.loading { text-align: center; padding: 40px 0; color: var(--sub); }
.card { background: var(--surface); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 16px; box-shadow: var(--card-shadow); min-width: 0; }
.card h2 { font-size: 1.15rem; font-weight: 800; margin-bottom: 10px; }
.card h3 { font-size: 1rem; font-weight: 800; margin: 14px 0 8px; }
.grid-2 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.muted { color: var(--sub); font-size: .9rem; }
.note { color: var(--sub); font-size: .8rem; text-align: center; }
.pill { display: inline-block; background: var(--gold); color: var(--navy); font-weight: 800; border-radius: 999px; padding: 2px 12px; }
.error { color: var(--error); font-weight: 700; }

.panel-green { background: linear-gradient(135deg, var(--emerald-900), var(--emerald-700)); color: #fff; border-color: transparent; }
.panel-green .muted { color: rgb(255 255 255 / 92%); }
.pending-note { background: var(--gold); color: var(--navy); font-weight: 700; border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; }
.countdown { font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.panel-violet { background: linear-gradient(135deg, #3f2d96, #7c5cff); color: #fff; border-color: transparent; }
.panel-violet .muted { color: rgb(255 255 255 / 88%); }

/* ── 공 ── */
.balls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ball {
  --c: #999;
  --size: 44px;
  width: var(--size); height: var(--size); border-radius: 50%; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.05rem; color: #fff; text-shadow: 0 1px 2px rgb(0 0 0 / 35%);
  background: var(--c);
  background: radial-gradient(circle at 34% 28%, color-mix(in srgb, var(--c) 50%, #fff), var(--c) 55%, color-mix(in srgb, var(--c) 78%, #000));
  box-shadow: 0 3px 0 rgb(0 0 0 / 14%);
}
.ball.small { --size: 34px; font-size: .9rem; }
.ball-yellow { --c: #f9b908; color: #4a2f00; text-shadow: none; }
.ball-blue { --c: #3fa9f5; }
.ball-red { --c: #f2544b; }
.ball-gray { --c: #9aa3a8; }
.ball-green { --c: #7bc63a; }
.ball.dim { background: var(--surface-variant); color: var(--dim-text); box-shadow: none; text-shadow: none; border: 1.5px solid var(--outline); }
.plus { font-weight: 800; color: var(--sub); }

/* 번호 연출: 남색 공 안에서 숫자 띠가 위에서 아래로 빠르게 지나가고(숫자 하나에 0.07초), 멈추면 살짝 커졌다 돌아온다 */
.ball.rolling { --c: #2c3a55; overflow: hidden; align-items: flex-start; }
.roll-strip { display: flex; flex-direction: column; width: 100%; animation: ball-roll 560ms linear infinite; }
.roll-strip i { font-style: normal; height: var(--size); flex: 0 0 auto; display: flex; align-items: center; justify-content: center; }
@keyframes ball-roll { from { transform: translateY(-88.8889%); } to { transform: translateY(0); } }
.ball.pop { animation: ball-pop 450ms cubic-bezier(.34, 1.56, .64, 1); }
@keyframes ball-pop { from { transform: scale(1.28); } to { transform: scale(1); } }
.fx-toggles { display: flex; flex-wrap: wrap; gap: 0 16px; margin-top: 12px; padding-top: 6px; border-top: 1px solid var(--outline); color: var(--sub); font-size: .9rem; }
.fx-toggle { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; cursor: pointer; }
.fx-toggle input { width: 20px; height: 20px; accent-color: var(--emerald-700); }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; background: var(--facts-bg); border-radius: 14px; padding: 10px; margin-top: 12px; text-align: center; }
.facts dt { color: var(--sub); font-size: .8rem; }
.facts dd { margin: 0; color: var(--accent-text); font-weight: 800; font-size: 1.1rem; }

/* ── 단추와 입력 ── */
.btn { border: 0; border-radius: 14px; padding: 12px 16px; font-weight: 800; cursor: pointer; background: var(--surface-variant); color: var(--ink); min-height: 48px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-gold { background: linear-gradient(90deg, var(--gold), var(--orange)); color: var(--navy); }
.btn-green { background: var(--emerald-700); color: #fff; }
.btn-blue { background: #2f6fdb; color: #fff; }
.btn-line { background: transparent; border: 1.5px solid var(--outline); }
.btn-small { min-height: 44px; padding: 8px 12px; border-radius: 12px; font-weight: 700; }
.field { display: grid; gap: 4px; }
.field label, .label { font-weight: 800; font-size: .9rem; }
.input, select.input { border: 1.5px solid var(--input-border); border-radius: 12px; padding: 10px 12px; min-height: 48px; background: var(--input-bg); width: 100%; }
.inline-inputs { display: flex; gap: 6px; }
.inline-inputs .input { min-width: 0; }
.mine-inputs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; max-width: 420px; }
.mine-inputs .input { text-align: center; padding: 10px 4px; }
.choice { display: flex; gap: 8px; }
.choice button { flex: 1; }
.choice button[aria-pressed="true"] { background: var(--emerald-700); color: #fff; }
.choice button[aria-pressed="false"] { background: var(--surface-variant); border: 1px solid var(--input-border); }

/* 번호판: 넓은 화면은 한 줄에 9개, 휴대폰은 로또 용지처럼 7개 (누르기 쉽게 크게) */
.number-grid { display: grid; grid-template-columns: repeat(9, 1fr); gap: 6px; max-width: 540px; }
.number-grid button { aspect-ratio: 1; border-radius: 50%; border: 1.5px solid var(--outline); background: var(--input-bg); font-weight: 700; cursor: pointer; padding: 0; min-width: 0; }
.number-grid button[data-state="fixed"] { background: var(--emerald-700); color: #fff; border-color: var(--emerald-700); }
.number-grid button[data-state="excluded"] { background: var(--excluded); color: #fff; border-color: var(--excluded); text-decoration: line-through; }

/* ── 목록 ── */
.game { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--outline); flex-wrap: wrap; }
.game:first-child { border-top: 0; }
.game-index { width: 30px; height: 30px; border-radius: 50%; background: var(--index-bg); color: var(--index-text); font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.game-body { flex: 1; min-width: min(220px, 100%); display: grid; gap: 4px; }
.table { width: 100%; border-collapse: collapse; }
.table th { background: var(--table-head); color: #fff; text-align: left; padding: 8px 10px; font-size: .9rem; }
.table th:first-child { border-radius: 12px 0 0 12px; }
.table th:last-child { border-radius: 0 12px 12px 0; }
.table td { padding: 8px 10px; border-bottom: 1px solid var(--outline); vertical-align: middle; }
.bar { height: 8px; border-radius: 999px; background: var(--surface-variant); overflow: hidden; min-width: 80px; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--bar-fill); }
.bar.hot > i { background: var(--coral); }
.draw-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--outline); flex-wrap: wrap; }
.draw-item:first-child { border-top: 0; }
.draw-item .round { font-weight: 800; min-width: 64px; }

/* ── 사주 ── */
.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.pillars .cell { display: grid; gap: 4px; }
.ganji { border-radius: 12px; color: #fff; font-weight: 800; font-size: 1.4rem; padding: 8px 0; }
/* 오행 색 (흰 글자가 잘 읽히게 조금 진하게) */
.el-0 { background: #23824a; } .el-1 { background: #c93d28; } .el-2 { background: #9a6d12; } .el-3 { background: #66727b; } .el-4 { background: #2366c2; }
.el-none { background: #9aa6a0; }
.elements { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; text-align: center; }
.elements div { border-radius: 14px; padding: 8px 0; background: var(--surface-variant); }
.elements b { display: block; font-size: 1.3rem; }
.elements .weak { color: var(--error); font-size: .75rem; font-weight: 800; }
.luck { background: var(--surface-variant); border-radius: 12px; padding: 8px 12px; margin-top: 10px; }
.reason { display: flex; gap: 10px; padding: 8px 0; align-items: flex-start; }
.reason p { color: var(--sub); font-size: .88rem; }
.tag { display: inline-block; border-radius: 999px; color: #fff; font-size: .75rem; font-weight: 800; padding: 1px 8px; margin-left: 4px; }

/* ── 회원: 로그인 단추(각 회사 표기 규칙), 동의, 내 정보 ── */
.header-name { color: #fff; font-weight: 700; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 9em; }
.sns-list { display: grid; gap: 10px; margin: 12px 0; max-width: 420px; }
.sns-btn { position: relative; display: flex; align-items: center; justify-content: center; min-height: 52px; border-radius: 12px; font-weight: 700; text-decoration: none; font-size: 1rem; padding: 0 44px; }
.sns-logo { position: absolute; left: 16px; width: 20px; height: 20px; display: grid; place-items: center; }
.sns-logo svg { width: 100%; height: 100%; }
.sns-btn.kakao { background: #fee500; color: rgb(0 0 0 / 85%); }
.sns-btn.naver { background: #03c75a; color: #fff; }
.sns-btn.naver .sns-logo { width: 16px; height: 16px; }
.sns-btn.google { background: #fff; color: #1f1f1f; border: 1px solid #747775; font-weight: 600; }
.sns-btn.dev { background: var(--surface-variant); color: var(--ink); border: 1.5px dashed var(--outline); font-weight: 600; }
.sns-note { font-size: .82rem; }
.consent { display: grid; gap: 8px; margin-top: 8px; }
.consent-item { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 0; }
.consent-item input { width: 22px; height: 22px; flex: 0 0 auto; accent-color: var(--emerald-700); }
.consent-item a { margin-left: auto; font-size: .9rem; }
.consent-all { border-bottom: 1px solid var(--outline); padding-bottom: 10px; }
.required { color: var(--error); font-weight: 700; font-size: .85rem; }
.info-list { display: grid; gap: 8px; margin: 0; }
.info-list div { display: flex; gap: 12px; }
.info-list dt { color: var(--sub); min-width: 6em; }
.info-list dd { margin: 0; font-weight: 700; }
.withdraw summary { cursor: pointer; font-weight: 800; min-height: 44px; display: flex; align-items: center; }
.withdraw[open] { display: grid; gap: 8px; }

/* ── 커뮤니티·1:1 문의 ── */
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; }
.subtabs a { padding: 9px 14px; min-height: 44px; display: inline-flex; align-items: center; border-radius: 999px; background: var(--surface); border: 1px solid var(--outline); color: var(--ink); text-decoration: none; font-weight: 700; }
.subtabs a[aria-current="page"] { background: var(--emerald-700); border-color: var(--emerald-700); color: #fff; }
.card .subtabs a { background: var(--surface-variant); }
.card .subtabs a[aria-current="page"] { background: var(--emerald-700); }
.post-list { list-style: none; margin: 12px 0 0; padding: 0; }
.post-item { display: grid; gap: 2px; padding: 12px 0; border-top: 1px solid var(--outline); }
.post-item:first-child { border-top: 0; }
.post-item a { color: var(--ink); text-decoration: none; min-height: 28px; }
.post-item a:hover b { text-decoration: underline; }
.post-item .count { color: var(--accent-text); font-weight: 800; }
.notice-badge { display: inline-block; border-radius: 6px; padding: 0 7px; margin-right: 6px; font-size: .78rem; font-weight: 800; background: var(--emerald-700); color: #fff; vertical-align: middle; }
.notice-list { margin-bottom: 4px; }
.notice-item { background: var(--facts-bg); border-radius: 12px; padding: 10px 12px; border-top: 0; margin-bottom: 6px; }
.is-hidden { opacity: .55; }
.status-badge { display: inline-block; border-radius: 999px; padding: 0 8px; margin-right: 6px; font-size: .78rem; font-weight: 800; background: var(--surface-variant); color: var(--ink); vertical-align: middle; }
.status-reviewing { background: #dbe8ff; color: #1f4fa3; }
.status-planned { background: #ffe9a8; color: #6b4a00; }
.status-done { background: #d3f2e3; color: #0b5c40; }
.status-declined { background: #e3e6e5; color: #4d5754; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 14px; }
.post-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; }
textarea.input { resize: vertical; min-height: 96px; line-height: 1.6; }
.input-small { min-height: 40px; width: auto; padding: 6px 10px; }
.admin-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; padding: 10px 12px; border-radius: 12px; background: var(--surface-variant); }
.comment-list { list-style: none; margin: 0 0 12px; padding: 0; }
.comment { padding: 10px 0; border-top: 1px solid var(--outline); }
.comment:first-child { border-top: 0; }
.comment.from-admin { background: var(--facts-bg); border-radius: 12px; padding: 10px 12px; border-top: 0; margin: 4px 0; }
.comment-form { display: grid; gap: 8px; margin-top: 8px; }
.link-btn { background: none; border: 0; padding: 8px 4px; min-height: 36px; color: var(--sub); text-decoration: underline; cursor: pointer; font-size: .85rem; }

/* ── 관리자 ── */
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 10px; margin-top: 12px; }
.stat-tile { display: grid; gap: 2px; padding: 12px 14px; border-radius: 14px; background: var(--surface-variant); color: var(--ink); text-decoration: none; }
.stat-tile b { font-size: 1.7rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-tile small { font-size: .9rem; margin-left: 2px; color: var(--sub); }
.link-tile:hover { outline: 2px solid var(--outline); }
.delta { font-weight: 800; }
.delta.up { color: var(--accent-text); }
.delta.down { color: var(--error); }
.trend { margin: 0; display: grid; gap: 8px; }
.trend-bars { display: flex; align-items: flex-end; gap: 2px; height: 120px; padding-top: 8px; border-bottom: 1px solid var(--outline); }
.trend-bar { position: relative; flex: 1 1 0; min-width: 0; height: var(--h); background: var(--bar-fill); border-radius: 4px 4px 0 0; outline-offset: 1px; }
.trend-bar:hover, .trend-bar:focus-visible { background: var(--emerald-500); }
.trend-bar:hover::after, .trend-bar:focus-visible::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); white-space: nowrap; background: #2b2930; color: #fff; padding: 4px 8px; border-radius: 8px; font-size: .78rem; z-index: 2; pointer-events: none; }
.trend-bars .trend-bar:first-child:hover::after, .trend-bars .trend-bar:first-child:focus-visible::after { left: 0; transform: none; }
.trend-bars .trend-bar:last-child:hover::after, .trend-bars .trend-bar:last-child:focus-visible::after { left: auto; right: 0; transform: none; }
.trend-axis { display: flex; justify-content: space-between; font-size: .8rem; }
.trend-table { margin-top: 12px; }
.trend-table summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 700; }
.share-table td:first-child { width: 40%; }

@media (prefers-color-scheme: dark) {
  .status-reviewing { background: #22324f; color: #b9d0ff; }
  .status-planned { background: #4a3a10; color: #ffe08a; }
  .status-done { background: #173c2d; color: #a9ecd0; }
  .status-declined { background: #2c3331; color: #c3cbc8; }
}

/* ── 바닥글·알림·글 ── */
.site-footer { max-width: 960px; margin: 0 auto; padding: 8px 16px 40px; color: var(--sub); font-size: .8rem; display: grid; gap: 6px; text-align: center; }
.footer-links { display: flex; justify-content: center; gap: 16px; font-size: .9rem; }
.footer-links a { color: var(--ink); text-decoration: none; }
.biz-info { font-style: normal; display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 14px; line-height: 1.6; }
.biz-info a { color: var(--sub); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #2b2930; color: #fff; padding: 12px 18px; border-radius: 12px; max-width: calc(100% - 32px); opacity: 0; pointer-events: none; transition: opacity .2s; }
.toast.show { opacity: 1; }
.prose { display: grid; gap: 10px; }
.prose h2 { margin-top: 8px; }
.policy-title { font-size: 1.35rem; font-weight: 800; }
.prose ul { margin: 0; padding-left: 20px; }
.policy-table { width: 100%; border-collapse: collapse; font-size: .9rem; table-layout: fixed; }
.policy-table th, .policy-table td { border: 1px solid var(--outline); padding: 8px; text-align: left; vertical-align: top; word-break: keep-all; overflow-wrap: anywhere; }
.policy-table th:first-child { width: 36%; }
.policy-table th { background: var(--surface-variant); }

@media (max-width: 480px) {
  /* 당첨번호 일곱 개(보너스 포함)가 한 줄에 들어가는 크기 */
  .balls { gap: 4px; }
  .ball { --size: 36px; font-size: .95rem; }
  .ball.small { --size: 30px; font-size: .8rem; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .mine-inputs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .countdown { font-size: 1.6rem; }
  .wordmark { font-size: 1.3rem; }
  .number-grid { grid-template-columns: repeat(7, 1fr); }
}
@media (max-width: 480px) {
  /* 좁은 휴대폰: 머리글에는 닉네임(내 정보로 가는 길)만 두고, 로그아웃은 내 정보 화면에서 한다 */
  .header-logout { display: none; }
}
@media (max-width: 380px) {
  .tabs { gap: 2px; padding: 6px 8px 12px; }
  .tabs a { padding: 9px 8px; font-size: .95rem; }
}
/* 아주 좁은 휴대폰(폭 350 이하): 당첨번호 일곱 개가 한 줄에 들어가게 공을 줄이고, 번호판은 한 줄에 6개 */
@media (max-width: 350px) {
  .balls { gap: 3px; }
  .ball { --size: 31px; font-size: .85rem; }
  .ball.small { --size: 28px; font-size: .78rem; }
  .number-grid { grid-template-columns: repeat(6, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
