:root {
  --paper: #faf7ef;
  --ink: #27241e;
  --accent: #a13324;
  --line: #bcb3a4;
  --muted: #61584e;
  --serif: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif CJK JP", serif;
  color: var(--ink);
  background: var(--paper);
  font: 16px/1.7 "Hiragino Sans","Hiragino Kaku Gothic ProN","Noto Sans JP","Yu Gothic Medium","Yu Gothic",Meiryo,sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
.masthead, main, .notice { width: min(100% - 32px, 500px); margin-inline: auto; }
.masthead { height: 52px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--ink); }
.brand { color: var(--accent); font: 900 1.45rem var(--serif); text-decoration: none; }
main { padding-block: 28px 36px; overflow-wrap: anywhere; }
h1, h2 { font-family: var(--serif); line-height: 1.35; margin: 0; }
h1 { font-size: clamp(1.65rem, 6vw, 2.4rem); }
h2 { font-size: 1.25rem; }
p { margin: 8px 0 18px; }
small, .meta, legend { color: var(--muted); font-size: .875rem; line-height: 1.5; }
a { color: var(--accent); text-underline-offset: .2em; }
button, .button, input, textarea { font: inherit; color: inherit; }
button, .button {
  min-height: 48px; padding: 8px 14px; border: 1px solid var(--ink);
  border-radius: 4px; background: var(--paper); cursor: pointer;
  text-align: center; text-decoration: none; display: inline-grid; place-items: center;
}
button:disabled { opacity: .48; cursor: default; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.primary { background: var(--accent); border-color: var(--accent); color: var(--paper); font-weight: 700; }
.primary:focus-visible { outline-offset: 4px; }
.help { border: 0; color: var(--accent); padding-inline: 0; }
.actions { display: grid; gap: 8px; margin-block: 20px; }
.genre { --genre-band: #a13324; margin-top: 26px; }
.genre[data-genre="作品"] { --genre-band: #97584d; }
.genre[data-genre="人物"] { --genre-band: #87483b; }
.genre[data-genre="スポーツ"] { --genre-band: #a25845; }
.genre[data-genre="生活"] { --genre-band: #9b6857; }
.genre[data-genre="場所"] { --genre-band: #865950; }
.genre h2 { color: var(--accent); border-bottom: 1px solid var(--ink); padding-bottom: 5px; }
.theme-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; list-style: none; padding: 0; margin: 10px 0 0; }
.theme-list a { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; gap: 8px; height: 100%; min-height: 108px; padding: 10px; border: 1px solid var(--line); border-top: 12px solid var(--genre-band); border-radius: 4px; color: var(--ink); font-weight: 700; text-decoration: none; }
.theme-list a:hover { color: var(--accent); }
.theme-count { padding: 2px 8px; border: 1px solid var(--line); border-radius: 99px; font-weight: 400; }
.theme-pickup { grid-column: 1 / -1; }
.theme-pickup a { min-height: 138px; padding: 14px; border-top-width: 20px; font-size: 1.4rem; }
.catalog-create { display: grid; width: 100%; margin-top: 26px; }
fieldset { margin: 20px 0; padding: 0; border: 0; }
legend { margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 24px; padding: 6px 12px; min-height: 48px; }
input[type="radio"], progress { accent-color: var(--accent); }
progress { width: 100%; display: block; height: 8px; margin: 14px 0 8px; }
.play { min-height: 65svh; padding-bottom: calc(160px + env(safe-area-inset-bottom)); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.duel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: clamp(20px, 11svh, 96px); }
.duel button { min-height: 160px; font: 800 clamp(1.1rem, 4.2vw, 1.5rem)/1.4 var(--serif); padding-inline: 8px; overflow-wrap: anywhere; }
.duel button:hover, .duel button:active { background: var(--accent); color: var(--paper); }
.controls { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: min(100%, 532px); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--paper); border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.controls button:first-child { grid-column: 1 / -1; }
.result-box { margin-top: 16px; padding: 14px; border: 3px solid var(--ink); }
.result-box > :first-child { margin-top: 0; }
.result-box .teaser { margin-bottom: 0; }
.result-share { display: grid; gap: 10px; margin-top: 20px; }
.result-share .primary { width: 100%; }
.result-secondary { display: flex; flex-wrap: wrap; gap: 8px; }
.result-secondary > * { padding: 4px 10px; font-size: .875rem; }
.ranking { list-style: none; margin: 14px 0 0; padding: 0; }
.ranking li { display: grid; grid-template-columns: 3rem minmax(0, 1fr); gap: 8px; align-items: baseline; padding: 5px 0; border-bottom: 1px solid var(--line); }
.ranking strong { color: var(--accent); font-variant-numeric: tabular-nums; }
.ranking .winner { grid-template-columns: 4rem minmax(0, 1fr); font: 900 clamp(1.4rem, 5vw, 2.2rem)/1.35 var(--serif); padding: 8px 0 16px; border-color: var(--ink); }
.ranking .winner strong { font-size: 1.3em; }
.ranking .featured { font-size: 1.1rem; font-weight: 700; }
summary { cursor: pointer; min-height: 48px; padding-block: 10px; }
details { margin-top: 12px; }
.teaser { color: var(--accent); margin-top: 16px; }
form label.field { display: block; margin-top: 16px; }
.field input, .field textarea, .share-link { display: block; width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 4px; background: transparent; }
textarea { resize: vertical; }
form .primary { margin-top: 16px; }
.notice { color: var(--accent); }
.notice:empty { display: none; }
.dialog-toast { position: fixed; bottom: calc(130px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); margin: 0; padding: 8px 12px; border: 1px solid var(--accent); background: var(--paper); pointer-events: none; }
dialog { width: min(100% - 32px, 470px); color: var(--ink); background: var(--paper); border: 1px solid var(--ink); }
dialog::backdrop { background: rgb(39 36 30 / .55); }
