/* ============================================================
   이의 있습니다! · 2026-09-20 전면 개편
   헌법 §7 「법정 웹툰」 톤: 크림 배경 · 검은 테두리 3px · 오프셋 그림자 · Black Han Sans
   ⚠️ display 를 명시한 요소는 hidden 속성이 안 먹는다 → 맨 아래 [hidden] 규칙을 지우지 말 것.
   ============================================================ */

:root {
  --cream: #FFF6E5;
  --ink: #1B1B1F;
  --red: #E8332A;
  --yellow: #FFD13F;
  --navy: #2E4374;
  --paper: #FFFFFF;
  --gray: #6B6B72;
  --line: rgba(27, 27, 31, 0.14);
  --shadow: 5px 5px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background-color: var(--cream);
  background-image: repeating-linear-gradient(135deg,
    rgba(27, 27, 31, 0.035) 0 2px, transparent 2px 11px);
  color: var(--ink);
  font-family: 'Apple SD Gothic Neo', 'Malgun Gothic', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

h1, h2, h3, .logo, .stamp, .big {
  font-family: 'Black Han Sans', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  font-weight: 400;
  letter-spacing: -0.01em;
}

/* ── 머리 (헌법 §5 표준: 브랜드 … 앱버튼 👤 🔗) ── */
.shin-header {
  display: block;
  background: var(--paper);
  border-bottom: 3px solid var(--ink);
  padding: 8px 0;
  position: relative;
  z-index: 20;
}
.shin-header-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 28px; height: 28px; flex: none;
  display: grid; place-items: center;
  background: var(--red); color: #fff;
  border: 2px solid var(--ink); border-radius: 6px;
  font-family: 'Black Han Sans', serif; font-size: 16px; padding-top: 2px;
}
.brand-name { font-weight: 800; font-size: 14px; white-space: nowrap; }
.head-tools { display: flex; align-items: center; gap: 6px; }
.tool-btn {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  background: var(--paper); color: var(--ink);
  border: 2px solid var(--ink); border-radius: 8px;
  font-size: 15px; line-height: 1; cursor: pointer; text-decoration: none;
  box-shadow: 2px 2px 0 var(--ink);
  transition: transform .08s, box-shadow .08s;
}
.tool-btn:active { transform: translate(2px, 2px); box-shadow: none; }
.tool-btn[aria-pressed="false"] { opacity: .42; }
.shin-copy-link.skinned { pointer-events: auto; }

/* ── 본문 ── */
.wrap { max-width: 720px; margin: 0 auto; padding: 14px 14px 30px; }

.card {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 14px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--yellow); color: var(--ink);
  border: 3px solid var(--ink); border-radius: 12px;
  box-shadow: var(--shadow-sm);
  font-family: 'Black Han Sans', sans-serif; font-size: 17px;
  padding: 11px 18px; cursor: pointer;
  transition: transform .08s, box-shadow .08s, background .12s;
}
.btn:active { transform: translate(3px, 3px); box-shadow: none; }
.btn.wide { width: 100%; }
.btn.blue { background: var(--navy); color: #fff; }
.btn.ghost { background: var(--paper); box-shadow: none; border-width: 2px; font-family: inherit; font-weight: 700; font-size: 14px; }
.btn.small { padding: 7px 14px; }
.btn:disabled { opacity: .5; cursor: default; }

/* ══ 시작 화면 ══ */
.hero { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 14px; }
.hero-copy { flex: 1 1 auto; min-width: 0; }
.kicker {
  display: inline-block; margin: 0 0 6px;
  background: var(--navy); color: #fff;
  border-radius: 999px; padding: 3px 11px;
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
}
.logo { margin: 0 0 8px; font-size: clamp(30px, 9vw, 46px); line-height: 1.05; }
.logo .red { color: var(--red); }
.tagline { margin: 0; font-size: 14px; color: #33333a; }
.tagline b { background: linear-gradient(transparent 62%, var(--yellow) 62%); }
.hero-jo { margin: 0; flex: none; width: 40%; max-width: 190px; }
.hero-jo img { display: block; width: 100%; height: auto; }

.record { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.record div { border-right: 2px dashed var(--line); }
.record div:last-child { border-right: 0; }
.record b { display: block; font-family: 'Black Han Sans', sans-serif; font-size: 24px; line-height: 1.1; color: var(--navy); }
.record span { font-size: 11px; color: var(--gray); }

.set-lab { margin: 0 0 6px; font-size: 12px; font-weight: 800; color: var(--gray); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 13px; }
.seg.two { grid-template-columns: repeat(2, 1fr); }
.seg button {
  background: var(--paper); border: 2px solid var(--ink); border-radius: 10px;
  padding: 7px 4px; cursor: pointer; font-family: inherit; color: var(--ink);
  display: flex; flex-direction: column; align-items: center; gap: 1px;
}
.seg button b { font-size: 14px; }
.seg button small { font-size: 10px; color: var(--gray); line-height: 1.25; text-align: center; }
.seg button[aria-pressed="true"] { background: var(--yellow); box-shadow: 2px 2px 0 var(--ink); }
.seg button[aria-pressed="true"] small { color: #4a4238; }

.how h3 { margin: 0 0 10px; font-size: 17px; }
.reasons { display: grid; gap: 8px; }
.reason-row {
  border-left: 5px solid var(--red); background: #FBF7EF;
  border-radius: 0 8px 8px 0; padding: 7px 10px;
}
.reason-row b { font-size: 14px; }
.reason-row p { margin: 2px 0 0; font-size: 12.5px; color: #44444c; line-height: 1.45; }
.reason-row em { display: block; margin-top: 3px; font-style: normal; font-size: 11.5px; color: var(--navy); font-weight: 700; }
.reason-row .law { display: inline-block; margin-top: 5px; font-size: 10.5px; color: #6B6B72; background: rgba(27,27,31,.05); border-radius: 6px; padding: 2px 7px; }

.notice-line {
  display: flex; gap: 8px; align-items: flex-start;
  background: rgba(128, 128, 128, .12);
  border: 1px solid rgba(27, 27, 31, .1);
  border-radius: 9px; padding: 8px 11px; margin: 0 0 9px;
  font-size: 12px; color: #4a4a52; line-height: 1.5;
}
.notice-line > span:first-child { opacity: .55; flex: none; }

/* ══ 재판 화면 ══ */
.hud {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 8px 12px; margin-bottom: 10px; font-size: 12px; color: var(--gray);
  flex-wrap: wrap;
}
.hud b { font-family: 'Black Han Sans', sans-serif; font-size: 16px; color: var(--ink); margin-left: 2px; }
.hud b.low { color: var(--red); }
#comboTxt {
  background: var(--red); color: #fff; border-radius: 999px;
  padding: 1px 10px; font-weight: 800; font-size: 12px;
  animation: pop .25s ease-out;
}
#comboTxt b { color: #fff; font-size: 14px; }

.stand {
  display: grid; grid-template-columns: 116px 1fr; gap: 10px;
  align-items: end; padding: 10px; margin-bottom: 8px; position: relative; overflow: hidden;
}
.stand::before {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, rgba(46, 67, 116, .05) 0 9px, transparent 9px 18px);
  pointer-events: none;
}
.witness { display: block; width: 100%; height: auto; position: relative; }
.say { position: relative; align-self: center; }
.say .label {
  margin: 0 0 4px; font-size: 11px; font-weight: 800; color: #fff;
  background: var(--navy); display: inline-block; padding: 1px 9px; border-radius: 999px;
}
.say .txt {
  margin: 0; font-size: 15.5px; line-height: 1.5; font-weight: 600;
  background: #FBF7EF; border: 2px solid var(--ink); border-radius: 12px;
  padding: 10px 12px; position: relative;
  animation: sayIn .18s ease-out;
}
.say .txt::before {
  content: ''; position: absolute; left: -9px; top: 18px;
  border: 5px solid transparent; border-right-color: var(--ink);
}
@keyframes sayIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.timebar {
  height: 14px; background: #ECE6DA;
  border: 2px solid var(--ink); border-radius: 999px;
  overflow: hidden; margin-bottom: 10px;
}
.timebar i { display: block; height: 100%; width: 100%; background: var(--navy); transform-origin: left center; }
.timebar.warn i { background: var(--red); }
.timebar.warn { animation: tick .5s infinite; }
@keyframes tick { 50% { border-color: var(--red); } }

.btn.obj {
  width: 100%; background: var(--red); color: #fff;
  font-size: 22px; padding: 14px; box-shadow: var(--shadow);
  margin-bottom: 10px;
}
.btn.obj:disabled { background: #C8C4BC; color: #6d6a64; box-shadow: var(--shadow-sm); }

.hint { margin: -2px 0 10px; text-align: center; font-size: 12px; color: var(--gray); line-height: 1.5; }
.hint b { color: #3a3a42; }
.picking .hint { display: none; }

.pick { margin-bottom: 10px; }
.pick-lab { margin: 0 0 6px; font-size: 13px; font-weight: 800; }
.pick-lab span { color: var(--red); font-family: 'Black Han Sans', sans-serif; }
.pick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.pick-grid button {
  background: var(--paper); border: 2px solid var(--ink); border-radius: 10px;
  box-shadow: 2px 2px 0 var(--ink);
  padding: 9px 6px; cursor: pointer; font-family: 'Black Han Sans', sans-serif;
  font-size: 15px; color: var(--ink);
  transition: transform .07s, box-shadow .07s;
}
.pick-grid button:active { transform: translate(2px, 2px); box-shadow: none; }
.pick-grid button.ok { background: #DFF3E0; }
.pick-grid button.no { background: #FBE0DE; }

.call { min-height: 26px; text-align: center; font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.call .v-ok { color: #1F7A3D; }
.call .v-no { color: var(--red); }
.call small { display: block; font-weight: 500; color: #4a4a52; font-size: 12.5px; line-height: 1.45; margin-top: 2px; }
#giveBtn { display: block; margin: 0 auto; }

/* 「이의!」 팝 */
.boom {
  position: fixed; left: 50%; top: 32%; z-index: 60;
  transform: translate(-50%, -50%) rotate(-6deg);
  font-family: 'Black Han Sans', sans-serif; font-size: clamp(34px, 12vw, 64px);
  color: #fff; -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
  text-shadow: 6px 6px 0 var(--red);
  pointer-events: none; animation: boom .6s ease-out forwards;
}
@keyframes boom {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(-6deg) scale(.4); }
  35% { opacity: 1; transform: translate(-50%, -50%) rotate(-6deg) scale(1.12); }
  70% { opacity: 1; transform: translate(-50%, -50%) rotate(-6deg) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -54%) rotate(-6deg) scale(1); }
}
.flash { position: fixed; inset: 0; background: #fff; opacity: .72; z-index: 55; pointer-events: none; animation: fade .25s ease-out forwards; }
@keyframes fade { to { opacity: 0; } }
.shake { animation: shake .34s; }
@keyframes shake {
  0%, 100% { transform: none; }
  20% { transform: translate(-6px, 2px) rotate(-.6deg); }
  45% { transform: translate(5px, -3px) rotate(.5deg); }
  70% { transform: translate(-3px, 2px); }
}

/* 재판장 컷인 */
.cutin {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 58;
  display: flex; align-items: flex-end; gap: 10px;
  padding: 0 14px 14px; pointer-events: none;
  animation: cutIn .28s ease-out;
}
.cutin img { width: 96px; height: auto; filter: drop-shadow(3px 3px 0 var(--ink)); }
.cutin p {
  margin: 0 0 16px; background: var(--paper);
  border: 3px solid var(--ink); border-radius: 12px; box-shadow: var(--shadow-sm);
  padding: 8px 13px; font-family: 'Black Han Sans', sans-serif; font-size: 16px;
}
@keyframes cutIn { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }

/* ══ 결과 화면 ══ */
.end-card { text-align: center; position: relative; padding-top: 18px; }
.end-jo { width: 128px; height: auto; display: block; margin: 0 auto -4px; }
.stamp {
  display: inline-block; color: var(--red);
  border: 4px double var(--red); border-radius: 10px;
  padding: 4px 16px; font-size: 26px; letter-spacing: .12em;
  transform: rotate(-7deg); margin-bottom: 8px;
  animation: stampIn .35s cubic-bezier(.2, 1.6, .5, 1);
}
@keyframes stampIn { from { opacity: 0; transform: rotate(-7deg) scale(2.3); } to { opacity: 1; transform: rotate(-7deg) scale(1); } }
.stars { font-size: 24px; letter-spacing: .1em; margin-bottom: 4px; }
.end-line { margin: 0 0 12px; font-size: 14.5px; color: #3a3a42; }
.end-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
.end-stats div { background: #FBF7EF; border-radius: 9px; padding: 7px 2px; }
.end-stats b { display: block; font-family: 'Black Han Sans', sans-serif; font-size: 20px; color: var(--navy); }
.end-stats span { font-size: 10.5px; color: var(--gray); }
.end-best { margin: 0 0 12px; font-size: 13px; font-weight: 700; color: var(--red); min-height: 20px; }
.end-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.end-btns .btn { width: 100%; font-size: 15px; padding: 11px 6px; }
.cta { margin: 14px 0 0; padding-top: 12px; border-top: 2px dashed var(--line); font-size: 13px; color: #4a4a52; }
.cta a { color: var(--navy); font-weight: 800; text-decoration: none; border-bottom: 2px solid var(--yellow); }

.review h3 { margin: 0 0 10px; font-size: 16px; }
.rv { border-top: 1px dashed var(--line); padding: 9px 0; font-size: 13.5px; }
.rv:first-of-type { border-top: 0; }
.rv .q { margin: 0; line-height: 1.5; }
.rv .a { margin: 4px 0 0; font-size: 12.5px; color: #4a4a52; line-height: 1.45; }
.rv .tag {
  display: inline-block; font-size: 11px; font-weight: 800; color: #fff;
  border-radius: 999px; padding: 1px 8px; margin-right: 5px; vertical-align: 1px;
}
.tag-ok { background: #1F7A3D; }
.tag-no { background: var(--red); }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 54; overflow: hidden; }
.confetti i {
  position: absolute; top: -14px; width: 9px; height: 14px; border-radius: 2px;
  animation: fall linear forwards;
}
@keyframes fall { to { transform: translateY(104vh) rotate(760deg); } }

.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(14px);
  background: var(--ink); color: #fff; border-radius: 999px;
  padding: 9px 18px; font-size: 13.5px; font-weight: 700;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 80;
  max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%); }

.foot { border-top: 3px solid var(--ink); background: var(--paper); padding: 16px 14px 26px; text-align: center; }
.foot nav { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 7px; }
.foot a { color: var(--navy); font-size: 13px; font-weight: 700; text-decoration: none; }
.foot p { margin: 0; font-size: 11.5px; color: var(--gray); }

/* ══ 폰 ══ 선택 화면이 스크롤 없이 한 화면에 들어오게 한다(조변 2026-09-20) */
@media (max-width: 599px) {
  .wrap { padding: 12px 12px 24px; }
  .hero-jo { width: 38%; }
  .stand { grid-template-columns: 96px 1fr; gap: 8px; padding: 8px; }
  .witness { height: 132px; width: auto; max-width: 100%; margin: 0 auto; }
  .say .txt { font-size: 14.5px; padding: 9px 10px; }
  .btn.obj { font-size: 19px; padding: 12px; }
  .pick-grid button { font-size: 14px; padding: 8px 4px; }
  .end-stats { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 599px) and (max-height: 740px) {
  .stand { grid-template-columns: 80px 1fr; }
  .witness { height: 104px; }
  .say .txt { font-size: 14px; }
  .btn.obj { font-size: 18px; padding: 10px; margin-bottom: 8px; }
  .pick-grid button { padding: 7px 4px; font-size: 13.5px; }
  .hud { padding: 6px 10px; }
}
/* 사유를 고르는 동안에는 이의 버튼을 치우고 증인 칸을 줄여 목록을 끌어올린다 */
.picking .btn.obj { display: none; }
.picking .witness { height: 86px; }
.picking .say .txt { font-size: 14px; }

@media (min-width: 600px) {
  .stand { grid-template-columns: 150px 1fr; }
  .pick-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* 🚨 display 를 명시한 요소가 있으므로 이 규칙이 없으면 hidden 이 먹지 않는다 */
[hidden] { display: none !important; }
