/* 색상 대비: 글자/배경 조합 모두 7:1 이상 (WCAG AAA). 2026-12-01 계산 확인.
   글꼴은 기기 기본 글꼴만 사용 (웹폰트 파일을 배포하지 않아 별도 라이선스 필요 없음). */
:root {
  --bg: #0b2a2f;          /* 패널 배경 */
  --bg-2: #123a40;
  --line: #3f7b83;
  --text: #f3fbfb;        /* bg 대비 약 14:1 */
  --muted: #b9dade;       /* bg 대비 약 10:1 */
  --accent: #ffd84a;      /* 버튼 배경, 글자는 --ink (대비 11.3:1) */
  --ink: #13262a;
  --danger: #ffb4a8;      /* bg 대비 약 9:1 */
  --link: #9fe8ff;        /* bg 대비 약 11:1 */
  --focus: #ffffff;
  --scene: #5f9ea3;
  font-family: system-ui, -apple-system, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--scene); color: var(--text); }
a { color: var(--link); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--ink); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }

#court { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

.hud { position: fixed; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 16px;
  padding: 10px 16px; background: rgba(11, 42, 47, .86); backdrop-filter: blur(6px); z-index: 10; flex-wrap: wrap; }
.brand { font-weight: 800; letter-spacing: .02em; }
.hud-stats { display: flex; gap: 18px; font-size: 15px; }
.hud-stats b { font-size: 18px; color: #fff; font-variant-numeric: tabular-nums; }
.hud-right { margin-left: auto; display: flex; gap: 8px; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 16px;
  border-radius: 10px; border: 2px solid var(--line); background: var(--bg-2); color: var(--text);
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); color: var(--ink); border-color: var(--accent); }
.btn.ghost { background: transparent; }
.btn.danger { background: #5a1d18; border-color: var(--danger); color: #fff; }
.btn.login { width: 100%; margin: 6px 0; min-height: 46px; }
.btn.google { background: #ffffff; color: #1f1f1f; border-color: #747775; }
.btn.dev { background: transparent; border-style: dashed; }
.btn.off { opacity: .55; cursor: not-allowed; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.linklike { background: none; border: 0; color: var(--link); font: inherit; text-decoration: underline; cursor: pointer; padding: 0; }

.panel { position: fixed; background: rgba(11, 42, 47, .9); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; z-index: 9; }
.ranking { top: 70px; right: 16px; width: 250px; max-height: calc(100% - 180px); overflow: auto; }
.ranking.closed { display: none; }
.ranking h2 { font-size: 16px; margin: 0 0 8px; display: flex; justify-content: space-between; }
.live { color: #ff9e9e; font-size: 12px; }
.ranking ol { list-style: none; margin: 0; padding: 0; }
.ranking li { display: flex; justify-content: space-between; padding: 6px 4px; border-bottom: 1px solid rgba(63, 123, 131, .5); font-variant-numeric: tabular-nums; }
.ranking li .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; }
.ranking li.me { color: var(--accent); font-weight: 800; }
.ranking li.flash { animation: flash 1s; }
@keyframes flash { from { background: rgba(255, 216, 74, .35); } to { background: transparent; } }

.ad-slot { position: fixed; left: 16px; bottom: 52px; width: 220px; padding: 10px 12px; background: #f6fbfb; color: #12333a;
  border-radius: 12px; z-index: 9; border: 1px solid #c9e3e6; }
.ad-slot a { color: #0a4f8a; font-weight: 700; }
.ad-slot p { margin: 4px 0; font-size: 14px; }
.ad-label { font-size: 11px; font-weight: 800; background: #12333a; color: #fff; padding: 1px 6px; border-radius: 4px; }

.controls-tip { position: fixed; bottom: 52px; left: 50%; transform: translateX(-50%); margin: 0; padding: 6px 14px;
  background: rgba(11, 42, 47, .86); border-radius: 999px; font-size: 14px; z-index: 9; white-space: nowrap; }

#swipeLayer { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 11; }
.swipe-label { position: fixed; margin: 0; transform: translate(-50%, -140%); pointer-events: none; z-index: 12;
  background: rgba(11, 42, 47, .88); color: #fff; font-weight: 900; padding: 4px 10px; border-radius: 999px; font-size: 15px; white-space: nowrap; }
.shots { list-style: none; padding: 0; margin: 4px 0 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
.shots b { color: var(--accent); }
#floats { position: fixed; inset: 0; pointer-events: none; z-index: 12; overflow: hidden; }
.float { position: absolute; transform: translate(-50%, -50%); font-weight: 900; white-space: nowrap;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .45), 0 0 12px rgba(0, 0, 0, .35); animation: floatUp .9s ease-out forwards; }
.float.perfect { color: #ffd84a; font-size: 34px; }
.float.good { color: #ffffff; font-size: 24px; }
.float.late { color: #d6eef0; font-size: 18px; }
.float.score { color: #ffd84a; font-size: 30px; }
.float.rally { color: #ffffff; font-size: 40px; animation-duration: 1.3s; }
@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(.7); }
  15% { opacity: 1; transform: translate(-50%, -50%) scale(1.12); }
  30% { transform: translate(-50%, -55%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -140%) scale(1); }
}
.hint { position: fixed; left: 50%; top: 76px; transform: translateX(-50%); margin: 0; max-width: min(560px, calc(100% - 32px));
  background: #ffd84a; color: #13262a; font-weight: 800; padding: 10px 16px; border-radius: 12px; z-index: 13; text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3); }
.stick { position: fixed; left: 24px; bottom: 70px; width: 130px; height: 130px; border-radius: 50%; z-index: 12;
  background: rgba(11, 42, 47, .55); border: 2px solid rgba(243, 251, 251, .6); touch-action: none; }
.knob { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%;
  background: rgba(243, 251, 251, .9); }
.pause-btn { position: fixed; right: 16px; bottom: 70px; z-index: 12; }
#court { touch-action: none; }
@media (prefers-reduced-motion: reduce) { .float { animation-duration: .01s; } }

.overlay { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(6, 24, 27, .55); z-index: 20; padding: 16px; overflow: auto; }
.overlay[hidden] { display: none; }
.card { background: var(--bg); border: 1px solid var(--line); border-radius: 18px; padding: 24px; width: min(440px, 100%);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.card h1 { margin: 0 0 8px; font-size: 26px; }
.card h2 { font-size: 16px; margin: 18px 0 6px; }
.lead { font-size: 16px; line-height: 1.55; }
.big { font-size: 44px; font-weight: 900; margin: 8px 0; color: var(--accent); }
.big.code { letter-spacing: .18em; font-variant-numeric: tabular-nums; user-select: all; }
#mpJoinCode { text-transform: uppercase; letter-spacing: .12em; }
.small { font-size: 13.5px; line-height: 1.55; }
.muted { color: var(--muted); }
.req { color: var(--accent); font-weight: 700; }
.error { color: var(--danger); min-height: 1.2em; font-weight: 700; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.row .btn { flex: 1 1 auto; }
input[type=text], input:not([type]), input[type=email] { width: 100%; min-height: 42px; padding: 8px 10px; border-radius: 10px;
  border: 2px solid var(--line); background: #071d21; color: var(--text); font: inherit; }
.row input { flex: 1 1 160px; width: auto; }
label { display: block; margin-top: 10px; font-weight: 700; }
fieldset { border: 1px solid var(--line); border-radius: 12px; margin: 14px 0 0; padding: 8px 12px 12px; }
legend { padding: 0 6px; font-weight: 800; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; margin-top: 8px; }
.check input { width: 20px; height: 20px; flex: none; accent-color: var(--accent); }
.check a { margin-left: auto; font-size: 13px; }
.collect-table { background: var(--bg-2); border-radius: 8px; padding: 8px 10px; margin: 6px 0 4px 28px; }
hr { border: 0; border-top: 1px solid var(--line); }

dialog { border: 0; padding: 0; background: transparent; color: var(--text); max-height: 92vh; }
dialog::backdrop { background: rgba(6, 24, 27, .6); }
dialog .card { width: min(500px, 94vw); }

.cookie { position: fixed; left: 50%; bottom: 52px; transform: translateX(-50%); width: min(620px, calc(100% - 32px));
  background: var(--bg); border: 2px solid var(--line); border-radius: 16px; padding: 14px 16px; z-index: 30; }
.cookie h2 { margin: 0 0 4px; font-size: 16px; }
/* 세 버튼은 크기·색이 똑같다: 어느 쪽으로도 유도하지 않음 */
.cookie .row .btn { flex: 1 1 140px; }

.foot { position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 16px; justify-content: center; align-items: center;
  padding: 10px; background: rgba(11, 42, 47, .92); font-size: 13.5px; z-index: 11; flex-wrap: wrap; }
.foot a, .foot .linklike { color: var(--text); }

@media (max-width: 720px) {
  .ranking { width: calc(100% - 32px); top: auto; bottom: 100px; max-height: 40%; }
  .ad-slot { display: none; }
  .controls-tip { display: none; }
  .hud-stats { gap: 10px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { .ranking li.flash { animation: none; } }

/* 약관 페이지 */
body.doc { overflow: auto; background: var(--bg); }
.doc main { max-width: 820px; margin: 0 auto; padding: 32px 18px 80px; line-height: 1.75; }
.doc h1 { font-size: 28px; }
.doc h2 { font-size: 19px; margin-top: 32px; border-top: 1px solid var(--line); padding-top: 18px; }
.doc table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
.doc th, .doc td { border: 1px solid var(--line); padding: 8px; text-align: left; vertical-align: top; }
.doc th { background: var(--bg-2); }
.doc .fill { background: #5a4a10; color: #fff; padding: 0 4px; border-radius: 4px; }
.doc nav { margin-bottom: 18px; display: flex; gap: 14px; flex-wrap: wrap; }
