/* 지뢰찾기 — 초록 회로 기판(금빛 선 · 보라 칩 · 네온 숫자) */
/* ── AAA 공통 꾸밈(숫자 퍼즐 6개가 같은 사본을 쓴다 — 단추 · HUD 느낌 통일). 색은 --k1(주색) --k2(주색 어둠) --k3(곁색) ── */
.k-title { background: none; backdrop-filter: none; padding: 0; overflow: hidden; }
.k-title .k-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.k-wrap { position: relative; width: min(440px, 100%); max-height: 100%; overflow: visible; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 18px 16px 22px; text-align: center; scrollbar-width: none; }
.k-wrap::-webkit-scrollbar { display: none; }
.k-art { position: relative; animation: k-bob 3.2s ease-in-out infinite; }
@keyframes k-bob { 50% { transform: translateY(-7px); } }
.k-logo { position: relative; margin: 0; font-family: var(--logo, var(--title)); font-weight: 400; font-size: clamp(34px, 9.4vw, 62px); line-height: 1.08; letter-spacing: 0.01em; max-width: 100%; text-wrap: balance;
  color: var(--k2); -webkit-text-stroke: 12px var(--k2); filter: drop-shadow(0 6px 0 var(--k2)) drop-shadow(0 14px 18px rgba(0, 0, 0, 0.4)); }
.k-logo::after { content: attr(data-t); position: absolute; inset: 0; -webkit-text-stroke: 0; color: transparent; background: linear-gradient(180deg, #fff 0%, #fff 42%, var(--k-logo2, #ffe08a) 100%); -webkit-background-clip: text; background-clip: text; }
.k-logo.long { font-size: clamp(30px, 7.6vw, 50px); }
.k-wrap > * { max-width: 100%; }
.k-sub { margin: -4px 0 0; font-size: 15px; font-weight: 700; color: rgba(255, 255, 255, 0.88); text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4); max-width: 340px; line-height: 1.4; }
.k-modes { display: flex; gap: 8px; width: 100%; justify-content: center; flex-wrap: wrap; }
.k-modes button { flex: 1 1 0; min-width: 0; max-width: 140px; padding: 9px 4px 8px; border: 0; border-radius: 16px; background: rgba(255, 255, 255, 0.13); color: #fff; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.18), 0 4px 0 rgba(0, 0, 0, 0.25);
  display: flex; flex-direction: column; align-items: center; gap: 2px; line-height: 1.15; transition: transform 0.15s, background 0.15s; cursor: pointer; }
.k-modes button b { font-family: var(--title); font-weight: 400; font-size: 17px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.k-modes button small { font-size: 11px; font-weight: 700; opacity: 0.85; white-space: nowrap; }
.k-modes button.on { background: #fff; color: var(--k2); box-shadow: 0 0 0 3px var(--k3), 0 6px 0 rgba(0, 0, 0, 0.28); transform: translateY(-3px); }
.k-modes button:active { transform: translateY(1px); }
.k-best { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 5px 14px 5px 8px; border-radius: 999px; background: rgba(0, 0, 0, 0.3); color: #ffe08a; font-weight: 800; font-size: 14px; box-shadow: inset 0 0 0 1.5px rgba(255, 224, 138, 0.35); margin: 0; }
.k-best svg { width: 22px; height: 22px; flex: none; fill: currentColor; }
.k-best.none { color: rgba(255, 255, 255, 0.78); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.2); }
/* 크고 도톰한 입체 단추 (눌림 · 반짝임 · 숨쉬기) */
.k-play.big-btn, .k-play { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: min(300px, 100%); min-height: 68px; margin: 6px 0 0; padding: 0 28px; border: 0; border-radius: 22px; overflow: hidden; cursor: pointer;
  font-family: var(--title); font-weight: 400; font-size: 30px; letter-spacing: 0.02em; color: #fff; text-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
  background: linear-gradient(180deg, var(--k-btn1, #7cf08f) 0%, var(--k-btn2, #22b85a) 100%); box-shadow: 0 8px 0 var(--k-btn3, #137a3a), 0 14px 26px rgba(0, 0, 0, 0.35), inset 0 2px 0 rgba(255, 255, 255, 0.55);
  animation: k-breathe 1.8s ease-in-out infinite; transition: transform 0.08s, box-shadow 0.08s; }
.k-play svg { width: 26px; height: 26px; fill: #fff; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.25)); flex: none; }
.k-play::after { content: ''; position: absolute; top: -20%; bottom: -20%; width: 40%; left: -60%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent); transform: skewX(-18deg); animation: k-shine 2.8s ease-in-out infinite; pointer-events: none; }
.k-play:active { transform: translateY(6px) scale(0.98) !important; box-shadow: 0 2px 0 var(--k-btn3, #137a3a), 0 6px 12px rgba(0, 0, 0, 0.3), inset 0 2px 0 rgba(255, 255, 255, 0.4); animation: none; }
@keyframes k-breathe { 50% { transform: scale(1.04); } }
@keyframes k-shine { 0%, 55% { left: -60%; } 85%, 100% { left: 130%; } }
.k-link { display: inline-block; border: 0; background: none; color: rgba(255, 255, 255, 0.8); font-weight: 700; font-size: 14px; padding: 8px 14px; border-radius: 12px; text-decoration: none; cursor: pointer; }
.k-link:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.k-link[hidden] { display: none; }
.k-row { display: flex; gap: 2px; justify-content: center; flex-wrap: wrap; margin-top: 4px; }
/* HUD 알약: 아이콘 + 숫자 */
.k-pill { display: inline-flex; align-items: center; gap: 5px; min-width: 0; height: 40px; padding: 0 10px 0 5px; border-radius: 999px; background: linear-gradient(180deg, rgba(255, 255, 255, 0.17), rgba(255, 255, 255, 0.06)); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.14), 0 4px 10px rgba(0, 0, 0, 0.22); color: #fff; }
.k-pill .ic { width: 29px; height: 29px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--ic, var(--k1)); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.2), inset 0 2px 0 rgba(255, 255, 255, 0.35); }
.k-pill .ic svg { width: 17px; height: 17px; fill: #fff; }
.k-pill b { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-family: Fredoka, var(--title); font-weight: 600; font-size: 19px; line-height: 1.1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.k-pill.bump { animation: k-bump 0.35s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes k-bump { 40% { transform: scale(1.16); } }
/* 결과 카드 */
.k-card.panel { position: relative; width: min(380px, 100%); background: linear-gradient(180deg, var(--k-card1, #2b2f6b), var(--k-card2, #1a1d45)); color: #fff; border-radius: 28px; padding: 30px 22px 18px; margin-top: 40px; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12), 0 28px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2); overflow: visible; animation: k-cardin 0.5s cubic-bezier(.2, 1.4, .4, 1); }
.overlay:has(.k-card) { overflow: auto; }
@keyframes k-cardin { from { transform: translateY(40px) scale(0.85); opacity: 0; } }
.k-card h2 { margin: 2px 0 2px; font-family: var(--logo, var(--title)); font-weight: 400; font-size: 40px; color: #fff; text-shadow: 0 4px 0 var(--k2), 0 8px 18px rgba(0, 0, 0, 0.35); }
.k-card p { color: rgba(255, 255, 255, 0.8); margin: 0 0 6px; }
.k-stars { display: flex; justify-content: center; align-items: flex-end; gap: 6px; margin: -76px 0 4px; height: 86px; }
.k-stars i { width: 62px; height: 62px; display: grid; place-items: center; }
.k-stars i:nth-child(2) { width: 82px; height: 82px; transform: translateY(-10px); }
.k-stars svg { width: 100%; height: 100%; overflow: visible; }
.k-stars .bg { fill: #14163a; stroke: rgba(255, 255, 255, 0.25); stroke-width: 3; }
.k-stars .fg { fill: url(#kStarG); stroke: #b87400; stroke-width: 3; transform-origin: 50px 52px; transform: scale(0); }
.k-stars i.on .fg { animation: k-starin 0.5s cubic-bezier(.2, 1.8, .4, 1) forwards; }
@keyframes k-starin { 0% { transform: scale(2.2) rotate(-30deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
.k-score { font-family: Fredoka, var(--title); font-weight: 600; font-size: 46px; line-height: 1.1; color: #fff; text-shadow: 0 4px 0 rgba(0, 0, 0, 0.3); }
.k-card .stats { margin: 10px 0 8px; }
.k-card .stats div { background: rgba(255, 255, 255, 0.08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1); }
.k-card .stats b { color: #fff; font-family: Fredoka, var(--title); font-weight: 600; }
.k-card .stats span { color: rgba(255, 255, 255, 0.68); }
.k-ribbon { display: inline-block; margin: 4px auto 6px; padding: 6px 22px; font-family: var(--title); font-size: 18px; color: #4a2a00; background: linear-gradient(180deg, #ffe680, #ffb627); border-radius: 8px; box-shadow: 0 4px 0 #b86f00, 0 8px 16px rgba(0, 0, 0, 0.3); transform: rotate(-3deg); animation: k-rib 0.6s cubic-bezier(.2, 1.6, .4, 1) both 1.2s; }
.k-ribbon[hidden] { display: none; }
@keyframes k-rib { from { transform: scale(0) rotate(-20deg); } }
.k-next { font-size: 14px; font-weight: 700; color: #ffe08a !important; min-height: 1.4em; }
.k-card .k-play { width: 100%; font-size: 26px; min-height: 62px; margin-top: 10px; }
/* 처음 하는 사람 안내 손가락 */
.k-hand { position: fixed; z-index: 70; width: 58px; height: 58px; margin: -4px 0 0 -22px; pointer-events: none; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.45)); }
.k-hand svg { width: 100%; height: 100%; }
.k-hand.tap svg { animation: k-tap 0.9s ease-in-out infinite; transform-origin: 40% 10%; }
@keyframes k-tap { 0%, 100% { transform: translate(0, 10px); } 45% { transform: translate(0, 0) scale(0.9); } }
.k-tapring { position: fixed; z-index: 69; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 12px rgba(255, 255, 255, 0.8); pointer-events: none; animation: k-ring 0.9s ease-out infinite; }
@keyframes k-ring { 0%, 40% { transform: scale(0.3); opacity: 0; } 50% { opacity: 1; } 100% { transform: scale(1.4); opacity: 0; } }
.k-tip { position: fixed; z-index: 70; transform: translate(-50%, 0); max-width: 86vw; padding: 7px 14px; border-radius: 14px; background: #fff; color: #1c2140; font-weight: 800; font-size: 14px; text-align: center; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35); pointer-events: none; animation: pop-in 0.3s ease-out; }
@media (prefers-reduced-motion: reduce) { .k-play, .k-art, .k-play::after { animation: none !important; } }
html:not([lang="ko"]) .k-modes button b, html:not([lang="ko"]) .k-play, html:not([lang="ko"]) .k-ribbon, html:not([lang="ko"]) .k-pill b { font-weight: 800; }
.k-play.k-sm { min-height: 50px; width: min(250px, 100%); font-size: 20px; margin-top: 2px; border-radius: 18px; animation: none; box-shadow: 0 6px 0 var(--k-btn3, #137a3a), 0 10px 18px rgba(0, 0, 0, 0.3), inset 0 2px 0 rgba(255, 255, 255, 0.5); }
.k-play.k-sm::after { display: none; }
.k-play.k-sm svg { width: 20px; height: 20px; }
.k-next:empty { display: none; }
@media (max-height: 600px) { .k-wrap { overflow: auto; } }

.stage.ms { --k1: #7b6cff; --k2: #0b2a1f; --k3: #7dffcf; --k-logo2: #b9ffe4; --k-btn1: #9c8cff; --k-btn2: #5a4fe6; --k-btn3: #2f2799; --k-card1: #15392d; --k-card2: #0a1f18;
  justify-content: flex-start;
  gap: 6px;
  padding: 8px 0 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 210, 100, 0.10) 0 3px, transparent 4px) 0 0 / 84px 84px,
    linear-gradient(rgba(125, 255, 207, 0.05) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(125, 255, 207, 0.05) 1px, transparent 1px) 0 0 / 28px 28px,
    radial-gradient(120% 80% at 50% 0%, #17483a 0%, #0c2a21 60%, #07190f 100%);
}
.ms-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.ms .ico { display: block; width: 100%; height: 100%; }

/* 위쪽 줄 */
.ms-hud { flex: none; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 10px; width: 100%; max-width: 560px; }
.ms-box { display: flex; align-items: center; gap: 6px; min-width: 76px; height: 44px; padding: 0 14px 0 9px; border-radius: 999px; background: linear-gradient(180deg, #0a1d16, #06130e); box-shadow: inset 0 0 0 1.5px rgba(125, 255, 207, 0.22), inset 0 2px 8px rgba(0, 0, 0, 0.6), 0 4px 10px rgba(0, 0, 0, 0.3); }
.ms-box b { text-shadow: 0 0 10px currentColor; }
.ms-box b.bump { animation: k-bump 0.35s cubic-bezier(.3, 1.6, .5, 1); }
.ms-box .ico { width: 24px; height: 24px; flex: none; color: #ffb0a6; }
.ms-box b { flex: 1; text-align: right; font-family: var(--title); font-weight: 400; font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
.ms-left b { color: #ff8a7c; }
.ms-clock b { color: #ffd23f; }
.ms-clock .ti { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid #ffd23f; position: relative; opacity: 0.9; }
.ms-clock .ti::before { content: ''; position: absolute; left: 50%; top: 2px; width: 2.5px; height: 6px; margin-left: -1.25px; background: #ffd23f; border-radius: 2px; transform-origin: 50% 100%; animation: ms-tick 4s steps(8) infinite; }
@keyframes ms-tick { to { transform: rotate(360deg); } }
.ms-face { flex: none; width: 54px; height: 54px; padding: 3px; border: 0; border-radius: 18px; background: linear-gradient(#1d4a3c, #0d261e); box-shadow: 0 0 0 2px rgba(125, 255, 207, 0.5), 0 5px 0 #04100b, 0 8px 16px rgba(0, 0, 0, 0.4); transition: transform 0.12s; cursor: pointer; }
.ms-face:active { transform: scale(0.92); }
.ms-face svg, .hero-face svg { display: block; width: 100%; height: 100%; }
.ms-face g, .hero-face g[class^='f-'] { display: none; }
.ms-face[data-f='norm'] .f-norm, .ms-face[data-f='oh'] .f-oh, .ms-face[data-f='dead'] .f-dead, .ms-face[data-f='win'] .f-win { display: inline; }
.hero-face g.f-norm, .hero-face[data-f='win'] g.f-win, .hero-face[data-f='dead'] g.f-dead { display: inline; }
.hero-face[data-f] g.f-norm { display: none; }
.ms-face[data-f='win'] { box-shadow: 0 0 0 2px #3ee0b5, 0 0 18px rgba(62, 224, 181, 0.5); }
.ms-face[data-f='dead'] { box-shadow: 0 0 0 2px #ff6b5a, 0 0 18px rgba(255, 107, 90, 0.45); }
.ms-face .ant { animation: ms-blink 2.4s ease-in-out infinite; }
@keyframes ms-blink { 50% { opacity: 0.45; } }
.ms-tool { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; width: 56px; height: 44px; padding: 0; border: 0; border-radius: 14px; background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.05)); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.12), 0 4px 0 rgba(0, 0, 0, 0.35); cursor: pointer; color: #cfd3ff; font-size: 11px; font-weight: 700; line-height: 1.1; transition: background 0.15s, transform 0.12s, opacity 0.2s; }
.ms-tool:active { transform: scale(0.94); }
.ms-tool .ico { width: 22px; height: 22px; }
.ms-tool .zi { font-style: normal; font-size: 17px; line-height: 22px; height: 22px; }
.ms-tool span { max-width: 52px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ms-tool.on { background: #ffd23f; color: #1c2140; box-shadow: 0 0 0 2px rgba(255, 210, 63, 0.35), 0 4px 14px rgba(255, 210, 63, 0.3); }
.ms-zoombtn.on { background: #7b6cff; color: #fff; box-shadow: 0 4px 14px rgba(123, 108, 255, 0.4); }
.ms-tool.off { opacity: 0.28; pointer-events: none; }
@media (hover: hover) {
  .ms-tool:not(.on):hover { background: rgba(255, 255, 255, 0.14); }
}
@media (max-width: 380px) {
  .ms-hud { gap: 5px; padding: 0 6px; }
  .ms-box { min-width: 64px; padding: 0 9px 0 7px; gap: 4px; }
  .ms-box b { font-size: 23px; }
  .ms-box .ico { width: 20px; height: 20px; }
  .ms-clock .ti { width: 17px; height: 17px; }
  .ms-tool { width: 50px; }
}

/* 판 */
.ms-wrap { flex: 1; min-height: 0; width: 100%; display: flex; overflow: hidden; padding: 8px; }
.ms-wrap.zoomed { overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.ms-board {
  margin: auto; position: relative; display: grid; gap: var(--gap); padding: 8px; border-radius: 16px;
  background: radial-gradient(circle at 0 0, rgba(255, 210, 100, 0.18) 0 2px, transparent 2.5px) 4px 4px / 20px 20px, linear-gradient(160deg, #0f3328, #08201a);
  box-shadow: 0 0 0 2px #c9a24a, 0 0 0 6px #0a1d16, 0 0 0 7px rgba(201, 162, 74, 0.45), 0 22px 44px rgba(0, 0, 0, 0.55);
  touch-action: manipulation; -webkit-touch-callout: none; transition: box-shadow 0.4s;
}
.ms-board.won { box-shadow: 0 0 0 2px #7dffcf, 0 0 0 6px rgba(62, 224, 181, 0.25), 0 0 60px rgba(62, 224, 181, 0.55); }
.ms-board.won .c { animation: ms-wave 0.7s ease-in-out var(--w, 0ms) both; }
@keyframes ms-wave { 40% { transform: translateY(-18%) scale(1.12); filter: brightness(1.5); } }
.ms-board.deal { animation: ms-deal 0.45s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes ms-deal { from { transform: scale(0.85) rotate(-2deg); opacity: 0; } }
.ms-board.lost { box-shadow: 0 0 0 2px rgba(255, 107, 90, 0.7), 0 0 0 6px rgba(255, 107, 90, 0.14), 0 18px 40px rgba(0, 0, 0, 0.45); }
.ms-board.shake { animation: ms-shake 0.45s ease-out; }
@keyframes ms-shake { 15% { transform: translate(-6px, 3px); } 30% { transform: translate(5px, -4px); } 45% { transform: translate(-4px, -2px); } 60% { transform: translate(3px, 3px); } 80% { transform: translate(-1px, 1px); } }

.c {
  position: relative; width: var(--cs); height: var(--cs); display: grid; place-items: center;
  border-radius: calc(var(--cs) * 0.2); cursor: pointer;
  background: linear-gradient(160deg, #9084ff 0%, #6a63f2 55%, #5258e4 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35), inset 0 -3px 0 rgba(22, 26, 70, 0.4), 0 1px 2px rgba(0, 0, 0, 0.35);
  font-family: var(--title); font-weight: 700; font-size: calc(var(--cs) * 0.64); line-height: 1;
  -webkit-touch-callout: none;
}
/* 칩 무늬 */
.c::after { content: ''; position: absolute; inset: 29%; border-radius: calc(var(--cs) * 0.08); border: max(1px, calc(var(--cs) * 0.045)) solid rgba(255, 255, 255, 0.16); pointer-events: none; }
@media (hover: hover) {
  .c:not(.open):not(.mine):hover { filter: brightness(1.13); }
}
.c.press { transform: translateY(1px) scale(0.94); filter: brightness(0.92); box-shadow: inset 0 2px 5px rgba(20, 24, 60, 0.55); }
.c.hold::before { content: ''; position: absolute; inset: -2px; border-radius: inherit; border: 2px solid #ffd23f; opacity: 0; animation: ms-hold 0.38s linear forwards; }
@keyframes ms-hold { from { opacity: 0; transform: scale(1.35); } to { opacity: 1; transform: scale(1); } }
.c.hint { animation: ms-hint 0.42s ease-out; }
@keyframes ms-hint { 40% { filter: brightness(1.6); transform: scale(0.9); } }
.c.nope { animation: ms-nope 0.3s; }
@keyframes ms-nope { 25% { transform: translateX(-2px); } 75% { transform: translateX(2px); } }

/* 열린 칸 */
.c.open {
  cursor: default; background: linear-gradient(180deg, #06150f, #0b2219); box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(125, 255, 207, 0.08);
  animation: ms-open 0.26s ease-out both;
}
.c.open::after, .c.mine::after, .c.flag::after { display: none; }
@keyframes ms-open { from { transform: scale(0.6); background: #8f84ff; opacity: 0.6; } }
.c.n1 { color: #3ee0b5; }
.c.n2 { color: #5cb8ff; }
.c.n3 { color: #ff7a6b; }
.c.n4 { color: #c2b8ff; }
.c.n5 { color: #ffd23f; }
.c.n6 { color: #ff8fd0; }
.c.n7 { color: #ffffff; }
.c.n8 { color: #9aa1c8; }
.c.open[class*=' n'] { cursor: pointer; text-shadow: 0 0 calc(var(--cs) * 0.25) currentColor; }

/* 깃발 */
.c.flag .ico { width: 78%; height: 78%; animation: ms-flag 0.28s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
@keyframes ms-flag { from { transform: translateY(-30%) scale(0.3); opacity: 0; } }
.c.flag.auto { background: linear-gradient(160deg, #4fe8c2, #1fb894); }
.c.flag.wrong { background: #3a2140; }
.c.flag.wrong::before { content: ''; position: absolute; inset: 14%; background: linear-gradient(45deg, transparent 44%, #ff6b5a 44% 56%, transparent 56%), linear-gradient(-45deg, transparent 44%, #ff6b5a 44% 56%, transparent 56%); }
.c.unflag { animation: ms-unflag 0.2s ease-out; }
@keyframes ms-unflag { 50% { transform: scale(0.9); } }

/* 버그(지뢰) */
.c.mine { cursor: default; background: #2b2550; box-shadow: inset 0 0 0 1px rgba(255, 107, 90, 0.25); animation: ms-mine 0.35s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
.c.mine .ico { width: 82%; height: 82%; color: #ffb0a6; }
@keyframes ms-mine { from { transform: scale(0.3); opacity: 0; } }
.c.mine.boom { z-index: 2; background: radial-gradient(circle, #fff1b0 0%, #ffd23f 35%, #ff6b5a 100%); box-shadow: 0 0 0 2px #fff3c4, 0 0 22px 6px rgba(255, 140, 60, 0.75); animation: ms-boom 0.5s ease-out both; }
.c.mine.boom .ico { color: #1c2140; }
@keyframes ms-boom { 0% { transform: scale(1.6); } 60% { transform: scale(0.9); } }

/* 터지는 효과 */
.ms-burst { position: absolute; z-index: 3; width: 0; height: 0; pointer-events: none; }
.ms-burst i { position: absolute; left: 0; top: 0; display: block; }
.ms-burst .ring { width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; border: 4px solid #ffd23f; animation: ms-ring 0.6s ease-out forwards; }
@keyframes ms-ring { to { transform: scale(7); opacity: 0; border-width: 1px; } }
.ms-burst .flash { width: 60px; height: 60px; margin: -30px 0 0 -30px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 245, 200, 0.95), rgba(255, 140, 60, 0.5) 45%, transparent 70%); animation: ms-flash 0.5s ease-out forwards; }
@keyframes ms-flash { from { transform: scale(0.4); } to { transform: scale(2.6); opacity: 0; } }
.ms-burst .spark { width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 2px; background: #ffd23f; box-shadow: 0 0 6px #ff9a3c; transform: rotate(var(--a)); animation: ms-spark 0.75s cubic-bezier(0.2, 0.7, 0.3, 1) forwards; }
.ms-burst .spark:nth-child(3n) { background: #ff6b5a; }
.ms-burst .spark:nth-child(4n) { background: #fff; width: 5px; height: 5px; }
@keyframes ms-spark { to { transform: rotate(var(--a)) translateX(calc(70px * var(--d))) scale(0.3); opacity: 0; } }

/* 깃발 모드일 때 판 테두리 노란빛 */
.ms.flagging .ms-board:not(.won):not(.lost) { box-shadow: 0 0 0 2px rgba(255, 210, 63, 0.75), 0 0 0 6px rgba(255, 210, 63, 0.14), 0 18px 40px rgba(0, 0, 0, 0.45); }

/* 알림 */
.ms-toast { position: absolute; left: 50%; bottom: 18px; z-index: 5; max-width: calc(100% - 32px); padding: 9px 16px; border-radius: 999px; background: rgba(12, 14, 34, 0.92); color: #fff; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1); opacity: 0; transform: translate(-50%, 10px); transition: opacity 0.2s, transform 0.2s; pointer-events: none; }
.ms-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 시작 · 끝 화면 (어두운 판) */
.ms .overlay { background: rgba(3, 14, 10, 0.66); }
.ms .overlay.k-title { background: radial-gradient(110% 80% at 50% 0%, #1b5643 0%, #0c2a21 55%, #05140e 100%); }
.ms .panel:not(.k-card) { background: linear-gradient(170deg, #262b58, #1b1f44); color: #eef0ff; box-shadow: 0 0 0 1px rgba(123, 108, 255, 0.35), 0 24px 60px rgba(0, 0, 0, 0.5); padding: 20px 20px 18px; }
.ms .panel h2 { font-size: 30px; margin: 2px 0 4px; color: #fff; }
.ms .panel p { color: #b9bedf; font-size: 15px; line-height: 1.5; margin-bottom: 10px; }
.ms .panel ul { color: #b9bedf; font-size: 14px; line-height: 1.5; margin: 0 0 12px; padding-left: 18px; }
.ms .panel li { margin: 2px 0; }
.ms .panel li::marker { color: #ffd23f; }
.ms-hero { display: flex; align-items: center; justify-content: center; gap: 10px; height: 60px; }
.ms-hero > .ico { width: 34px; height: 34px; color: #ffb0a6; }
.ms-hero > .ico:first-child { transform: rotate(-14deg); animation: ms-bob 2.2s ease-in-out infinite; }
.ms-hero > .ico:last-child { transform: rotate(10deg); animation: ms-bob 2.2s 1.1s ease-in-out infinite; }
.ms-hero .hero-face { width: 60px; height: 60px; }
@keyframes ms-bob { 50% { translate: 0 -5px; } }
.ms .panel .seg { margin: 4px 0 8px; }
.ms .panel .seg button { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 2px; background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.1); color: #cfd3ff; line-height: 1.2; }
.ms .panel .seg button b { font-size: 15px; }
.ms .panel .seg button small { font-size: 11.5px; opacity: 0.75; font-variant-numeric: tabular-nums; }
.ms .panel .seg button.on { border-color: #7b6cff; background: rgba(123, 108, 255, 0.25); color: #fff; }
.ms-bestline { font-size: 13.5px !important; color: #ffd23f !important; margin: 0 0 6px !important; min-height: 1.4em; }

.ms .sub-btn { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.12); color: #cfd3ff; }
.ms .panel .stats div { background: rgba(0, 0, 0, 0.25); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); }
.ms .panel .stats b { color: #fff; }
.ms .panel .stats span { color: #9aa1c8; }
.ms .is-win .stats div:first-child b { color: #ffd23f; }
.ms .is-lose .stats div:first-child b { color: #ff8a7c; }
.ms .panel .newbest { color: #3ee0b5; font-weight: 800; }
.end-ico { display: flex; align-items: center; justify-content: center; gap: 4px; height: 64px; }
.end-ico .hero-face { width: 64px; height: 64px; animation: pop-in 0.4s cubic-bezier(0.3, 1.6, 0.5, 1); }
.end-ico > .ico { width: 34px; height: 34px; color: #ffb0a6; transform: rotate(18deg); margin-left: -6px; }
.ms .is-win .end-h { color: #3ee0b5; }
.ms .is-lose .end-h { color: #ff8a7c; }
@media (prefers-reduced-motion: reduce) {
  .c, .c .ico, .ms-board, .ms-burst i { animation-duration: 0.01s !important; }
}
/* 낮은 화면(폰 가로) — 위쪽 줄을 작게 */
@media (max-height: 480px) {
  .stage.ms { padding-top: 4px; gap: 2px; }
  .ms-box, .ms-tool { height: 36px; }
  .ms-face { width: 40px; height: 40px; border-radius: 12px; }
  .ms-box b { font-size: 21px; }
  .ms-tool span { display: none; }
  .ms-tool { width: 42px; }
  .ms-wrap { padding: 4px; }
}

/* 제목 화면 */
.ms-tbg .tr { position: absolute; height: 3px; border-radius: 2px; background: linear-gradient(90deg, transparent, rgba(201, 162, 74, 0.5) 20%, rgba(201, 162, 74, 0.5) 80%, transparent); overflow: hidden; }
.ms-tbg .tr::after { content: ''; position: absolute; top: -2px; width: 60px; height: 7px; border-radius: 4px; background: radial-gradient(closest-side, #7dffcf, transparent); animation: ms-pulse 2.6s linear infinite; }
.ms-tbg .t1 { left: 0; right: 40%; top: 18%; } .ms-tbg .t2 { left: 35%; right: 0; top: 74%; } .ms-tbg .t3 { left: 5%; right: 55%; top: 88%; } .ms-tbg .t4 { left: 60%; right: 2%; top: 30%; }
.ms-tbg .t2::after { animation-delay: -1s; animation-duration: 3.4s; } .ms-tbg .t3::after { animation-delay: -2s; } .ms-tbg .t4::after { animation-delay: -0.4s; animation-duration: 2s; }
@keyframes ms-pulse { from { left: -60px; } to { left: 100%; } }
.ms-tbg .chip { position: absolute; width: 54px; height: 54px; border-radius: 10px; background: linear-gradient(160deg, #3a3480, #241f5c); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.08), 0 8px 16px rgba(0, 0, 0, 0.4); opacity: 0.55; }
.ms-tbg .chip::before { content: ''; position: absolute; inset: -6px 8px; border-top: 4px dotted #c9a24a; border-bottom: 4px dotted #c9a24a; opacity: 0.7; }
.ms-tbg .c1 { left: 8%; top: 40%; } .ms-tbg .c2 { right: 6%; top: 84%; transform: scale(1.3); } .ms-tbg .c3 { left: 70%; top: 8%; transform: scale(0.8); }
.ms-hero { position: relative; width: 190px; height: 120px; display: block; margin-top: 6px; }
.ms-hero .radar { position: absolute; left: 50%; top: 50%; width: 150px; height: 150px; margin: -75px 0 0 -75px; border-radius: 50%; border: 2px solid rgba(125, 255, 207, 0.35);
  background: conic-gradient(from 0deg, rgba(125, 255, 207, 0.4), transparent 25%); animation: ms-radar 2.4s linear infinite; }
@keyframes ms-radar { to { transform: rotate(360deg); } }
.ms-hero .hero-face { position: absolute; left: 50%; top: 50%; width: 92px; height: 92px; margin: -46px 0 0 -46px; filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.5)); }
.ms-hero .hb { position: absolute; width: 44px; height: 44px; }
.ms-hero .hb .ico { width: 100%; height: 100%; color: #ffb0a6; }
.ms-hero .hb1 { left: -6px; top: 56px; transform: rotate(-16deg); animation: ms-bob 2.2s ease-in-out infinite; }
.ms-hero .hb2 { right: -4px; top: 8px; transform: rotate(12deg); animation: ms-bob 2.2s 1.1s ease-in-out infinite; }
.ms .k-modes button small { font-variant-numeric: tabular-nums; }
@media (max-height: 640px) { .ms-hero { display: none; } .k-wrap { gap: 8px; } }
/* 결과 카드 */
.ms-endp .k-stars[hidden] { display: none; }
.ms-endp .end-ico { height: 72px; }
.ms-endp .end-ico .hero-face { width: 72px; height: 72px; }
.ms-endp .k-stars:not([hidden]) + .end-ico { display: none; }
.ms .ms-endp .end-h { color: #fff; }
.ms .is-lose .end-h { color: #ffcfc8; text-shadow: 0 4px 0 #5a1414; font-size: 32px; }
.ms-endp .stats b { font-size: 24px; }
.ms-endp .end-msg { font-size: 14px; }
