:root { --text: #f2efe9; --sub: rgba(242, 239, 233, 0.62); --sans: "Pretendard", -apple-system, sans-serif; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: #0b0f1c; color: var(--text); font-family: var(--sans); overflow: hidden; -webkit-font-smoothing: antialiased; }
.stage { position: fixed; inset: 0; touch-action: none; }
.top { position: fixed; top: max(14px, env(safe-area-inset-top)); left: 16px; pointer-events: none; }
.name { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: 0.02em; color: var(--sub); }
.hint { position: fixed; left: 0; right: 0; bottom: max(132px, calc(env(safe-area-inset-bottom) + 120px)); margin: 0; text-align: center; font-size: 13px; line-height: 1.6; color: var(--sub); pointer-events: none; transition: opacity 1.2s; }
.hint.off { opacity: 0; }
.sit { position: fixed; left: 50%; bottom: max(74px, calc(env(safe-area-inset-bottom) + 62px)); transform: translateX(-50%); height: 44px; padding: 0 22px; border: 0; border-radius: 22px; background: rgba(255, 236, 205, 0.92); color: #2a2118; font: 600 15px var(--sans); cursor: pointer; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35); }
.sit.quiet { background: rgba(255, 255, 255, 0.14); color: var(--text); backdrop-filter: blur(8px); }
.sit.jump { background: rgba(255, 92, 72, .92); color: #fff; }
.fade { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity .6s; z-index: 30; }
.fade.on { opacity: 1; }

/* 입장 패널 */
.entry { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(5, 7, 13, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); z-index: 10; transition: opacity .5s; }
.entry.out { opacity: 0; pointer-events: none; }
.card { width: 100%; max-width: 460px; max-height: calc(100dvh - 32px); overflow-y: auto; margin: 0; padding: 24px 20px 16px; border-radius: 22px; background: rgba(18, 22, 34, .86); box-shadow: 0 20px 60px rgba(0, 0, 0, .45); border: 1px solid rgba(255, 255, 255, .07); }
.eyebrow { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .08em; color: var(--sub); }
.card h1 { margin: 4px 0 8px; font-size: 34px; font-weight: 800; letter-spacing: -.02em; }
.lead { margin: 0 0 20px; font-size: 14px; line-height: 1.6; color: var(--sub); }
.card h2 { margin: 18px 0 10px; font-size: 13px; font-weight: 700; color: var(--text); }
.chips { display: grid; gap: 8px; }
.teams { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); }
.areas { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.chip { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 12px; background: rgba(255, 255, 255, .05); color: var(--text); font: 500 14px var(--sans); text-align: left; cursor: pointer; transition: background .15s, border-color .15s; }
.chip:hover { background: rgba(255, 255, 255, .09); }
.chip[aria-checked="true"] { border-color: rgba(255, 236, 205, .85); background: rgba(255, 236, 205, .12); }
.areas .chip { justify-content: center; }
.dot { flex: none; width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); }
.note { margin: 8px 0 0; font-size: 12px; color: var(--sub); }
.enter { position: sticky; bottom: 0; width: 100%; height: 50px; margin-top: 22px; box-shadow: 0 -10px 24px 6px rgba(18, 22, 34, .95); border: 0; border-radius: 14px; background: rgba(255, 236, 205, .95); color: #2a2118; font: 700 16px var(--sans); cursor: pointer; }
.myteam { display: flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px 0 9px; border: 0; border-radius: 16px; background: rgba(255, 255, 255, .12); color: var(--text); font: 600 13px var(--sans); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); cursor: pointer; }
.myteam i { width: 14px; height: 14px; border-radius: 50%; }

.corner-btns { position: fixed; top: max(10px, env(safe-area-inset-top)); right: 16px; display: flex; gap: 6px; }
.pill { height: 32px; padding: 0 12px; border: 0; border-radius: 16px; background: rgba(255, 255, 255, .12); color: var(--text); font: 600 13px var(--sans); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); cursor: pointer; }

/* 점수판: 위 가운데 */
.score { position: fixed; top: max(48px, calc(env(safe-area-inset-top) + 40px)); left: 50%; transform: translateX(-50%); display: grid; grid-template-columns: auto auto auto; align-items: center; column-gap: 10px; padding: 6px 14px 7px; border-radius: 14px; background: rgba(8, 10, 18, .55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); pointer-events: none; white-space: nowrap; }
.score b { font-size: 14px; font-weight: 700; }
.score span { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.score em { grid-column: 1 / -1; justify-self: center; font-style: normal; font-size: 11px; color: var(--sub); }
@media (min-width: 700px) { .score { top: max(10px, env(safe-area-inset-top)); } }

/* 골 알림: 가운데서 커졌다가 사라진다 */
.goal { position: fixed; left: 50%; top: 38%; transform: translate(-50%, -50%) scale(.6); display: flex; flex-direction: column; align-items: center; gap: 2px; opacity: 0; pointer-events: none; }
.goal span { font-size: 64px; font-weight: 900; letter-spacing: -.02em; color: #fff; text-shadow: 0 4px 30px var(--c, #000); }
.goal b { font-size: 18px; font-weight: 700; padding: 4px 12px; border-radius: 10px; background: var(--c, #333); color: #fff; }
.goal.on { animation: goal 4.5s ease-out forwards; }
@keyframes goal { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.6); } 8% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); } 14% { transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1); } }

/* 응원 버튼 줄 */
.acts { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 6px; padding: 6px; border-radius: 18px; background: rgba(8, 10, 18, .5); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.acts button { flex: none; white-space: nowrap; min-width: 54px; height: 40px; padding: 0 12px; border: 0; border-radius: 13px; background: rgba(255, 255, 255, .1); color: var(--text); font: 600 14px var(--sans); cursor: pointer; }
.acts button:active { background: rgba(255, 236, 205, .3); transform: scale(.96); }
.toast { position: fixed; left: 50%; top: 30%; transform: translateX(-50%); margin: 0; padding: 8px 14px; border-radius: 12px; background: rgba(8, 10, 18, .75); font-size: 14px; opacity: 0; transition: opacity .3s; pointer-events: none; }
.toast.on { opacity: 1; }
.shop { position: fixed; left: 50%; bottom: max(74px, calc(env(safe-area-inset-bottom) + 62px)); transform: translateX(-50%); display: flex; gap: 8px; }
.shop button { height: 44px; padding: 0 18px; border: 0; border-radius: 22px; background: rgba(255, 236, 205, .92); color: #2a2118; font: 600 15px var(--sans); cursor: pointer; box-shadow: 0 6px 24px rgba(0, 0, 0, .35); }
@media (max-width: 400px) { .acts { gap: 4px; padding: 5px; } .acts button { min-width: 0; padding: 0 11px; font-size: 13px; } }
.live { grid-column: 1 / -1; justify-self: center; margin: 3px 0 0; padding: 2px 8px; border-radius: 8px; background: rgba(255, 59, 48, .85); font-size: 11px; font-weight: 700; }

/* 문자중계: 왼쪽 아래. 닫혀 있으면 마지막 한 줄, 누르면 목록 */
.feed { position: fixed; left: 12px; bottom: max(76px, calc(env(safe-area-inset-bottom) + 64px)); width: min(320px, calc(100vw - 24px)); }
.feed button { display: flex; gap: 8px; align-items: center; width: 100%; height: 34px; padding: 0 12px; border: 0; border-radius: 12px; background: rgba(8, 10, 18, .55); color: var(--text); font: 500 12px var(--sans); text-align: left; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); cursor: pointer; }
.feed button b { flex: none; font-weight: 700; color: #ffd23a; }
.feed button span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--sub); }
.feed ol { display: none; max-height: 38vh; overflow-y: auto; margin: 0 0 6px; padding: 8px 12px; border-radius: 12px; background: rgba(8, 10, 18, .72); list-style: none; font-size: 13px; line-height: 1.5; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.feed.open ol { display: block; }
.feed { display: flex; flex-direction: column-reverse; }
.feed li { padding: 3px 0; color: var(--sub); }
.feed li b { display: inline-block; min-width: 34px; color: var(--text); font-variant-numeric: tabular-nums; }
.feed li.k-goal { color: #fff; font-weight: 700; }
.feed li.k-card { color: #ffd23a; } .feed li.k-red { color: #ff6b5e; }
@media (max-width: 700px) { .feed { bottom: max(124px, calc(env(safe-area-inset-bottom) + 112px)); } .hint { bottom: max(170px, calc(env(safe-area-inset-bottom) + 158px)); } }
