@charset "utf-8";

/* おーるいんわんくん — 共通デザインシステム
   Claude Design「おーるいんわんくん.dc.html」TURN 3（ライト）を基準に実装し、
   TURN 2（ダーク）を prefers-color-scheme で同一マークアップに載せる。 */

/* ---------- トークン ---------- */

:root {
  --backdrop: #EFE7DB;      /* キャンバス外の余白（PC幅で見える面） */
  --card: #FFFFFF;          /* アプリ本体の面 */
  --chrome: #FFFFFF;        /* ヘッダー / タブバー */
  --chrome-line: inset 0 0 0 1px #F1EBE1;
  --surface: #F4F5F6;       /* パネル・フォーム・表 */
  --text: #2B1B33;
  --body: #3C4248;          /* 解説本文 */
  --muted: #5F666D;
  --muted-2: #6B7278;
  --faint: #666D74;
  --line: #E6E8EA;          /* 見出しの罫・表ヘッダ下 */
  --line-soft: #ECEEEF;     /* 表の行間 */
  --field-line: #DEE1E3;
  --dashed: #CFD3D6;
  --accent: #D6247E;
  --accent-bg: #FDE9F2;
  --lime: #E4F13F;
  --amber: #F5A623;
  --amber-bg: #FDF1DE;
  --amber-text: #9C6404;
  --radio-off: #DFE1E1;
  --radio-dot-off: #C4C7C7;
  --radio-on: #D6247E;          /* 選択中の枠。ダークはライムに変わる */
  --radio-bg: #FFFFFF;          /* 未選択の面 */
  --radio-dot-bg: #FFFFFF;
  --radio-on-dot: radial-gradient(circle, #D6247E 0 5px, #fff 6px);
  --chip-bg: #FFFFFF;
  --chip-line: #CFD3D6;
  --result-bg: linear-gradient(180deg, #FDE9F2, #FFFFFF);
  --result-border: 2px solid #2B1B33;
  --result-shadow: 0 4px 0 #2B1B33;
  --result-error-bg: #FBE6CE;
  --result-error-border: 2px solid #2B1B33;
  --row-next: #FDE9F2;
  --nav-filter: none;
  --shell-shadow: 0 18px 40px rgba(31, 35, 40, .12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --backdrop: #17111B;
    --card: #1E1622;
    --chrome: #150F19;
    --chrome-line: none;
    --surface: #2A2030;
    --text: #F7F2EA;
    --body: #C3C8CE;
    --muted: #A8AEB6;
    --muted-2: #8A9099;
    --faint: #6C737C;
    --line: #2E3338;
    --line-soft: #262B30;
    --field-line: #33383F;
    --dashed: #3A4048;
    --accent: #F272A9;
    --accent-bg: rgba(242, 114, 169, .18);
    --amber-bg: rgba(245, 166, 35, .16);
    --amber-text: #F5A623;
    --radio-off: #33383F;
    --radio-dot-off: #4A5058;
    --radio-on: #E4F13F;
    --radio-bg: #2A2030;
    --radio-dot-bg: transparent;
    --radio-on-dot: radial-gradient(circle, #E4F13F 0 5px, transparent 6px);
    --chip-bg: #1E1622;
    --chip-line: #3A4048;
    --result-bg: linear-gradient(180deg, #20302F, #1E2226);
    --result-border: 1.5px solid #E4F13F;
    --result-shadow: none;
    --result-error-bg: #2A241C;
    --result-error-border: 1.5px solid #F5A623;
    --row-next: rgba(242, 114, 169, .12);
    --nav-filter: invert(1) brightness(.92);
    --shell-shadow: 0 24px 50px rgba(20, 18, 16, .35);
  }
}

/* ---------- ベース ---------- */

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--backdrop);
  color: var(--text);
  font-family: "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic UI",
    "Noto Sans JP", -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; }
input, select, button { font-family: inherit; }
summary { list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }

/* ピクセルアート素材はニアレストネイバーで拡縮する（2倍素材を等倍で置く） */
.px { image-rendering: pixelated; }

/* 読み上げ専用。カウントアップを1桁ずつ読み上げさせないため、結果は確定文だけを流す */
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- アプリシェル（モバイル単一カラム / PC は中央寄せカード） ---------- */

.shell {
  max-width: 520px;
  margin: 0 auto;
  background: var(--card);
  overflow: hidden;
}

@media (min-width: 560px) {
  body { padding: 28px 16px 48px; }
  .shell { border-radius: 30px; box-shadow: var(--shell-shadow); }
}

/* ---------- ヘッダー ---------- */

.hdr {
  display: flex; align-items: center; justify-content: center;
  position: relative; padding: 15px 18px;
  background: var(--chrome); box-shadow: var(--chrome-line);
}
.hdr__brand { display: flex; align-items: center; gap: 9px; color: var(--text); }
.hdr__brand:hover { text-decoration: none; }
.hdr__logo { width: 39px; height: 26px; object-fit: contain; }
.hdr__name { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: .04em; }
.hdr__dots {
  position: absolute; right: 18px;
  font-size: 18px; color: var(--muted-2); letter-spacing: .1em;
}

/* ツールページのヘッダー */
.hdr--tool { justify-content: flex-start; gap: 10px; padding: 14px 18px; }
.hdr__back { font-size: 20px; color: var(--text); line-height: 1; }
.hdr__back:hover { text-decoration: none; }
.hdr__title { margin: 0; font-size: 15px; font-weight: 800; letter-spacing: .03em; }
.hdr__pill {
  margin-left: auto; font-size: 11px; font-weight: 800;
  color: var(--accent); background: var(--accent-bg);
  padding: 4px 10px; border-radius: 99px;
}

/* ---------- ヒーロー ---------- */

.hero {
  position: relative; background: var(--chrome); overflow: hidden;
  /* 元デザインは 480px 幅で高さ 250px = 素材と同じ比率。
     幅可変でも切れないよう比率で持つ。 */
  aspect-ratio: 1738 / 905;
}
.hero img { width: 100%; height: 100%; object-fit: cover; }

.hero-dots {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 0 6px; background: var(--card);
}
.hero-dots span { width: 44px; height: 4px; border-radius: 2px; background: var(--dashed); }
.hero-dots span[data-on] { background: var(--lime); }

/* ---------- 告知バー ---------- */

.notice-wrap { padding: 10px 16px 4px; }
.notice {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 18px; background: var(--surface); border-radius: 16px;
}
.notice__main { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 800; }
.notice__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--lime); }
.notice__count { font-size: 13px; font-weight: 700; color: var(--muted-2); }

/* ---------- 本文コンテナ ---------- */

.body { padding: 20px 16px 6px; display: flex; flex-direction: column; gap: 22px; }
.body--tool { gap: 14px; }

/* ---------- カテゴリ ---------- */

.cat { display: flex; flex-direction: column; gap: 13px; }
.cat__head { display: flex; align-items: center; gap: 9px; }
/* カテゴリ見出しは塗りアイコン（-on）をそのまま使う。反転はタブバーの非選択だけ */
.cat__icon { width: 22px; height: 22px; }
.cat__name { font-size: 15px; font-weight: 800; letter-spacing: .04em; }
.cat__rule { flex: 1; height: 1px; background: var(--line); }

.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }

/* ---------- ツールタイル ---------- */

.tile { display: flex; flex-direction: column; align-items: center; gap: 9px; color: var(--text); }
.tile:hover { text-decoration: none; }
.tile__box {
  width: 74px; height: 74px; border-radius: 22px;
  display: flex; align-items: center; justify-content: center;
  background: var(--tile-bg); color: var(--tile-fg);
  font-size: 24px; font-weight: 800;
}
.tile__box img { width: 44px; height: 44px; }
.tile__label { font-size: 11px; font-weight: 800; text-align: center; line-height: 1.4; }

.tile--soon .tile__box {
  background: var(--surface); border: 2px dashed var(--dashed);
  font-size: 11px; font-weight: 400; color: var(--faint);
}
.tile--soon .tile__label { color: var(--faint); }

/* タイル配色（カテゴリ内で隣と被らないだけのルール。1色1ツールの固定表は作らない） */
.t-lime   { --tile-bg: #E4F13F; --tile-fg: #2B1B33; }
.t-blue   { --tile-bg: #35A0F0; --tile-fg: #08131E; }
.t-amber  { --tile-bg: #F5A623; --tile-fg: #1E1405; }
.t-pink   { --tile-bg: #FF5C7A; --tile-fg: #26060E; }
.t-purple { --tile-bg: #8B7BF0; --tile-fg: #100B26; }
.t-terra  { --tile-bg: #E2725B; --tile-fg: #FFFFFF; }
@media (prefers-color-scheme: dark) {
  .t-terra { --tile-bg: #F7F2EA; --tile-fg: #1E1622; }
}

/* ---------- マスコットのひとこと ---------- */

.mascot-note {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; background: var(--surface); border-radius: 16px;
}
.mascot-note img { width: 51px; height: 34px; object-fit: contain; flex: none; }
.mascot-note p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.7; }

/* ---------- フッター ---------- */

.foot { padding: 18px 18px 14px; display: flex; flex-direction: column; gap: 9px; }
.foot--tool { padding-top: 20px; }
.foot__links { display: flex; gap: 14px; font-size: 12px; }
.foot__links a { color: var(--muted); }
.foot__meta { font-size: 11px; color: var(--faint); line-height: 1.7; }

/* ---------- タブバー ---------- */

.tabs {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  padding: 10px 8px 14px; background: var(--chrome); box-shadow: var(--chrome-line);
}
.tabs a {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  color: var(--muted-2); font-size: 11px; font-weight: 800;
}
.tabs a:hover { text-decoration: none; }
.tabs img { width: 26px; height: 26px; filter: var(--nav-filter); }
.tabs a[aria-current] { color: var(--accent); }
.tabs a[aria-current] img { filter: none; }

/* ---------- フォーム ---------- */

.lead { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.8; }

.form { background: var(--surface); border-radius: 22px; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field__label { font-size: 13px; font-weight: 800; color: var(--muted); }

/* iOS Safari のフォーカス時オートズームを避けるため 16px 以上を必須にする */
.input {
  width: 100%; font-size: 17px; padding: 13px;
  border: 2px solid var(--field-line); border-radius: 14px;
  background: var(--card); color: var(--text);
  font-variant-numeric: tabular-nums;
}

.opts { display: flex; flex-direction: column; gap: 7px; }
.opt {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 12px 13px; border: 2px solid var(--radio-off); border-radius: 13px;
  background: var(--radio-bg); color: var(--text); cursor: pointer;
}
.opt__dot {
  width: 18px; height: 18px; flex: none; border-radius: 50%;
  border: 2px solid var(--radio-dot-off); background: var(--radio-dot-bg);
}
.opt__label { font-size: 16px; font-weight: 700; }
.opt[aria-checked="true"] { border-color: var(--radio-on); background: var(--accent-bg); }
.opt[aria-checked="true"] .opt__dot { border-color: var(--radio-on); background: var(--radio-on-dot); }

.submit {
  width: 100%; padding: 16px; font-size: 17px; font-weight: 800;
  color: #2B1B33; background: var(--lime); border: none; border-radius: 15px; cursor: pointer;
}
.submit:active { transform: translateY(2px); }

/* ---------- 結果カード ---------- */

.result {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 12px;
  padding: 18px; border-radius: 22px;
  border: var(--result-border); box-shadow: var(--result-shadow);
  background: var(--result-bg);
}
.result[data-phase="error"] { background: var(--result-error-bg); border: var(--result-error-border); }
.result[data-phase="done"] { animation: ow-pop .42s cubic-bezier(.2, .9, .3, 1.2) both; }

.result__shine { position: absolute; inset: 0; overflow: hidden; border-radius: 22px; pointer-events: none; }
.result__shine i {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0;
  background: linear-gradient(100deg, transparent 40%, rgba(255, 255, 255, .6) 50%, transparent 60%);
}
.result[data-phase="done"] .result__shine i { animation: ow-shine .9s ease-out .15s 1; }

.result__head { position: relative; display: flex; align-items: center; gap: 12px; }
.result__face { flex: none; }
.result[data-phase="done"] .result__face { animation: ow-wiggle .5s ease-in-out 2; }
.result__face img { width: 75px; height: 50px; object-fit: contain; }
.result__kicker { font-size: 12px; font-weight: 800; color: var(--accent); }
.result__sub { font-size: 13px; color: var(--muted); line-height: 1.6; }

.result__num { position: relative; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.result__date { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.result__days { font-size: 46px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--accent); }
.result__unit { font-size: 18px; font-weight: 800; }
.result__tail, .result__mid { font-size: 14px; color: var(--muted); }

.chips { position: relative; display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  font-size: 11px; font-weight: 700; background: var(--chip-bg);
  border: 1.5px solid var(--chip-line); border-radius: 99px; padding: 4px 10px;
}
.chip--duty { background: var(--amber-bg); border-color: var(--amber); color: var(--amber-text); }

/* ---------- 表 ---------- */

.panel { background: var(--surface); border-radius: 22px; overflow: hidden; }
.panel__head { padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; }
.panel__title { font-size: 14px; font-weight: 800; }
.panel__note { font-size: 11px; color: var(--muted-2); }

.ow-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ow-table th {
  text-align: left; font-size: 12px; font-weight: 800; color: var(--muted-2);
  padding: 8px 16px; border-bottom: 1px solid var(--line);
}
.ow-table th:nth-child(2) { padding: 8px 8px; }
.ow-table th:last-child { text-align: right; }
.ow-table td { font-size: 14px; padding: 11px 16px; border-bottom: 1px solid var(--line-soft); }
.ow-table td:nth-child(2) { padding: 11px 8px; color: var(--muted); }
.ow-table td:last-child { text-align: right; white-space: nowrap; }
.ow-table .days { font-size: 16px; font-weight: 800; }
.ow-table .unit { font-size: 12px; }
.ow-table tr[data-next] td { background: var(--row-next); }
.ow-table .empty { color: var(--muted); font-size: 13px; text-align: center; padding: 18px 16px; }

/* 解説内の付与日数表は列が多いので、狭い画面では横スクロールさせる */
.scroll-x { overflow-x: auto; background: var(--surface); border-radius: 16px; }
.ow-table--compact th, .ow-table--compact td { padding: 9px 10px; font-size: 13px; white-space: nowrap; }
.ow-table--compact th { font-size: 11px; line-height: 1.3; text-align: right; }
.ow-table--compact th:first-child, .ow-table--compact td:first-child { text-align: left; }
.ow-table--compact td { text-align: right; }
.ow-table--compact td:nth-child(2) { color: inherit; }
.ow-table--compact tr:last-child td { border-bottom: none; }

.badge-duty {
  display: inline-block; margin-left: 6px; font-size: 10px; font-weight: 800;
  background: var(--amber-bg); border: 1.2px solid var(--amber); color: var(--amber-text);
  border-radius: 99px; padding: 2px 6px;
}

/* 印刷時は装飾を落として読める表にする */
@media print {
  .ow-table td, .ow-table th { background: #fff !important; color: #000 !important; }
}

/* ---------- 広告枠 ---------- */

.ad { display: flex; flex-direction: column; gap: 5px; }
.ad__label { font-size: 10px; color: var(--faint); letter-spacing: .08em; }
.ad__slot {
  min-height: 250px; border: 1.5px dashed var(--dashed); border-radius: 14px;
  background: var(--surface); display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--faint); text-align: center; padding: 12px;
}

/* AdSense 審査を通すまでは広告枠を出さない。中身のない広告枠はプログラムポリシー上のリスクになる。
   承認が下りたら、この1ブロックを消せば枠が復帰する（マークアップは各ツールページに残してある）。 */
.ad { display: none; }

/* ---------- 解説・FAQ ---------- */

.prose { display: flex; flex-direction: column; gap: 12px; padding-top: 4px; }
.prose h2 { margin: 0; font-size: 18px; font-weight: 800; }
.prose h3 { margin: 0; font-size: 15px; font-weight: 800; }
.prose p { margin: 0; font-size: 14px; line-height: 1.9; color: var(--body); text-wrap: pretty; }
.prose a { text-decoration: underline; }

.faq { background: var(--surface); border-radius: 16px; padding: 14px 16px; }
.faq summary { font-size: 14px; font-weight: 800; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.faq summary::after { content: "＋"; color: var(--accent); font-size: 18px; }
.faq[open] summary::after { content: "－"; }
.faq p { margin: 10px 0 0; font-size: 13px; line-height: 1.85; color: var(--body); }

.related { display: flex; flex-direction: column; gap: 11px; padding-top: 4px; }
.related__title { font-size: 15px; font-weight: 800; }

/* ---------- モーション ---------- */

@keyframes ow-pop {
  0% { transform: scale(.92) translateY(10px); opacity: 0 }
  65% { transform: scale(1.02) translateY(0); opacity: 1 }
  100% { transform: scale(1) }
}
@keyframes ow-wiggle {
  0%, 100% { transform: rotate(-4deg) }
  50% { transform: rotate(4deg) }
}
@keyframes ow-shine {
  0% { transform: translateX(-100%); opacity: 1 }
  100% { transform: translateX(100%); opacity: 0 }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
