/* 커피 내기 단판 게임: 관리자 화면(coffee.html) + 폰과 같이 쓰는 순위표·당번·관전 (coffee-view.js) */

/* ---------- 같이 쓰는 조각 ---------- */
.cf-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: 0 0 0 1.5px rgba(0, 0, 0, .25); }
.cf-tag { display: inline-block; align-self: center; background: var(--red); color: #fff; font: 700 13px var(--font); letter-spacing: .04em; border-radius: 99px; padding: 3px 12px; }
.cf-cup { display: inline-block; flex: none; }
.cf-cup svg { display: block; width: 100%; height: 100%; }
.cf-cup.sm { width: 22px; height: 22px; }
.cf-cup.mid { width: 56px; height: 56px; }
.cf-cup.big { width: 110px; height: 110px; animation: cf-wobble 1.6s ease-in-out infinite; }
.cf-cup .steam path { animation: cf-steam 1.8s ease-in-out infinite; }
.cf-cup .steam path:nth-child(2) { animation-delay: .3s; }
.cf-cup .steam path:nth-child(3) { animation-delay: .6s; }
@keyframes cf-steam { 0%, 100% { opacity: .2; transform: translateY(2px); } 50% { opacity: 1; transform: translateY(-2px); } }
@keyframes cf-wobble { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@media (prefers-reduced-motion: reduce) { .cf-cup.big, .cf-cup .steam path { animation: none; } }

/* 오락실 HIGH SCORE 순위표 */
.cf-board { width: 100%; background: #10261a; border: 2px solid var(--accent2); border-radius: 14px; padding: 12px 10px 8px; box-shadow: 0 0 0 4px rgba(242, 184, 128, .12), inset 0 0 24px rgba(0, 0, 0, .35); text-align: left; }
.cf-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 8px; }
.cf-hs { font: 700 20px var(--font-display, 'Fredoka'), sans-serif; letter-spacing: .12em; color: var(--accent2); text-shadow: 0 0 10px rgba(242, 184, 128, .55); }
.cf-gname { color: var(--muted); font-size: 13px; }
.cf-board .cf-tag { font-size: 11px; padding: 2px 8px; }
.cf-board ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.cf-row { display: grid; grid-template-columns: 3.2em minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; background: rgba(255, 255, 255, .04); font-variant-numeric: tabular-nums; }
.cf-rank { font: 700 15px 'Fredoka', var(--font); color: var(--muted); letter-spacing: .03em; }
.cf-row.top .cf-rank { color: var(--accent2); }
.cf-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cf-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.cf-name em { font-style: normal; font-size: 11px; font-weight: 800; background: var(--accent); color: var(--on-accent, #fff); border-radius: 99px; padding: 1px 6px; flex: none; }
.cf-val { font: 700 15px 'Fredoka', var(--font); white-space: nowrap; }
.cf-row.none { opacity: .55; }
.cf-row.none .cf-val { font: 600 12px var(--font); }
.cf-row.me { outline: 2px solid var(--accent2); animation: cf-blink 1.1s steps(2, start) infinite; }
@keyframes cf-blink { 50% { outline-color: transparent; } }
.cf-row.duty { background: rgba(224, 93, 79, .28); }
.cf-row.dm { background: rgba(224, 93, 79, .16); }
@media (prefers-reduced-motion: reduce) { .cf-row.me { animation: none; } }

/* 판정 */
.cf-verdict { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; margin-bottom: 12px; }
.cf-verdict p { margin: 0; }
.cf-sub { color: var(--muted); font-size: 14px; }
.cf-loser-msg { font: 400 clamp(24px, 7vw, 34px)/1.25 'Jua', var(--font); color: var(--accent2); text-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
.cf-verdict.loser { background: radial-gradient(circle at 50% 30%, rgba(242, 184, 128, .18), transparent 70%); padding: 6px 0 4px; }
.cf-duty { font: 400 22px/1.3 'Jua', var(--font); }
.cf-dm-title { font: 700 clamp(30px, 9vw, 42px) 'Fredoka', 'Jua', var(--font); color: var(--red); letter-spacing: .04em; text-shadow: 0 0 14px rgba(224, 93, 79, .55); }
.cf-vs { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.cf-vs-n { display: inline-flex; align-items: center; gap: 6px; background: var(--panel2); border: 1px solid var(--line); border-radius: 99px; padding: 5px 12px; font-weight: 800; }
.cf-vs-n.me { border-color: var(--accent2); }
.cf-vs-x { font: 700 18px 'Fredoka', var(--font); color: var(--red); }

/* 관전 막대 */
.cf-spec { width: 100%; display: flex; flex-direction: column; gap: 10px; margin: 6px 0; text-align: left; }
.cf-spec-row { display: grid; grid-template-columns: minmax(0, 7em) minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.cf-spec-name { display: flex; align-items: center; gap: 6px; font-weight: 800; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cf-spec-bar { height: 16px; background: rgba(0, 0, 0, .25); border-radius: 99px; overflow: hidden; }
.cf-spec-bar i { display: block; height: 100%; border-radius: 99px; transition: width .25s; }
.cf-spec-bar.low i { opacity: .55; }
.cf-spec-val { font: 700 16px 'Fredoka', var(--font); font-variant-numeric: tabular-nums; min-width: 3.5em; text-align: right; }

/* 칩 (참가자) */
.cf-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--panel2); border: 1px solid var(--line); border-radius: 99px; padding: 5px 10px; font-weight: 700; font-size: 14px; }
.cf-chip.off { opacity: .5; }
.cf-chip.me { border-color: var(--accent2); }
.cf-chip em { font-style: normal; font-size: 11px; font-weight: 800; color: var(--accent2); }
.cf-rename { border: 1px solid var(--line); background: var(--felt2); color: var(--text); border-radius: 99px; font: 700 12px var(--font); padding: 3px 9px; margin-left: 2px; cursor: pointer; }

/* ---------- 폰 (play.html) ---------- */
.cf-wait .cf-wait-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.cf-result, .cf-wait { gap: 12px; }
body.embed .top .lang-menu { display: none !important; }

/* ---------- 관리자 화면 (coffee.html) ---------- */
body.cf-admin { min-height: 100dvh; background: var(--noise), var(--vignette) fixed, radial-gradient(ellipse at top, var(--felt) 0%, var(--felt2) 100%) fixed; }
.cf-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; padding: calc(env(safe-area-inset-top) + 10px) 16px 10px; background: rgba(16, 38, 26, .92); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); }
.cf-brand { width: 34px; height: 34px; flex: none; display: block; }
.cf-brand svg { display: block; width: 100%; height: 100%; }
.cf-top h1 { margin: 0; font: 400 17px 'Jua', var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cf-top .grow { flex: 1; }
.cf-tb { background: none; border: 0; font-size: 18px; padding: 0 2px; cursor: pointer; color: var(--text); }
.cf-net { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.cf-net.online { background: var(--green); }
.cf-main { width: min(560px, 100%); margin: 0 auto; padding: 14px 16px calc(env(safe-area-inset-bottom) + 110px); display: flex; flex-direction: column; gap: 14px; }
.cf-card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.cf-card h2 { margin: 0; font-size: 18px; }
.cf-card p { margin: 0; }
.cf-me { border-color: var(--accent2); }
.cf-row-in { display: flex; gap: 8px; }
.cf-input { flex: 1; min-width: 0; font: 600 17px var(--font); padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--felt2); color: var(--text); }
.cf-err { color: var(--accent2); font-size: 14px; min-height: 1em; }
.cf-btn { font: 800 15px var(--font); padding: 11px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); cursor: pointer; white-space: nowrap; }
.cf-btn.primary { background: var(--accent); border-color: var(--ink); color: var(--on-accent, #fff); box-shadow: 0 3px 0 var(--ink); }
.cf-btn.big { font-size: 17px; padding: 14px 20px; }
.cf-btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.cf-join { flex-direction: row; align-items: center; gap: 14px; }
.cf-qr { flex: none; width: 128px; height: 128px; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: #fff; cursor: zoom-in; }
.cf-qr svg { display: block; width: 100%; height: 100%; }
.cf-join-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cf-code { font: 700 38px 'Fredoka', var(--font); letter-spacing: .14em; color: var(--accent2); line-height: 1.1; }
.cf-players { display: flex; flex-wrap: wrap; gap: 6px; }
.cf-x { border: 0; background: none; color: var(--muted); font-size: 17px; line-height: 1; padding: 0 0 0 2px; cursor: pointer; }
.cf-games-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cf-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.cf-game { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px 8px; border-radius: 12px; border: 2px solid transparent; background: var(--paper); color: var(--ink); cursor: pointer; text-align: center; font-family: var(--font); }
.cf-game .gi { width: 40px; height: 40px; display: block; }
.cf-game .gi svg { display: block; width: 100%; height: 100%; }
.cf-game b { font-size: 13px; line-height: 1.25; }
.cf-game small { font-size: 11px; color: #6b5a44; }
.cf-game.na { opacity: .4; }
.cf-game.on { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(224, 122, 79, .45); transform: translateY(-2px); }
.cf-startbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; display: flex; align-items: center; gap: 12px; padding: 12px 16px calc(env(safe-area-inset-bottom) + 12px); background: rgba(16, 38, 26, .96); border-top: 1px solid var(--line); }
.cf-startbar { width: 100%; }
@media (min-width: 600px) { .cf-startbar { left: 50%; right: auto; transform: translateX(-50%); width: 560px; border: 1px solid var(--line); border-bottom: 0; border-radius: 16px 16px 0 0; } }
.cf-start-info { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.cf-start-info .gi { width: 30px; height: 30px; flex: none; }
.cf-start-info .gi svg { display: block; width: 100%; height: 100%; }
.cf-start-info > span:last-child { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cf-lastduty { flex-direction: row; align-items: center; gap: 10px; font-weight: 700; }
.cf-dmpick { align-items: center; text-align: center; border-color: var(--red); }
.cf-dmpick .cf-dm-title { font-size: 26px; }
.cf-res { align-items: center; }
.cf-actions { display: flex; flex-direction: column; gap: 8px; }
.cf-reset { text-align: center; margin: 4px 0 0; }
.cf-reset .link { background: none; border: 0; color: var(--muted); text-decoration: underline; font: 600 13px var(--font); cursor: pointer; }
.cf-qrbig { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .8); display: flex; align-items: center; justify-content: center; padding: 20px; }
.cf-qrbig-box { background: var(--panel); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; max-width: 420px; width: 100%; }
.cf-qrbig-box .qr { width: min(80vw, 340px); background: #fff; border-radius: 12px; overflow: hidden; }
.cf-qrbig-box .qr svg { display: block; width: 100%; height: auto; }
.cf-qrbig-box p { margin: 0; word-break: break-all; }

/* 판이 진행되는 동안: 관리자도 참가 화면(iframe)으로 게임 */
#cf-frame { position: fixed; inset: 0; width: 100%; height: 100%; border: 0; z-index: 40; background: var(--felt); }
#cf-frame.off { visibility: hidden; pointer-events: none; z-index: -1; }
body.in-round { overflow: hidden; }
body.in-round .cf-startbar { display: none; }
.cf-abort { position: fixed; z-index: 45; left: 10px; bottom: calc(env(safe-area-inset-bottom) + 10px); font: 700 12px var(--font); color: var(--text); background: rgba(0, 0, 0, .45); border: 1px solid var(--line); border-radius: 99px; padding: 5px 12px; opacity: .65; cursor: pointer; }
.cf-abort.hidden { display: none; }
@media (max-width: 400px) {
  .cf-top { padding-left: 12px; padding-right: 12px; }
  .cf-top .lang-btn { padding: .25rem .55rem; font-size: .8rem; }
  .cf-brand { width: 30px; height: 30px; }
}
