:root {
  --bg: #2B2150;
  --card: #3A2E6B;
  --dim: #CFC6F2;
  --line: #6F62AD;
  --off: #4A3D85;
  --cream: #FFF4D6;
  --cream-shadow: #D9C58E;
  --yellow: #FFC93C;
  --mint: #7FE0C4;
  --mint-shadow: #4FA98F;
  --pink: #FF9EB5;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); }
body {
  color: #fff;
  font-family: 'Dongle', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  font-weight: 700;
  line-height: 1;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; padding: 0; touch-action: manipulation; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 4px solid var(--yellow); outline-offset: 2px; }

#app {
  max-width: 480px;
  height: 100dvh;
  margin: 0 auto;
  padding: calc(20px + env(safe-area-inset-top)) 20px calc(20px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.grow { flex: 1 1 0; min-height: 0; }
#app.long { height: auto; min-height: 100dvh; }

/* 머리줄 */
.top { display: flex; align-items: center; gap: 12px; }
.icon-btn { width: 48px; height: 48px; flex: none; border-radius: 16px; background: var(--card); display: flex; align-items: center; justify-content: center; }
.icon-btn[aria-pressed="false"] { opacity: .55; }
.dots { flex: 1; display: flex; gap: 6px; justify-content: center; }
.dot { width: 16px; height: 16px; border-radius: 8px; background: var(--off); }
.dot.done { background: var(--yellow); }
.dot.now { width: 28px; background: var(--mint); }
.stars { height: 48px; padding: 0 14px; border-radius: 16px; background: var(--card); display: flex; align-items: center; gap: 6px; font-size: 28px; }
.top-title { flex: 1; text-align: center; font-size: 34px; }
.top-title.mint { color: var(--mint); }

/* 문제 카드 */
.card { background: var(--card); border-radius: 28px; padding: 20px 20px 24px; text-align: center; }
.card .label { font-size: 24px; color: var(--dim); }
.card .question { font-size: 52px; margin-top: 8px; word-break: keep-all; }
.card .question.mid { font-size: 42px; }
.card .question.small { font-size: 36px; }

/* 고양이 */
.cat-box { flex: 1 1 190px; min-height: 96px; max-height: 210px; display: flex; justify-content: center; align-items: flex-end; padding-top: 14px; }
.cat-box.big { max-height: 250px; flex-basis: 250px; }
.cat { height: 100%; width: auto; max-width: 100%; overflow: visible; }
.say { text-align: center; font-size: 30px; color: var(--dim); min-height: 30px; }

/* 빈칸과 글자 블록 */
.slots { display: flex; gap: 10px; justify-content: center; }
.slot { flex: 1 1 0; max-width: 78px; height: 84px; border-radius: 20px; border: 4px dashed var(--line); background: var(--card); color: #fff; font-size: 64px; display: flex; align-items: center; justify-content: center; }
.slots.many .slot { height: 66px; border-radius: 16px; font-size: 48px; }
.slot.next { border-style: solid; border-color: var(--mint); }
.slot.filled { border-style: solid; border-color: var(--cream); background: var(--cream); color: var(--bg); }
.slot.locked { border-color: var(--mint); background: var(--mint); color: var(--bg); }
.slot .ghost { color: var(--line); }
.slots.shake { animation: shake .5s ease-in-out; }
.blocks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.block { height: 68px; border-radius: 18px; background: var(--cream); color: var(--bg); font-size: 46px; box-shadow: 0 6px 0 var(--cream-shadow); transition: transform .08s; }
.block:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--cream-shadow); }
.block.used { visibility: hidden; }

/* 버튼 */
.row { display: flex; gap: 10px; }
.row .btn { flex: 1; }
.btn { flex: none; min-height: 58px; border-radius: 20px; background: var(--card); color: #fff; font-size: 32px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; }
.btn.yellow { background: var(--yellow); color: var(--bg); }
.btn.main { min-height: 64px; border-radius: 22px; background: var(--mint); color: var(--bg); font-size: 40px; box-shadow: 0 6px 0 var(--mint-shadow); margin-bottom: 6px; }
.btn.main:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--mint-shadow); }
.btn:disabled { opacity: .45; }
.vote { flex: 1; height: 72px; border-radius: 22px; border: 4px solid var(--line); background: var(--bg); color: #fff; font-size: 38px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.vote[aria-pressed="true"] { border-color: var(--yellow); background: var(--yellow); color: var(--bg); }

/* 정답 화면 */
.answer { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.answer .label { font-size: 26px; word-break: keep-all; }
.tiles { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.tile { width: 70px; height: 78px; border-radius: 20px; background: var(--mint); color: var(--bg); font-size: 60px; display: flex; align-items: center; justify-content: center; }
.tiles.many { flex-wrap: nowrap; align-self: stretch; }
.tiles.many .tile { flex: 1 1 0; max-width: 50px; width: auto; height: 60px; border-radius: 14px; font-size: 44px; }
.why { font-size: 30px; line-height: 1.05; text-align: center; margin-top: 4px; word-break: keep-all; }
.meter { background: var(--card); border-radius: 20px; padding: 12px 16px; display: flex; align-items: center; gap: 12px; font-size: 26px; }
.meter .text { flex: 1; }
.meter .pips { display: flex; gap: 6px; }
.pip { width: 22px; height: 22px; border-radius: 11px; border: 3px dashed var(--line); }
.pip.on { border: 0; background: var(--yellow); }

/* 처음 화면 */
.title { text-align: center; font-size: 68px; line-height: .85; margin-top: 10px; }
.title small { display: block; font-size: 30px; color: var(--dim); margin-top: 10px; }
.stat-row { display: flex; gap: 10px; }
.stat { flex: 1; background: var(--card); border-radius: 20px; padding: 12px 8px; text-align: center; font-size: 26px; color: var(--dim); }
.stat b { display: block; font-size: 44px; color: #fff; }

/* 스티커 */
.book { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.cell { aspect-ratio: 1; border-radius: 20px; border: 3px dashed var(--line); display: flex; align-items: center; justify-content: center; position: relative; }
.cell.got { border: 0; background: var(--card); }
.cell svg { width: 62%; height: 62%; }
.cell .times { position: absolute; right: 6px; bottom: 4px; font-size: 24px; color: var(--dim); }
.prize { display: flex; justify-content: center; }
.prize svg { width: 150px; height: 150px; animation: pop .6s cubic-bezier(.3, 1.6, .5, 1) both; }

/* 내가 문제 내기 */
.form { display: flex; flex-direction: column; gap: 10px; }
.form label { font-size: 28px; color: var(--dim); }
.form input, .form textarea { width: 100%; border: 3px solid var(--line); border-radius: 16px; background: var(--card); color: #fff; font: inherit; font-size: 34px; padding: 6px 14px; user-select: text; -webkit-user-select: text; }
.form textarea { resize: none; height: 84px; line-height: 1; }
.note { font-size: 26px; color: var(--pink); min-height: 26px; text-align: center; }
.mine-list { display: flex; flex-direction: column; gap: 8px; }
.mine-item { background: var(--card); border-radius: 16px; padding: 8px 8px 8px 14px; display: flex; align-items: center; gap: 8px; font-size: 28px; }
.mine-item span { flex: 1; word-break: keep-all; }
.mine-item em { font-style: normal; color: var(--mint); }
.mine-item button { width: 44px; height: 44px; border-radius: 14px; background: var(--bg); display: flex; align-items: center; justify-content: center; flex: none; }
h2 { margin: 6px 0 0; font-size: 34px; font-weight: 700; }

/* 캐릭터 고르기 */
.chars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.char { background: var(--card); border: 4px solid transparent; border-radius: 24px; padding: 14px 6px 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 32px; }
.char .cat { width: 100%; height: auto; }
.char.on { border-color: var(--mint); background: var(--off); }

/* 옷장 */
.tabs { display: flex; gap: 8px; }
.tab { flex: 1; height: 50px; border-radius: 16px; background: var(--card); font-size: 30px; color: var(--dim); }
.tab.on { background: var(--mint); color: var(--bg); }
.cell.item { border-style: dashed; border-width: 3px; font-size: 48px; background: none; }
.cell.item.got { border-style: solid; background: var(--card); }
.cell.item.on { background: var(--off); box-shadow: 0 0 0 4px var(--mint); }
.cell.item svg { width: 78%; height: 78%; }
.odds { text-align: center; font-size: 24px; }
.rar { font-size: .9em; }

/* 선물 상자 */
.box-btn { width: 100%; }
.drop-card { display: flex; align-items: center; gap: 10px; background: var(--card); border: 3px solid; border-radius: 20px; padding: 6px 10px; min-height: 58px; }
.drop-card.pop { animation: pop .5s cubic-bezier(.3, 1.6, .5, 1) both; }
.drop-icon { width: 46px; height: 46px; flex: none; }
.drop-icon svg { width: 100%; height: 100%; }
.drop-text { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 28px; }
.drop-text span { font-size: 22px; color: var(--dim); }
.btn.small { flex: none; min-height: 44px; font-size: 28px; border-radius: 14px; background: var(--mint); color: var(--bg); padding: 0 16px; }

/* 가족 대결 */
.card.left { text-align: left; }
.card.left .why { text-align: left; color: var(--dim); }
.card.left .label { margin-top: 8px; color: var(--mint); }
.who { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.versus { display: flex; gap: 10px; }
.stat.win { background: var(--mint); color: var(--bg); }
.stat.win b { color: var(--bg); }

/* 마주 보고 대결 */
#app.vs { padding: 8px 14px; gap: 6px; }
.half { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.top-half { transform: rotate(180deg); }
.vs-bar { display: flex; align-items: center; justify-content: space-between; font-size: 30px; color: var(--dim); }
.vs-bar .icon-btn { width: 44px; height: 44px; }
.vs-name { font-size: 28px; color: var(--dim); text-align: center; }
.vs-name b { color: var(--yellow); font-size: 36px; }
.vs-q { font-size: 36px; text-align: center; word-break: keep-all; }
.half .say { font-size: 28px; min-height: 28px; color: var(--mint); }
.half .slot { height: 60px; max-width: 60px; font-size: 48px; border-radius: 16px; }
.half .block { height: 54px; font-size: 40px; }

/* 움직임 */
.cat-sway, .cat-pulse { transform-box: fill-box; transform-origin: 27% 79%; }
.cat-breathe, .cat-tilt, .cat-perk, .cat-jump, .cat-rock { transform-box: fill-box; transform-origin: 50% 100%; }
.cat-blink, .cat-twinkle { transform-box: fill-box; transform-origin: 50% 50%; }
.cat-sway { animation: cat-sway 2.4s ease-in-out infinite; }
.cat-pulse { animation: cat-pulse .9s ease-in-out infinite; }
.cat-breathe { animation: cat-breathe 2.8s ease-in-out infinite; }
.cat-blink { animation: cat-blink 3.6s linear infinite; }
.cat-tilt { animation: cat-tilt 3.2s ease-in-out infinite; }
.cat-hop { animation: cat-hop .5s ease-out; }
.cat-perk { animation: cat-perk .5s ease-out; }
.cat-shake { animation: cat-shake 1s ease-in-out; }
.cat-jump { animation: cat-jump 1.3s ease-in-out infinite; }
.cat-rock { animation: cat-rock .7s ease-in-out infinite; }
.cat-shiver { animation: cat-shiver .14s linear infinite; }
.cat-twinkle { animation: cat-twinkle 1.2s ease-in-out infinite; }
.cat-flash { animation: cat-flash .9s ease-in-out infinite; }
.cat-rise { animation: cat-rise 2.4s ease-in-out infinite; }
.cat-fall { animation: cat-fall 2.2s linear infinite; }
.cat-drip { animation: cat-drip 1.8s ease-in infinite; }
.cat-d1 { animation-delay: .4s; }
.cat-d2 { animation-delay: .8s; }
@keyframes cat-sway { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(6deg); } }
@keyframes cat-pulse { 0%, 100% { transform: scale(1) rotate(-3deg); } 50% { transform: scale(1.08) rotate(5deg); } }
@keyframes cat-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.03, 1.05); } }
@keyframes cat-blink { 0%, 90%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes cat-tilt { 0%, 100% { transform: rotate(0deg); } 30%, 70% { transform: rotate(-9deg); } }
@keyframes cat-hop { 0%, 100% { transform: translateY(0); } 45% { transform: translateY(-12px); } }
@keyframes cat-perk { 0%, 100% { transform: scaleY(1); } 45% { transform: scaleY(1.2); } }
@keyframes cat-shake { 0%, 80%, 100% { transform: translateX(0); } 15%, 45% { transform: translateX(-7px); } 30%, 60% { transform: translateX(7px); } }
@keyframes cat-jump { 0%, 85%, 100% { transform: translateY(0) scale(1, 1); } 12% { transform: translateY(0) scale(1.06, .92); } 42% { transform: translateY(-26px) scale(.97, 1.04); } 70% { transform: translateY(0) scale(1.05, .94); } }
@keyframes cat-rock { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } }
@keyframes cat-shiver { 0%, 100% { transform: translateX(-2px); } 50% { transform: translateX(2px); } }
@keyframes cat-twinkle { 0%, 100% { transform: scale(.3); opacity: .2; } 50% { transform: scale(1); opacity: 1; } }
@keyframes cat-flash { 0%, 100% { opacity: .15; } 50% { opacity: 1; } }
@keyframes cat-rise { 0% { transform: translateY(6px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(-10px); opacity: 0; } }
@keyframes cat-fall { 0% { transform: translateY(-10px); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(34px); opacity: 0; } }
@keyframes cat-drip { 0% { transform: translateY(-4px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(14px); opacity: 0; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@keyframes pop { 0% { transform: scale(0) rotate(-30deg); } 100% { transform: scale(1) rotate(0); } }
/* 키가 작은 화면 */
@media (max-height: 760px) {
  #app { gap: 10px; padding-top: calc(12px + env(safe-area-inset-top)); padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .card { padding: 14px 16px 16px; }
  .card .question { font-size: 44px; }
  .card .question.mid { font-size: 38px; }
  .card .question.small { font-size: 32px; }
  .cat-box { flex-basis: 120px; max-height: 130px; min-height: 96px; padding-top: 8px; }
  .cat-box.big { flex-basis: 150px; max-height: 160px; }
  .say { font-size: 26px; min-height: 26px; }
  .slot { height: 68px; font-size: 54px; max-width: 66px; }
  .block { height: 58px; font-size: 42px; }
  .tile { width: 60px; height: 64px; font-size: 52px; }
  .vote { height: 60px; }
  .title { font-size: 56px; }
}
@media (max-height: 660px) {
  .cat-box { flex-basis: 96px; max-height: 100px; min-height: 80px; }
  .btn { min-height: 50px; }
  .btn.main { min-height: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  [class^="cat-"], .slots.shake, .prize svg { animation: none; }
}

/* 시간 제한 막대 */
.timer { display: flex; align-items: center; gap: 10px; height: 16px; flex: none; }
.timer-track { flex: 1; height: 12px; border-radius: 6px; background: var(--off); overflow: hidden; }
.timer-fill { height: 100%; border-radius: 6px; background: var(--mint); transform-origin: 0 50%; transition: transform .1s linear; }
.timer b { width: 30px; text-align: right; font-size: 34px; line-height: 16px; color: var(--mint); }
.timer.hurry .timer-fill { background: var(--pink); }
.timer.hurry b { color: var(--pink); }
.timer.slim { height: 8px; }
.timer.slim .timer-track { height: 8px; }
.top-title.pink { color: var(--pink); }

/* 쓰는 아이템 (도구) */
.tools { display: flex; gap: 8px; flex: none; }
.tool { position: relative; flex: 1; height: 48px; border-radius: 14px; background: var(--card); display: flex; align-items: center; justify-content: center; }
.tool svg { width: 30px; height: 30px; }
.tool .times { position: absolute; right: 5px; bottom: -2px; font-size: 24px; line-height: 24px; color: var(--yellow); }
.tool:disabled { opacity: .35; }
.tool.spent { opacity: .35; outline: 2px dashed var(--line); outline-offset: -2px; }
.btn small { font-size: .7em; opacity: .75; margin-left: 4px; }
.timer.frozen .timer-fill { background: #8FD3FF; }
.timer.frozen b { color: #8FD3FF; }
.tool-got { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 14px; font-size: 28px; color: var(--mint); }
.tool-got span { display: flex; align-items: center; gap: 6px; color: #fff; }
.tool-got svg { width: 28px; height: 28px; }
.tool-got em { font-style: normal; }
.tool-row svg { width: 40px; height: 40px; flex: none; }
.tool-row small { display: block; font-size: 22px; color: var(--dim); }
.tool-row.none { opacity: .5; }
.tabs .tab { font-size: 26px; }
@media (max-height: 760px) { .tool { height: 42px; } .tool svg { width: 26px; height: 26px; } }
@media (max-height: 660px) {
  .tool { height: 36px; }
  .tool svg { width: 24px; height: 24px; }
  .tool .times { font-size: 20px; line-height: 20px; }
  .cat-box { min-height: 62px; flex-basis: 70px; padding-top: 4px; }
  .prize svg { width: 76px; height: 76px; }
  .tool-got { font-size: 24px; }
}

.prize { flex: none; }
.prize svg { width: 110px; height: 110px; }
@media (max-height: 660px) { .prize svg { width: 76px; height: 76px; } }

/* 아이템 칸 두 개 (캐릭터 양옆) */
.stage { flex: 1 1 190px; min-height: 96px; max-height: 210px; display: flex; align-items: center; gap: 8px; }
.stage .cat-box { flex: 1 1 0; min-width: 0; height: 100%; min-height: 0; max-height: none; }
.kart { width: 68px; height: 68px; flex: none; border-radius: 22px; background: var(--card); border: 3px dashed var(--line); display: flex; align-items: center; justify-content: center; }
.kart.full { border: 3px solid var(--yellow); box-shadow: 0 5px 0 #B98A14; }
.kart.full:active { transform: translateY(3px); box-shadow: 0 2px 0 #B98A14; }
.kart svg { width: 42px; height: 42px; }
.combo { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 28px; color: var(--mint); flex: none; }
.combo .pips { display: flex; gap: 5px; }
.combo .pip.goal { outline: 2px solid var(--yellow); outline-offset: 1px; }
.combo-text { display: flex; align-items: center; gap: 8px; }
.combo-text span { display: flex; align-items: center; gap: 4px; color: #fff; }
.combo-text svg { width: 30px; height: 30px; }
.combo-text em { font-style: normal; color: var(--yellow); }
@media (max-height: 760px) { .stage { flex-basis: 120px; max-height: 130px; } .kart { width: 60px; height: 60px; } }
@media (max-height: 660px) { .stage { flex-basis: 80px; max-height: 100px; min-height: 66px; } .kart { width: 54px; height: 54px; border-radius: 18px; } .kart svg { width: 34px; height: 34px; } .combo { font-size: 24px; } }
.combo-text .pop { animation: pop .5s cubic-bezier(.3, 1.6, .5, 1) both; }
.combo .pip { width: 16px; height: 16px; border-width: 2px; }
@media (max-height: 660px) {
  .combo .pips { display: none; }
  .combo-text svg { width: 24px; height: 24px; }
  .card.answer { padding: 12px 16px 14px; }
}
.combo-text, .combo-text span, .combo-text em { white-space: nowrap; }
.combo-text span + span { margin-left: 6px; }
@media (max-height: 660px) { #app { gap: 10px; } }

/* 문제 화면 아래쪽: 글자 블록 자리가 결과로 바뀐다 */
.lower { flex: 1 0 auto; display: flex; flex-direction: column; gap: 14px; }
.lower.done > * { animation: rise .25s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.lower .why { font-size: 34px; background: var(--card); border-radius: 22px; padding: 12px 16px; margin: 0; }
.say.mint { color: var(--mint); }
.say.pink { color: var(--pink); }
.dot.miss { background: var(--pink); }
.timer.stopped { opacity: .35; }
.minis .vote { height: 52px; font-size: 28px; border-width: 3px; border-radius: 18px; gap: 4px; }
.minis .vote svg { width: 24px; height: 24px; }
@media (max-height: 760px) { .lower { gap: 10px; } .lower .why { font-size: 28px; padding: 8px 14px; } .minis .vote { height: 46px; } }
@media (prefers-reduced-motion: reduce) { .lower.done > * { animation: none; } }

/* ---------- 몽실이 양 ---------- */
.cat image { image-rendering: auto; }
.cat-box.poke { cursor: pointer; }
/* 여러 장을 차례로 보여 주는 움직임(달리기·도약·박치기). 지연 시간은 game.js 가 장마다 넣는다 */
.fr { visibility: hidden; animation-name: fr4; animation-timing-function: steps(1, end); animation-iteration-count: infinite; }
@keyframes fr4 { 0% { visibility: visible; } 25%, 100% { visibility: hidden; } }
.cat-wobble, .cat-snooze, .cat-sweep { transform-box: fill-box; transform-origin: 50% 100%; }
.cat-wobble { animation: cat-wobble 1.6s ease-in-out infinite; }
.cat-snooze { animation: cat-snooze 3.6s ease-in-out infinite; }
.cat-sweep { animation: cat-sweep .5s ease-in-out infinite; }
@keyframes cat-wobble { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg) translateY(-4px); } }
@keyframes cat-snooze { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.02, 1.05); } }
@keyframes cat-sweep { 0%, 100% { transform: translateX(-6px) rotate(-2deg); } 50% { transform: translateX(6px) rotate(2deg); } }
/* 눈 깜빡임: 4초에 한 번, 아주 잠깐 눈꺼풀을 덮는다 */
.sh-blink { opacity: 0; animation: sh-blink 4.2s linear infinite; }
@keyframes sh-blink { 0%, 93%, 100% { opacity: 0; } 94.5%, 97.5% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .fr { animation: none; }
  .fr:first-child { visibility: visible; }
  .sh-blink { animation: none; }
}
/* 아이템·도구 그림 */
.ticon, .iicon { display: block; object-fit: contain; pointer-events: none; }
.kart .ticon { width: 50px; height: 50px; }
.cell.item .iicon { width: 82%; height: 82%; }
.drop-icon .iicon { width: 100%; height: 100%; }
.tool-row .ticon { width: 44px; height: 44px; flex: none; }
.combo-text .ticon { width: 30px; height: 30px; }
.tool-got .ticon { width: 28px; height: 28px; }
@media (max-height: 760px) { .kart .ticon { width: 44px; height: 44px; } }
@media (max-height: 660px) { .kart .ticon { width: 38px; height: 38px; } .combo-text .ticon { width: 24px; height: 24px; } }

/* 작은 폰(높이 660 이하): 결과와 마주 보고 대결이 한 화면에 들어가게 줄인다 */
@media (max-height: 660px) {
  .lower { gap: 8px; }
  .lower .why { font-size: 26px; padding: 6px 12px; border-radius: 16px; }
  .lower.done .btn.main { min-height: 50px; }
  .minis .vote { height: 40px; font-size: 24px; }
  .combo { font-size: 22px; }
  #app.vs { padding: 4px 12px; gap: 4px; }
  .half { gap: 4px; }
  .half .block { height: 46px; font-size: 36px; }
  .half .slot { height: 50px; max-width: 50px; font-size: 40px; }
  .vs-q { font-size: 30px; line-height: 1; }
  .vs-name { font-size: 24px; line-height: 1; }
  .vs-name b { font-size: 30px; }
  .half .say { font-size: 24px; min-height: 24px; }
  .vs-bar .icon-btn { width: 38px; height: 38px; }
  .vs-bar .btn.small { min-height: 38px; }
}
.card .question.tiny { font-size: 31px; line-height: 1.05; }
#app.solved .stage, #app.solved > .cat-box { min-height: 44px; }
@media (max-height: 760px) { .card .question.tiny { font-size: 27px; } }
@media (max-height: 720px) {
  #app.vs { padding: 4px 12px; gap: 4px; }
  .half { gap: 5px; }
  .half .block { height: 48px; font-size: 38px; }
  .vs-q { font-size: 32px; line-height: 1; }
}

/* 글자 블록 = 키보드 키캡. 테두리 네 변의 색을 달리해 비스듬한 옆면을 만들고, 안쪽 밝은 면이 손가락이 닿는 윗면이다. */
.block {
  height: 72px; padding: 0; font-size: 42px; line-height: 1; color: var(--bg);
  border-style: solid; border-width: 4px 7px 12px 7px;
  border-color: #EBDCAE #D6C28A #B59F64 #D6C28A;
  border-radius: 14px;
  background: linear-gradient(180deg, #FFFBEC 0%, #FFF1CC 100%);
  background-clip: padding-box;
  box-shadow: 0 2px 0 #7E6C3F, inset 0 2px 0 rgba(255, 255, 255, .9), inset 0 -2px 3px rgba(181, 159, 100, .35);
  transition: transform .06s, border-width .06s;
}
.block:active { transform: translateY(5px); border-bottom-width: 7px; height: 67px; margin-bottom: 5px; box-shadow: 0 1px 0 #7E6C3F, inset 0 2px 0 rgba(255, 255, 255, .6); }
.half .block { height: 58px; font-size: 36px; border-width: 3px 6px 10px 6px; }
.half .block:active { height: 54px; margin-bottom: 4px; border-bottom-width: 6px; transform: translateY(4px); }
@media (max-height: 760px) {
  .block { height: 62px; font-size: 38px; border-width: 3px 6px 10px 6px; }
  .block:active { height: 58px; margin-bottom: 4px; border-bottom-width: 6px; transform: translateY(4px); }
}
@media (max-height: 720px) {
  .half .block { height: 52px; font-size: 34px; border-width: 3px 5px 9px 5px; }
  .half .block:active { height: 49px; margin-bottom: 3px; border-bottom-width: 6px; transform: translateY(3px); }
}
@media (max-height: 660px) {
  .half .block { height: 50px; font-size: 32px; }
  .half .block:active { height: 47px; }
}
.block { padding-top: 5px; }
.half .block { padding-top: 3px; }

/* 키캡 그림(img/keys/k1~k8.webp, scripts/keycap_cut.py 가 만든다)을 블록 바탕에 깔고 글자만 윗면에 얹는다.
   자리마다 색이 정해져 있다: 윗줄 빨강·노랑·초록·하늘, 아랫줄 주황·보라·민트·분홍. */
.block, .half .block {
  border: 0; border-radius: 0; box-shadow: none;
  background: center / 100% 100% no-repeat;
  padding: 0 0 26% 0; /* 윗면이 위쪽으로 치우쳐 있어서 글자를 그만큼 올린다 */
  color: #2B2150; text-shadow: 0 1px 0 rgba(255, 255, 255, .55);
  transition: transform .06s, filter .06s;
}
.block:nth-child(8n+1) { background-image: url(img/keys/k1.webp); }
.block:nth-child(8n+2) { background-image: url(img/keys/k2.webp); }
.block:nth-child(8n+3) { background-image: url(img/keys/k3.webp); }
.block:nth-child(8n+4) { background-image: url(img/keys/k4.webp); }
.block:nth-child(8n+5) { background-image: url(img/keys/k5.webp); }
.block:nth-child(8n+6) { background-image: url(img/keys/k6.webp); }
.block:nth-child(8n+7) { background-image: url(img/keys/k7.webp); }
.block:nth-child(8n+8) { background-image: url(img/keys/k8.webp); }
.block:active, .half .block:active {
  height: 72px; margin-bottom: 0; border: 0; box-shadow: none;
  transform: translateY(4px) scale(.95); filter: brightness(.9);
}
.block { height: 76px; }
.half .block, .half .block:active { height: 60px; }
@media (max-height: 760px) { .block, .block:active { height: 64px; } }
@media (max-height: 720px) { .half .block, .half .block:active { height: 54px; } }
@media (max-height: 660px) { .half .block, .half .block:active { height: 52px; } }
.block:active { height: 76px; }
@media (max-height: 760px) { .block:active { height: 64px; } }

/* 정답 칸에 놓인 글자도 누른 키캡 그림 그대로 보인다 (k1~k8 = 블록 자리 순서) */
.slot.filled, .slot.filled.locked {
  border: 0; border-radius: 0; background-color: transparent;
  background-position: center; background-size: 100% 100%; background-repeat: no-repeat;
  padding: 0 0 20px 0; font-size: 46px; line-height: 1; /* 칸은 flex 자식이라 % 여백을 쓰면 줄 전체 너비 기준이 된다 */
  color: #2B2150; text-shadow: 0 1px 0 rgba(255, 255, 255, .55);
}
.slot.filled.k1, .slot.filled.locked.k1 { background-image: url(img/keys/k1.webp); }
.slot.filled.k2, .slot.filled.locked.k2 { background-image: url(img/keys/k2.webp); }
.slot.filled.k3, .slot.filled.locked.k3 { background-image: url(img/keys/k3.webp); }
.slot.filled.k4, .slot.filled.locked.k4 { background-image: url(img/keys/k4.webp); }
.slot.filled.k5, .slot.filled.locked.k5 { background-image: url(img/keys/k5.webp); }
.slot.filled.k6, .slot.filled.locked.k6 { background-image: url(img/keys/k6.webp); }
.slot.filled.k7, .slot.filled.locked.k7 { background-image: url(img/keys/k7.webp); }
.slot.filled.k8, .slot.filled.locked.k8 { background-image: url(img/keys/k8.webp); }
/* 힌트로 놓였거나 정답이 확정된 칸은 민트색 빛으로 표시한다 */
.slot.filled.locked { filter: drop-shadow(0 0 3px var(--mint)) drop-shadow(0 0 2px var(--mint)); }
.slots.many .slot.filled { font-size: 36px; }
.half .slot.filled { font-size: 34px; }
@media (max-height: 760px) { .slot.filled { font-size: 40px; } .slots.many .slot.filled { font-size: 34px; } }
@media (max-height: 660px) { .half .slot.filled { font-size: 30px; } }

.slots.many .slot.filled { padding-bottom: 15px; }
.half .slot.filled { padding-bottom: 14px; }
@media (max-height: 760px) { .slot.filled { padding-bottom: 16px; } .slots.many .slot.filled { padding-bottom: 14px; } }
@media (max-height: 660px) { .half .slot.filled { padding-bottom: 11px; } }
