/* 구구팡 슬라임 – 네온 아케이드 테마 */
:root {
  --bg-top: #3b1580;
  --bg-mid: #12062e;
  --bg-deep: #06020f;
  --card: linear-gradient(160deg, #1d0d4a, #10072b);
  --card-solid: #170a3c;
  --ink: #f2ecff;
  --ink-soft: #b9acdf;
  --pink: #ff4fd8;
  --pink-soft: #ff8be6;
  --cyan: #4ff0ff;
  --cyan-soft: #bff8ff;
  --violet: #7a5cff;
  --yellow: #ffe45c;
  --green: #5cffa1;
  --red: #ff5d7a;
  --glass: rgba(255, 255, 255, 0.07);
  --glass-line: rgba(255, 255, 255, 0.16);
  --neon-border: linear-gradient(135deg, var(--pink), var(--violet) 50%, var(--cyan));
  --glow-pink: 0 0 22px rgba(255, 79, 216, 0.45), 0 0 50px rgba(79, 240, 255, 0.18);
  --font: "Jua", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --digits: "Orbitron", "Jua", sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1.5px 1.5px at 20% 30%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 70% 20%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 85% 70%, #cdf 50%, transparent 51%),
    radial-gradient(1px 1px at 40% 80%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 10% 85%, #fdf 50%, transparent 51%),
    radial-gradient(1px 1px at 55% 50%, #fff 50%, transparent 51%),
    radial-gradient(ellipse at 50% 0%, var(--bg-top) 0%, var(--bg-mid) 55%, var(--bg-deep) 100%);
  background-attachment: fixed;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  word-break: keep-all;
}

button, input, select { font-family: inherit; color: inherit; }

.screen {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  overflow-y: auto;
  padding: 16px;
}
.screen.active { display: flex; align-items: center; justify-content: center; }
#screen-game.active { display: block; padding: 0; overflow: hidden; }

/* ---------- 네온 카드 ---------- */
.menu-card, .panel, .qbox, .modal {
  border: 3px solid transparent;
  background: var(--card) padding-box, var(--neon-border) border-box;
  box-shadow: var(--glow-pink);
}
.menu-card {
  border-radius: 28px;
  padding: 26px 24px 22px;
  width: min(460px, 100%);
  text-align: center;
  margin: auto;
}

.logo {
  font-size: 46px;
  margin: 6px 0 0;
  letter-spacing: 1px;
  color: var(--cyan-soft);
  text-shadow: 0 0 10px var(--cyan), 0 0 26px rgba(79, 240, 255, 0.7);
}
.logo span { color: #ffd0f5; text-shadow: 0 0 10px var(--pink), 0 0 26px rgba(255, 79, 216, 0.75); }
.subtitle { margin: 4px 0 18px; color: var(--ink-soft); font-size: 18px; }
.title-sm {
  margin: 0 0 12px;
  font-size: 30px;
  color: var(--cyan-soft);
  text-shadow: 0 0 10px var(--cyan);
}

.logo-slimes { display: flex; justify-content: center; gap: 6px; }
.logo-slimes canvas { animation: bob 1.6s ease-in-out infinite; filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.25)); }
.logo-slimes canvas:nth-child(2) { animation-delay: 0.2s; }
.logo-slimes canvas:nth-child(3) { animation-delay: 0.4s; }
.logo-slimes canvas:nth-child(4) { animation-delay: 0.6s; }
.logo-slimes canvas:nth-child(5) { animation-delay: 0.8s; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

.menu-section h2 { font-size: 18px; margin: 4px 0 8px; color: var(--ink-soft); letter-spacing: 1px; }

/* ---------- 입력칸 ---------- */
.id-fields input, .create-room input, .create-room select {
  width: 100%;
  min-width: 0;
  border: 2px solid rgba(79, 240, 255, 0.35);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 17px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--ink);
  outline: none;
}
.id-fields input::placeholder, .create-room input::placeholder { color: rgba(185, 172, 223, 0.6); }
.id-fields input:focus, .create-room input:focus, .create-room select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 12px rgba(79, 240, 255, 0.45);
}
.create-room select option { background: var(--card-solid); }

/* ---------- 버튼 ---------- */
.btn-row { display: flex; gap: 10px; justify-content: center; margin-bottom: 10px; }
.btn-row.wide > .btn { flex: 1; min-width: 0; }

.btn {
  border: 1.5px solid var(--glass-line);
  border-radius: 16px;
  padding: 13px 16px;
  font-size: 20px;
  cursor: pointer;
  background: var(--glass);
  color: var(--ink);
  white-space: nowrap;
  transition: transform 0.08s, box-shadow 0.15s, filter 0.15s;
}
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: translateY(2px); }
.btn:disabled { opacity: 0.4; cursor: default; transform: none; filter: none; }
.btn.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--pink), var(--violet));
  color: #fff;
  box-shadow: 0 0 16px rgba(255, 79, 216, 0.55);
}
.btn.soft { border-color: rgba(79, 240, 255, 0.45); color: var(--cyan-soft); box-shadow: inset 0 0 10px rgba(79, 240, 255, 0.15); }
.btn.small { font-size: 16px; padding: 8px 14px; }
.btn.lv { flex: 1; color: #fff; font-size: 22px; border-color: transparent; }
.btn.lv.easy { background: linear-gradient(135deg, #2ee88a, #13a86a); box-shadow: 0 0 14px rgba(46, 232, 138, 0.55); }
.btn.lv.normal { background: linear-gradient(135deg, #4fb2ff, #3a62ff); box-shadow: 0 0 14px rgba(79, 178, 255, 0.55); }
.btn.lv.hard { background: linear-gradient(135deg, #ff6b8a, #e0287a); box-shadow: 0 0 14px rgba(255, 93, 122, 0.6); }

/* ---------- 게임 방법 ---------- */
.howto { text-align: left; width: min(560px, 100%); }
.howto .title-sm { text-align: center; }
.howto ol { padding-left: 22px; line-height: 1.6; font-size: 17px; }
.howto b { color: var(--pink-soft); font-weight: normal; }
.keys { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 16px; }
.keys th, .keys td { padding: 6px 10px; border-bottom: 1px solid var(--glass-line); text-align: left; }
.keys th { width: 40%; color: var(--cyan); font-weight: normal; }
.tip { color: var(--ink-soft); font-size: 15px; }
.howto .btn { display: block; margin: 8px auto 0; }

/* ---------- 로비 / 방 ---------- */
.lobby, .room { width: min(560px, 100%); }
.lobby-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.me-name { color: var(--ink-soft); }
.create-room { display: flex; gap: 8px; margin-bottom: 14px; }
.create-room input { flex: 1; }
.create-room select { flex: 0 0 auto; width: auto; }
.create-room .btn { flex: 0 0 auto; font-size: 18px; padding: 10px 14px; }

.room-list, .player-list {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  max-height: 46vh;
  overflow-y: auto;
  text-align: left;
}
.room-list li, .player-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  margin-bottom: 8px;
}
.room-list .r-title { flex: 1; min-width: 0; font-size: 19px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-list .r-host { color: var(--ink-soft); font-size: 14px; display: block; }
.room-list .r-count { color: var(--ink-soft); white-space: nowrap; }
.room-list .r-badge { font-size: 13px; padding: 3px 8px; border-radius: 10px; background: var(--yellow); color: #3a2a00; white-space: nowrap; }
.room-list .btn { font-size: 16px; padding: 8px 14px; }
.room-list .empty { justify-content: center; color: var(--ink-soft); background: transparent; border: 0; }

.room-sub { color: var(--ink-soft); margin: -6px 0 14px; }
.player-list li { font-size: 20px; }
.player-list .p-name { flex: 1; min-width: 0; }
.player-list .p-school { color: var(--ink-soft); font-size: 14px; margin-left: 4px; }
.player-list .p-tag { font-size: 14px; padding: 3px 10px; border-radius: 10px; background: rgba(122, 92, 255, 0.35); color: var(--ink); white-space: nowrap; }
.player-list .p-tag.ready { background: #13a86a; box-shadow: 0 0 10px rgba(46, 232, 138, 0.5); }
.player-list .p-tag.host { background: linear-gradient(90deg, var(--pink), var(--violet)); }
.player-list .p-dot { width: 26px; height: 26px; border-radius: 9px; flex: 0 0 auto; box-shadow: 0 0 10px currentColor; }
.status-msg { min-height: 22px; color: var(--ink-soft); margin: 4px 0 10px; }

/* ---------- 게임 화면 ---------- */
.arena-fit {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.arena {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 14px;
  transform-origin: center center;
}

.panel {
  border-radius: 22px;
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  position: relative;
}
.panel.self { box-shadow: 0 0 30px rgba(255, 79, 216, 0.75), 0 0 70px rgba(79, 240, 255, 0.3); }
.panel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; min-height: 88px; }
/* width: 0 + flex: 1 → 긴 닉네임이 판 폭을 넓히지 않고 "…"로 줄어듦 */
.panel-who { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; flex: 1; width: 0; min-width: 0; }
.panel-school {
  font-size: 13px;
  padding: 3px 10px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--pink), var(--violet));
  box-shadow: 0 0 10px rgba(255, 79, 216, 0.6);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.panel-school:empty { display: none; }
.panel-name {
  font-size: 22px;
  color: var(--cyan-soft);
  text-shadow: 0 0 6px rgba(79, 240, 255, 0.9), 0 0 12px rgba(79, 240, 255, 0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  /* 빛이 잘리지 않도록 안쪽 여백을 두고, 그만큼 바깥으로 당김 */
  padding: 6px 8px;
  margin: -6px -8px;
  max-width: calc(100% + 16px);
}
.panel-name small { font-size: 13px; color: var(--ink-soft); text-shadow: none; margin-left: 4px; }
.panel.small .panel-name { font-size: 16px; }
.panel.small .panel-head { min-height: 70px; }

/* 다음 / 그다음 슬라임 상자 */
.panel-next { display: flex; gap: 6px; align-items: flex-end; flex: 0 0 auto; }
.nslot {
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 12px;
  padding: 3px 6px 6px;
  background: rgba(0, 0, 0, 0.35);
  border: 2px solid var(--cyan);
  box-shadow: 0 0 10px rgba(79, 240, 255, 0.55), inset 0 0 10px rgba(79, 240, 255, 0.25);
}
.nslot.second { border-color: var(--pink); box-shadow: 0 0 10px rgba(255, 79, 216, 0.55), inset 0 0 8px rgba(255, 79, 216, 0.25); }
.nslot span { font-size: 10px; color: var(--cyan); margin-bottom: 2px; white-space: nowrap; }
.nslot.second span { color: var(--pink-soft); }
.nslot canvas { display: block; }

.board-frame {
  border-radius: 12px;
  padding: 3px;
  background: linear-gradient(180deg, var(--cyan), var(--violet), var(--pink));
  box-shadow: 0 0 16px rgba(122, 92, 255, 0.7);
}
.panel canvas.board { border-radius: 9px; display: block; }
.panel-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 3px; }
.panel-foot span:first-child { font-size: 13px; color: #c9b8ff; letter-spacing: 1px; }
.panel-score {
  font-family: var(--digits);
  font-weight: 900;
  font-size: 22px;
  color: var(--yellow);
  text-shadow: 0 0 10px #ffb800;
  letter-spacing: 2px;
}
.panel.small .panel-score { font-size: 15px; letter-spacing: 1px; }
.panel-qtag {
  position: absolute;
  left: 50%;
  top: 48%;
  transform: translate(-50%, -50%);
  background: rgba(20, 8, 60, 0.92);
  border: 1.5px solid var(--pink);
  color: #ffd6f6;
  border-radius: 12px;
  padding: 6px 12px;
  font-size: 17px;
  box-shadow: 0 0 12px rgba(255, 79, 216, 0.6);
  white-space: nowrap;
  display: none;
}
.panel-qtag.show { display: block; }

.opp-area { display: flex; gap: 14px; align-items: flex-start; }

.center-col {
  width: 250px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
}
.mode-label, .mini-stats {
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: 14px;
  color: var(--ink);
}
.mode-label { text-align: center; padding: 8px; font-size: 18px; }

.qbox {
  border-radius: 22px;
  padding: 14px;
  min-height: 330px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.q-idle { text-align: center; color: var(--ink-soft); }
.q-idle-title { font-size: 22px; color: var(--cyan-soft); text-shadow: 0 0 10px var(--cyan); margin-bottom: 6px; }
.q-idle b { color: var(--pink-soft); font-weight: normal; }
.q-active { display: none; text-align: center; }
.qbox.asking .q-idle { display: none; }
.qbox.asking .q-active { display: block; }
.qbox.asking {
  background: linear-gradient(#1a0b44, #12073a) padding-box, linear-gradient(135deg, var(--yellow), var(--pink)) border-box;
  animation: glow 1s ease-in-out infinite;
}
@keyframes glow {
  0%, 100% { box-shadow: 0 0 18px rgba(255, 228, 92, 0.4); }
  50% { box-shadow: 0 0 34px rgba(255, 228, 92, 0.8); }
}
.q-label { color: var(--yellow); font-size: 16px; }
.q-expr { font-size: 38px; margin: 4px 0; white-space: nowrap; }
.q-expr #q-a, .q-expr #q-b { color: var(--cyan); text-shadow: 0 0 10px var(--cyan); }
.q-input {
  display: inline-block;
  min-width: 70px;
  border-bottom: 4px solid var(--pink);
  color: var(--pink-soft);
  text-shadow: 0 0 10px var(--pink);
}
.q-feedback { min-height: 40px; font-size: 15px; color: var(--ink-soft); line-height: 1.3; }
.q-feedback.bad { color: #ff8aa0; }
.q-feedback.good { color: var(--green); font-size: 22px; text-shadow: 0 0 10px rgba(92, 255, 161, 0.7); }
.qbox.shake { animation: shake 0.35s; }
@keyframes shake {
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.keypad button {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(79, 240, 255, 0.55);
  color: #dffbff;
  font-size: 24px;
  padding: 8px 0;
  cursor: pointer;
  box-shadow: inset 0 0 8px rgba(79, 240, 255, 0.2);
}
.keypad button:active { background: rgba(79, 240, 255, 0.25); }
.keypad .k-del { font-size: 16px; }
.keypad .k-ok {
  background: linear-gradient(135deg, var(--pink), var(--violet));
  border-color: transparent;
  color: #fff;
  font-size: 18px;
  box-shadow: 0 0 12px rgba(255, 79, 216, 0.6);
}
.keypad.locked button { opacity: 0.45; }

.mini-row { display: flex; flex-direction: column; gap: 12px; }
.mini-stats { padding: 8px 12px; font-size: 15px; line-height: 1.5; color: var(--ink-soft); }
.mini-stats b { color: var(--yellow); font-weight: normal; }
.mini-stats .lb { display: block; }

/* 터치 조작 */
.touch-controls {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: none;
  justify-content: center;
  gap: 10px;
  padding: 8px 10px 14px;
}
body.touch .touch-controls { display: flex; }
.touch-controls button {
  width: 68px;
  height: 58px;
  border-radius: 18px;
  background: rgba(20, 8, 60, 0.85);
  border: 2px solid rgba(79, 240, 255, 0.6);
  box-shadow: 0 0 12px rgba(79, 240, 255, 0.35), inset 0 0 10px rgba(79, 240, 255, 0.2);
  font-size: 28px;
  color: var(--cyan-soft);
  touch-action: none;
}
.touch-controls button[data-t="down"] { border-color: rgba(255, 79, 216, 0.7); color: #ffd0f5; box-shadow: 0 0 12px rgba(255, 79, 216, 0.4), inset 0 0 10px rgba(255, 79, 216, 0.2); }
.touch-controls button.on { background: rgba(79, 240, 255, 0.3); }
.touch-controls button svg { display: block; margin: auto; pointer-events: none; }

/* 오버레이 */
.overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(6, 2, 20, 0.6);
  z-index: 10;
}
.overlay.show { display: flex; }
#overlay-countdown { background: transparent; pointer-events: none; }
.countdown {
  font-family: var(--digits);
  font-weight: 900;
  font-size: 120px;
  color: #fff;
  text-shadow: 0 0 12px var(--pink), 0 0 40px var(--pink), 0 0 80px var(--violet);
  animation: pop 0.5s;
}
@keyframes pop { from { transform: scale(1.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal {
  border-radius: 28px;
  padding: 26px 26px;
  text-align: center;
  width: min(420px, 92vw);
  animation: pop 0.3s;
}
.modal h2 { font-size: 40px; margin: 0 0 6px; color: var(--yellow); text-shadow: 0 0 12px #ffb800; }
.modal p { color: var(--ink-soft); }
.modal .btn { margin-top: 8px; }
.modal > .btn { display: block; width: 100%; }
.result-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; }
.result-stats div { background: var(--glass); border: 1px solid var(--glass-line); border-radius: 14px; padding: 8px; }
.result-stats b { display: block; font-size: 26px; color: var(--pink-soft); font-weight: normal; text-shadow: 0 0 10px var(--pink); }
.result-stats span { font-size: 14px; color: var(--ink-soft); }

.toast {
  position: fixed;
  left: 50%;
  top: 18px;
  transform: translateX(-50%) translateY(-120px);
  background: rgba(20, 8, 60, 0.95);
  border: 1.5px solid var(--pink);
  box-shadow: 0 0 16px rgba(255, 79, 216, 0.5);
  color: #fff;
  padding: 10px 18px;
  border-radius: 14px;
  z-index: 50;
  transition: transform 0.25s;
  max-width: 90vw;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ---------- 학교 / 닉네임 / 내 기록 ---------- */
.id-fields {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--glass-line);
  border-radius: 16px;
  padding: 8px;
  margin-bottom: 8px;
}
.id-fields > * { min-width: 0; }
.my-record { min-height: 24px; margin-bottom: 14px; font-size: 15px; color: var(--ink-soft); }
.my-record b { color: var(--yellow); font-weight: normal; }

/* 학교 검색 */
.school-pick { position: relative; display: flex; min-width: 0; }
.school-pick input { flex: 1; padding-right: 34px; text-overflow: ellipsis; }
.school-pick.picked input { border-color: var(--green); background: rgba(19, 168, 106, 0.18); color: #c9ffe0; box-shadow: 0 0 10px rgba(92, 255, 161, 0.35); }
.school-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 16px;
  cursor: pointer;
  display: none;
}
.school-pick.picked .school-clear { display: block; }
.school-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 20;
  list-style: none;
  margin: 0;
  padding: 6px;
  background: #1a0b44;
  border: 1.5px solid var(--cyan);
  border-radius: 14px;
  box-shadow: 0 0 20px rgba(79, 240, 255, 0.4), 0 12px 30px rgba(0, 0, 0, 0.5);
  max-height: 260px;
  overflow-y: auto;
  text-align: left;
  display: none;
}
.school-results.show { display: block; }
.school-results li {
  padding: 9px 10px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 17px;
}
.school-results li small { color: var(--ink-soft); font-size: 14px; white-space: nowrap; }
.school-results li.dup small { color: var(--pink-soft); }
.school-results li.active, .school-results li:hover { background: rgba(79, 240, 255, 0.15); }
.school-results li.info { color: var(--ink-soft); cursor: default; justify-content: center; font-size: 15px; }
.school-results li.info:hover { background: transparent; }

/* ---------- 랭킹 ---------- */
.ranking { width: min(560px, 100%); }
.tabs { display: flex; gap: 6px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--glass-line); border-radius: 16px; padding: 5px; margin-bottom: 8px; }
.tabs button {
  flex: 1;
  border: 0;
  border-radius: 12px;
  padding: 10px 0;
  font-size: 18px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
}
.tabs button.on { background: linear-gradient(135deg, var(--pink), var(--violet)); color: #fff; box-shadow: 0 0 12px rgba(255, 79, 216, 0.5); }
.rank-note { color: var(--ink-soft); font-size: 14px; min-height: 20px; margin: 4px 0 8px; }
.rank-list {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  max-height: 52vh;
  overflow-y: auto;
  text-align: left;
}
.rank-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  margin-bottom: 6px;
}
.rank-list li.me { border-color: var(--yellow); box-shadow: 0 0 14px rgba(255, 228, 92, 0.45); background: rgba(255, 228, 92, 0.1); }
.rank-list .rk {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(122, 92, 255, 0.35);
  font-family: var(--digits);
  font-weight: 900;
  font-size: 14px;
  flex: 0 0 auto;
}
.rank-list li.top1 .rk { background: #ffd23f; color: #4a3200; box-shadow: 0 0 12px rgba(255, 210, 63, 0.7); }
.rank-list li.top2 .rk { background: #d9dee8; color: #3a4253; box-shadow: 0 0 10px rgba(217, 222, 232, 0.5); }
.rank-list li.top3 .rk { background: #f1b98a; color: #5a2b08; box-shadow: 0 0 10px rgba(241, 185, 138, 0.5); }
.rank-list .who { flex: 1; min-width: 0; }
.rank-list .who div { font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-list .who small { color: var(--ink-soft); font-size: 13px; }
.rank-list .val { text-align: right; white-space: nowrap; }
.rank-list .val b { display: block; font-size: 20px; color: var(--yellow); font-weight: normal; text-shadow: 0 0 8px rgba(255, 184, 0, 0.7); }
.rank-list .val small { color: var(--ink-soft); font-size: 13px; }
.rank-list .empty { justify-content: center; color: var(--ink-soft); background: transparent; border: 0; }

/* ---------- 좁은 화면 (휴대폰 메뉴) ---------- */
@media (max-width: 480px) {
  .screen { padding: 12px; }
  .menu-card { padding: 20px 16px 18px; border-radius: 24px; }
  .logo { font-size: 38px; }
  .subtitle { font-size: 16px; }
  .id-fields { grid-template-columns: minmax(0, 1fr); }
  .btn { font-size: 18px; padding: 12px 10px; }
  .btn.lv { font-size: 20px; }
  .btn-row { gap: 8px; }
  .create-room { flex-wrap: wrap; }
  .create-room input { flex-basis: 100%; }
  .create-room select { flex: 1; }
  .create-room .btn { flex: 2; }
}
@media (max-width: 360px) {
  .btn { font-size: 16px; padding: 11px 6px; }
}

/* ---------- 세로 화면 (휴대폰) 게임 ----------
   위: 두 보드를 나란히 크게
   아래(dock): 평소에는 큰 조작 버튼, 곱셈 문제가 나오면 큰 키패드로 바뀜 */
.dock { display: none; }
body.portrait .dock {
  --dock-h: 150px; /* 실제 높이는 화면에 맞춰 main.js 가 정함 */
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--dock-h);
  padding: 6px 10px max(10px, env(safe-area-inset-bottom));
}
body.portrait .center-col { width: auto; gap: 6px; display: flex; flex-direction: column; }
body.portrait .mode-label,
body.portrait .q-idle,
body.portrait .q-label { display: none; }
body.portrait .qbox { display: none; min-height: 0; padding: 8px 10px; }
body.portrait.asking .qbox { display: flex; flex: 1; }
body.portrait.asking .center-col { flex: 1; }
body.portrait.asking .touch-controls { display: none; }
/* 세로 화면에서는 게임 중 기록(푼 문제·정답률)을 숨기고 결과 창에서만 보여 줌 */
body.portrait .mini-row { display: none !important; }
body.portrait .mini-row { flex-direction: row; align-items: center; gap: 8px; }
body.portrait .mini-stats { flex: 1; padding: 6px 10px; font-size: 13px; line-height: 1.35; }
body.portrait .mini-stats .lb { display: inline; }
body.portrait .mini-stats .lb::before { content: " · "; }
body.portrait .mini-row .btn { flex: 0 0 auto; }
body.portrait .touch-controls { display: flex; position: static; flex: 1; padding: 0; gap: 8px; }
body.portrait .touch-controls { align-items: stretch; }
body.portrait .touch-controls button { flex: 1; width: auto; height: auto; min-height: 0; font-size: 30px; }
/* 문제가 나오면: 왼쪽은 문제, 오른쪽은 7 8 9 / 4 5 6 / 1 2 3 / 지우기 0 확인 키패드 */
body.portrait .qbox.asking .q-active {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  height: 100%;
}
body.portrait .q-expr { font-size: 30px; margin: 0; white-space: nowrap; }
body.portrait .q-input { display: block; width: 78%; margin: 2px auto 0; min-height: 38px; }
body.portrait .q-feedback { min-height: 0; margin-top: 6px; font-size: 13px; }
body.portrait .q-feedback.good { font-size: 18px; }
body.portrait .qbox.asking .q-active { grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr); }
/* 키패드: 1 2 3 / 4 5 6 / 7 8 9 / 지우기 0 확인 (전화 다이얼 순서) */
body.portrait .keypad { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(4, 1fr); gap: 5px; height: 100%; }
body.portrait .qbox.asking .q-active { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); }
body.portrait .q-expr { font-size: 34px; }
body.portrait .keypad button { font-size: 22px; padding: 0; }
body.portrait .keypad .k-del { font-size: 14px; }
body.portrait .keypad .k-ok { font-size: 16px; }
@media (max-height: 640px) {
  body.portrait .q-expr { font-size: 26px; }
}
/* 세로 화면: 그만하기는 상대 판 아래 빈 곳에 작게 */
body.portrait #opp-area .btn { font-size: 14px; padding: 7px 8px; align-self: stretch; }

/* 세로 화면: 판을 촘촘하게, 상대가 여럿이면 오른쪽에 세로로 쌓기 */
body.portrait .arena { gap: 10px; padding: 6px; }
body.portrait .panel { padding: 8px 9px 9px; }
body.portrait .panel-head { min-height: 0; }
.opp-area.stack { flex-direction: column; gap: 8px; }
.panel.tiny { padding: 6px 7px 7px; gap: 3px; border-radius: 14px; }
.panel.tiny .panel-next,
.panel.tiny .panel-foot span:first-child { display: none; }
.panel.tiny .panel-head { min-height: 0; }
.panel.tiny .panel-name { font-size: 13px; padding: 2px 4px; margin: -2px -4px; }
.panel.tiny .panel-school { font-size: 10px; padding: 1px 6px; }
.panel.tiny .board-frame { padding: 2px; border-radius: 8px; }
.panel.tiny canvas.board { border-radius: 6px; }
.panel.tiny .panel-foot { justify-content: center; }
.panel.tiny .panel-score { font-size: 11px; letter-spacing: 0; }
.panel.tiny .panel-qtag { font-size: 11px; padding: 3px 6px; }
body.portrait .q-left { overflow: hidden; max-height: 100%; }

/* ---------- 전체 화면 버튼 / 카카오톡 안내 ---------- */
.menu-tools { display: flex; flex-wrap: wrap; justify-content: flex-end; margin: -8px -6px 12px; min-height: 0; }
.menu-tools .btn { font-size: 13px; padding: 6px 10px; }
.menu-tools .btn[hidden] { display: none; }
.inapp-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -6px 0 10px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(255, 228, 92, 0.12);
  border: 1px solid var(--yellow);
  color: #fff3b0;
  font-size: 13px;
  text-align: left;
}
.inapp-banner[hidden] { display: none; }
.inapp-banner span { flex: 1; }
.inapp-banner .btn { flex: 0 0 auto; font-size: 13px; padding: 7px 10px; }

/* ---------- QR 공유 ---------- */
.qr-overlay { position: fixed; z-index: 50; background: rgba(6, 2, 20, 0.82); padding: 16px; }
.qr-modal { width: min(560px, 100%); max-height: 100%; overflow-y: auto; }
.qr-modal h2 { font-size: clamp(26px, 6vw, 38px); }
.qr-modal p { margin: 0 0 12px; }
.qr-img {
  display: block;
  width: min(100%, 62vh, 420px);
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 0 0 4px var(--cyan), 0 0 28px rgba(79, 240, 255, 0.55);
}
.qr-url {
  margin: 14px 0 4px;
  font-size: clamp(16px, 4.2vw, 24px);
  color: var(--cyan-soft);
  word-break: break-all;
  user-select: all;
}

/* ---------- 첫 화면 통계 ---------- */
.play-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 14px;
}
.play-stats[hidden] { display: none; }
.play-stats div {
  min-width: 0;
  padding: 8px 4px 7px;
  border-radius: 14px;
  background: var(--glass);
  border: 1.5px solid rgba(79, 240, 255, 0.45);
  box-shadow: 0 0 10px rgba(79, 240, 255, 0.18), inset 0 0 12px rgba(79, 240, 255, 0.08);
}
.play-stats div:nth-child(2) { border-color: rgba(255, 79, 216, 0.5); box-shadow: 0 0 10px rgba(255, 79, 216, 0.2), inset 0 0 12px rgba(255, 79, 216, 0.08); }
.play-stats div:nth-child(3) { border-color: rgba(255, 228, 92, 0.5); box-shadow: 0 0 10px rgba(255, 228, 92, 0.2), inset 0 0 12px rgba(255, 228, 92, 0.08); }
.play-stats b {
  display: block;
  font-size: 24px;
  font-weight: normal;
  line-height: 1.1;
  color: #fff;
  white-space: nowrap;
  text-shadow: 0 0 8px var(--cyan);
}
.play-stats div:nth-child(2) b { text-shadow: 0 0 8px var(--pink); }
.play-stats div:nth-child(3) b { text-shadow: 0 0 8px var(--yellow); }
.play-stats span { font-size: 13px; color: var(--ink-soft); white-space: nowrap; }

/* ---------- 온라인 서버를 쓸 수 없을 때 ---------- */
.busy-bar {
  display: block;
  width: 100%;
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1.5px solid rgba(255, 228, 92, 0.6);
  background: rgba(255, 228, 92, 0.08);
  box-shadow: 0 0 12px rgba(255, 228, 92, 0.25), inset 0 0 12px rgba(255, 228, 92, 0.08);
  color: #fff6c2;
  font: inherit;
  font-size: 15px;
  line-height: 1.45;
  text-align: center;
  word-break: keep-all;
  cursor: pointer;
}
.busy-bar[hidden] { display: none; }
.busy-bar b { color: var(--yellow); font-weight: normal; text-shadow: 0 0 8px rgba(255, 228, 92, 0.7); }
.busy-modal { text-align: center; word-break: keep-all; }
.busy-icon {
  font-size: 46px;
  line-height: 1;
  margin-bottom: 6px;
  filter: drop-shadow(0 0 10px rgba(255, 228, 92, 0.7));
  animation: busy-flicker 2.4s infinite;
}
@keyframes busy-flicker {
  0%, 100% { opacity: 1; }
  46% { opacity: 1; }
  48% { opacity: 0.35; }
  50% { opacity: 1; }
  53% { opacity: 0.5; }
  55% { opacity: 1; }
}
.busy-modal #busy-text { white-space: pre-line; }
.busy-modal #busy-text b { color: var(--yellow); font-weight: normal; }
.busy-ok { color: var(--cyan-soft); text-shadow: 0 0 8px rgba(79, 240, 255, 0.5); }
.busy-guest { font-size: 14px; color: var(--ink-soft); }

/* ---------- 운영자: 오늘 현황 ---------- */
.admin-modal { text-align: center; }
.admin-day { color: var(--ink-soft); font-size: 15px; }
.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 6px 0 12px;
}
.admin-item {
  padding: 10px 8px 9px;
  border-radius: 14px;
  background: var(--glass);
  border: 1.5px solid rgba(79, 240, 255, 0.4);
  box-shadow: 0 0 10px rgba(79, 240, 255, 0.15), inset 0 0 12px rgba(79, 240, 255, 0.06);
  word-break: keep-all;
}
.admin-item span { display: block; font-size: 14px; color: var(--ink-soft); }
.admin-item b { display: block; font-size: 30px; font-weight: normal; color: #fff; text-shadow: 0 0 10px var(--cyan); line-height: 1.2; }
.admin-item small { display: block; font-size: 13px; color: var(--cyan-soft); }
.admin-item:first-child { border-color: rgba(255, 228, 92, 0.6); }
.admin-item:first-child b { text-shadow: 0 0 10px var(--yellow); }
.admin-loading { grid-column: 1 / -1; color: var(--ink-soft); }
.admin-note { font-size: 13px; color: var(--ink-soft); }

/* ---------- 만든 사람 표시 (메뉴 아래) ---------- */
.maker {
  margin-top: 16px;
  padding: 12px 14px 13px;
  border-radius: 16px;
  border: 1.5px solid transparent;
  background:
    linear-gradient(rgba(23, 10, 60, 0.92), rgba(23, 10, 60, 0.92)) padding-box,
    linear-gradient(90deg, var(--yellow), var(--pink), var(--cyan)) border-box;
  box-shadow: 0 0 14px rgba(255, 228, 92, 0.25);
}
.maker-title { display: flex; align-items: baseline; justify-content: center; gap: 8px; }
.maker-title span { font-size: 14px; color: var(--ink-soft); letter-spacing: 1px; }
.maker-title b {
  font-size: 26px;
  font-weight: normal;
  color: var(--yellow);
  text-shadow: 0 0 10px rgba(255, 184, 0, 0.8), 0 0 22px rgba(255, 79, 216, 0.35);
}
.maker-link {
  display: inline-block;
  margin-top: 4px;
  font-size: 14px;
  color: var(--cyan-soft);
  text-decoration: none;
  border-bottom: 1.5px solid rgba(79, 240, 255, 0.6);
  padding-bottom: 1px;
}
.maker-link:hover, .maker-link:focus-visible { color: #fff; text-shadow: 0 0 8px var(--cyan); border-bottom-color: var(--cyan); }

/* 혼자 연습(세로 화면): 그만하기는 조작 버튼 바로 위 오른쪽 */
.dock-quit { display: none; }
body.portrait .dock-quit:not(:empty) { display: flex; justify-content: flex-end; }
body.portrait.asking .dock-quit { display: none; }
body.portrait .dock-quit .btn { font-size: 14px; padding: 6px 14px; }

/* ---------- 소리 켜기/끄기 ---------- */
.menu-tools { gap: 6px; flex-wrap: wrap; }
.sound-toggle.off, #btn-mute.off { opacity: 0.5; border-style: dashed; }
.game-tools { display: flex; gap: 8px; }
.game-tools #btn-quit { flex: 1; }
.game-tools #btn-mute { flex: 0 0 auto; }

/* ---------- 친구에게 상용구 보내기 ---------- */
.emote-box { margin: 4px 0 12px; }
.emote-log {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}
.emote-log:empty { display: none; }
.emote-log li {
  padding: 5px 10px;
  border-radius: 10px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  font-size: 15px;
  animation: pop 0.25s;
}
.emote-log li b { font-weight: normal; color: var(--cyan-soft); margin-right: 2px; }
.emote-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.emote-btn {
  min-width: 0;
  padding: 8px 4px;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 79, 216, 0.55);
  background: rgba(255, 79, 216, 0.1);
  color: #fff;
  font: inherit;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(255, 79, 216, 0.25);
}
.emote-btn:active { transform: scale(0.95); }
.emote-grid.cooling .emote-btn { opacity: 0.4; pointer-events: none; }
.emote-mute { display: block; margin: 8px auto 0; font-size: 13px; padding: 5px 12px; }
.emote-mute.off { opacity: 0.6; border-style: dashed; }
@media (max-width: 520px) {
  .emote-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 게임 중: 💬 버튼과 고르는 창 */
#btn-emote { flex: 0 0 auto; }
#btn-emote[hidden] { display: none; }
#btn-emote.on { border-color: var(--pink); box-shadow: 0 0 12px rgba(255, 79, 216, 0.6); }
.emote-pop {
  position: fixed;
  left: 50%;
  top: 14%;
  transform: translateX(-50%);
  z-index: 30;
  width: min(440px, calc(100vw - 24px));
  padding: 12px;
  border-radius: 18px;
  background: rgba(20, 8, 60, 0.96);
  border: 1.5px solid var(--pink);
  box-shadow: 0 0 22px rgba(255, 79, 216, 0.5);
  text-align: center;
  animation: pop 0.2s;
}
.emote-pop[hidden] { display: none; }
.emote-pop-title { font-size: 14px; color: var(--ink-soft); margin-bottom: 8px; }
.emote-pop-close {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  color: var(--ink-soft);
  font-size: 18px;
  cursor: pointer;
}

/* 보낸 친구의 판 위 말풍선 */
.panel-bubble {
  position: absolute;
  left: 50%;
  top: 22%;
  transform: translateX(-50%);
  z-index: 5;
  max-width: 94%;
  padding: 7px 12px;
  border-radius: 14px;
  background: #fff;
  color: #2a1060;
  font-size: 17px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.7), 0 0 26px rgba(79, 240, 255, 0.5);
  pointer-events: none;
  animation: bubble 2.5s forwards;
}
.panel.small .panel-bubble { font-size: 14px; padding: 5px 9px; }
.panel.tiny .panel-bubble { font-size: 11px; padding: 3px 6px; border-radius: 9px; }
@keyframes bubble {
  0% { opacity: 0; transform: translate(-50%, 8px) scale(0.8); }
  10% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  85% { opacity: 1; }
  100% { opacity: 0; }
}

/* 결과 화면 */
.result-emotes { margin: 4px 0 6px; }
.result-emotes[hidden] { display: none; }
.result-emotes .emote-btn { font-size: 13px; padding: 7px 2px; }
/* 상용구가 더해져 결과 창이 길어지므로, 작은 휴대폰에서는 창 안에서 스크롤 */
#overlay-result .modal { max-height: calc(100% - 24px); overflow-y: auto; }


/* =====================================================================
   티어 이름표 (롤 랭크처럼 이름 옆에 따라다님)
   각 티어: --t-hi(밝은), --t-mid, --t-lo(어두운), 바탕 --t-bg1→--t-bg2, 테두리 --t-line, 빛 --t-glow
   ===================================================================== */
.t-bronze      { --t-hi: #ffd2ad; --t-mid: #cd7f45; --t-lo: #6b3615; --t-bg1: #3d1f0c; --t-bg2: #7a4219; --t-line: #d98f58; --t-glow: rgba(217, 143, 88, 0.35); --t-ink: #ffe4cf; }
.t-silver      { --t-hi: #ffffff; --t-mid: #b9c6d6; --t-lo: #56657a; --t-bg1: #2a3342; --t-bg2: #5b6a80; --t-line: #dbe4ef; --t-glow: rgba(219, 228, 239, 0.4); --t-ink: #f4f8ff; }
.t-gold        { --t-hi: #fff6c4; --t-mid: #ffc93c; --t-lo: #9a6407; --t-bg1: #4a3000; --t-bg2: #a8740d; --t-line: #ffd75e; --t-glow: rgba(255, 201, 60, 0.6); --t-ink: #fff4c9; }
.t-platinum    { --t-hi: #d6fff7; --t-mid: #3fe0c5; --t-lo: #0d6e62; --t-bg1: #06322e; --t-bg2: #138a7d; --t-line: #6ff7e0; --t-glow: rgba(63, 224, 197, 0.6); --t-ink: #dcfff8; }
.t-diamond     { --t-hi: #eaf4ff; --t-mid: #6aa8ff; --t-lo: #2346b0; --t-bg1: #0e1d5c; --t-bg2: #3264d8; --t-line: #a9d0ff; --t-glow: rgba(106, 168, 255, 0.7); --t-ink: #eef6ff; }
.t-master      { --t-hi: #f7e2ff; --t-mid: #c56bff; --t-lo: #5e169c; --t-bg1: #2a0750; --t-bg2: #7b28cf; --t-line: #e3adff; --t-glow: rgba(197, 107, 255, 0.75); --t-ink: #fbefff; }
.t-grandmaster { --t-hi: #ffe0e0; --t-mid: #ff4f5e; --t-lo: #8a0c1b; --t-bg1: #3d0309; --t-bg2: #c2182c; --t-line: #ff8f99; --t-glow: rgba(255, 79, 94, 0.8); --t-ink: #fff0f1; }
.t-challenger  { --t-hi: #fffbe0; --t-mid: #ffd76a; --t-lo: #1f7fd6; --t-bg1: #0b2a55; --t-bg2: #6b4a00; --t-line: #ffe58a; --t-glow: rgba(120, 220, 255, 0.85); --t-ink: #fffbe8; }

.np-wrap { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-width: 0; vertical-align: middle; flex-wrap: wrap; }
.np {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  min-width: 0;
  padding: 2px 10px 2px 4px;
  border-radius: 10px;
  border: 2px solid var(--t-line);
  background: linear-gradient(135deg, var(--t-bg1), var(--t-bg2) 55%, var(--t-bg1) 120%);
  color: var(--t-ink);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  box-shadow: 0 0 8px var(--t-glow), inset 0 0 8px rgba(255, 255, 255, 0.08);
  overflow: hidden;
  line-height: 1.25;
  white-space: nowrap;
}
.np-name { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.np-suffix { font-size: 0.65em; opacity: 0.8; margin-left: 2px; }
.np-emb { width: 1.45em; height: 1.45em; flex: 0 0 auto; filter: drop-shadow(0 0 3px var(--t-glow)); overflow: visible; }
.np-emb .e-out { fill: var(--t-lo); stroke: var(--t-hi); stroke-width: 1; }
.np-emb .e-in { fill: var(--t-mid); }
.np-emb .e-gem { fill: var(--t-hi); opacity: 0.95; }
.np-emb .e-crown { fill: #ffe066; stroke: #8a5a00; stroke-width: 0.5; }
.np-emb .e-wing { fill: var(--t-mid); opacity: 0.9; }
.np-sm { font-size: 0.85em; padding: 1px 7px 1px 3px; border-width: 1.5px; border-radius: 8px; }
.np-title {
  font-size: 0.72em;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  white-space: nowrap;
  text-shadow: none;
}

/* 골드부터: 금속처럼 반짝이는 바탕 */
.np.t-gold, .np.t-platinum, .np.t-diamond, .np.t-master {
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.28), transparent 38%, transparent 62%, rgba(255, 255, 255, 0.12)),
    linear-gradient(135deg, var(--t-bg1), var(--t-bg2) 55%, var(--t-bg1) 120%);
}
/* 플래티넘부터: 이름 글씨에 빛나는 색 */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .np.t-platinum .np-name, .np.t-diamond .np-name, .np.t-master .np-name,
  .np.t-grandmaster .np-name, .np.t-challenger .np-name {
    background: linear-gradient(180deg, #fff 20%, var(--t-hi) 60%, var(--t-mid));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: none;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.7));
  }
  .np.t-challenger .np-name { background-image: linear-gradient(180deg, #fffbe0 15%, #ffe066 55%, #6ff7ff); }
}

/* 골드부터: 이름표 위로 빛이 스르륵 지나감 */
.np.t-gold::after, .np.t-platinum::after, .np.t-diamond::after,
.np.t-master::after, .np.t-grandmaster::after, .np.t-challenger::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-20deg);
  animation: np-shine 3.2s ease-in-out infinite;
  pointer-events: none;
}
.np.t-diamond::after { animation-duration: 2.6s; }
.np.t-master::after, .np.t-grandmaster::after { animation-duration: 2.2s; }
.np.t-challenger::after { animation-duration: 1.8s; }
@keyframes np-shine { 0% { left: -60%; } 60%, 100% { left: 130%; } }

/* 다이아: 반짝이는 별 */
.np.t-diamond::before {
  content: '✦';
  position: absolute;
  right: 3px;
  top: -2px;
  font-size: 9px;
  color: #fff;
  animation: np-twinkle 1.6s ease-in-out infinite;
}
@keyframes np-twinkle { 0%, 100% { opacity: 0.1; transform: scale(0.6); } 50% { opacity: 1; transform: scale(1.1); } }

/* 마스터: 진한 보랏빛 */
.np.t-master { box-shadow: 0 0 12px var(--t-glow), 0 0 22px rgba(197, 107, 255, 0.35), inset 0 0 10px rgba(255, 255, 255, 0.12); }

/* 그랜드마스터: 불꽃처럼 일렁이는 빛 */
.np.t-grandmaster {
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.22), transparent 40%),
    linear-gradient(135deg, #3d0309, #b3121f 50%, #ff6a2b 115%);
  animation: np-flame 1.4s ease-in-out infinite;
}
.np-emb .e-wing { fill: var(--t-mid); }
.t-challenger .np-emb .e-wing { fill: #ffe066; }
@keyframes np-flame {
  0%, 100% { box-shadow: 0 0 10px var(--t-glow), 0 0 20px rgba(255, 120, 60, 0.35), inset 0 0 10px rgba(255, 180, 120, 0.15); }
  50% { box-shadow: 0 0 16px var(--t-glow), 0 0 30px rgba(255, 140, 60, 0.55), inset 0 0 14px rgba(255, 200, 140, 0.25); }
}

/* 챌린저: 금빛과 하늘빛이 도는 무지개 테두리 */
.np.t-challenger {
  border-color: transparent;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.22), transparent 40%) padding-box,
    linear-gradient(135deg, #2a1660, #123f73 50%, #6b4a00 110%) padding-box,
    linear-gradient(90deg, #ffe066, #6ff7ff, #ff8ae2, #ffe066, #6ff7ff) border-box;
  background-size: 100% 100%, 100% 100%, 300% 100%;
  border-width: 2.5px;
  animation: np-rainbow 2.4s linear infinite, np-chal 2s ease-in-out infinite;
}
@keyframes np-rainbow { from { background-position: 0 0, 0 0, 0% 0; } to { background-position: 0 0, 0 0, 150% 0; } }
@keyframes np-chal {
  0%, 100% { box-shadow: 0 0 12px rgba(255, 224, 102, 0.7), 0 0 24px rgba(111, 247, 255, 0.4); }
  50% { box-shadow: 0 0 18px rgba(111, 247, 255, 0.8), 0 0 34px rgba(255, 138, 226, 0.45); }
}
.np-chip { font-size: 15px; }

/* 게임 판의 이름 자리 */
.panel-name.has-np { text-shadow: none; overflow: visible; padding: 4px; margin: -4px; }
.panel-name.has-np .np-wrap { flex-wrap: nowrap; }
.panel-name.has-np .np { font-size: 20px; }
body.portrait .panel.self .panel-name.has-np .np { font-size: 17px; }
.panel.small .panel-name.has-np .np { font-size: 15px; }
.panel.tiny .panel-name.has-np .np { font-size: 12px; }
.panel-name.has-np .np-title { display: none; }
/* 게임 판: 대표 칭호는 이름표 아래 줄에 작게 */
.panel-title {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
}
.panel-title.admin-title { border-color: #ffe066; background: linear-gradient(90deg, rgba(255, 79, 216, 0.35), rgba(79, 240, 255, 0.3)); }
.panel.small .panel-title, .panel.tiny .panel-title { display: none; }
.player-list .p-name .np-wrap { margin-right: 4px; }
.room-list .r-host .np { font-size: 13px; }
.rank-list .who div { overflow: visible; }
.rank-list .who .np { font-size: 16px; }

/* ---------- 홈 화면 내 티어 카드 ---------- */
.my-record { text-align: left; }
.my-tier {
  padding: 10px 12px 10px;
  border-radius: 16px;
  border: 1.5px solid var(--t-line);
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.15)), linear-gradient(135deg, var(--t-bg1), transparent 70%);
  box-shadow: 0 0 14px var(--t-glow);
}
.mt-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
/* 좁은 화면에서 이름표가 잘리지 않게: 자리가 모자라면 버튼이 아래 줄로 */
.mt-head .mt-btns { margin-left: auto; }
.mt-head > .np-wrap { flex: 1 1 0; min-width: 96px; } /* 칭호는 이름표 아래로 접히고, 그래도 좁으면 버튼이 내려감 */
.mt-head .np { font-size: 19px; }
.mt-book { flex: 0 0 auto; font-size: 13px; padding: 5px 10px; }
.mt-line { margin-top: 6px; font-size: 15px; color: var(--ink); }
.my-tier .mt-tier { font-weight: normal; color: var(--t-hi); text-shadow: 0 0 8px var(--t-glow); }
.mt-rp { color: var(--yellow); }
.mt-bar { height: 9px; margin-top: 5px; border-radius: 99px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.mt-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--t-mid, var(--cyan)), var(--t-hi, #fff)); box-shadow: 0 0 8px var(--t-glow, rgba(79, 240, 255, 0.6)); transition: width 0.9s cubic-bezier(.2, .8, .2, 1); }
.mt-note { display: block; margin-top: 3px; font-size: 12px; color: var(--ink-soft); }
.mt-stats { margin-top: 6px; font-size: 13px; color: var(--ink-soft); }
.mt-stats .mt-item { white-space: nowrap; }

/* ---------- 랭킹: 이번 주 / 전체 ---------- */
.period-tabs { display: flex; justify-content: center; gap: 6px; margin-bottom: 8px; }
.period-tabs button {
  font: inherit;
  font-size: 15px;
  padding: 5px 16px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 228, 92, 0.5);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
}
.period-tabs button.on { background: rgba(255, 228, 92, 0.18); color: var(--yellow); box-shadow: 0 0 10px rgba(255, 228, 92, 0.4); }
.tabs button[hidden] { display: none; }
.rank-list li.champ { justify-content: center; font-size: 15px; color: var(--yellow); border-color: rgba(255, 228, 92, 0.6); background: rgba(255, 228, 92, 0.08); }

/* ---------- 결과 화면: 티어 변화 ---------- */
.result-tier { margin: 8px 0 4px; padding: 10px 12px; border-radius: 16px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--glass-line); }
.result-tier[hidden] { display: none; }
.rt-row { display: flex; align-items: center; justify-content: center; gap: 10px; }
.rt-rp { font-size: 18px; color: var(--ink); }
.rt-diff { font-family: var(--digits); font-weight: 900; font-size: 20px; color: var(--ink-soft); }
.rt-diff.plus { color: #5dff9e; text-shadow: 0 0 10px rgba(93, 255, 158, 0.8); animation: pop 0.5s; }
.rt-diff.minus { color: #ff8f99; }
.result-tier .mt-bar { margin-top: 8px; }
.result-tier .mt-bar i { background: linear-gradient(90deg, var(--cyan), #fff); }
.new-title {
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(255, 79, 216, 0.25), rgba(122, 92, 255, 0.25));
  border: 1.5px solid var(--pink);
  color: #fff;
  font-size: 16px;
  box-shadow: 0 0 12px rgba(255, 79, 216, 0.5);
  animation: pop 0.5s;
}
/* 승급 연출 */
.promo { position: relative; padding: 10px 0 8px; margin-bottom: 6px; text-align: center; overflow: hidden; border-radius: 14px; }
.promo .np-chip { font-size: 26px; padding: 4px 16px 4px 8px; animation: promo-in 0.8s cubic-bezier(.2, 1.6, .4, 1); position: relative; z-index: 1; }
.promo-text { position: relative; z-index: 1; margin-top: 6px; font-size: 24px; color: var(--t-hi); text-shadow: 0 0 12px var(--t-glow), 0 0 24px var(--t-glow); animation: pop 0.6s 0.3s both; }
.promo-burst {
  position: absolute;
  left: 50%;
  top: 40%;
  width: 260px;
  height: 260px;
  margin: -130px 0 0 -130px;
  background: repeating-conic-gradient(from 0deg, var(--t-glow) 0deg 10deg, transparent 10deg 30deg);
  border-radius: 50%;
  -webkit-mask: radial-gradient(circle, #000 20%, transparent 70%);
  mask: radial-gradient(circle, #000 20%, transparent 70%);
  animation: promo-spin 6s linear infinite, promo-fade 0.8s ease-out;
}
@keyframes promo-in { 0% { transform: scale(0.2) rotate(-20deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes promo-spin { to { transform: rotate(360deg); } }
@keyframes promo-fade { from { opacity: 0; transform: scale(0.3); } to { opacity: 1; } }

/* ---------- 칭호 도감 ---------- */
.title-modal { width: min(620px, 100%); max-height: 100%; overflow-y: auto; text-align: left; }
.title-modal h2 { text-align: center; font-size: 30px; }
.title-modal h2 small { font-size: 16px; color: var(--ink-soft); text-shadow: none; }
.title-modal .modal-body > p { text-align: center; margin: 0 0 6px; }
.title-list h3 { margin: 12px 0 6px; font-size: 16px; color: var(--cyan-soft); font-weight: normal; }
.title-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.title-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 8px;
  align-items: center;
  text-align: left;
  padding: 7px 10px;
  border-radius: 12px;
  border: 1.5px solid var(--glass-line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-soft);
  font: inherit;
  cursor: default;
}
.title-card .tc-icon { grid-row: span 2; font-size: 22px; opacity: 0.6; }
.title-card .tc-name { font-size: 15px; }
.title-card .tc-desc { font-size: 11px; opacity: 0.8; }
.title-card.got { color: #fff; border-color: rgba(255, 79, 216, 0.6); background: rgba(255, 79, 216, 0.12); cursor: pointer; }
.title-card.got .tc-icon { opacity: 1; }
.title-card.on { border-color: var(--yellow); box-shadow: 0 0 12px rgba(255, 228, 92, 0.6); background: rgba(255, 228, 92, 0.14); }
.title-card.soon { opacity: 0.55; border-style: dashed; }
@media (max-width: 420px) { .title-grid { grid-template-columns: minmax(0, 1fr); } }

/* =====================================================================
   운영자 이름표 (랭크와 상관없이) — 네온 핑크·하늘·금빛이 도는 테두리 + 빛나는 별
   ===================================================================== */
.t-admin { --t-hi: #fff7c2; --t-mid: #ff4fd8; --t-lo: #1a0630; --t-bg1: #07020f; --t-bg2: #2a0846; --t-line: #ffe066; --t-glow: rgba(255, 79, 216, 0.85); --t-ink: #fff; }
.np.t-admin {
  border: 2.5px solid transparent;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.25), transparent 42%) padding-box,
    linear-gradient(120deg, #07020f, #2a0846 45%, #062a4a 100%) padding-box,
    linear-gradient(90deg, #ff4fd8, #4ff0ff, #ffe066, #ff4fd8, #4ff0ff) border-box;
  background-size: 100% 100%, 100% 100%, 300% 100%;
  animation: np-admin-border 2s linear infinite, np-admin-glow 1.6s ease-in-out infinite;
}
@keyframes np-admin-border { from { background-position: 0 0, 0 0, 0% 0; } to { background-position: 0 0, 0 0, 150% 0; } }
@keyframes np-admin-glow {
  0%, 100% { box-shadow: 0 0 12px rgba(255, 79, 216, 0.85), 0 0 26px rgba(79, 240, 255, 0.35), inset 0 0 10px rgba(255, 79, 216, 0.3); }
  50% { box-shadow: 0 0 18px rgba(79, 240, 255, 0.9), 0 0 34px rgba(255, 224, 102, 0.5), inset 0 0 14px rgba(79, 240, 255, 0.35); }
}
.np.t-admin::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-20deg);
  animation: np-shine 1.6s ease-in-out infinite;
  pointer-events: none;
}
.np.t-admin::before {
  content: '✦ ✧';
  position: absolute;
  right: 4px;
  top: -3px;
  font-size: 9px;
  letter-spacing: 2px;
  color: #fff7c2;
  text-shadow: 0 0 6px #ff4fd8;
  animation: np-twinkle 1.2s ease-in-out infinite;
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .np.t-admin .np-name {
    background: linear-gradient(180deg, #fffbe0 10%, #ffe066 45%, #ff8ae2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: none;
    filter: drop-shadow(0 0 3px rgba(255, 79, 216, 0.9));
  }
}
.np-emb .e-ray { stroke: #ffe066; stroke-width: 1.6; stroke-linecap: round; transform-box: fill-box; transform-origin: center; animation: e-spin 6s linear infinite; }
.np-emb .e-star { fill: #ffe066; stroke: #fff; stroke-width: 0.8; filter: drop-shadow(0 0 2px #ff4fd8); }
.np-emb .e-core { fill: #ff4fd8; }
@keyframes e-spin { to { transform: rotate(360deg); } }
.np-title.admin-title { border-color: #ffe066; background: linear-gradient(90deg, rgba(255, 79, 216, 0.35), rgba(79, 240, 255, 0.3)); }
.my-tier.t-admin { border-color: #ff4fd8; box-shadow: 0 0 16px rgba(255, 79, 216, 0.6), 0 0 30px rgba(79, 240, 255, 0.25); }

/* ---------- 들어가기 (로그인) ---------- */
.login-box[hidden] { display: none; }
.pin-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin: 0 0 6px; }
.pin-row input {
  min-width: 0;
  font: inherit;
  font-size: 18px;
  letter-spacing: 2px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 2px solid rgba(79, 240, 255, 0.55);
  background: rgba(8, 4, 30, 0.75);
  color: #fff;
  outline: none;
}
.pin-row input::placeholder { color: rgba(185, 172, 223, 0.6); letter-spacing: 0; font-size: 16px; }
.pin-row input:focus { border-color: var(--cyan); box-shadow: 0 0 12px rgba(79, 240, 255, 0.5); }
.pin-row .btn { white-space: nowrap; padding-left: 20px; padding-right: 20px; }
.login-help { margin: 0 0 12px; font-size: 13px; color: var(--ink-soft); line-height: 1.5; }
.mt-btns { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; flex: 0 1 auto; max-width: 100%; }
.mt-out, .mt-today { font-size: 13px; padding: 5px 10px; }

/* ---------- 홈 화면 아래 작은 메뉴 ---------- */
.foot-links { margin-top: 10px; display: flex; justify-content: center; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-soft); }
.foot-links button { font: inherit; font-size: 12px; background: none; border: 0; padding: 4px 2px; color: var(--ink-soft); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.foot-links button:hover, .foot-links button:focus-visible { color: #fff; }

/* ---------- 업데이트 안내 · 개인정보처리방침 ---------- */
.doc-modal { width: min(600px, 100%); max-height: 100%; overflow-y: auto; text-align: left; font-size: 15px; line-height: 1.6; }
.doc-modal h2 { text-align: center; font-size: 28px; }
.doc-modal h3 { margin: 14px 0 4px; font-size: 17px; font-weight: normal; color: var(--cyan-soft); }
.doc-modal p, .doc-modal li { color: var(--ink); }
.doc-modal p { margin: 4px 0; }
.doc-modal ul { margin: 4px 0; padding-left: 20px; }
.doc-modal b { color: var(--yellow); font-weight: normal; }
.doc-modal a { color: var(--cyan-soft); }
.doc-date { text-align: center; color: var(--ink-soft) !important; font-size: 13px; margin-top: -4px !important; }
.doc-modal > .btn { margin-top: 14px; }
.notice-item { margin-top: 10px; padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--glass-line); }
.notice-item h3 { margin-top: 0; }
.notice-item.key { border-color: var(--pink); background: rgba(255, 79, 216, 0.1); box-shadow: 0 0 12px rgba(255, 79, 216, 0.3); }
.notice-item.server-up { border-color: var(--yellow); background: rgba(255, 228, 92, 0.09); box-shadow: 0 0 14px rgba(255, 228, 92, 0.35); }
.notice-item.server-up h3 { color: #fff6c2; text-shadow: 0 0 10px rgba(255, 228, 92, 0.8); }
.tier-line { font-size: 13px; color: var(--ink-soft) !important; }

/* 긴 창(칭호 도감·안내·개인정보처리방침): 제목과 닫기 버튼은 그대로, 가운데 내용만 스크롤 */
.title-modal, .doc-modal { display: flex; flex-direction: column; overflow: hidden; max-height: calc(100% - 8px); }
.title-modal > h2, .doc-modal > h2, .title-modal > .btn-row, .doc-modal > .btn { flex: 0 0 auto; }
.modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -8px;
  padding: 0 8px 6px;
  /* 아래로 더 있다는 걸 알 수 있게 끝을 살짝 흐리게 */
  -webkit-mask-image: linear-gradient(#000 calc(100% - 18px), transparent);
  mask-image: linear-gradient(#000 calc(100% - 18px), transparent);
}
.title-modal > .btn-row, .doc-modal > .btn { margin-top: 10px; }

/* ---------- 연쇄 연출: 판 흔들림 + 테두리 번쩍임 ---------- */
.panel.chain-hit { animation: chain-shake 0.45s cubic-bezier(.36, .07, .19, .97); }
.panel.chain-hit .board-frame { animation: chain-flash 0.6s ease-out; }
@keyframes chain-shake {
  0%, 100% { transform: translate(0, 0); }
  15% { transform: translate(calc(var(--sk, 4px) * -1), calc(var(--sk, 4px) * 0.4)); }
  30% { transform: translate(var(--sk, 4px), calc(var(--sk, 4px) * -0.5)); }
  45% { transform: translate(calc(var(--sk, 4px) * -0.7), calc(var(--sk, 4px) * 0.3)); }
  60% { transform: translate(calc(var(--sk, 4px) * 0.5), 0); }
  80% { transform: translate(calc(var(--sk, 4px) * -0.2), 0); }
}
@keyframes chain-flash {
  0% { box-shadow: 0 0 0 3px var(--glow, #ffe14d), 0 0 40px var(--glow, #ffe14d), inset 0 0 30px var(--glow, #ffe14d); }
  100% { box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
  .panel.chain-hit { animation: none; }
}
#btn-guide { flex: 0 0 auto; }
#btn-guide[hidden] { display: none; }
#btn-guide.off { opacity: 0.55; border-style: dashed; }

/* =====================================================================
   구구팡 타임 (대결 1분 30초부터 방해 슬라임 1.5배)
   ===================================================================== */
/* 5초 전 알림 */
.ggp-warn {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 22;
  padding: 6px 18px;
  border-radius: 999px;
  font-size: 17px;
  color: #fff;
  white-space: nowrap;
  background: rgba(20, 4, 34, 0.88);
  border: 2px solid var(--pink);
  box-shadow: 0 0 12px rgba(255, 79, 216, 0.85), inset 0 0 12px rgba(255, 79, 216, 0.35);
  text-shadow: 0 0 6px #ff4fd8;
  pointer-events: none;
}
.ggp-warn[hidden] { display: none; }
.ggp-warn-icon { color: var(--yellow); text-shadow: 0 0 8px #ffb800; }
.ggp-warn b {
  display: inline-block;
  min-width: 1em;
  margin-left: 4px;
  font-family: var(--digits);
  font-weight: 900;
  color: var(--yellow);
  text-shadow: 0 0 6px #fff, 0 0 12px #ffb800;
}
.ggp-warn.tick { animation: ggp-tick 0.9s ease-out; }
@keyframes ggp-tick {
  0% { transform: translateX(-50%) scale(1.22); box-shadow: 0 0 28px #ff4fd8, 0 0 50px rgba(79, 240, 255, 0.6), inset 0 0 16px rgba(255, 79, 216, 0.6); }
  100% { transform: translateX(-50%) scale(1); }
}

/* 시작 연출: 화면 가로로 펼쳐지는 네온 경고 띠 */
.ggp-time {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 21;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.ggp-time.show { display: flex; }
.ggp-time.show::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: radial-gradient(ellipse at center, rgba(255, 79, 216, 0.55), rgba(122, 92, 255, 0.22) 45%, rgba(6, 2, 15, 0) 75%);
  animation: ggp-bg 2.6s ease-out forwards;
}
.ggp-band {
  position: relative;
  width: 100%;
  padding: 22px 12px 20px;
  text-align: center;
  background: linear-gradient(180deg, rgba(10, 2, 25, 0.86), rgba(34, 6, 56, 0.92) 50%, rgba(10, 2, 25, 0.86));
  border-top: 2px solid #ff4fd8;
  border-bottom: 2px solid #4ff0ff;
  box-shadow: 0 0 22px rgba(255, 79, 216, 0.85), 0 0 46px rgba(79, 240, 255, 0.35);
  overflow: hidden;
}
.ggp-time.show .ggp-band { animation: ggp-band 2.6s cubic-bezier(.2, .9, .2, 1) forwards; }
.ggp-stripes {
  position: absolute;
  left: 0;
  right: 0;
  height: 7px;
  opacity: 0.9;
  background: repeating-linear-gradient(-45deg, #ff4fd8 0 10px, rgba(255, 79, 216, 0) 10px 20px);
  box-shadow: 0 0 10px rgba(255, 79, 216, 0.8);
  animation: ggp-stripes 0.5s linear infinite;
}
.ggp-stripes.top { top: 5px; }
.ggp-stripes.bottom {
  bottom: 5px;
  background: repeating-linear-gradient(45deg, #4ff0ff 0 10px, rgba(79, 240, 255, 0) 10px 20px);
  box-shadow: 0 0 10px rgba(79, 240, 255, 0.8);
  animation-direction: reverse;
}
@keyframes ggp-stripes { from { background-position: 0 0; } to { background-position: 28.3px 0; } }
.ggp-title {
  position: relative;
  display: inline-block;
  font-size: 92px;
  font-size: clamp(42px, 13vw, 112px);
  line-height: 1.1;
  letter-spacing: 3px;
  color: #fff;
  text-shadow: 0 0 4px #fff, 0 0 10px #fff, 0 0 18px #ff4fd8, 0 0 36px #ff4fd8, 0 0 64px #ff4fd8, 0 0 100px #7a5cff;
}
.ggp-time.show .ggp-title { animation: ggp-flicker 2.6s linear forwards; }
/* 켜질 때 지지직: 하늘·분홍 글자가 어긋났다 맞춰짐 */
.ggp-title::before, .ggp-title::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0;
  text-shadow: none;
}
.ggp-title::before { color: #4ff0ff; }
.ggp-title::after { color: #ff4fd8; }
.ggp-time.show .ggp-title::before { animation: ggp-glitch-a 0.6s steps(2) 0.1s; }
.ggp-time.show .ggp-title::after { animation: ggp-glitch-b 0.6s steps(2) 0.1s; }
.ggp-desc {
  margin-top: 6px;
  font-size: 22px;
  font-size: clamp(16px, 4.4vw, 28px);
  color: #fff;
  text-shadow: 0 0 6px #4ff0ff, 0 0 14px #4ff0ff;
}
.ggp-desc b { font-family: var(--digits); font-weight: 900; color: var(--yellow); text-shadow: 0 0 6px #fff, 0 0 14px #ffb800; }
@keyframes ggp-bg { 0% { opacity: 0; } 6% { opacity: 1; } 40% { opacity: 0.4; } 100% { opacity: 0; } }
@keyframes ggp-band {
  0% { transform: scaleY(0); opacity: 0; }
  7% { transform: scaleY(1.18); opacity: 1; }
  12% { transform: scaleY(1); }
  86% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(0); opacity: 0; }
}
@keyframes ggp-flicker {
  0%, 5% { opacity: 0; }
  6% { opacity: 1; }
  8% { opacity: 0.2; }
  10% { opacity: 1; }
  12% { opacity: 0.35; }
  15%, 100% { opacity: 1; }
}
@keyframes ggp-glitch-a {
  0% { opacity: 0.8; transform: translate(-5px, 2px); clip-path: inset(10% 0 55% 0); }
  50% { opacity: 0.8; transform: translate(4px, -2px); clip-path: inset(60% 0 8% 0); }
  100% { opacity: 0; transform: none; }
}
@keyframes ggp-glitch-b {
  0% { opacity: 0.8; transform: translate(5px, -2px); clip-path: inset(55% 0 12% 0); }
  50% { opacity: 0.8; transform: translate(-4px, 2px); clip-path: inset(5% 0 62% 0); }
  100% { opacity: 0; transform: none; }
}

/* 구구팡 타임 동안: 판 테두리가 분홍·금빛으로 맥박, 화면 가장자리가 붉게 숨 쉼 */
body.ggp-on .board-frame {
  background: linear-gradient(180deg, #ff4fd8, #ffe45c 50%, #ff4fd8);
  animation: ggp-frame 0.9s ease-in-out infinite;
}
@keyframes ggp-frame {
  0%, 100% { box-shadow: 0 0 14px rgba(255, 79, 216, 0.85); }
  50% { box-shadow: 0 0 26px rgba(255, 79, 216, 1), 0 0 48px rgba(255, 228, 92, 0.5); }
}
body.ggp-on #screen-game::after {
  content: '';
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 4;
  pointer-events: none;
  box-shadow: inset 0 0 70px rgba(255, 40, 140, 0.55);
  animation: ggp-vignette 0.9s ease-in-out infinite;
}
@keyframes ggp-vignette { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .ggp-stripes, body.ggp-on .board-frame, body.ggp-on #screen-game::after { animation: none; }
  .ggp-time.show .ggp-title::before, .ggp-time.show .ggp-title::after { animation: none; }
}
