/* 탭탭! 학교 키우기 NEXT — 기존 게임(styles/game.css)의 "보크셀 장난감 월드" 톤을 그대로 잇는다.
   화면 = 위(내 재화·퀘스트·대항전) / 가운데(살아있는 캠퍼스, 가장 크게) / 아래(선택한 시설 + 탭). */
:root {
  color-scheme: light;
  --sky-1: #3aa8ff; --sky-2: #6ccaff; --sky-3: #b8ecff;
  --ink: #1d2744; --ink-2: #56638a; --ink-3: #8f9bbd;
  --panel: #ffffff; --panel-2: #f1f6ff; --line: #dbe5f7;
  --blue: #2f7bff; --blue-e: #1a55d0; --blue-s: #e3eeff;
  --green: #35c65f; --green-e: #1f9a45; --green-s: #dff8e7;
  --yellow: #ffc933; --yellow-e: #d99a00; --yellow-s: #fff4d1;
  --pink: #ff5c93; --pink-e: #d63b71; --pink-s: #ffe3ee;
  --purple: #8a6cff; --purple-e: #6547e0; --purple-s: #ece6ff;
  --orange: #ff8a3d; --orange-e: #d9651c;
  --red: #ff5a5f;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: "Jua", "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", system-ui, sans-serif;
  --font-display: "Black Han Sans", "Jua", "Apple SD Gothic Neo", system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; background: var(--sky-3); }
body {
  font-family: var(--font); color: var(--ink);
  word-break: keep-all; overflow-wrap: anywhere;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
.num { font-family: var(--font-display); font-weight: 400; font-variant-numeric: tabular-nums; }

.frame {
  position: fixed; left: 50%; top: 0; width: 390px; height: var(--lh, 100vh);
  transform: translateX(-50%) scale(var(--s, 1)); transform-origin: top center; overflow: hidden;
}
/* 화면 비율이 넓은 창(PC)에서 게임 밖 여백 */
html, body { background: linear-gradient(180deg, #3aa8ff, #b8ecff); }
.nx {
  position: absolute; inset: 0;
  display: grid; grid-template-rows: auto 1fr auto;
  background: linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 38%, var(--sky-3) 100%);
}

/* ---------------------------------------------------------------- 위 */
.top { padding: calc(var(--safe-top) + 8px) 12px 6px; display: grid; gap: 6px; z-index: 3; }
.top__row { display: flex; align-items: center; gap: 8px; }
.money { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.coin {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 38% 34%, #fff4d1 0 18%, var(--yellow) 19% 62%, var(--yellow-e) 63%);
  box-shadow: 0 3px 0 rgba(29, 39, 68, 0.25);
}
.coin.is-pulse { animation: coin-pulse 180ms ease-out; }
@keyframes coin-pulse { 50% { transform: scale(1.18); } }
.money__txt { display: grid; min-width: 0; }
.money__n {
  font-size: 30px; line-height: 1; color: #fff;
  -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  /* 먹선(6px)의 바깥 절반이 글자 상자 밖으로 나온다 — 안쪽 여백으로 잘리지 않게 하고, 같은 만큼 바깥 여백을 당겨 자리는 그대로 */
  padding: 3px 4px; margin: -3px -4px;
}
.money__txt small { font-size: 12px; color: #fff; text-shadow: 0 1px 0 rgba(29, 39, 68, 0.5); }
.gems {
  display: flex; align-items: center; gap: 4px; height: 36px; padding: 0 12px 0 8px;
  border-radius: 999px; background: #fff; box-shadow: 0 4px 0 var(--purple-e); color: var(--purple-e); font-size: 17px;
}
.iconbtn {
  width: 36px; height: 36px; border-radius: 12px; background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 3px 0 rgba(29, 39, 68, 0.2); font-size: 17px; display: grid; place-items: center;
}

.quest {
  display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto 6px; column-gap: 8px; row-gap: 4px; align-items: center;
  text-align: left; padding: 7px 8px 7px 8px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.94); box-shadow: 0 4px 0 rgba(29, 39, 68, 0.16);
}
.quest__tag { grid-row: 1 / 3; font-size: 11px; color: #fff; background: var(--blue); border-radius: 8px; padding: 6px 7px; }
.quest__txt { font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quest__bar { grid-column: 2; height: 6px; border-radius: 3px; background: var(--blue-s); overflow: hidden; }
.quest__bar i { display: block; height: 100%; width: 0; background: var(--blue); border-radius: 3px; transition: width 200ms; }
.quest__go { grid-row: 1 / 3; grid-column: 3; font-size: 13px; color: var(--ink-3); padding: 6px 4px; }
.quest.is-done { background: var(--yellow-s); box-shadow: 0 4px 0 var(--yellow-e); animation: q-pop 1s ease-in-out infinite; }
.quest.is-done .quest__go { color: #fff; background: var(--green); border-radius: 10px; padding: 7px 12px; box-shadow: 0 3px 0 var(--green-e); }
@keyframes q-pop { 50% { transform: scale(1.02); } }

.rival {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px;
  font-size: 12px; color: #fff; padding: 4px 10px 8px; border-radius: 12px; position: relative;
  background: rgba(29, 39, 68, 0.62);
}
.rival__me { text-align: left; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rival__them { text-align: right; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rival__vs { font-family: var(--font-display); color: var(--yellow); }
.rival__bar { position: absolute; left: 10px; right: 10px; bottom: 3px; height: 3px; border-radius: 2px; background: var(--red); overflow: hidden; }
.rival__bar i { display: block; height: 100%; width: 50%; background: var(--green); transition: width 400ms; }

/* ---------------------------------------------------------------- 캠퍼스 */
.stage { position: relative; min-height: 0; overflow: hidden; touch-action: none; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: pointer; }
.fx { position: absolute; inset: 0; pointer-events: none; z-index: 2; }

.side { position: absolute; top: 8px; display: grid; gap: 8px; z-index: 3; }
.side--l { left: 8px; }
.side--r { right: 8px; }
.sidebtn {
  width: 58px; display: grid; justify-items: center; gap: 0; padding: 5px 0 4px; border-radius: 16px;
  background: #fff; box-shadow: 0 4px 0 rgba(29, 39, 68, 0.22); font-size: 12px; line-height: 1.15;
}
.sidebtn__ico { font-size: 20px; }
.sidebtn small { font-size: 10px; color: var(--ink-3); min-height: 12px; }
.sidebtn--exam.is-ready { background: var(--red); color: #fff; box-shadow: 0 4px 0 #c23a3f; animation: side-wob 1.4s ease-in-out infinite; }
.sidebtn--exam.is-ready small { color: #ffe3e3; }
.sidebtn--gacha.is-ready { background: var(--purple); color: #fff; box-shadow: 0 4px 0 var(--purple-e); }
.sidebtn--gacha.is-ready small { color: var(--purple-s); }
.sidebtn--boost { background: var(--yellow); box-shadow: 0 4px 0 var(--yellow-e); }
.sidebtn--boost small { color: #7a5600; }
.sidebtn--boost.is-on { background: var(--green); color: #fff; box-shadow: 0 4px 0 var(--green-e); }
.sidebtn--boost.is-on small { color: #fff; }
@keyframes side-wob { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg) scale(1.05); } }

.boss {
  position: absolute; left: 76px; right: 76px; top: 10px; z-index: 3;
  display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; align-items: center;
  padding: 8px 10px; border-radius: 14px; background: rgba(29, 39, 68, 0.86); color: #fff;
}
.boss__name { font-size: 14px; }
.boss__hp { grid-column: 1 / 3; position: relative; height: 16px; border-radius: 8px; background: #4a1f2a; overflow: hidden; }
.boss__hp i { position: absolute; inset: 0 auto 0 0; width: 100%; background: linear-gradient(90deg, #ff5a5f, #ff8a3d); transition: width 90ms; }
.boss__hp span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; font-family: var(--font-display); }
.boss__time { grid-column: 2; grid-row: 1; font-family: var(--font-display); font-size: 18px; color: var(--yellow); }

.fever {
  position: absolute; left: 12px; right: 12px; bottom: 8px; z-index: 3; pointer-events: none;
  display: grid; gap: 3px; justify-items: center;
}
.fever__pct { display: none; }
.fever__lbl { font-size: 12px; color: #fff; text-shadow: 0 1px 0 rgba(29, 39, 68, 0.7), 0 0 6px rgba(29, 39, 68, 0.4); }
.fever__bar { width: 100%; height: 10px; border-radius: 5px; background: rgba(29, 39, 68, 0.45); overflow: hidden; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7); }
.fever__bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--yellow), var(--pink)); transition: width 120ms; }
.fever.is-on .fever__bar i { background: linear-gradient(90deg, var(--pink), var(--yellow), var(--green), var(--blue)); background-size: 200% 100%; animation: fever-flow 0.6s linear infinite; }
.fever.is-on .fever__lbl { color: var(--yellow); font-size: 15px; }
@keyframes fever-flow { to { background-position: 200% 0; } }

.hand {
  position: fixed; z-index: 15; font-size: 30px; pointer-events: none; transform: translate(-30%, 0);
  animation: hand-tap 0.9s ease-in-out infinite; filter: drop-shadow(0 3px 0 rgba(29, 39, 68, 0.35));
}
@keyframes hand-tap { 0%, 100% { translate: 0 0; } 50% { translate: 0 10px; } }

.banner {
  position: absolute; left: 50%; top: 38%; z-index: 5; pointer-events: none;
  transform: translate(-50%, -50%); padding: 12px 20px; border-radius: 18px; text-align: center;
  background: var(--ink); color: #fff; font-size: 18px; white-space: nowrap;
  box-shadow: 0 0 0 4px var(--yellow), 0 12px 30px rgba(0, 0, 0, 0.3);
  animation: banner-in 1.8s cubic-bezier(0.2, 1.3, 0.4, 1) forwards;
}
.banner b { font-family: var(--font-display); font-weight: 400; color: var(--yellow); font-size: 22px; display: block; }
@keyframes banner-in {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(0.6); }
  12% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
  80% { opacity: 1; transform: translate(-50%, -54%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -64%) scale(0.96); }
}

/* 탭 숫자 팝콘(../src/tapfx.mjs 재사용) */
.pop, .tapchip, .tapring { position: absolute; left: 0; top: 0; pointer-events: none; will-change: transform, opacity; opacity: 0; }
.pop { font-family: var(--font-display); font-size: 22px; line-height: 1; white-space: nowrap; color: #fff; -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill; text-shadow: 0 3px 0 var(--ink); z-index: 3; }
.pop--crit { -webkit-text-stroke-width: 6px; text-shadow: 0 4px 0 var(--ink), 0 0 18px rgba(255, 201, 51, 0.9); z-index: 4; }
.tapchip { box-shadow: 0 0 0 2px var(--ink); z-index: 2; }
.tapring { width: 50px; height: 50px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, 0.95); z-index: 2; }
.tapring--strong { border-color: var(--yellow); border-width: 5px; }
.tapflash { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; background: radial-gradient(circle at var(--fx, 50%) var(--fy, 50%), rgba(255, 244, 209, 0.95) 0, rgba(255, 244, 209, 0) 55%); }

/* ---------------------------------------------------------------- 아래 */
.dock {
  z-index: 3; background: #fff; border-radius: 22px 22px 0 0;
  box-shadow: 0 -6px 20px rgba(29, 39, 68, 0.14); padding: 10px 10px calc(var(--safe-bottom) + 4px);
}
.card { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: center; min-height: 92px; }
.card__ico {
  grid-row: 1 / 3; width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; font-size: 26px;
  background: var(--c-s, var(--blue-s)); box-shadow: inset 0 -4px 0 rgba(29, 39, 68, 0.08);
}
.card__head { min-width: 0; display: flex; align-items: baseline; gap: 6px; }
.card__name { font-size: 18px; white-space: nowrap; }
.card__lv { font-family: var(--font-display); font-size: 15px; color: var(--blue); white-space: nowrap; }
.card__info { font-size: 12px; color: var(--ink-2); min-width: 0; line-height: 1.35; }
.card__info b { color: var(--ink); font-family: var(--font-display); font-weight: 400; }
.card__ms { grid-column: 1 / 4; display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: center; font-size: 11px; color: var(--ink-3); }
.card__ms span:first-child { height: 7px; border-radius: 4px; background: var(--panel-2); overflow: hidden; }
.card__ms i { display: block; height: 100%; background: var(--yellow); border-radius: 4px; }
.card__btns { grid-row: 1 / 3; grid-column: 3; display: grid; gap: 6px; justify-items: stretch; }

.btn {
  display: inline-grid; place-items: center; gap: 0; min-height: 44px; padding: 4px 12px; border-radius: 14px;
  font-size: 15px; line-height: 1.1; color: #fff; background: var(--blue); box-shadow: 0 4px 0 var(--blue-e);
  transition: transform 60ms;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--blue-e); }
.btn small { font-size: 11px; opacity: 0.92; font-family: var(--font-display); }
.btn--green { background: var(--green); box-shadow: 0 4px 0 var(--green-e); }
.btn--yellow { background: var(--yellow); box-shadow: 0 4px 0 var(--yellow-e); color: var(--ink); }
.btn--pink { background: var(--pink); box-shadow: 0 4px 0 var(--pink-e); }
.btn--purple { background: var(--purple); box-shadow: 0 4px 0 var(--purple-e); }
.btn--ghost { background: var(--panel-2); box-shadow: 0 4px 0 var(--line); color: var(--ink-2); }
.btn:disabled, .btn.is-off { background: #dfe5f0; box-shadow: 0 4px 0 #c5cedf; color: #8f9bbd; }
.btn--sm { min-height: 36px; font-size: 13px; padding: 3px 10px; border-radius: 12px; }
.btn--wide { width: 100%; }

.tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-top: 8px; }
.tab { display: grid; justify-items: center; font-size: 11px; color: var(--ink-2); padding: 4px 0; border-radius: 12px; position: relative; }
.tab span { font-size: 20px; line-height: 1.2; }
.tab em { font-style: normal; }
.sharebtn__ico { font-style: normal; }
.card__msp, .card__msc { display: none; }
.tab.has-dot::after { content: ""; position: absolute; top: 3px; right: 22%; width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px #fff; }

/* ---------------------------------------------------------------- 시트·모달 */
.sheet-host { position: fixed; inset: 0; z-index: 20; background: rgba(13, 20, 40, 0.45); display: grid; align-items: end; animation: fade 160ms; }
.sheet {
  width: 100%; max-width: 520px; margin: 0 auto; max-height: 78dvh; display: grid; grid-template-rows: auto 1fr auto;
  background: #fff; border-radius: 24px 24px 0 0; padding-bottom: var(--safe-bottom); animation: sheet-in 220ms cubic-bezier(0.2, 1, 0.3, 1);
}
.sheet__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 8px 18px; font-size: 19px; }
.sheet__body { overflow-y: auto; padding: 4px 14px 18px; -webkit-overflow-scrolling: touch; }
/* 토스 배너 칸: 너비 100%·높이는 광고가 정한다. 내용과 띄워(오클릭 방지) 구분선 아래에 둔다. 광고가 없으면 접힌다 */
.sheet__ad { width: 100%; min-height: 0; }
.sheet__ad.is-on { margin-top: 6px; padding-top: 10px; border-top: 1px solid rgba(0, 0, 0, 0.08); }
@keyframes sheet-in { from { transform: translateY(40%); opacity: 0.4; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } }

.list { display: grid; gap: 10px; }
.row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 2px 10px; align-items: center;
  padding: 10px; border-radius: 16px; background: var(--panel-2);
}
.row.is-sel { box-shadow: 0 0 0 3px var(--blue); background: #fff; }
.row.is-lock { opacity: 0.6; }
.row__ico { grid-row: 1 / 3; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 23px; background: #fff; }
.row__t { font-size: 15px; display: flex; gap: 6px; align-items: baseline; min-width: 0; }
.row__t em { font-style: normal; font-family: var(--font-display); color: var(--blue); font-size: 13px; }
.row__s { font-size: 11.5px; color: var(--ink-2); line-height: 1.35; }
.row__b { grid-row: 1 / 3; grid-column: 3; display: grid; gap: 6px; }

.note { font-size: 12px; color: var(--ink-2); line-height: 1.5; background: var(--panel-2); border-radius: 12px; padding: 10px 12px; }
.note b { color: var(--ink); }
.h3 { font-size: 15px; margin: 16px 2px 8px; }

.gacha-top { display: grid; gap: 10px; padding: 14px; border-radius: 18px; background: linear-gradient(150deg, var(--purple), var(--pink)); color: #fff; text-align: center; }
.gacha-top p { margin: 0; font-size: 13px; opacity: 0.92; }
.gacha-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gcard {
  position: relative; display: grid; justify-items: center; gap: 2px; padding: 8px 4px 7px; border-radius: 14px;
  background: var(--panel-2); text-align: center; font-size: 11.5px; min-height: 112px;
  box-shadow: inset 0 0 0 2px var(--rc, transparent);
}
.gcard canvas { width: auto; height: 52px; image-rendering: auto; }
.gcard b { font-size: 12px; line-height: 1.2; }
.gcard small { color: var(--ink-2); font-size: 10.5px; line-height: 1.25; }
.gcard__r { position: absolute; top: 5px; left: 6px; font-size: 9.5px; color: #fff; background: var(--rc); border-radius: 6px; padding: 1px 5px; }
.gcard__lv { position: absolute; top: 5px; right: 6px; font-family: var(--font-display); font-size: 11px; color: var(--ink-2); }
.gcard.is-none { opacity: 0.45; filter: grayscale(1); }
.gcard.is-new { animation: card-in 500ms cubic-bezier(0.2, 1.4, 0.4, 1) both; }
@keyframes card-in { from { transform: rotateY(90deg) scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }

.league { display: grid; gap: 6px; }
.lg { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 12px; background: var(--panel-2); font-size: 14px; }
.lg b { font-family: var(--font-display); font-weight: 400; }
.lg.is-me { background: var(--yellow-s); box-shadow: inset 0 0 0 2px var(--yellow); }
.lg__rank { font-family: var(--font-display); color: var(--ink-3); text-align: center; }

.modal-host { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; background: rgba(13, 20, 40, 0.55); animation: fade 160ms; }
.modal {
  width: min(360px, 100%); max-height: 86dvh; overflow-y: auto; background: #fff; border-radius: 24px; padding: 20px 18px 18px;
  text-align: center; display: grid; gap: 12px; animation: modal-in 260ms cubic-bezier(0.2, 1.3, 0.4, 1);
}
.modal h2 { margin: 0; font-size: 22px; font-weight: 400; font-family: var(--font-display); }
.modal p { margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.modal .big { font-family: var(--font-display); font-size: 34px; color: var(--yellow-e); }
.modal__btns { display: grid; gap: 8px; }
.modal__emoji { font-size: 46px; line-height: 1; }
@keyframes modal-in { from { transform: scale(0.85) translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }

.ad { position: fixed; inset: 0; z-index: 40; background: #0d1428; color: #fff; display: grid; place-items: center; text-align: center; gap: 10px; padding: 30px; }
.ad__box { display: grid; gap: 12px; justify-items: center; }
.ad__box b { font-size: 22px; }
.ad__box small { color: #aeb9dc; font-size: 12px; }
.ad__bar { width: 220px; height: 8px; border-radius: 4px; background: #2b3a66; overflow: hidden; }
.ad__bar i { display: block; height: 100%; width: 0; background: var(--yellow); animation: ad-bar 3s linear forwards; }
@keyframes ad-bar { to { width: 100%; } }

.toast-host { position: fixed; left: 0; right: 0; bottom: calc(var(--safe-bottom) + 150px); z-index: 50; display: grid; justify-items: center; gap: 6px; pointer-events: none; }
.toast { padding: 9px 16px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 14px; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25); animation: toast 2.2s ease forwards; max-width: 90vw; text-align: center; }
@keyframes toast { 0% { opacity: 0; transform: translateY(10px) scale(0.9); } 10% { opacity: 1; transform: none; } 85% { opacity: 1; } 100% { opacity: 0; transform: translateY(-6px); } }

@media (max-height: 700px) {
  .rival { display: none; }
  .card { min-height: 84px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* 학교 고르기 */
.field { width: 100%; height: 46px; border-radius: 14px; border: 2px solid var(--line); padding: 0 14px; font: inherit; font-size: 16px; background: var(--panel-2); color: var(--ink); -webkit-user-select: text; user-select: text; }
.field:focus { outline: none; border-color: var(--blue); background: #fff; }
.schlist { display: grid; gap: 6px; max-height: 34dvh; overflow-y: auto; text-align: left; }
.sch { display: grid; gap: 1px; padding: 10px 12px; border-radius: 12px; background: var(--panel-2); text-align: left; }
.sch b { font-size: 15px; font-weight: 400; }
.sch small { font-size: 12px; color: var(--ink-2); }
.sch.is-on { background: var(--green-s); box-shadow: inset 0 0 0 2px var(--green); }

/* 자랑하기·초대 */
.sharebtn {
  display: grid; justify-items: center; height: 36px; padding: 2px 9px 0; border-radius: 12px; font-size: 15px; line-height: 1;
  background: linear-gradient(135deg, #ff5c93, #ffb03b); color: #fff; box-shadow: 0 3px 0 #d63b71;
}
.sharebtn span { font-size: 10px; margin-top: 1px; }
.rival { cursor: pointer; }
.rival__sos {
  position: absolute; right: 8px; top: -9px; padding: 3px 8px; border-radius: 999px; font-size: 11px;
  background: var(--red); color: #fff; box-shadow: 0 2px 0 #c23a3f; animation: side-wob 1.2s ease-in-out infinite;
}
.brag {
  position: absolute; left: 50%; bottom: 40px; z-index: 4; transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px; max-width: calc(100% - 140px);
  padding: 9px 14px; border-radius: 999px; font-size: 14px; color: #fff; white-space: nowrap;
  background: linear-gradient(135deg, #ff5c93, #8a6cff); box-shadow: 0 4px 0 #6547e0, 0 8px 20px rgba(29, 39, 68, 0.3);
  animation: brag-in 420ms cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.brag b { overflow: hidden; text-overflow: ellipsis; }
@keyframes brag-in { from { opacity: 0; transform: translate(-50%, 20px) scale(0.8); } }
.sharesheet { display: grid; gap: 10px; }
.sharesheet__tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sharesheet__tabs button { padding: 8px; border-radius: 12px; background: var(--panel-2); font-size: 13px; color: var(--ink-2); }
.sharesheet__tabs button.is-on { background: var(--ink); color: #fff; }
.sharesheet__img { width: 100%; max-height: 46dvh; object-fit: contain; border-radius: 16px; background: var(--panel-2); }
.sharesheet__btns { display: grid; gap: 8px; }
.invitebox { display: grid; gap: 6px; padding: 12px; border-radius: 16px; background: var(--yellow-s); text-align: left; }
.invitebox__code { font-family: var(--font-display); font-size: 26px; letter-spacing: 0.08em; color: var(--ink); }
.invitebox small { color: var(--ink-2); font-size: 12px; line-height: 1.45; }
.friends { display: flex; flex-wrap: wrap; gap: 6px; }
.friends span { padding: 4px 9px; border-radius: 999px; background: #fff; font-size: 12px; box-shadow: inset 0 0 0 1.5px var(--blue-s); }
.invite-hero { padding: 10px 12px; border-radius: 14px; background: linear-gradient(135deg, #ffe3ee, #e3eeff); font-size: 14px; }

/* ---- 빈 화면·내 기여·숫자 풀이·확률표 ---- */
.empty { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 18px 14px; border-radius: 14px; background: var(--panel-2); }
.empty__ico { font-size: 34px; line-height: 1; }
.empty b { font-size: 16px; }
.empty p { margin: 0; font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.empty--sm { padding: 12px; margin-bottom: 10px; }
.contrib { margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--yellow-s); font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.contrib b { color: var(--ink); }
.gloss { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; font-size: 12.5px; line-height: 1.45; background: var(--panel-2); border-radius: 12px; padding: 10px 12px; }
.gloss dt { font-weight: 400; color: var(--ink); white-space: nowrap; }
.gloss dd { margin: 0; color: var(--ink-2); }
.odds { margin-top: 12px; }
.odds summary { cursor: pointer; font-size: 14px; padding: 8px 2px; color: var(--blue); }
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 12px; background: var(--panel-2); margin-bottom: 8px; }
.tablewrap table { width: 100%; border-collapse: collapse; font-size: 12px; }
.tablewrap :is(th, td) { padding: 7px 8px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); line-height: 1.45; }
.tablewrap td b { font-weight: 400; color: var(--ink); }

/* ---- 설정: 그래픽 3단 ---- */
.seg { display: grid; grid-template-columns: auto 1fr 1fr 1fr; gap: 6px; align-items: center; font-size: 14px; }
.seg > span { padding: 0 6px; color: var(--ink-2); }
.seg button { min-height: 38px; border-radius: 12px; background: var(--panel-2); color: var(--ink-2); font: inherit; border: 0; }
.seg button.is-on { background: var(--blue); color: #fff; }
.seg__note { margin-top: -4px; font-size: 11.5px; color: var(--ink-3); padding: 0 4px; }

/* ---- 상점 ---- */
.shop { display: grid; gap: 8px; margin: 4px 0 10px; }
.shop__item { display: grid; grid-template-columns: 42px 1fr auto; gap: 10px; align-items: center; padding: 10px; border-radius: 14px; background: var(--panel-2); }
.shop__item.is-hot { background: var(--pink-s); box-shadow: inset 0 0 0 2px var(--pink); }
.shop__ico { font-size: 30px; text-align: center; }
.shop__txt { display: grid; gap: 2px; min-width: 0; }
.shop__txt b { font-size: 15px; font-weight: 400; }
.shop__txt small { font-size: 12px; color: var(--ink-2); line-height: 1.4; }
.shop__txt em { font-style: normal; font-size: 11px; color: var(--ink-3); }
.shop__txt em.shop__on { color: var(--green-e); }
.shop__item .btn { min-width: 84px; }
.hist { display: grid; gap: 6px; max-height: 46vh; overflow: auto; text-align: left; margin: 6px 0 10px; }
.hist > div { display: grid; padding: 8px 10px; border-radius: 10px; background: var(--panel-2); }
.hist small { font-size: 11.5px; color: var(--ink-2); }
.cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0 12px; text-align: left; }
.cmp > div { display: grid; gap: 4px; padding: 10px; border-radius: 12px; background: var(--panel-2); }
.cmp small { font-size: 12px; color: var(--ink-2); line-height: 1.5; }
.adnote { font-size: 12px !important; color: var(--ink-3) !important; margin: 4px 0 0 !important; }

/* 가볍게 모드: 화면 틀의 무거운 효과를 줄인다 */
body.lite :is(.sheet, .modal, .card, .tabs) { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }

/* 앱 출시 알림 팝업(waitlist.mjs) — 웹 버전에서만 뜬다 */
.wlp { display: grid; gap: 10px; text-align: left; }
.wlp__os { grid-template-columns: 1fr 1fr; }
.wlp__os button { min-height: 44px; font-size: 15px; }
.wlp__consent { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.wlp__consent input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--ink); }
.wlp__consent b { color: var(--red); font-weight: 400; font-family: var(--font-display); }
.wlp__more { font-size: 12px; color: var(--ink-3); line-height: 1.5; }
.wlp__more summary { cursor: pointer; text-decoration: underline; width: fit-content; }
.wlp__msg:empty { display: none; }
.wlp__msg { font-size: 13px; color: var(--red); }

/* ✒️ 잉크 만화 아이콘(icons.mjs) — 이모지 자리에 들어가는 먹선 그림. 크기는 둘러싼 글자 크기를 따른다 */
.ii { display: inline-block; width: 1.2em; height: 1.2em; vertical-align: -0.25em; line-height: 0; flex: none; font-style: normal; }
.ii > svg { display: block; width: 100%; height: 100%; overflow: visible; }
.tab span .ii, .sidebtn__ico .ii { width: 1.4em; height: 1.4em; }
.card__ico .ii, .row__ico .ii { width: 1.45em; height: 1.45em; vertical-align: top; }
.modal__emoji .ii, .empty__ico .ii, .shop__ico .ii { width: 1.15em; height: 1.15em; vertical-align: top; }
