/* 할로윈 파티 (2026-10-27) -- 교실 TV · 태블릿에서 여럿이 하는 놀이. 밤하늘 · 호박 · 보라 · 연두 슬라임 색.
   다른 화면과 달리 어두운 바탕입니다(TV 에 띄웠을 때 «파티» 처럼 보이게). 글씨는 TV 뒷자리에서도 보이게 vw 로 키웁니다. */
:root {
  --hw-bg: #1a1027; --hw-bg2: #2b1840; --hw-ink: #fff4e3; --hw-soft: #cdb9e6;
  --hw-orange: #ff8a1f; --hw-orange2: #ffb35c; --hw-purple: #8b5cf6; --hw-green: #7bd64a; --hw-red: #ff5470;
  --hw-card: rgba(255, 255, 255, .08); --hw-line: rgba(255, 255, 255, .16);
}
body.hw {
  background: radial-gradient(circle at 85% 8%, rgba(255, 236, 170, .35) 0 60px, rgba(255, 236, 170, .08) 61px 160px, transparent 161px),
    linear-gradient(180deg, var(--hw-bg) 0%, var(--hw-bg2) 100%) fixed;
  color: var(--hw-ink); min-height: 100vh;
}
body.hw header.bar { background: rgba(20, 10, 32, .85); border-bottom: 1px solid var(--hw-line); backdrop-filter: blur(6px); }
body.hw header.bar h1, body.hw header.bar h1 a { color: var(--hw-ink); }
body.hw header.bar .ghost { background: rgba(255, 255, 255, .1); color: var(--hw-ink); border-color: var(--hw-line); }
body.hw .wrap { max-width: min(1680px, 100%); }
/* 놀이 화면은 한 화면 높이에 맞춥니다(TV · 가로 태블릿에서 굴리지 않게). 판(문 · 카드)이 남는 높이를 다 씁니다. */
#s-doors:not(.hidden), #s-memory:not(.hidden) { display: flex; flex-direction: column; height: calc(100vh - 160px); height: calc(100dvh - 160px); min-height: 400px; }
body.hw .hw-card { background: var(--hw-card); border: 1px solid var(--hw-line); border-radius: 22px; padding: 20px 22px; margin-bottom: 16px; }
body.hw h2 { color: var(--hw-ink); }
body.hw .hint, body.hw .muted { color: var(--hw-soft); }
/* 묻는 창(«레이스를 끝낼까요?» · «사탕 0개로»): 할로윈 화면의 밝은 글자가 흰 창에서 안 보이던 것 → 창도 어둡게 (2026-10-29) */
body.hw .sheet-panel { background: #241634; color: var(--hw-ink); border: 1px solid var(--hw-line); }
body.hw button { font-family: inherit; }
.hw-btn {
  min-height: 56px; padding: 12px 22px; border-radius: 99px; border: 0; cursor: pointer;
  background: linear-gradient(180deg, var(--hw-orange2), var(--hw-orange)); color: #2a1300; font-size: 18px; font-weight: 800;
  box-shadow: 0 4px 0 #b4570a; width: auto;
}
.hw-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #b4570a; }
.hw-btn.alt { background: rgba(255, 255, 255, .12); color: var(--hw-ink); box-shadow: 0 4px 0 rgba(0, 0, 0, .35); border: 1px solid var(--hw-line); }
.hw-btn.good { background: linear-gradient(180deg, #a6ec7c, var(--hw-green)); color: #10300a; box-shadow: 0 4px 0 #3f8a1d; }
.hw-btn.bad { background: linear-gradient(180deg, #ff8aa0, var(--hw-red)); color: #3a0010; box-shadow: 0 4px 0 #a3203a; }
.hw-btn:disabled { opacity: .45; }
.hw-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
/* 숙제 목록(homework.html)의 .hw-row(줄 여백 · 위 금 · 최소 높이)가 style.css 에 있어서 여기서 지웁니다 -- 이름이 같아 이 화면에도 붙었습니다. */
body.hw .hw-row { padding: 0; min-height: 0; border-top: 0; border-radius: 0; }
.hw-chips { display: flex; gap: 8px; flex-wrap: wrap; }
body.hw .hw-chip { min-height: 48px; padding: 8px 16px; border-radius: 99px; border: 2px solid var(--hw-line); background: transparent; color: var(--hw-ink); font-size: 16px; font-weight: 700; width: auto; cursor: pointer; box-shadow: none; }
body.hw .hw-chip.on { background: var(--hw-purple); border-color: var(--hw-purple); color: #fff; }

/* 떠다니는 박쥐(움직임 줄이기를 켠 기기에서는 가만히) */
.hw-bats { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.hw-bats span { position: absolute; font-size: 28px; opacity: .55; animation: hw-fly 18s linear infinite; }
.hw-bats span:nth-child(2) { top: 30%; animation-duration: 23s; animation-delay: -6s; font-size: 22px; }
.hw-bats span:nth-child(3) { top: 62%; animation-duration: 27s; animation-delay: -14s; font-size: 34px; }
.hw-bats span:nth-child(1) { top: 12%; }
@keyframes hw-fly { 0% { transform: translate(-10vw, 0) } 25% { transform: translate(25vw, -4vh) } 50% { transform: translate(55vw, 3vh) } 75% { transform: translate(85vw, -3vh) } 100% { transform: translate(115vw, 0) } }
@media (prefers-reduced-motion: reduce) { .hw-bats span { animation: none; } }
.wrap { position: relative; z-index: 1; }

/* ── 놀이 고르기 ── */
.hw-hero { text-align: center; padding: 10px 0 18px; }
.hw-hero h2 { font-size: clamp(30px, 4vw, 54px); margin: 0; letter-spacing: -0.02em; }
.hw-hero p { margin: 8px 0 0; font-size: clamp(15px, 1.6vw, 20px); color: var(--hw-soft); }
.hw-games { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 640px) { .hw-games { grid-template-columns: minmax(0, 1fr); } }
.hw-game {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: center; text-align: left; width: 100%;
  min-height: 120px; padding: 18px; border-radius: 22px; border: 1px solid var(--hw-line); cursor: pointer;
  background: linear-gradient(135deg, rgba(139, 92, 246, .35), rgba(255, 138, 31, .18)); color: var(--hw-ink);
}
.hw-game .ic { font-size: clamp(44px, 5vw, 64px); line-height: 1; }
.hw-game b { display: block; font-size: clamp(19px, 2vw, 26px); }
.hw-game span { display: block; margin-top: 4px; color: var(--hw-soft); font-size: clamp(13px, 1.3vw, 16px); line-height: 1.45; }
@media (hover: hover) { .hw-game:hover { border-color: var(--hw-orange); } }

/* ── 팀 점수판 ── */
.hw-teams { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 0 0 14px; }
.hw-team {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 14px; border-radius: 18px; border: 3px solid transparent;
  background: rgba(255, 255, 255, .08); font-weight: 800; font-size: clamp(16px, 1.7vw, 24px);
}
.hw-team.turn { border-color: var(--hw-orange); background: rgba(255, 138, 31, .2); box-shadow: 0 0 18px rgba(255, 138, 31, .45); }
.hw-team .c { font-variant-numeric: tabular-nums; min-width: 2.6em; text-align: right; }
.hw-team button { width: 36px; min-height: 36px; padding: 0; border-radius: 50%; border: 1px solid var(--hw-line); background: transparent; color: var(--hw-ink); font-size: 18px; cursor: pointer; }
@media (pointer: coarse) { .hw-team button { width: 42px; min-height: 42px; } }
.hw-team.bump { animation: hw-bump .45s; }
@keyframes hw-bump { 40% { transform: scale(1.12) } }
.hw-turn { text-align: center; font-size: clamp(18px, 2vw, 28px); font-weight: 800; margin: -4px 0 12px; color: var(--hw-orange2); }

/* ── 게임 공통 머리 ── */
.hw-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.hw-top h2 { margin: 0; font-size: clamp(22px, 2.6vw, 34px); flex: 1; }

/* ── 문 열기 ── */
.hw-doors { flex: 1 1 auto; min-height: 0; display: grid; gap: clamp(8px, 1.2vw, 16px); grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); }
@media (max-width: 900px) { .hw-doors { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 520px) { .hw-doors { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.hw-door {
  position: relative; height: 100%; min-height: 70px; border-radius: 14px 14px 6px 6px; border: 3px solid #4a2a12; cursor: pointer; padding: 0; width: 100%;
  background: linear-gradient(180deg, #8a4f22, #5b3214); color: #ffe7c2; font-size: clamp(22px, 3vw, 44px); font-weight: 900;
  box-shadow: inset 0 0 0 6px rgba(0, 0, 0, .18), 0 6px 0 rgba(0, 0, 0, .35); transform-origin: left center; transition: transform .5s;
}
.hw-door::after { content: ""; position: absolute; right: 14%; top: 52%; width: 9%; aspect-ratio: 1; border-radius: 50%; background: #ffc94d; }
.hw-door.open { transform: perspective(600px) rotateY(-72deg); opacity: .35; pointer-events: none; }
.hw-door .num { position: relative; z-index: 1; }
@media (prefers-reduced-motion: reduce) { .hw-door { transition: none; } }

/* ── 크게 뜨는 상자(문 안에서 나온 것 · 폭탄 · 결과) ── */
.hw-pop { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(8, 3, 16, .72); }
.hw-pop.hidden { display: none; }
.hw-pop-box {
  width: min(880px, 100%); max-height: calc(100vh - 32px); overflow: auto; text-align: center; padding: clamp(18px, 3vw, 40px);
  border-radius: 28px; background: linear-gradient(160deg, #3a2157, #24123a); border: 2px solid var(--hw-line); box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
  animation: hw-in .35s ease;
}
@keyframes hw-in { from { transform: scale(.85); opacity: 0 } }
.hw-pop-box .big { font-size: clamp(64px, 10vw, 140px); line-height: 1.05; }
.hw-pop-box .ttl { font-size: clamp(22px, 3vw, 40px); font-weight: 900; margin-top: 8px; }
.hw-pop-box .sub { font-size: clamp(16px, 2vw, 26px); color: var(--hw-soft); margin-top: 8px; line-height: 1.45; }
.hw-pop-box .ans { margin-top: 14px; font-size: clamp(28px, 4.4vw, 60px); font-weight: 900; color: var(--hw-green); letter-spacing: .02em; }
.hw-pop-box .hw-row { justify-content: center; margin-top: 20px; }
.hw-shake { animation: hw-shake .5s; }
@keyframes hw-shake { 20%, 60% { transform: translateX(-12px) } 40%, 80% { transform: translateX(12px) } }

/* ── 사탕 비 ── */
.hw-rain { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.hw-rain span { position: absolute; top: -40px; font-size: 32px; animation: hw-fall 1.6s ease-in forwards; }
@keyframes hw-fall { to { transform: translateY(110vh) rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .hw-rain { display: none; } }

/* ── 호박 폭탄 ── */
.hw-bomb { text-align: center; }
.hw-pumpkin { font-size: clamp(100px, min(20vw, 30vh), 280px); line-height: 1; display: inline-block; filter: drop-shadow(0 10px 20px rgba(255, 138, 31, .4)); }
.hw-pumpkin.live { animation: hw-pulse 1s ease-in-out infinite; }
.hw-pumpkin.fast { animation-duration: .35s; }
@keyframes hw-pulse { 50% { transform: scale(1.06) rotate(-2deg) } }
@media (prefers-reduced-motion: reduce) { .hw-pumpkin.live { animation: none; } }
.hw-prompt { margin: 14px auto 0; max-width: 900px; padding: 18px 20px; border-radius: 20px; background: rgba(255, 255, 255, .1); font-size: clamp(22px, 3.2vw, 44px); font-weight: 900; line-height: 1.3; min-height: 1.3em; word-break: keep-all; }
.hw-fuse { height: 12px; max-width: 520px; margin: 14px auto 0; border-radius: 99px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.hw-fuse i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--hw-orange), #ffdf6b); }
.hw-flash { position: fixed; inset: 0; z-index: 55; background: #fff3c4; pointer-events: none; animation: hw-flash .6s forwards; }
@keyframes hw-flash { to { opacity: 0 } }

/* ── 유령 짝 찾기 ── */
.hw-mem { flex: 1 1 auto; min-height: 0; display: grid; gap: clamp(8px, 1vw, 14px); grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); }
.hw-mc { height: 100%; min-height: 56px; perspective: 800px; border: 0; padding: 0; background: transparent; cursor: pointer; width: 100%; }
.hw-mc .in { position: relative; width: 100%; height: 100%; transition: transform .45s; transform-style: preserve-3d; }
.hw-mc.up .in, .hw-mc.done .in { transform: rotateY(180deg); }
.hw-mc .f, .hw-mc .b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; border-radius: 16px; backface-visibility: hidden; }
.hw-mc .b { background: linear-gradient(160deg, #ff9f43, #e2600c); font-size: clamp(34px, 4.4vw, 64px); box-shadow: 0 5px 0 rgba(0, 0, 0, .35); }
.hw-mc .f { transform: rotateY(180deg); background: #fff4e3; color: #2a1300; font-weight: 900; font-size: clamp(18px, 2.4vw, 34px); padding: 6px; text-align: center; word-break: keep-all; }
.hw-mc .f.emo { font-size: clamp(40px, 5.4vw, 80px); }
.hw-mc.done .f { background: #d8f6c6; box-shadow: 0 0 0 4px var(--hw-green); }
.hw-mc.done { cursor: default; }
@media (prefers-reduced-motion: reduce) { .hw-mc .in { transition: none; } }

/* ── 마녀의 룰렛 ── */
.hw-wheel-wrap { position: relative; width: min(calc(100vh - 440px), 92vw, 760px); min-width: 240px; margin: 6px auto 0; aspect-ratio: 1; }
.hw-wheel { width: 100%; height: 100%; border-radius: 50%; transition: transform 4.2s cubic-bezier(.12, .7, .1, 1); box-shadow: 0 0 0 10px #3b1d5c, 0 0 40px rgba(139, 92, 246, .6); }
.hw-wheel text { font-weight: 900; fill: #fff; paint-order: stroke; stroke: rgba(0, 0, 0, .45); stroke-width: 3px; }
.hw-pin { position: absolute; left: 50%; top: -14px; transform: translateX(-50%); font-size: 44px; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .5)); z-index: 2; }
.hw-hub-cap { position: absolute; left: 50%; top: 50%; width: 18%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: #1a1027; display: flex; align-items: center; justify-content: center; font-size: clamp(28px, 4vw, 52px); box-shadow: 0 0 0 6px #3b1d5c; }
.hw-wheel-opts { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; align-items: center; margin-top: 14px; }
.hw-wheel-opts input[type=number] { width: 90px; min-height: 48px; font-size: 18px; text-align: center; border-radius: 12px; }

/* TV(넓은 화면): 글씨 · 단추를 한 단계 크게 */
@media (min-width: 1600px) {
  .hw-btn { min-height: 64px; font-size: 22px; padding: 14px 28px; }
  body.hw .hw-chip { min-height: 54px; font-size: 19px; }
}
/* 폰: 판을 화면 높이에 억지로 맞추지 않고 굴리게(칸이 너무 작아지니까) */
@media (max-width: 520px) {
  #s-doors:not(.hidden), #s-memory:not(.hidden) { height: auto; }
  .hw-door { aspect-ratio: 3 / 4; height: auto; }
  .hw-mc { aspect-ratio: 4 / 3; height: auto; }
}

/* 낮은 가로 태블릿(1024×600 · 962×601): 호박 폭탄 화면을 한 화면에 */
@media (max-height: 760px) and (orientation: landscape) {
  .hw-pumpkin { font-size: 22vh; }
  .hw-prompt { font-size: clamp(20px, 2.6vw, 30px); padding: 10px 16px; margin-top: 8px; }
  .hw-bomb .hint { display: none; }
  .hw-teams { margin-bottom: 8px; }
  .hw-team { padding: 4px 8px 4px 12px; }
  .hw-top { margin-bottom: 6px; }
  .hw-fuse { margin-top: 8px; }
  .hw-wheel-wrap { width: min(calc(100vh - 345px), 92vw); }
}

/* 놀이 아홉: 넓은 화면은 다섯 칸(두 줄)으로 -- TV · 가로 태블릿(1280×800)에서 고르기 화면이 굴러가지 않게.
   카드가 좁아지니 그림은 위, 글은 아래로 세웁니다. */
@media (min-width: 1100px) {
  .hw-games { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .hw-game { grid-template-columns: minmax(0, 1fr); align-items: start; align-content: start; min-height: 0; padding: 16px 18px; gap: 6px; }
  .hw-game .ic { font-size: clamp(40px, 3.6vw, 60px); }
}

/* ── 🧙 마녀가 말하길 ── */
.hw-round { font-size: clamp(16px, 1.8vw, 24px); font-weight: 800; color: var(--hw-orange2); }
.hw-witch { text-align: center; margin: 0 auto; max-width: 1200px; padding: clamp(12px, 2vh, 28px) 16px; border-radius: 28px;
  background: radial-gradient(circle at 50% 30%, rgba(139, 92, 246, .35), rgba(139, 92, 246, .08) 70%); border: 1px solid var(--hw-line); }
.hw-witch-says { min-height: 1.2em; font-size: clamp(26px, min(4vw, 6vh), 60px); font-weight: 900; color: var(--hw-orange2); letter-spacing: .02em; }
.hw-witch-emoji { font-size: clamp(64px, min(14vw, 18vh), 200px); line-height: 1.1; }
.hw-witch-cmd { font-size: clamp(32px, min(5.4vw, 8vh), 84px); font-weight: 900; line-height: 1.15; word-break: keep-all; }
.hw-witch-ko { min-height: 1.3em; margin-top: 6px; font-size: clamp(18px, min(2.2vw, 3.4vh), 32px); color: var(--hw-soft); }
.hw-witch-note { min-height: 1.4em; margin-top: 10px; font-size: clamp(20px, min(2.6vw, 4vh), 38px); font-weight: 900; }
.hw-witch-note.ok { color: var(--hw-green); }
.hw-witch-note.bad { color: var(--hw-red); }
.hw-witch-how { text-align: center; font-size: clamp(14px, 1.4vw, 22px); margin-top: 10px; }
body.hw #witchAuto.on { background: var(--hw-orange); border-color: var(--hw-orange); color: #2a1300; }

/* ── 👀 숨은 괴물 맞히기 ── */
.hw-peek { text-align: center; }
.hw-peek-box { position: relative; width: min(calc(100vh - 470px), 86vw, 620px); min-width: 220px; aspect-ratio: 1; margin: 0 auto;
  border-radius: 24px; overflow: hidden; background: radial-gradient(circle, #fff4e3 0%, #ffd9a8 100%); box-shadow: 0 0 0 6px #3b1d5c, 0 0 40px rgba(255, 138, 31, .35); }
.hw-peek-box .emo { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: min(calc((100vh - 470px) * .66), 57vw, 410px); line-height: 1; }
.hw-peek-box .tiles { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, 1fr); }
.hw-peek-box .tiles i { font-style: normal; display: flex; align-items: center; justify-content: center; font-size: clamp(20px, 3vw, 40px);
  background: linear-gradient(160deg, #4a2a72, #2b1840); border: 2px solid #1a1027; transition: opacity .35s, transform .35s; }
.hw-peek-box .tiles i.off { opacity: 0; transform: scale(.6) rotate(12deg); }
@media (prefers-reduced-motion: reduce) { .hw-peek-box .tiles i { transition: none; } }
/* 가로 화면(TV · 가로 태블릿): 숨은 괴물은 그림 왼쪽 · 글과 단추 오른쪽 -- 그림을 화면 높이만큼 크게 */
@media (orientation: landscape) and (min-aspect-ratio: 5/4) {
  .hw-peek { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: clamp(16px, 2vw, 40px); text-align: center; }
  .hw-peek-box { grid-row: span 2; width: min(calc(100vh - 260px), 52vw, 760px); min-width: 200px; }
  .hw-peek-box .emo { font-size: min(calc((100vh - 260px) * .66), 34vw, 500px); }
  .hw-peek .hw-prompt { margin-top: 0; align-self: end; }
  .hw-peek .hw-row { align-self: start; }
}
/* 낮은 가로 태블릿: 마녀는 글씨를 한 단계 작게 */
@media (max-height: 760px) and (orientation: landscape) {
  .hw-witch-how { display: none; }
  .hw-witch { padding: 8px 12px; }
  .hw-witch-says { font-size: clamp(22px, 4.6vh, 40px); }
  .hw-witch-emoji { font-size: clamp(56px, 15vh, 120px); }
  .hw-witch-cmd { font-size: clamp(28px, 7vh, 56px); }
  .hw-witch-ko { font-size: clamp(16px, 3vh, 24px); margin-top: 2px; }
  .hw-witch-note { font-size: clamp(18px, 3.4vh, 28px); margin-top: 4px; }
  #s-witch .hw-row { margin-top: 6px !important; margin-bottom: 4px !important; }
}
@media (max-width: 520px) {
  .hw-peek-box { width: 86vw; }
  .hw-peek-box .emo { font-size: 57vw; }
}

/* ── 🔤 유령 행맨 ── 가로: 유령 왼쪽 · 낱말 · 글자판 오른쪽 / 세로: 위아래 */
#s-hang:not(.hidden) { display: flex; flex-direction: column; height: calc(100vh - 160px); height: calc(100dvh - 160px); min-height: 420px; }
#s-hang .hw-top .hw-chips { flex: none; }
.hw-hang { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 34%) minmax(0, 1fr); gap: clamp(12px, 2vw, 36px); align-items: center; }
.hw-hang-ghost { height: 100%; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.hw-hang-ghost svg { width: 100%; height: 100%; min-height: 0; max-height: 62vh; flex: 1 1 auto; overflow: visible; }
.hw-hang-ghost .guide { fill: none; stroke: rgba(255, 255, 255, .22); stroke-width: 3; stroke-dasharray: 8 7; }
.hw-hang-ghost .gp { opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(.6); transition: opacity .35s, transform .35s; }
.hw-hang-ghost .gp.on { opacity: 1; transform: none; }
.hw-hang-ghost .body { fill: #fff4e3; }
.hw-hang-ghost .dark { fill: #2b1840; }
.hw-hang-ghost .boo-t { font-size: 30px; font-weight: 900; fill: var(--hw-orange2); opacity: 0; }
.hw-hang-ghost svg.boo { animation: hw-shake .5s 2; }
.hw-hang-ghost svg.boo .boo-t { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .hw-hang-ghost .gp { transition: none; } .hw-hang-ghost svg.boo { animation: none; } }
.hw-hang-left { font-size: clamp(16px, 1.8vw, 26px); font-weight: 800; color: var(--hw-soft); }
.hw-hang-main { display: flex; flex-direction: column; gap: clamp(10px, 1.6vh, 20px); min-width: 0; }
.hw-hang-word { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(6px, .8vw, 12px); }
.hw-hang-word span { width: clamp(38px, min(5.4vw, 8vh), 84px); height: clamp(50px, min(7vw, 10.5vh), 108px); display: flex; align-items: center; justify-content: center;
  border-bottom: 5px solid var(--hw-orange); font-size: clamp(30px, min(4.6vw, 7.4vh), 72px); font-weight: 900; text-transform: lowercase; color: var(--hw-ink); }
.hw-hang-word span.on { animation: hw-in .3s ease; }
.hw-hang-word span.miss { color: var(--hw-red); }
.hw-hang-hint { min-height: 1.4em; display: flex; justify-content: center; align-items: center; gap: 12px; font-size: clamp(20px, min(2.6vw, 4vh), 38px); font-weight: 800; color: var(--hw-orange2); }
.hw-hang-keys { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: clamp(4px, .6vw, 10px); }
.hw-hang-keys button { min-height: clamp(42px, min(5vw, 7.4vh), 76px); padding: 0; width: 100%; border-radius: 12px; border: 2px solid var(--hw-line); cursor: pointer;
  background: rgba(255, 255, 255, .12); color: var(--hw-ink); font-size: clamp(18px, min(2.4vw, 3.8vh), 36px); font-weight: 900; font-family: inherit; box-shadow: 0 3px 0 rgba(0, 0, 0, .35); }
.hw-hang-keys button:disabled { cursor: default; box-shadow: none; }
.hw-hang-keys button.ok { background: var(--hw-green); border-color: var(--hw-green); color: #10300a; }
.hw-hang-keys button.no { background: transparent; color: rgba(255, 255, 255, .3); text-decoration: line-through; }
@media (orientation: portrait), (max-width: 760px) {
  .hw-hang { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; align-items: stretch; }
  .hw-hang-ghost svg { max-height: 30vh; }
  .hw-hang-keys { grid-template-columns: repeat(9, minmax(0, 1fr)); }
}
@media (max-height: 760px) and (orientation: landscape) {
  #s-hang .hw-turn { margin: -6px 0 4px; font-size: 18px; }
  .hw-hang-main { gap: 8px; }
}
@media (max-width: 520px) {
  #s-hang:not(.hidden) { height: auto; }
  #s-hang .hw-top { flex-wrap: wrap; }
  #s-hang .hw-top .hw-chips { width: 100%; justify-content: center; }
  .hw-hang-keys { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}
/* 고르기 화면 · 낮은 가로 화면(1280×800 · 1366×768): 인사 · 팀 칸을 줄여 놀이 일곱이 한 화면에 */
@media (max-height: 820px) and (min-width: 1100px) {
  .hw-hero { margin-bottom: 8px; }
  .hw-hero h2 { font-size: clamp(28px, 5.4vh, 44px); margin: 0; }
  .hw-hero p { margin-top: 2px; font-size: 15px; }
  #s-hub .hw-card { padding: 10px 16px; margin-bottom: 10px; }
  #s-hub .hw-teams { margin-top: 6px !important; }
  #s-hub .hw-card .hint { display: none; }
  .hw-games { gap: 10px; }
  .hw-game { padding: 12px 16px; }
  .hw-game .ic { font-size: 40px; }
  /* 놀이 설명은 숨기고 그림 · 이름만(눌러 들어가면 화면에 방법이 있음) */
  .hw-game span > span { display: none; }
}

/* ── 💃 몬스터 얼음 댄스 ── 춤출 때는 출렁, 얼음이면 파랗게 굳음 */
.hw-frz { text-align: center; margin: 0 auto; max-width: 1200px; padding: clamp(14px, 3vh, 36px) 16px; border-radius: 28px; border: 1px solid var(--hw-line);
  background: radial-gradient(circle at 50% 35%, rgba(255, 138, 31, .28), rgba(139, 92, 246, .1) 70%); transition: background .3s; }
.hw-frz .emo { font-size: clamp(90px, min(16vw, 26vh), 240px); line-height: 1.1; display: inline-block; }
.hw-frz .big { min-height: 1.2em; font-size: clamp(32px, min(5.4vw, 8vh), 84px); font-weight: 900; line-height: 1.15; word-break: keep-all; }
.hw-frz .small { min-height: 1.3em; margin-top: 6px; font-size: clamp(18px, min(2.4vw, 3.6vh), 34px); color: var(--hw-soft); }
.hw-frz.dance .emo { animation: hw-dance .45s ease-in-out infinite alternate; }
.hw-frz.dance .big { color: var(--hw-orange2); }
@keyframes hw-dance { from { transform: rotate(-12deg) translateY(0) } to { transform: rotate(12deg) translateY(-12px) } }
.hw-frz.frozen { background: radial-gradient(circle at 50% 35%, rgba(120, 200, 255, .35), rgba(60, 120, 200, .12) 70%); border-color: rgba(150, 210, 255, .6); }
.hw-frz.frozen .emo { filter: drop-shadow(0 0 18px rgba(150, 220, 255, .9)); }
.hw-frz.frozen .big { color: #bfe6ff; }
@media (prefers-reduced-motion: reduce) { .hw-frz.dance .emo { animation: none; } }
body.hw #frzAuto.on { background: var(--hw-orange); border-color: var(--hw-orange); color: #2a1300; }

/* ── 🔀 뒤죽박죽 마법 주문 ── */
#s-scram .hw-top .hw-chips { flex: none; }
.hw-scr { display: flex; flex-direction: column; gap: clamp(10px, 2vh, 22px); align-items: center; }
.hw-scr-time { width: min(720px, 90%); max-width: none; margin: 0; }
.hw-scr-hint { min-height: 1.3em; font-size: clamp(22px, min(3vw, 4.4vh), 42px); font-weight: 800; color: var(--hw-orange2); }
.hw-scr-ans { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(6px, .8vw, 12px); }
.hw-scr-ans span { width: clamp(42px, min(6vw, 9vh), 92px); height: clamp(52px, min(7.4vw, 11vh), 112px); display: flex; align-items: center; justify-content: center;
  border-bottom: 5px solid var(--hw-orange); font-size: clamp(32px, min(5vw, 7.6vh), 76px); font-weight: 900; }
.hw-scr-ans span.on { animation: hw-in .25s ease; }
.hw-scr-ans span.hint { color: var(--hw-soft); }
.hw-scr-tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(8px, 1vw, 16px); min-height: clamp(64px, min(8vw, 12vh), 120px); }
.hw-scr-tiles button { width: clamp(58px, min(7.6vw, 11.5vh), 116px); aspect-ratio: 1; border: 0; border-radius: 50% 50% 44% 44%; cursor: pointer; padding: 0;
  background: radial-gradient(circle at 35% 30%, #ffc477, #ff8a1f 60%, #d4630a); color: #2a1300; font-size: clamp(28px, min(4.4vw, 6.6vh), 64px); font-weight: 900;
  font-family: inherit; box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .18), 0 5px 0 rgba(0, 0, 0, .35); position: relative; }
.hw-scr-tiles button::before { content: ''; position: absolute; top: -9%; left: 46%; width: 8%; height: 16%; border-radius: 4px; background: #3f8a1d; }
.hw-scr-tiles button.used { visibility: hidden; }
.hw-scr-tiles.locked button { filter: grayscale(.6) brightness(.7); cursor: default; }
@media (max-height: 760px) and (orientation: landscape) {
  .hw-frz { padding: 8px 12px; }
  .hw-frz .emo { font-size: clamp(70px, 22vh, 160px); }
  .hw-frz .big { font-size: clamp(28px, 7vh, 56px); }
  .hw-scr { gap: 8px; }
  #s-scram .hint { display: none; }
}
@media (max-width: 520px) {
  #s-scram .hw-top { flex-wrap: wrap; }
  #s-scram .hw-top .hw-chips { width: 100%; justify-content: center; }
}

/* ── ⭕❌ 유령 O/X 퀴즈 ── 교실 양쪽을 TV 화면 양쪽과 맞춥니다(왼쪽 O · 오른쪽 X) */
.hw-ox { text-align: center; max-width: 1400px; margin: 0 auto; }
.hw-ox-q { min-height: 1.2em; font-size: clamp(32px, min(5.4vw, 8.4vh), 88px); font-weight: 900; line-height: 1.15; word-break: keep-all; }
.hw-ox-ko { min-height: 1.4em; margin-top: 6px; font-size: clamp(18px, min(2.4vw, 3.6vh), 34px); color: var(--hw-soft); }
.hw-ox-sides { display: grid; grid-template-columns: 1fr auto 1fr; gap: clamp(12px, 2vw, 36px); align-items: center; margin-top: clamp(10px, 2.4vh, 28px); padding: 0 clamp(8px, 2vw, 32px); }
.hw-ox-sides .side { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: clamp(10px, 2.4vh, 28px);
  border-radius: 28px; border: 3px solid var(--hw-line); background: rgba(255, 255, 255, .06); transition: transform .3s, opacity .3s, background .3s; }
.hw-ox-sides .side span { font-size: clamp(70px, min(12vw, 20vh), 190px); line-height: 1; }
.hw-ox-sides .side b { font-size: clamp(22px, min(3vw, 4.4vh), 44px); }
.hw-ox-sides .side.win { transform: scale(1.03); background: rgba(123, 214, 74, .25); border-color: var(--hw-green); box-shadow: 0 0 40px rgba(123, 214, 74, .45); }
.hw-ox-sides .side.lose { opacity: .3; transform: scale(.94); }
.hw-ox-count { min-width: 1.4em; font-size: clamp(60px, min(9vw, 15vh), 150px); font-weight: 900; color: var(--hw-orange2); font-variant-numeric: tabular-nums; }
body.hw #oxAuto.on { background: var(--hw-orange); border-color: var(--hw-orange); color: #2a1300; }
@media (prefers-reduced-motion: reduce) { .hw-ox-sides .side { transition: none; } }
@media (max-height: 760px) and (orientation: landscape) {
  .hw-ox-sides .side span { font-size: clamp(56px, 17vh, 130px); }
  .hw-ox-sides .side { padding: 8px; }
}
/* 고르기 화면 · 낮은 가로 태블릿(1024×600 · 962×601): 다섯 칸에 그림 · 이름만, 인사 · 팀 칸도 작게 */
@media (min-width: 900px) and (max-width: 1099px) and (max-height: 760px) and (orientation: landscape) {
  .hw-hero { padding: 2px 0 6px; }
  .hw-hero h2 { font-size: 28px; }
  .hw-hero p, #s-hub .hw-card .hint { display: none; }
  #s-hub .hw-card { padding: 8px 14px; margin-bottom: 8px; }
  #s-hub .hw-teams { margin-top: 4px !important; }
  .hw-games { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
  .hw-game { grid-template-columns: minmax(0, 1fr); align-content: start; min-height: 0; padding: 10px 12px; gap: 4px; }
  .hw-game .ic { font-size: 34px; }
  .hw-game b { font-size: 17px; }
  .hw-game span > span { display: none; }
}

/* ── 💰 캔디 퀘스트 ── 보기는 카훗처럼 네 색 · 네 모양(색만으로 가리지 않게 모양도), 상자는 블루킷처럼 셋 */
.hw-game-new { position: relative; }
.hw-game-new::after { content: 'NEW'; position: absolute; top: 10px; right: 12px; font-size: 12px; font-weight: 900; letter-spacing: .08em;
  padding: 2px 8px; border-radius: 99px; background: var(--hw-orange); color: #2a1300; }
.cq-stage { display: flex; flex-direction: column; align-items: center; gap: clamp(8px, 1.6vh, 18px); text-align: center; }
.cq-intro { display: grid; gap: 10px; justify-items: center; padding: clamp(10px, 3vh, 40px) 0; }
.cq-intro .big { font-size: clamp(60px, min(10vw, 16vh), 140px); line-height: 1.1; }
.cq-intro .ttl, .cq-after .ttl { font-size: clamp(24px, min(3.4vw, 5vh), 46px); font-weight: 900; }
.cq-stage .sub { font-size: clamp(16px, min(2vw, 3vh), 26px); color: var(--hw-soft); }
.cq-turn { font-size: clamp(20px, min(2.4vw, 3.6vh), 34px); font-weight: 900; color: var(--hw-orange2); }
.cq-q { display: flex; align-items: center; justify-content: center; gap: .4em; font-size: clamp(28px, min(4.4vw, 6.8vh), 68px); font-weight: 900; line-height: 1.2; word-break: keep-all; max-width: 1300px; }
.cq-q .emo { font-size: 1.3em; }
.cq-time { width: min(760px, 90%); max-width: none; margin: 0; }
.cq-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(8px, 1.2vw, 16px); width: min(1300px, 100%); }
.cq-opt { display: flex; align-items: center; gap: 16px; min-height: clamp(64px, 11vh, 120px); padding: 10px 22px; border: 0; border-radius: 16px; cursor: pointer;
  color: #fff; font-family: inherit; font-size: clamp(22px, min(3vw, 4.6vh), 46px); font-weight: 900; text-align: left; box-shadow: 0 6px 0 rgba(0, 0, 0, .35); word-break: keep-all; }
.cq-opt i { font-style: normal; font-size: .9em; width: 1.4em; text-align: center; flex: none; }
.cq-opt.c0 { background: #e21b3c; } .cq-opt.c1 { background: #1368ce; } .cq-opt.c2 { background: #c98a00; } .cq-opt.c3 { background: #26890c; }
.cq-opts.n2 .cq-opt { justify-content: center; min-height: clamp(80px, 16vh, 170px); }
.cq-opt.dim { opacity: .25; }
.cq-opt.right { box-shadow: 0 0 0 5px #fff, 0 0 30px rgba(255, 255, 255, .6); transform: scale(1.02); }
.cq-opt.picked:not(.right) { box-shadow: 0 0 0 5px var(--hw-red); opacity: .6; }
.cq-opt:disabled { cursor: default; }
.cq-chests { display: flex; gap: clamp(14px, 3vw, 48px); justify-content: center; flex-wrap: wrap; padding: clamp(6px, 2vh, 24px) 0; }
.cq-chest { width: clamp(130px, min(20vw, 28vh), 260px); aspect-ratio: 1; border-radius: 26px; border: 3px solid var(--hw-orange); cursor: pointer;
  background: radial-gradient(circle at 50% 35%, rgba(255, 179, 92, .35), rgba(139, 92, 246, .25)); color: var(--hw-ink); display: grid; place-items: center; align-content: center; gap: 6px;
  font-family: inherit; box-shadow: 0 8px 0 rgba(0, 0, 0, .35); transition: transform .25s; }
.cq-chest .lid { font-size: clamp(56px, min(9vw, 13vh), 120px); line-height: 1; }
.cq-chest b { font-size: clamp(16px, min(1.8vw, 2.8vh), 26px); font-weight: 900; padding: 0 8px; }
@media (hover: hover) { .cq-chest:not(:disabled):hover { transform: translateY(-6px) rotate(-2deg); } }
.cq-chest.open { animation: hw-in .35s ease; cursor: default; }
.cq-chest.mine { border-color: #fff; box-shadow: 0 0 0 4px var(--hw-orange), 0 0 40px rgba(255, 138, 31, .6); }
.cq-chest.other { opacity: .45; transform: scale(.9); }
.cq-after { display: grid; gap: 10px; justify-items: center; }
.cq-podium { display: flex; align-items: flex-end; justify-content: center; gap: clamp(10px, 2vw, 28px); padding-top: 10px; }
.cq-podium .step { display: grid; justify-items: center; gap: 4px; width: clamp(120px, 18vw, 240px); }
.cq-podium .who { font-size: clamp(18px, min(2.2vw, 3.4vh), 32px); font-weight: 900; }
.cq-podium .g { font-size: clamp(16px, min(2vw, 3vh), 28px); color: var(--hw-orange2); font-weight: 900; }
.cq-podium .bar { width: 100%; border-radius: 16px 16px 0 0; display: grid; place-items: start center; padding-top: 10px; font-size: clamp(34px, 5vw, 60px);
  background: linear-gradient(180deg, var(--hw-purple), #4c1d95); animation: cq-rise .7s ease-out both; transform-origin: bottom; }
.cq-podium .s1 .bar { height: clamp(140px, 30vh, 300px); background: linear-gradient(180deg, #ffcf4a, #d9900a); }
.cq-podium .s2 .bar { height: clamp(100px, 21vh, 210px); background: linear-gradient(180deg, #e3e6ee, #9aa3b5); }
.cq-podium .s3 .bar { height: clamp(70px, 14vh, 150px); background: linear-gradient(180deg, #e9a46b, #a85a23); }
@keyframes cq-rise { from { transform: scaleY(0); } }
@media (prefers-reduced-motion: reduce) { .cq-podium .bar, .cq-chest.open { animation: none; } .cq-chest { transition: none; } }
@media (max-width: 640px) { .cq-opts { grid-template-columns: minmax(0, 1fr); } }
@media (max-height: 760px) and (orientation: landscape) {
  .cq-opt { min-height: 56px; padding: 6px 16px; }
  .cq-stage { gap: 6px; }
}
/* 놀이 열하나: 넓은 화면은 여섯 칸(두 줄) */
@media (min-width: 1100px) { .hw-games { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (min-width: 900px) and (max-width: 1099px) and (max-height: 760px) and (orientation: landscape) { .hw-games { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.cq-podium .s0 .bar { height: clamp(36px, 6vh, 60px); background: linear-gradient(180deg, #5b4a73, #3a2d4d); }
/* 고르기 화면 · 세로 태블릿(800×1280): 세 칸 -- 놀이 열하나가 한 화면에 */
@media (orientation: portrait) and (min-width: 700px) {
  .hw-games { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .hw-game { grid-template-columns: minmax(0, 1fr); align-content: start; min-height: 0; padding: 12px 14px; gap: 4px; }
  .hw-game .ic { font-size: 38px; }
  .hw-game b { font-size: 19px; }
}
/* 1024×600 · 962×601: 여섯 칸 카드를 조금 더 낮게 */
@media (min-width: 900px) and (max-width: 1099px) and (max-height: 760px) and (orientation: landscape) {
  .hw-game { padding: 8px 10px; }
  .hw-game .ic { font-size: 30px; }
  .hw-game b { font-size: 16px; }
  .hw-hero h2 { font-size: 24px; }
}

/* ── 📱 태블릿 팀전 ── 선생님 진행 화면(halloween.html#tq) · 팀 태블릿 · TV 창(team.html) */
.tq-setup { display: grid; gap: 12px; max-width: 900px; margin: 0 auto; }
.tq-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.tq-row > b { min-width: 3em; font-size: 18px; }
.tq-login { display: flex; gap: 8px; flex-wrap: wrap; }
.tq-login input { flex: 1 1 200px; min-height: 48px; font-size: 17px; border-radius: 12px; }
.tq-lobby { text-align: center; margin-bottom: 8px; }
.tq-bigcode { display: inline-grid; gap: 2px; justify-items: center; padding: 14px 34px; border-radius: 24px; background: rgba(255, 255, 255, .08); border: 2px dashed var(--hw-orange); }
.tq-bigcode small { font-size: clamp(14px, 1.4vw, 20px); color: var(--hw-soft); }
.tq-bigcode span { font-size: clamp(20px, 2.4vw, 34px); font-weight: 800; }
.tq-bigcode b { font-size: clamp(64px, min(10vw, 16vh), 150px); line-height: 1; letter-spacing: .12em; color: var(--hw-orange2); font-variant-numeric: tabular-nums; }
.tq-board { display: flex; flex-direction: column; align-items: center; gap: clamp(8px, 1.4vh, 16px); text-align: center; }
.tq-board .sub, .tq-end .sub { font-size: clamp(16px, 1.8vw, 24px); color: var(--hw-soft); }
.tq-chips { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
/* ── 🧹 빗자루 레이스 · 🎨 괴물 그림 퀴즈 (2026-10-29) ── */
.tq-gamehint { margin: -4px 0 4px; }
.rc-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; justify-content: center; text-align: center; }
.rc-top b { font-size: clamp(22px, 3vw, 36px); color: var(--hw-orange2); }
.rc-top span { color: var(--hw-muted, #c8b8e8); font-size: clamp(13px, 1.4vw, 18px); }
.rc-clock { font-style: normal; font-weight: 800; font-size: clamp(20px, 2.6vw, 32px); color: #fff; font-variant-numeric: tabular-nums; }
.rc-track { display: grid; gap: clamp(8px, 1.6vh, 18px); width: min(1400px, 100%); margin: 0 auto; }
.rc-lane { display: grid; grid-template-columns: minmax(120px, 15%) 1fr; align-items: center; gap: 14px; }
.rc-lane.away { opacity: .45; }
.rc-name { display: grid; gap: 2px; font-size: clamp(15px, 1.7vw, 22px); }
.rc-name b { color: var(--hw-orange2); font-variant-numeric: tabular-nums; }
.rc-road { position: relative; height: clamp(54px, 9vh, 92px); border-radius: 99px; background: linear-gradient(90deg, rgba(255,255,255,.06), rgba(255,138,31,.16));
  border: 2px solid var(--hw-line); margin-right: clamp(44px, 5vw, 70px); }
.rc-lane.t0 .rc-road { box-shadow: inset 0 -6px 0 rgba(226, 27, 60, .45); } .rc-lane.t1 .rc-road { box-shadow: inset 0 -6px 0 rgba(19, 104, 206, .5); }
.rc-lane.t2 .rc-road { box-shadow: inset 0 -6px 0 rgba(201, 138, 0, .55); } .rc-lane.t3 .rc-road { box-shadow: inset 0 -6px 0 rgba(38, 137, 12, .55); }
.rc-ticks { position: absolute; inset: 0; display: flex; justify-content: space-evenly; pointer-events: none; }
.rc-ticks i { width: 2px; background: rgba(255, 255, 255, .12); }
.rc-goal { position: absolute; right: calc(-1 * clamp(44px, 5vw, 70px)); top: 50%; transform: translateY(-50%); font-size: clamp(34px, 5vh, 60px); }
.rc-rider { position: absolute; top: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; transition: left .7s cubic-bezier(.2, 1.4, .4, 1);
  font-size: clamp(30px, 5.5vh, 58px); white-space: nowrap; }
.rc-rider .broom { font-size: .8em; margin-left: -.35em; transform: scaleX(-1); }
.rc-rider.hot { filter: drop-shadow(0 0 12px rgba(255, 138, 31, .9)); }
.rc-rider .fire { font-size: .55em; position: absolute; left: -.8em; bottom: 0; animation: rcFlick .4s infinite alternate; }
.rc-rider.stuck { filter: grayscale(.7); }
.rc-rider .web { position: absolute; inset: -10% auto auto 10%; font-size: .9em; }
@keyframes rcFlick { from { transform: scale(.9); opacity: .7; } to { transform: scale(1.15); opacity: 1; } }
.rc-feed { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: center; font-size: clamp(14px, 1.6vw, 20px); }
.rc-feed span { padding: 4px 12px; border-radius: 99px; background: rgba(255, 255, 255, .08); }
.rc-rules { list-style: none; margin: 10px auto 0; padding: 0; display: grid; gap: 6px; text-align: left; width: fit-content; font-size: 17px; }
.rc-mini { display: grid; gap: 6px; margin-bottom: 10px; }
.rc-mini-lane { display: grid; grid-template-columns: 30px 1fr 52px; align-items: center; gap: 8px; opacity: .75; font-size: 15px; }
.rc-mini-lane.me { opacity: 1; font-weight: 800; }
.rc-mini-road { height: 12px; border-radius: 99px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.rc-mini-road i { display: block; height: 100%; background: var(--hw-orange); border-radius: 99px; transition: width .5s; }
.rc-mini-lane.me .rc-mini-road { height: 16px; } .rc-mini-lane.me .rc-mini-road i { background: var(--hw-green); }
.rc-mini .rc-clock { justify-self: end; font-size: 18px; }
.rc-cheer { text-align: center; font-weight: 800; color: var(--hw-green); font-size: 20px; margin: 4px 0 8px; animation: rcPop .35s ease-out; }
.rc-cheer.boost { color: var(--hw-orange2); font-size: 24px; }
@keyframes rcPop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.rc-stuck { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 18px 10px; }
.rc-stuck .big { font-size: 90px; animation: rcPop .35s ease-out; }
.rc-stuck b { font-size: 26px; }
.rc-count span { font-size: 54px; font-weight: 900; color: var(--hw-orange2); font-variant-numeric: tabular-nums; margin-right: 6px; }
.dr-intro { display: grid; justify-items: center; gap: 8px; text-align: center; font-size: clamp(16px, 1.8vw, 22px); }
.dr-intro .big { font-size: clamp(60px, 10vh, 110px); }
.dr-intro .rule { color: var(--hw-orange2); }
.dr-stage { display: flex; justify-content: center; width: 100%; }   /* 늘 가득 -- 안 그러면 캔버스가 기본 300px 로 줄어듦 */
.dr-canvas { display: block; width: min(100%, calc(56vh * 4 / 3)); aspect-ratio: 4 / 3; border-radius: 14px; background: #fffaf0; border: 4px solid var(--hw-orange);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .45); touch-action: none; }
.tq-board .dr-canvas { width: clamp(300px, calc((100vh - 470px) * 4 / 3), 100%); }   /* TV 한 화면에: 위 칸 · 보기 · 단추를 뺀 높이만큼 */
.tq-board .dr-opts { grid-template-columns: repeat(4, minmax(0, 1fr)); }   /* TV: 보기는 한 줄로, 그림을 크게 */
.tq-board .dr-opts .cq-opt { min-height: clamp(52px, 8vh, 84px); padding: 6px 14px; gap: 10px; }
@media (max-width: 760px) { .tq-board .dr-opts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dr-pad-canvas { width: min(100%, calc(62vh * 4 / 3)); cursor: crosshair; }
.dr-word { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; font-size: clamp(24px, 3.4vw, 44px); }
.dr-word .emo { font-size: 1.3em; } .dr-word b { color: var(--hw-orange2); }
.dr-word.peek { opacity: .85; font-size: 22px; } .dr-word em { font-size: 14px; font-style: normal; color: var(--hw-muted, #c8b8e8); }
.dr-opts { width: min(1100px, 100%); margin: 0 auto; }
.dr-secret { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 4px 12px; padding: 8px 14px; margin: 4px 0 10px;
  border-radius: 14px; background: rgba(255, 138, 31, .14); border: 2px dashed var(--hw-orange); }
.dr-secret small { width: 100%; text-align: center; opacity: .8; }
.dr-secret .emo { font-size: 34px; } .dr-secret b { font-size: 32px; color: var(--hw-orange2); }
.dr-tools { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 10px 0 4px; }
.dr-pen { width: 46px; height: 46px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .3); cursor: pointer; }
.dr-pen.on { border-color: #fff; box-shadow: 0 0 0 3px var(--hw-orange); }
.dr-tool { min-height: 46px; padding: 0 14px; border-radius: 12px; border: 2px solid var(--hw-line); background: rgba(255, 255, 255, .08); color: inherit; font: inherit; cursor: pointer; }
.dr-tool.on { border-color: var(--hw-orange); background: rgba(255, 138, 31, .25); }
.dr-tool i { display: block; margin: auto; border-radius: 50%; background: currentColor; }
.dr-tool.w1 i { width: 8px; height: 8px; } .dr-tool.w2 i { width: 14px; height: 14px; } .dr-tool.w3 i { width: 24px; height: 24px; }
.dr-tab .tq-sent { margin-top: 10px; }
.dr-hint { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 4px 12px; font-size: clamp(16px, 1.8vw, 22px); }
.dr-hint b { font-family: ui-monospace, monospace; letter-spacing: .12em; font-size: 1.3em; color: var(--hw-orange2); }
.dr-hint small { opacity: .8; }
.dr-swap { width: 100%; max-width: 260px; margin-top: 4px; }
.tq-chip { display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-radius: 99px; background: rgba(255, 255, 255, .08); border: 2px solid var(--hw-line);
  font-size: clamp(16px, 1.6vw, 24px); font-weight: 800; }
.tq-chip b { color: var(--hw-orange2); }
.tq-chip i { font-style: normal; min-width: 1.4em; text-align: center; }
.tq-chip.away { opacity: .4; border-style: dashed; }
.tq-chip.done { border-color: var(--hw-green); background: rgba(123, 214, 74, .15); }
.tq-chip.turn { border-color: var(--hw-orange); box-shadow: 0 0 18px rgba(255, 138, 31, .5); }
.tq-chip.right { border-color: var(--hw-green); background: rgba(123, 214, 74, .22); }
.tq-chip.wrong { opacity: .55; }
.tq-n { font-size: clamp(16px, 1.6vw, 22px); color: var(--hw-soft); font-weight: 800; }
.tq-q { display: flex; align-items: center; justify-content: center; gap: .4em; font-size: clamp(28px, min(4.2vw, 6.4vh), 64px); font-weight: 900; line-height: 1.2; word-break: keep-all; max-width: 1300px; }
.tq-q .emo { font-size: 1.3em; }
.tq-time { width: min(760px, 90%); max-width: none; margin: 0; }
.tq-board .cq-opt { cursor: default; position: relative; }
.cq-opt.peek { box-shadow: 0 0 0 4px #fff; }
.tq-peek, .tq-who { margin-left: auto; font-style: normal; font-size: .7em; background: rgba(0, 0, 0, .25); border-radius: 99px; padding: 2px 12px; }
.tq-why { font-size: clamp(18px, min(2.2vw, 3.4vh), 30px); font-weight: 800; color: var(--hw-ink); max-width: 1200px; }
.tq-chests { display: grid; gap: 8px; width: min(900px, 100%); }
.tq-chestline { display: flex; justify-content: space-between; gap: 12px; padding: 10px 18px; border-radius: 14px; background: rgba(255, 255, 255, .08); font-size: clamp(18px, 2vw, 28px); font-weight: 800; }
.tq-chestline.wait b { color: var(--hw-soft); font-weight: 700; }
.tq-ctl { justify-content: center; margin-top: 14px; }
.tq-ctl .hint { flex-basis: 100%; text-align: center; margin: 0; }
body.hw #tqPeek.on { background: var(--hw-orange); border-color: var(--hw-orange); color: #2a1300; }
/* 팀 태블릿 */
.tq-page header .tq-me { margin-left: auto; font-weight: 900; font-size: 18px; }
.tq-page[data-team="0"] header.bar { box-shadow: inset 0 -4px 0 #ff8a1f; }
.tq-page[data-team="1"] header.bar { box-shadow: inset 0 -4px 0 #e9e2ff; }
.tq-page[data-team="2"] header.bar { box-shadow: inset 0 -4px 0 #8b5cf6; }
.tq-page[data-team="3"] header.bar { box-shadow: inset 0 -4px 0 #7bd64a; }
.tq-join { display: grid; gap: 14px; justify-items: center; text-align: center; max-width: 560px; margin: 0 auto; padding-top: 2vh; }
.tq-join h2 { margin: 0; font-size: clamp(24px, 4vw, 36px); }
.tq-code { display: flex; gap: 10px; }
.tq-code span { width: 64px; height: 78px; border-radius: 16px; border: 3px solid var(--hw-line); display: grid; place-items: center; font-size: 44px; font-weight: 900; background: rgba(255, 255, 255, .06); }
.tq-code span.on { border-color: var(--hw-orange); }
.tq-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: min(360px, 100%); }
.tq-pad button { min-height: 64px; border-radius: 16px; border: 1px solid var(--hw-line); background: rgba(255, 255, 255, .1); color: var(--hw-ink); font-size: 28px; font-weight: 900; font-family: inherit; cursor: pointer; }
.tq-pad button.ok { background: var(--hw-orange); color: #2a1300; }
.tq-teams { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; width: 100%; }
.tq-team { display: grid; justify-items: center; gap: 4px; padding: 18px 10px; border-radius: 22px; border: 3px solid var(--hw-line); background: rgba(255, 255, 255, .08); color: var(--hw-ink); font-family: inherit; cursor: pointer; }
.tq-team .ic { font-size: 56px; line-height: 1; }
.tq-team b { font-size: 22px; }
.tq-team small { color: var(--hw-soft); font-size: 13px; }
.tq-team.t0 { border-color: #ff8a1f; } .tq-team.t1 { border-color: #e9e2ff; } .tq-team.t2 { border-color: #8b5cf6; } .tq-team.t3 { border-color: #7bd64a; }
.tq-teams.small .tq-team { padding: 10px; } .tq-teams.small .ic { font-size: 40px; }
.tq-link { width: auto; }
.tq-wait, .tq-sent { display: grid; gap: 8px; justify-items: center; text-align: center; padding-top: 4vh; }
.tq-wait .big, .tq-sent .big { font-size: clamp(72px, 18vw, 140px); line-height: 1; }
.tq-wait h2 { margin: 0; font-size: clamp(26px, 5vw, 40px); }
.tq-wait p, .tq-sent p { margin: 0; font-size: 18px; color: var(--hw-soft); }
.tq-sent b { font-size: clamp(20px, 4vw, 30px); }
.tq-tab { display: grid; gap: 12px; }
.tq-qhead { display: grid; grid-template-columns: auto 1fr auto; gap: 8px 12px; align-items: center; }
.tq-qhead .n { color: var(--hw-soft); font-weight: 800; }
.tq-qhead .sec { grid-column: 3; font-size: 28px; font-weight: 900; color: var(--hw-orange2); font-variant-numeric: tabular-nums; }
.tq-qhead .q { grid-column: 1 / -1; display: flex; gap: .4em; align-items: center; justify-content: center; text-align: center; font-size: clamp(22px, 4.6vw, 40px); font-weight: 900; line-height: 1.25; word-break: keep-all; }
.tq-qhead .q .emo { font-size: 1.3em; }
.tq-opts .cq-opt { min-height: clamp(84px, 16vh, 150px); }
.tq-buzz { justify-self: center; width: min(70vw, 52vh, 340px); aspect-ratio: 1; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; align-content: center;
  background: radial-gradient(circle at 40% 35%, #ff7a8f, #e21b3c 60%, #9e0f26); color: #fff; font-size: clamp(64px, 16vw, 120px); font-family: inherit;
  box-shadow: 0 12px 0 #6e0a1a, 0 20px 40px rgba(0, 0, 0, .45); }
.tq-buzz b { font-size: clamp(26px, 6vw, 44px); }
.tq-buzz:active { transform: translateY(8px); box-shadow: 0 4px 0 #6e0a1a; }
.tq-yourturn { text-align: center; font-size: clamp(22px, 4.6vw, 36px); font-weight: 900; color: var(--hw-orange2); }
.tq-after { text-align: center; font-size: clamp(20px, 4vw, 32px); font-weight: 900; margin: 0; }
/* TV 창: 머리띠 작게 */
.tq-tv header.bar h1 { font-size: 18px; }
@media (max-width: 520px) { .tq-code span { width: 54px; height: 66px; font-size: 36px; } }
/* 팀 태블릿: 보기 단추를 화면에 맞게 크게 */
.tq-opts .cq-opt { min-height: clamp(90px, 22vh, 240px); font-size: clamp(24px, min(5vw, 5vh), 48px); }
@media (orientation: landscape) and (max-height: 760px) { .tq-opts .cq-opt { min-height: clamp(70px, 20vh, 140px); } }
/* 그림 퀴즈 공개(TV · 선생님 화면): 정답 줄 · 결과 줄이 더해지니 그림 판을 줄이고, 보기는 한 줄로(글자가 꺾여 줄이 두 배가 되던 것) (2026-10-29) */
.tq-board.dr-shown .dr-canvas { width: clamp(220px, calc((100vh - 690px) * 4 / 3), 100%); }
.tq-board.dr-on .dr-opts .cq-opt { font-size: clamp(18px, min(2.2vw, 3.8vh), 38px); }
.tq-board.dr-on .dr-opts .cq-opt span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tq-board.dr-on .dr-opts .tq-who { flex: none; font-size: .6em; padding: 2px 8px; }
.tq-board.dr-shown .dr-word { font-size: clamp(22px, min(3vw, 4.6vh), 40px); }
/* TV(넓은 화면)는 단추 · 글자가 한 단계 커서(위 min-width: 1600px) 그림 판을 그만큼 덜 크게 */
@media (min-width: 1600px) {
  .tq-board .dr-canvas { width: clamp(300px, calc((100vh - 620px) * 4 / 3), 100%); }
  .tq-board.dr-shown .dr-canvas { width: clamp(220px, calc((100vh - 750px) * 4 / 3), 100%); }
}
@media (max-height: 700px) and (orientation: landscape) {
  .tq-board .dr-canvas { width: clamp(200px, calc((100vh - 400px) * 4 / 3), 100%); }
  .tq-board.dr-shown .dr-canvas { width: clamp(150px, calc((100vh - 470px) * 4 / 3), 100%); }
  .tq-board.dr-on .dr-opts .cq-opt { min-height: 44px; }
}
