/* 귀여운 파스텔 테마. 색은 여기 변수만 바꾸면 전체가 따라 바뀐다 */
:root {
  --ink: #5a2d45;
  --ink-soft: #9a6a84;
  --pink: #ff5f9e;
  --pink-l: #ff8cbc;
  --pink-d: #c43570;
  --line: #ffc6dc;
  --cream: #fffaf3;
  --gold: #ffc21f;
  --sky: #22b8e8;
  --font: "Fredoka", "Jua", "Malgun Gothic", sans-serif;
}

html, body {
  margin: 0; height: 100%; overflow: hidden;
  font-family: var(--font); font-synthesis: none; color: var(--ink);
  /* 분홍 깅엄 식탁보 */
  background-color: #ffeef4;
  background-image:
    radial-gradient(ellipse at 50% 42%, rgb(255 255 255 / 60%), transparent 70%),
    linear-gradient(90deg, rgb(255 150 190 / 16%) 50%, transparent 50%),
    linear-gradient(rgb(255 150 190 / 16%) 50%, transparent 50%);
  background-size: 100% 100%, 56px 56px, 56px 56px;
}
/* --bar-h는 main.js가 하단 바 높이에 맞춰 넣는다. 테이블은 바 위쪽에만 그린다 */
#gameCanvas { position: fixed; top: 0; left: 0; right: 0; bottom: var(--bar-h, 90px); width: 100%; height: calc(100% - var(--bar-h, 90px)); display: block; }

/* 사탕 버튼: 누르면 쏙 들어간다 */
button {
  font: inherit; font-weight: 600; padding: 6px 16px; border-radius: 999px;
  border: 2px solid #f6b6d0; background: #fff; color: #8a3a63; cursor: pointer;
  box-shadow: 0 4px 0 #f3b3cd; transition: transform 0.08s, box-shadow 0.08s, background 0.15s;
}
button:hover:not(:disabled) { background: #fff3f8; transform: translateY(-1px); box-shadow: 0 5px 0 #f3b3cd; }
button:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #f3b3cd; }
button:disabled { opacity: 0.45; cursor: default; box-shadow: 0 2px 0 #eadbe2; filter: grayscale(0.5); }
button.primary { background: linear-gradient(#ff9cc6, var(--pink)); border-color: #e2487f; color: #fff; box-shadow: 0 4px 0 var(--pink-d); text-shadow: 0 1px 0 rgb(150 20 70 / 40%); }
button.primary:hover:not(:disabled) { background: linear-gradient(#ffb0d2, #ff74ab); box-shadow: 0 5px 0 var(--pink-d); }
button.primary:active:not(:disabled) { box-shadow: 0 1px 0 var(--pink-d); }
button.pinko { background: linear-gradient(#ffe27a, var(--gold)); border-color: #e89a00; color: #7a3a00; font-weight: 700; box-shadow: 0 4px 0 #c97f00; }
button.pinko:hover:not(:disabled) { background: linear-gradient(#ffeb9c, #ffcd45); box-shadow: 0 5px 0 #c97f00; }
button.pinko:active:not(:disabled) { box-shadow: 0 1px 0 #c97f00; }
button.pinko:not(:disabled) { animation: wiggle 1.4s ease-in-out infinite; }
@keyframes wiggle { 0%, 70%, 100% { rotate: 0deg; } 78% { rotate: -5deg; } 86% { rotate: 5deg; } 94% { rotate: -2deg; } }
select { font: inherit; font-weight: 600; padding: 5px 12px; border-radius: 999px; border: 2px solid #f6b6d0; background: #fff; color: #8a3a63; cursor: pointer; }

.hud { position: fixed; z-index: 10; }

/* 하단 바 */
#bar {
  left: 0; right: 0; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 8px 16px 10px;
  background: rgb(255 251 246 / 95%); border-top: 3px solid var(--line); border-radius: 22px 22px 0 0;
  box-shadow: 0 -4px 18px rgb(220 100 150 / 18%);
}
#status { flex: 0 0 100%; font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-soft); }
#status.mine { color: var(--pink); font-weight: 700; }
#recipe { display: flex; align-items: center; gap: 4px; margin-right: auto; }
.chip { font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: #f6e8ee; color: #b08aa0; }
.chip.on { background: var(--pink-l); color: #fff; }
.chip.pic { padding: 2px; line-height: 0; background: #fff; border: 2px solid #f1dde6; }
.chip.pic img { width: 26px; height: 26px; filter: grayscale(1); opacity: 0.35; }
.chip.pic.on { background: var(--pink-l); border-color: var(--pink-l); }
.chip.pic.on img { filter: none; opacity: 1; }
.chip.pic.core { outline: 2px solid var(--gold); outline-offset: 1px; }
#buttons { display: flex; gap: 8px; }
#topBtns { display: flex; gap: 8px; padding-left: 14px; border-left: 2px dashed var(--line); }

/* 진행 기록 */
#log {
  left: 10px; bottom: calc(var(--bar-h, 90px) + 10px); width: 280px; max-height: 18vh; overflow-y: auto;
  font-size: 12px; line-height: 1.55; color: var(--ink-soft); pointer-events: auto;
  background: rgb(255 255 255 / 78%); padding: 6px 12px; border: 2px solid #ffd6e6; border-radius: 14px;
}
#log:empty { display: none; }
#log div:last-child { color: var(--pink-d); font-weight: 600; }

/* 테이블 위 글자 */
#labels { position: fixed; inset: 0; z-index: 5; pointer-events: none; }
.label {
  position: absolute; transform: translate(-50%, -50%); white-space: nowrap; text-align: center;
  font-size: 12px; font-weight: 600; color: var(--ink-soft); text-shadow: 0 1px 0 #fff, 0 0 4px #fff;
}
.label.left { transform: translate(0, -50%); }
.label.opp {
  padding: 4px 14px; border-radius: 16px; background: var(--cream); border: 2px solid var(--line);
  box-shadow: 0 3px 0 rgb(240 150 190 / 45%); text-shadow: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.label.opp .nm { font-weight: 700; font-size: 14px; color: var(--ink); }
.label.opp .res { color: var(--pink-d); }
.label.active { border-color: var(--gold); box-shadow: 0 3px 0 #e5a800, 0 0 0 4px rgb(255 194 31 / 35%); }
.label.targetable { border-color: var(--sky); box-shadow: 0 3px 0 #1592bb, 0 0 0 4px rgb(34 184 232 / 30%); pointer-events: auto; cursor: pointer; }
.label.victim { border-color: var(--pink); background: #ffe3ef; box-shadow: 0 3px 0 var(--pink-d), 0 0 0 4px rgb(255 95 158 / 30%); }
.label.hint { padding: 4px 14px; border-radius: 999px; background: #fff; border: 2px solid var(--sky); color: var(--ink); text-shadow: none; }

/* 봇이 방금 한 행동 설명 (가운데 카드 옆 말풍선) */
.label.caption {
  z-index: 2; padding: 10px 18px; border-radius: 18px; background: #fff; border: 3px solid var(--pink-l);
  color: var(--ink); font-size: 17px; font-weight: 600; line-height: 1.5; text-align: left; text-shadow: none;
  box-shadow: 0 5px 0 rgb(240 120 170 / 35%); animation: pop 0.25s ease-out;
}
.label.caption b { color: var(--pink); }
.label.caption.left::before {
  content: ''; position: absolute; left: -13px; top: 50%; translate: 0 -50%;
  border: 10px solid transparent; border-left: 0; border-right: 13px solid var(--pink-l);
}

/* 차례 안내, PINKO!, 라운드 끝 */
.label.banner {
  z-index: 3; padding: 12px 38px; border-radius: 999px; background: #fff; border: 4px solid var(--line);
  color: var(--ink); font-size: 32px; font-weight: 700; text-shadow: none;
  box-shadow: 0 7px 0 rgb(240 130 175 / 40%), 0 14px 30px rgb(150 50 100 / 20%); animation: pop 0.3s ease-out;
}
.label.banner.mine { background: linear-gradient(#ffe68a, var(--gold)); border-color: #fff; color: #7a4a00; box-shadow: 0 7px 0 #d99a00, 0 14px 30px rgb(150 90 0 / 25%); }
.label.banner.pinko {
  font-size: 54px; letter-spacing: 2px; color: #fff; background: linear-gradient(#ff9cc6, var(--pink)); border: 5px solid #fff;
  text-shadow: 0 3px 0 #b8286a; box-shadow: 0 8px 0 var(--pink-d), 0 16px 34px rgb(196 53 112 / 35%);
}
.label.banner.round { font-size: 28px; color: #fff; background: linear-gradient(#d9c6ff, #a98bff); border-color: #fff; text-shadow: 0 2px 0 #7a5bd6; box-shadow: 0 7px 0 #7a5bd6; }
@keyframes pop { 0% { opacity: 0; scale: 0.6; } 70% { opacity: 1; scale: 1.08; } 100% { scale: 1; } }
.badge { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; margin-left: 4px; vertical-align: 1px; }
.badge.turn { background: var(--gold); color: #6b3d00; }
.badge.pinko { background: var(--pink); color: #fff; }

/* 겹쳐 뜨는 창 */
.overlay { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: rgb(110 40 80 / 35%); backdrop-filter: blur(2px); }
.overlay.light { background: rgb(110 40 80 / 15%); backdrop-filter: none; }
/* 위의 display: grid가 hidden 속성을 이기므로 따로 숨긴다 */
.overlay[hidden] { display: none; }
.panel {
  max-width: 620px; max-height: 80vh; overflow-y: auto; padding: 22px 28px; border-radius: 26px;
  background: var(--cream); color: var(--ink); line-height: 1.7; border: 4px solid var(--line);
  box-shadow: 0 10px 0 rgb(240 140 180 / 35%), 0 20px 40px rgb(120 40 80 / 20%); animation: pop 0.25s ease-out;
}
.panel h2 { margin: 0 0 8px; color: var(--pink); font-size: 28px; font-weight: 700; text-shadow: 0 2px 0 #ffd6e6; }
.panel li::marker { color: var(--pink); font-weight: 700; }
.note { color: var(--pink-d); font-size: 14px; text-align: center; }
.note.soft { margin: 10px 0 0; color: var(--ink-soft); font-size: 13px; }

/* 게임 준비 룸 */
.panel.room { width: min(600px, 86vw); max-height: 88vh; text-align: center; }
.roomHint { margin: 0 0 14px; color: var(--ink-soft); }
#seats { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; }
.seat {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 124px; padding: 10px 6px; border-radius: 20px; background: #fff; border: 3px solid var(--line);
  box-shadow: 0 4px 0 rgb(240 150 190 / 45%); line-height: 1.3;
}
.seat.pop { animation: pop 0.25s ease-out; }
.seat img { width: 56px; height: 56px; margin-bottom: 4px; border-radius: 50%; border: 3px solid #ffe3ef; background: #fff; }
.seat .nm { font-weight: 700; font-size: 15px; color: var(--ink); overflow-wrap: anywhere; }
.seat .tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.seat .tag { font-size: 11px; font-weight: 700; padding: 1px 9px; border-radius: 999px; background: #f6e8ee; color: #b08aa0; }
.seat .tag.host { background: #ffd6e6; color: var(--pink-d); }
.seat.me { border-color: var(--gold); background: #fff8e0; box-shadow: 0 4px 0 #e5b400; }
.seat.me img { border-color: var(--gold); }
.seat .tag.me { background: var(--gold); color: #6b3d00; }
.seat.human { border-color: #9fd8c4; background: #f0fbf6; box-shadow: 0 4px 0 #8fcfb6; }
.seat.human img { border-color: #bfe8d8; }
.seat.human .tag:not(.host) { background: #d4f2e6; color: #3c8f73; }
.seat.empty.locked { border: 3px dashed #f3bfd4; background: rgb(255 255 255 / 35%); box-shadow: none; color: #c7b3bd; }
.roomTop { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 8px; }
.roomTop button { font-size: 14px; padding: 4px 14px; }
.net { font-size: 14px; font-weight: 700; padding: 3px 12px; border-radius: 999px; background: #f6e8ee; color: var(--ink-soft); }
.net::before { content: '●'; margin-right: 6px; color: #e3b7c8; }
.net.open::before { color: #4fc18f; }
.net.connecting::before, .net.closed::before { color: #f2b84b; }
.net.error::before { color: #d4553a; }
.nameRow { display: flex; justify-content: center; align-items: center; gap: 10px; margin: 0 0 8px; font-weight: 600; }
.nameRow input {
  width: 160px; padding: 4px 12px; font: inherit; font-size: 15px; color: var(--ink); text-align: center;
  border: 3px solid var(--line); border-radius: 999px; background: #fff; outline: none;
}
.nameRow input:focus { border-color: var(--pink-l); }
.seat .x {
  position: absolute; top: 5px; right: 5px; width: 26px; height: 26px; padding: 0; line-height: 1;
  font-size: 16px; box-shadow: 0 2px 0 #f3b3cd;
}
button.seat.empty {
  border: 3px dashed #f3bfd4; background: rgb(255 255 255 / 45%); box-shadow: none; color: var(--ink-soft);
}
button.seat.empty:hover { background: #fff; border-color: var(--pink-l); color: var(--pink); transform: translateY(-2px); box-shadow: 0 4px 0 rgb(240 150 190 / 45%); }
button.seat.empty:active { transform: translateY(1px); box-shadow: none; }
.seat.empty .plus {
  display: grid; place-items: center; width: 50px; height: 50px; margin-bottom: 6px; border-radius: 50%;
  border: 3px dashed currentColor; font-size: 30px; font-weight: 700; line-height: 1;
}
.seat.empty .nm { color: inherit; font-size: 13px; font-weight: 600; }
.roomTools { display: flex; justify-content: center; gap: 10px; margin: 16px 0 4px; }
.roomTools button { font-size: 14px; padding: 4px 14px; }
#roomInfo { margin: 8px 0; font-weight: 700; color: var(--pink-d); }
#roomInfo.warn { color: #d4553a; }
.roomBtns { display: flex; justify-content: center; align-items: center; gap: 14px; }
.roomBtns button.big { width: auto; min-width: 200px; }
label.row { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 6px 0 4px; min-width: 260px; font-weight: 600; }

/* 설정 화면 */
.setRow { display: flex; align-items: center; gap: 14px; min-width: 400px; margin: 10px 0; padding: 8px 12px; border-radius: 16px; background: #fff; border: 2px dashed var(--line); }
.setName { flex: 1; font-weight: 600; white-space: nowrap; }
.seg { display: flex; gap: 4px; padding: 3px; border-radius: 999px; background: #ffeaf2; }
.seg button { padding: 4px 14px; border: 0; box-shadow: none; background: transparent; color: var(--ink-soft); font-size: 14px; }
.seg button:hover { background: #fff; }
.seg button.on { background: var(--pink); color: #fff; box-shadow: 0 2px 0 var(--pink-d); }
.switch { position: relative; width: 56px; height: 30px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #e9d3dd; transition: background 0.2s; }
.switch span::after {
  content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 0 rgb(0 0 0 / 15%); transition: transform 0.2s;
}
.switch input:checked + span { background: var(--pink); }
.switch input:checked + span::after { transform: translateX(26px); }
.switch input:focus-visible + span { outline: 3px solid var(--sky); }
input[type="range"] { flex: 0 0 150px; accent-color: var(--pink); cursor: pointer; }
input[type="range"]:disabled { opacity: 0.4; cursor: default; }
.volVal { width: 40px; text-align: right; font-weight: 600; color: var(--pink-d); }
#settings .panel > button { display: block; margin: 14px auto 0; min-width: 120px; }

/* 메인 화면 */
.overlay.solid {
  backdrop-filter: none;
  background-color: #ffd9e8;
  background-image:
    radial-gradient(circle, rgb(255 255 255 / 75%) 5px, transparent 6px),
    radial-gradient(circle at 50% 40%, #fff3f8, #ffc4dc 75%);
  background-size: 46px 46px, 100% 100%;
}
#menuDeco { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
#menuDeco img {
  position: absolute; translate: -50% -50%; border-radius: 50%; border: 4px solid #fff;
  box-shadow: 0 6px 0 rgb(220 100 150 / 25%); animation: float 5s ease-in-out infinite;
}
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-16px) rotate(6deg); } }
.menuBox {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px; width: 300px;
  padding: 26px 34px 30px; border-radius: 34px; background: rgb(255 250 243 / 92%); border: 4px solid #fff;
  box-shadow: 0 12px 0 rgb(240 130 175 / 40%), 0 24px 50px rgb(150 50 100 / 20%);
}
.logo { margin: 0; font-size: 84px; font-weight: 700; line-height: 1; letter-spacing: 1px; white-space: nowrap; }
.logo span { display: inline-block; color: var(--pink); text-shadow: 0 5px 0 var(--pink-d), 0 10px 14px rgb(196 53 112 / 30%); animation: bob 2.4s ease-in-out infinite; }
.logo span:nth-child(even) { color: #ff9a4d; text-shadow: 0 5px 0 #c9621c, 0 10px 14px rgb(201 98 28 / 30%); }
.logo span:nth-child(2) { animation-delay: 0.15s; }
.logo span:nth-child(3) { animation-delay: 0.3s; }
.logo span:nth-child(4) { animation-delay: 0.45s; }
.logo span:nth-child(5) { animation-delay: 0.6s; }
.logo span:nth-child(6) { animation-delay: 0.75s; }
@keyframes bob { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-8px); } }
.sub { margin: 0 0 10px; color: #b0668a; font-size: 18px; }
button.big { width: 100%; padding: 12px; font-size: 20px; font-weight: 700; }

/* 결과표 */
#resultsTable { border-collapse: collapse; margin-bottom: 16px; font-size: 14px; }
#resultsTable th { color: var(--pink); font-weight: 700; }
#resultsTable td, #resultsTable th { padding: 5px 10px; border-bottom: 2px dashed #ffd6e6; text-align: left; vertical-align: middle; }
#resultsTable .win td { color: #d98a00; font-weight: 700; background: #fff4cc; }
#resultsTable .win td:first-child::before { content: '👑 '; }
#resultsTable .cards { max-width: 300px; white-space: normal; line-height: 0; }
#resultsTable .cards img { width: 24px; height: 24px; margin: 1px; border-radius: 50%; }

/* 튜토리얼: 수프 할머니 말풍선 */
#coach {
  position: fixed; top: 12px; left: 12px; z-index: 15; width: min(400px, calc(100vw - 24px)); box-sizing: border-box;
  max-height: calc(100vh - var(--bar-h, 90px) - 24px); overflow-y: auto;
  padding: 12px 16px 14px; border-radius: 20px; background: #fff; border: 3px solid var(--pink-l); color: var(--ink);
  box-shadow: 0 6px 0 rgb(240 120 170 / 35%), 0 14px 30px rgb(150 50 100 / 18%);
}
#coach[hidden] { display: none; }
/* 결과표가 떠 있을 때는 아래쪽 가운데로 옮겨, 결과표를 가리지 않고 그 위에 뜨게 */
#coach.front {
  z-index: 25; top: auto; bottom: 12px; width: min(560px, calc(100vw - 24px));
  left: calc(50% - min(280px, calc(50vw - 12px))); max-height: 40vh;
}
#coach.pop { animation: pop 0.3s ease-out; }
#coach.shake { animation: shake 0.45s; }
@keyframes shake { 0%, 100% { translate: 0; } 20% { translate: -8px; } 40% { translate: 7px; } 60% { translate: -5px; } 80% { translate: 3px; } }
.coachHead { display: flex; align-items: center; gap: 10px; }
#coachFace { width: 56px; height: 56px; flex: none; border-radius: 50%; box-shadow: 0 3px 0 rgb(240 120 170 / 35%); }
#coachName { font-size: 17px; font-weight: 700; color: var(--pink-d); }
#coachStep { font-size: 12px; font-weight: 600; color: var(--ink-soft); margin-right: auto; }
#coachExit { font-size: 12px; padding: 3px 10px; box-shadow: 0 2px 0 #f3b3cd; }
#coachText { margin-top: 8px; font-size: 16px; line-height: 1.6; }
#coachText b, .coachRow b { color: var(--pink); }
#coachIcons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
#coachIcons:empty { display: none; }
#coachIcons > img { width: 40px; height: 40px; }
.coachRow { display: flex; align-items: center; gap: 10px; width: 100%; font-size: 14px; line-height: 1.4; }
.coachRow img { width: 34px; height: 34px; flex: none; }
#coachNudge { margin-top: 8px; padding: 6px 10px; border-radius: 12px; background: #fff3c4; color: #7a4a00; font-size: 14px; font-weight: 600; }
#coachNudge[hidden] { display: none; }
.coachBtns { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.coachBtns:empty { display: none; }

/* 튜토리얼에서 눌러야 할 버튼/보여 줄 곳에 두르는 초록 고리 */
.tutPulse { position: relative; }
.tutPulse::after {
  content: ''; position: absolute; inset: -6px; border: 3px solid #26d07c; border-radius: 16px; pointer-events: none;
  animation: tutRing 1s ease-in-out infinite;
}
button.tutPulse::after, .chip.tutPulse::after { border-radius: 999px; }
.tutPulse:disabled::after { display: none; }
@keyframes tutRing { 0%, 100% { opacity: 1; scale: 1; } 50% { opacity: 0.35; scale: 1.06; } }
/* 효과: 색종이, 펑 (fx.js가 만든다) */
#fx { position: fixed; inset: 0; z-index: 22; overflow: hidden; pointer-events: none; }
#fx .confetti {
  position: absolute; width: 9px; height: 14px; margin: -7px 0 0 -5px; border-radius: 3px;
  animation: confetti var(--dur) cubic-bezier(0.2, 0.6, 0.4, 1) forwards;
}
#fx .confetti.icon { width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; }
@keyframes confetti {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  35% { transform: translate(calc(var(--dx) * 0.7), var(--up)) rotate(calc(var(--rot) * 0.4)); opacity: 1; }
  100% { transform: translate(var(--dx), calc(var(--up) + var(--fall))) rotate(var(--rot)); opacity: 0; }
}
#fx .confetti.rain { animation: rain var(--dur) linear forwards; }
@keyframes rain {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translate(var(--dx), var(--fall)) rotate(var(--rot)); opacity: 0; }
}
#fx .puffRing {
  position: absolute; width: 80px; height: 80px; margin: -40px 0 0 -40px; border-radius: 50%;
  border: 5px solid #fff; box-shadow: 0 0 0 3px var(--pink-l); animation: puffRing 0.45s ease-out forwards;
}
@keyframes puffRing { 0% { scale: 0.3; opacity: 1; } 100% { scale: 1.5; opacity: 0; } }
#fx .spark { position: absolute; font-style: normal; font-size: 22px; line-height: 1; margin: -11px 0 0 -11px; animation: spark 0.5s ease-out forwards; }
#fx .spark::before { content: '✦'; }
@keyframes spark { 0% { transform: translate(0, 0) scale(0.4); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(1.1); opacity: 0; } }

/* 좁은 화면: 하단 바가 세 줄로 늘어나지 않게 버튼을 조금 줄인다 */
@media (max-width: 1240px) {
  #bar { gap: 6px 10px; padding: 8px 12px 10px; }
  #bar button { font-size: 14px; padding: 5px 11px; }
  #buttons, #topBtns { gap: 6px; }
  #topBtns { padding-left: 10px; }
  .chip.pic img { width: 22px; height: 22px; }
}
/* 낮은 화면: 게임 준비 룸의 '시작하기'가 아래로 밀려나지 않게 */
@media (max-height: 760px) {
  .panel { padding: 16px 24px; }
  .panel h2 { font-size: 24px; margin-bottom: 4px; }
  .panel.room { max-height: 94vh; }
  .seat { min-height: 96px; padding: 6px; }
  .seat img { width: 44px; height: 44px; margin-bottom: 2px; }
  .seat.empty .plus { width: 40px; height: 40px; font-size: 24px; margin-bottom: 4px; }
  .roomHint { margin-bottom: 8px; }
  .roomTools { margin: 10px 0 2px; }
  #roomInfo { margin: 4px 0; }
  .roomBtns button.big { padding: 9px; font-size: 18px; }
}
/* 규칙이 길어도 '닫기'는 스크롤 없이 늘 패널 아래에 보이게 */
#rulesClose { position: sticky; bottom: 0; box-shadow: 0 0 0 8px var(--cream), 0 3px 0 rgb(240 140 180 / 45%); }@media (max-width: 1100px) {
  #bar button { padding: 5px 9px; }
  #recipe { gap: 2px; }
  .chip.pic img { width: 20px; height: 20px; }
}