/* 바람의 양궁장 — 숲빛 초록·크림·금색 UI */
:root {
  --bg: #1f2a1c;
  --bg-2: #2b3a26;
  --line: #4f6644;
  --gold: #f2c14e;
  --gold-2: #ffe08a;
  --cream: #f5efdc;
  --muted: #b9c2a6;
  --red: #ff6b5e;
  --blue: #58b4ff;
  --body: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #a9d2f3; color: var(--cream); font-family: var(--body); -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
#cv { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
#hud { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; }
[hidden] { display: none !important; }

.back-btn { position: fixed; top: 10px; left: 10px; z-index: 30; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; font-size: 13px; font-weight: 600; color: var(--cream); text-decoration: none; border-radius: 9px; background: rgba(31,42,28,.88); border: 1px solid var(--line); }
.back-btn:hover { border-color: var(--gold); }

.hud-top { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 20; pointer-events: none; display: grid; justify-items: center; gap: 6px; }
.hud-box { display: flex; align-items: center; gap: 14px; padding: 6px 14px; border-radius: 12px; background: rgba(31,42,28,.88); border: 1px solid var(--line); box-shadow: 0 6px 16px rgba(0,0,0,.3); white-space: nowrap; }
.st-name { font-weight: 800; font-size: 14px; color: var(--gold-2); }
.score { font-size: 13px; color: var(--muted); }
.score b { font-size: 19px; color: var(--cream); font-variant-numeric: tabular-nums; margin-right: 2px; }
.arrows { display: flex; gap: 3px; }
.arrows i { width: 6px; height: 16px; border-radius: 2px; background: var(--gold); }
.arrows i.used { background: #55604a; }
.tour-board { display: flex; gap: 10px; align-items: center; padding: 5px 12px; border-radius: 10px; background: rgba(31,42,28,.88); border: 1px solid var(--line); font-size: 13px; white-space: nowrap; }
.tour-board .side { display: flex; gap: 4px; align-items: center; }
.tour-board .pts { font-size: 18px; font-weight: 800; color: var(--gold-2); min-width: 14px; text-align: center; }
.tour-board .arr { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 3px; border-radius: 5px; background: #121a10; font-size: 12px; font-weight: 700; }
.tour-board .arr.me { color: #ffb3aa; }
.tour-board .arr.rv { color: #a8d8ff; }
.tour-board .vs { color: var(--muted); font-size: 11px; }

.hud-right { position: fixed; top: 10px; right: 10px; z-index: 30; display: flex; gap: 6px; }
.mini { width: 40px; height: 38px; border-radius: 9px; background: rgba(31,42,28,.9); border: 1px solid var(--line); font-weight: 700; font-size: 16px; }
.mini:hover { border-color: var(--gold); }

.wind-box { position: fixed; top: 92px; right: 10px; z-index: 20; display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 12px; background: rgba(31,42,28,.88); border: 1px solid var(--line); pointer-events: none; }
.w-arrow { display: inline-block; font-size: 22px; color: var(--gold-2); transition: transform .3s; }
.w-val b { font-size: 20px; font-variant-numeric: tabular-nums; }
.w-val small { margin-left: 2px; color: var(--muted); font-size: 11px; }
.w-gust { font-size: 11px; font-weight: 800; color: #1f2a1c; background: var(--gold); padding: 2px 6px; border-radius: 6px; animation: gust 1.2s infinite; }
@keyframes gust { 50% { opacity: .55; } }

.minimap { position: fixed; left: 10px; bottom: 10px; z-index: 20; padding: 6px; border-radius: 12px; background: rgba(31,42,28,.85); border: 1px solid var(--line); pointer-events: none; text-align: center; }
.minimap canvas { display: block; width: 110px; height: 110px; }
.minimap p { margin: 3px 0 0; font-size: 11px; color: var(--muted); }
.minimap p:empty { display: none; }

.hint { position: fixed; left: 50%; bottom: 16px; transform: translate(-50%, 6px); z-index: 21; margin: 0; width: max-content; max-width: min(520px, calc(100vw - 150px)); text-align: center; padding: 8px 14px; border-radius: 10px; background: rgba(20,28,18,.85); border: 1px solid var(--line); font-size: 13px; line-height: 1.45; opacity: 0; transition: .3s; pointer-events: none; }
.hint.show { opacity: 1; transform: translate(-50%, 0); }
.help-line { position: fixed; right: 10px; bottom: 10px; z-index: 19; margin: 0; font-size: 11px; color: rgba(255,255,255,.8); text-shadow: 0 1px 2px #000; pointer-events: none; text-align: right; }

.pop { position: fixed; left: 50%; top: 36%; transform: translate(-50%, -50%); z-index: 22; pointer-events: none; font-size: 54px; font-weight: 900; color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.35), 0 0 18px rgba(0,0,0,.4); opacity: 0; }
.pop.show { animation: pop 1.1s ease forwards; }
.pop small { display: block; font-size: 15px; font-weight: 700; text-align: center; }
.pop.gold { color: var(--gold-2); }
.pop.miss { color: #ddd; font-size: 34px; }
@keyframes pop { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); } 30%, 75% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -70%); } }

.banner { position: fixed; left: 50%; top: 30%; transform: translate(-50%, -50%); z-index: 22; text-align: center; pointer-events: none; opacity: 0; width: max-content; max-width: 92vw; }
.banner.show { animation: banner 2.2s ease forwards; }
.banner b { display: block; font-size: 34px; font-weight: 900; color: var(--gold-2); text-shadow: 0 3px 0 #2d2410, 0 0 18px rgba(0,0,0,.5); }
.banner span { font-size: 15px; text-shadow: 0 1px 3px #000; }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, -40%); } 15%, 75% { opacity: 1; transform: translate(-50%, -50%); } 100% { opacity: 0; transform: translate(-50%, -55%); } }

.toast-wrap { position: fixed; top: 60px; left: 50%; transform: translateX(-50%); z-index: 60; display: grid; gap: 6px; pointer-events: none; }
.toast { padding: 8px 14px; border-radius: 10px; background: #2f3f28; border: 1px solid var(--gold); font-size: 13px; box-shadow: 0 6px 16px rgba(0,0,0,.4); animation: toast 3.2s ease forwards; white-space: nowrap; }
.toast b { color: var(--gold-2); }
@keyframes toast { 0% { opacity: 0; transform: translateY(-8px); } 10%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; } }

/* 모달·메뉴 */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 14px; background: rgba(10,14,9,.55); overflow: auto; }
.sheet { width: min(720px, 100%); max-height: calc(100dvh - 28px); overflow: auto; padding: 20px 22px; border-radius: 16px; background: linear-gradient(180deg, var(--bg-2), var(--bg)); border: 1px solid var(--gold); box-shadow: 0 20px 50px rgba(0,0,0,.5); text-align: center; }
.sheet h2 { margin: 0 0 6px; font-size: 26px; color: var(--gold-2); }
.sheet h3 { margin: 14px 0 6px; font-size: 15px; color: var(--gold-2); text-align: left; }
.logo { display: grid; justify-items: center; gap: 2px; margin-bottom: 8px; }
.logo .ic { font-size: 40px; }
.logo h1 { margin: 0; font-size: 28px; color: var(--gold-2); letter-spacing: -.01em; }
.logo p { margin: 0; color: var(--muted); font-size: 13px; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.55; }
.tabs { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; margin: 8px 0 12px; }
.tab { padding: 7px 12px; border-radius: 999px; background: #182215; border: 1px solid var(--line); font-size: 13px; font-weight: 700; }
.tab.on { background: var(--gold); color: #1f2a1c; border-color: var(--gold); }
.zone { margin: 10px 0 0; text-align: left; }
.zone-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.zone-head b { font-size: 15px; color: var(--gold-2); }
.zone-head small { color: var(--muted); font-size: 12px; }
.zone-lock { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.levels { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin: 6px 0 4px; }
.lv { display: grid; gap: 1px; justify-items: center; padding: 8px 2px; border-radius: 10px; background: #172014; border: 1px solid var(--line); min-width: 0; }
.lv:hover:not(:disabled) { border-color: var(--gold); background: #22301d; }
.lv:disabled { opacity: .4; cursor: not-allowed; }
.lv b { font-size: 16px; color: var(--gold-2); }
.lv span { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.lv i { font-style: normal; font-size: 11px; letter-spacing: -1px; }
.star-total { margin: 4px 0 0; font-size: 13px; }
.star-total b { color: var(--gold-2); }
.list { display: grid; gap: 6px; text-align: left; }
.row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; background: #172014; border: 1px solid var(--line); }
.row .ic { font-size: 26px; width: 34px; text-align: center; flex: none; }
.row .tx { flex: 1; min-width: 0; }
.row .tx b { display: block; font-size: 14px; }
.row .tx small { display: block; color: var(--muted); font-size: 12px; line-height: 1.4; }
.row.off { opacity: .45; }
.row.sel { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.btn { padding: 9px 16px; border-radius: 10px; border: 1px solid var(--gold); background: var(--gold); color: #1f2a1c; font-weight: 800; font-size: 14px; }
.btn.ghost { background: transparent; color: var(--cream); border-color: var(--line); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.stars { font-size: 38px; letter-spacing: 4px; margin: 4px 0; }
.stars .off { opacity: .22; filter: grayscale(1); }
.big-score { font-size: 46px; font-weight: 900; color: var(--cream); margin: 0; }
.big-score small { font-size: 16px; color: var(--muted); font-weight: 600; }
.ach-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; text-align: left; }
.ach { display: flex; gap: 8px; align-items: center; padding: 7px 9px; border-radius: 10px; background: #172014; border: 1px solid var(--line); font-size: 12px; }
.ach.off { opacity: .4; }
.ach .ic { font-size: 20px; }
.ach b { display: block; font-size: 13px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.stat { padding: 8px; border-radius: 10px; background: #172014; border: 1px solid var(--line); }
.stat b { display: block; font-size: 18px; color: var(--gold-2); }
.stat small { color: var(--muted); font-size: 11px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 8px 0; }
.cal span { padding: 6px 0; border-radius: 6px; background: #172014; font-size: 11px; color: var(--muted); }
.cal span.done { background: #4c6b33; color: #fff; font-weight: 700; }
.cal span.today { outline: 1px solid var(--gold); }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 10px; background: #172014; border: 1px solid var(--line); text-align: left; font-size: 14px; margin-bottom: 6px; }
.opt small { display: block; color: var(--muted); font-size: 12px; }
.opt input[type=range] { width: 130px; }
.opt input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--gold); }
.help { text-align: left; font-size: 13.5px; line-height: 1.6; margin: 0; padding-left: 18px; }
.help li { margin-bottom: 4px; }
.rival-line { font-style: italic; color: var(--muted); font-size: 13px; }
.ends-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; }
.ends-table td { padding: 4px; border-top: 1px solid #33452c; }
.ends-table td:first-child { color: var(--muted); text-align: left; }
.ends-table td.num { font-weight: 700; }

.loading { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, #35502c, #172014); }
.load-card { text-align: center; }
.load-icon { font-size: 56px; }
.load-card h1 { margin: 6px 0; font-size: 28px; color: var(--gold-2); }
.load-card p { color: var(--muted); font-size: 14px; }
.load-err { max-width: 420px; padding: 0 16px; line-height: 1.6; color: var(--cream); }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; background: #172014; margin: 0; }

@media (max-width: 640px) {
  .back-txt { display: none; }
  .back-btn { padding: 8px 10px; }
  .hud-top { top: 54px; left: 10px; right: 10px; transform: none; justify-items: stretch; }
  .hud-box { justify-content: space-between; gap: 8px; padding: 5px 10px; }
  .st-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
  .arrows i { width: 5px; height: 13px; }
  .tour-board { justify-content: center; gap: 6px; font-size: 12px; padding: 4px 8px; }
  .tour-board .arr { min-width: 17px; height: 18px; font-size: 11px; }
  .wind-box { top: auto; bottom: 10px; right: 10px; padding: 5px 10px; }
  .help-line { display: none; }
  .minimap canvas { width: 84px; height: 84px; }
  .hint { bottom: 70px; max-width: calc(100vw - 32px); font-size: 12.5px; }
  .levels { grid-template-columns: repeat(3, 1fr); }
  .ach-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .sheet { padding: 16px 14px; }
  .pop { font-size: 44px; }
}
