/* 役所手続きRPG 固有スタイル（色は common.css の変数のみ） */
:root { --yk-top: 53px; --yk-seal: var(--bad); }

/* タイトル */
.yk-hero .title-xl { margin: 4px 0 6px; }
.yk-hero .lead { margin-bottom: 12px; }
.yk-friend { border-color: var(--info); background: var(--info-soft); }
.yk-today { display: flex; gap: 12px; align-items: center; margin-top: 12px; padding: 12px; background: var(--surface-2); border-radius: var(--radius-sm); }
.yk-today-emoji { font-size: 34px; line-height: 1; }
.yk-daily .note { margin-top: 12px; }
.yk-howto { margin: 6px 0 0; padding-left: 1.4em; }
.yk-ticket-area { margin: 12px 0 16px; }
.yk-ticket {
  margin: 0 auto; max-width: 300px; text-align: center; background: var(--surface); border: 2px dashed var(--line);
  border-radius: var(--radius-sm); padding: 16px; box-shadow: var(--shadow);
}
.yk-ticket-no { font-size: 26px; font-weight: 900; letter-spacing: .04em; margin: 4px 0 8px; font-variant-numeric: tabular-nums; }
.yk-wait-num { font-size: clamp(34px, 11vw, 48px); font-weight: 900; color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1.2; }

/* ステータスバー */
.yk-status {
  position: sticky; top: var(--yk-top); z-index: 40; background: var(--bg); padding: 8px 0 8px;
  border-bottom: 1px solid var(--line); margin: -8px 0 12px;
}
.yk-status-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.yk-status-row + .yk-status-row { margin-top: 6px; flex-wrap: nowrap; }
.yk-clock-wrap { font-weight: 900; font-size: 20px; font-variant-numeric: tabular-nums; display: inline-flex; gap: 4px; align-items: center; margin-right: auto; }
.yk-clock-wrap.warn { color: var(--bad); animation: yk-blink 1s steps(2) infinite; }
@keyframes yk-blink { 50% { opacity: .55; } }
.yk-chip {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px; min-height: 36px; padding: 4px 10px;
  font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; touch-action: manipulation;
}
.yk-chip:disabled { opacity: .45; cursor: not-allowed; }
.yk-chip.warn { border-color: var(--bad); color: var(--bad); background: var(--bad-soft); }
.yk-chip-static { cursor: default; background: var(--surface-2); }
.yk-prog-label { border: 0; background: none; font-size: 12px; font-weight: 700; color: var(--good); white-space: nowrap; cursor: pointer; padding: 4px 0; }
.yk-prog-label.ng { color: var(--bad); }

/* 職員 */
.yk-npc { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.yk-npc-face { font-size: 26px; line-height: 1; flex: none; }
.yk-npc-text {
  background: var(--surface); border: 1px solid var(--line); border-radius: 4px 14px 14px 14px; padding: 8px 12px;
  font-size: 14px; flex: 1; min-width: 0;
}

/* 申請書 */
.yk-form { border-width: 2px; padding: 16px; }
.yk-form-head { border-bottom: 2px solid var(--text); padding-bottom: 8px; margin-bottom: 12px; text-align: center; }
.yk-form-head h2 { font-size: 22px; margin: 2px 0; letter-spacing: .1em; }
.yk-row { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.yk-row:last-of-type { border-bottom: 0; }
.yk-row input[type="text"], .yk-row textarea { font-size: 17px; min-height: 52px; }
.yk-row textarea { min-height: 84px; }
.yk-row.yk-new { background: var(--accent-soft); border-radius: var(--radius-sm); padding-left: 8px; padding-right: 8px; transition: background 1.2s ease; }
.yk-count { text-align: right; margin-top: 4px; font-variant-numeric: tabular-nums; }
.yk-whisper { color: var(--info); margin-top: 4px; min-height: 1em; }
.yk-check { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; font-size: 15px; cursor: pointer; }
.yk-check input { width: 22px; height: 22px; flex: none; margin-top: 2px; accent-color: var(--accent); }
.yk-fineprint { font-size: 11px; color: var(--text-sub); margin: 12px 0 0; line-height: 1.6; }
.yk-online-link {
  border: 0; background: none; padding: 0 1px; font: inherit; color: inherit; cursor: pointer; text-decoration: underline dotted;
}
.yk-online-link.yk-glow { color: var(--info); font-weight: 900; font-size: 14px; text-decoration: underline; animation: yk-blink 1.2s steps(2) infinite; }

/* 印鑑 */
.yk-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 8px; }
.yk-seg-btn {
  min-height: 40px; border: 2px solid var(--line); background: var(--surface); border-radius: var(--radius-sm); font-weight: 700;
  font-size: 14px; cursor: pointer; touch-action: manipulation;
}
.yk-seg-btn.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.yk-pad {
  position: relative; height: 96px; background: var(--surface-2); border-radius: var(--radius-sm); overflow: hidden;
  cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none;
}
.yk-frame {
  position: absolute; left: 50%; top: 50%; width: 72px; height: 72px; margin: -36px 0 0 -36px; border-radius: 50%;
  border: 2px dashed var(--text-sub); display: flex; align-items: center; justify-content: center; color: var(--text-sub);
  font-family: var(--font-serif); font-size: 20px; opacity: .7;
}
.yk-cursor {
  position: absolute; left: 0; top: 50%; width: 64px; height: 64px; margin-top: -32px; border-radius: 50%;
  border: 3px solid var(--yk-seal); color: var(--yk-seal); opacity: .35; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); font-weight: 900; will-change: transform; pointer-events: none;
}
.yk-mark {
  position: absolute; top: 50%; width: 64px; height: 64px; margin-top: -32px; border-radius: 50%; border: 3px solid var(--yk-seal);
  color: var(--yk-seal); display: flex; align-items: center; justify-content: center; font-family: var(--font-serif);
  font-weight: 900; font-size: 18px; writing-mode: vertical-rl; letter-spacing: -.05em; transform: rotate(-8deg); pointer-events: none;
}
.yk-mark-shinto { border-style: double; border-width: 4px; opacity: .8; }
.yk-mark-jitsu { border-width: 5px; }
.yk-stamp-in { animation: yk-stampin .3s cubic-bezier(.2, .9, .3, 1.2) both; }
@keyframes yk-stampin { from { transform: scale(2.2) rotate(-8deg); opacity: 0; } to { transform: scale(1) rotate(-8deg); opacity: 1; } }
.yk-press { margin-top: 8px; }

.yk-papers { display: flex; gap: 8px; }
.yk-paper {
  flex: 1; text-align: center; padding: 10px 0; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-2);
  font-size: 12px; font-weight: 700; color: var(--text-sub);
}
.yk-paper.ok { border-color: var(--good); background: var(--good-soft); color: var(--good); }
.yk-paper.ng { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }

/* 提出 */
.yk-submit { position: sticky; bottom: 12px; z-index: 30; background: var(--surface); border: 2px solid var(--good); border-radius: var(--radius); padding: 12px; margin-bottom: 16px; box-shadow: var(--shadow); animation: ml-pop .45s ease both; }

/* ルールカード */
.yk-rules-head { margin-top: 8px; font-size: 17px; }
.yk-rules { display: grid; gap: 10px; margin-bottom: 16px; }
.yk-rule {
  background: var(--surface); border: 2px solid var(--line); border-left-width: 6px; border-radius: var(--radius-sm); padding: 10px 12px;
}
.yk-rule.ok { border-color: var(--good); background: var(--good-soft); }
.yk-rule.ng { border-color: var(--bad); background: var(--bad-soft); }
.yk-rule.void { border-color: var(--line); background: var(--surface-2); opacity: .75; }
.yk-rule.void .yk-rule-text { text-decoration: line-through double; color: var(--text-sub); }
.yk-rule-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.yk-rule-no { font-weight: 900; font-size: 14px; }
.yk-aru { color: var(--warn); letter-spacing: .02em; }
.yk-rule-mark { margin-left: auto; font-weight: 900; font-size: 13px; }
.yk-rule.ok .yk-rule-mark { color: var(--good); }
.yk-rule.ng .yk-rule-mark { color: var(--bad); }
.yk-rule-text { margin: 6px 0 4px; font-weight: 700; line-height: 1.6; }
.yk-fact { font-size: 13px; margin-top: 4px; }
.yk-fact summary { cursor: pointer; color: var(--info); font-weight: 700; }
.yk-go { border: 0; background: none; color: var(--text-sub); font-size: 12px; padding: 6px 0 0; cursor: pointer; text-decoration: underline; }
.yk-rule.ok .yk-go, .yk-rule.void .yk-go { display: none; }
.yk-slide { animation: yk-slide .4s cubic-bezier(.2, .8, .3, 1) both; }
@keyframes yk-slide { from { transform: translateX(32px); opacity: 0; } to { transform: none; opacity: 1; } }
.yk-giveup { margin-top: 8px; color: var(--text-sub); }

/* 終了の大きな判子 */
.yk-bigseal {
  position: fixed; left: 50%; top: 45%; width: 200px; height: 200px; margin: -100px 0 0 -100px; z-index: 300; border-radius: 50%;
  border: 10px double var(--bad); color: var(--bad); background: var(--surface); display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); font-weight: 900; font-size: 56px; letter-spacing: .05em; box-shadow: var(--shadow);
  animation: yk-bigstamp .45s cubic-bezier(.2, .9, .3, 1.25) both; pointer-events: none;
}
.yk-bigseal.good { border-color: var(--good); color: var(--good); }
@keyframes yk-bigstamp { from { transform: scale(2.6) rotate(-20deg); opacity: 0; } to { transform: scale(1) rotate(-10deg); opacity: 1; } }

/* 結果 */
.yk-result-hero { position: relative; }
.yk-seal-mini {
  width: 92px; height: 92px; margin: 10px auto; border-radius: 50%; border: 6px double var(--bad); color: var(--bad);
  display: flex; align-items: center; justify-content: center; font-family: var(--font-serif); font-weight: 900; font-size: 26px;
  transform: rotate(-10deg); animation: yk-stampin .4s ease both;
}
.yk-seal-mini.good { border-color: var(--good); color: var(--good); }
.yk-ending { font-weight: 900; font-size: 18px; }
.yk-result-line { font-size: clamp(20px, 6vw, 26px); font-weight: 900; line-height: 1.4; margin: 6px 0 12px; }
.yk-title-badge { display: inline-flex; align-items: center; gap: 4px; padding: 6px 14px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 900; flex-wrap: wrap; justify-content: center; }
.yk-factcard { padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius-sm); }
.yk-titles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.yk-title-item { display: flex; flex-direction: column; gap: 2px; padding: 10px; border: 1px dashed var(--line); border-radius: var(--radius-sm); font-size: 13px; opacity: .7; }
.yk-title-item.on { border-style: solid; border-color: var(--accent); background: var(--accent-soft); opacity: 1; }
.yk-title-emoji { font-size: 22px; line-height: 1.2; }
.yk-bars { margin-top: 6px; }
.yk-bar-label { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; margin-bottom: 2px; }
.yk-bar.mine .yk-bar-label { color: var(--accent); font-weight: 700; }
.yk-bar.mine .progress > span { background: var(--accent); }
.yk-bar .progress > span { background: var(--text-sub); }

/* 静的解説 */
.yk-about h2 { font-size: 20px; margin-top: 8px; }
.yk-about h3 { font-size: 16px; margin-top: 18px; }
.yk-about p, .yk-about li { font-size: 14px; }
.yk-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.yk-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.yk-table th, .yk-table td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: left; vertical-align: top; }
.yk-table th { background: var(--surface-2); white-space: nowrap; }

@media (max-width: 380px) {
  .yk-chip { padding: 4px 8px; font-size: 12px; }
  .yk-clock-wrap { font-size: 18px; }
  .yk-form { padding: 12px; }
}
