@font-face { font-family: "Courier Prime"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/courier-prime-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Courier Prime"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/courier-prime-latin-700-normal.woff2") format("woff2"); }
:root { --bg:#fdf4e8; --card:#fffaf2; --ink:#17302c; --muted:#516761; --line:#ead9c4; --accent:#f58a2c; --link:#a84a0e;
  --red:#b3261e; --yellow:#8a5a00; --green:#1f6b3a; --type:"Courier Prime","Courier New",monospace; --ui:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; color-scheme: light dark; }
:root[data-theme="light"] { color-scheme: light; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg:#1c1633; --card:#281f47; --ink:#f1ecf8; --muted:#b6acca; --line:#40356a; --accent:#ff9f6e; --link:#c9baff; --red:#ff8a80; --yellow:#ffd166; --green:#7bdc9b; } }
:root[data-theme="dark"] { color-scheme: dark; --bg:#1c1633; --card:#281f47; --ink:#f1ecf8; --muted:#b6acca; --line:#40356a; --accent:#ff9f6e; --link:#c9baff; --red:#ff8a80; --yellow:#ffd166; --green:#7bdc9b; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--ui); -webkit-text-size-adjust: 100%; }
a { color: var(--link); }
.wrap { max-width: 860px; margin: 0 auto; padding: 16px 18px 48px; }
.head { text-align: center; padding: 18px 0 8px; }
.head h1 { font-family: var(--type); font-size: 2.1rem; margin: 0; letter-spacing: -.01em; }
.head h1 a { color: inherit; text-decoration: none; }
.tag { color: var(--muted); margin: 6px 0 0; }
.guide { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin: 14px 0; line-height: 1.5; }
.guide h2 { font-family: var(--type); font-size: 1.05rem; margin: 0 0 6px; }
.guide p { margin: 4px 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: 600 15px var(--ui); cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--accent); }
.btn:focus-visible, a:focus-visible, textarea:focus-visible, input:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
.btn.primary { background: #0a3cff; border-color: #0a3cff; color: #fff; }
.btn.small { min-height: 36px; padding: 4px 12px; font-size: 14px; }
.btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tile { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; text-decoration: none; color: inherit; }
.tile:hover { border-color: var(--accent); }
.tile img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--line); }
.tile .cap { padding: 8px 10px 10px; font-size: .9rem; display: grid; gap: 2px; }
.tile .meta { color: var(--muted); font-size: .8rem; }
.photo { display: block; max-width: 100%; max-height: 80vh; margin: 12px auto; border-radius: 12px; background: var(--line); }
.box { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin: 14px 0; }
.box h2 { font-family: var(--type); font-size: 1.1rem; margin: 0 0 8px; }
.story { white-space: pre-wrap; line-height: 1.6; font-family: var(--type); }
.lock { display: flex; gap: 10px; align-items: center; color: var(--muted); }
.study { display: grid; grid-template-columns: 44px 1fr; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.study:first-of-type { border-top: 0; }
.vote { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.vote button { width: 40px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--ink); font-size: 16px; cursor: pointer; }
.vote button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.vote b { font-size: 1rem; }
.by { color: var(--muted); font-size: .85rem; margin-bottom: 4px; }
.tagpill { display: inline-block; font-size: .75rem; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); margin-left: 6px; }
textarea { width: 100%; min-height: 260px; font: 1rem/1.6 var(--type); padding: 12px; border: 2px solid var(--muted); border-radius: 12px; background: #fff; color: #17110a; resize: vertical; }
input[type=text] { width: 100%; font: 1rem var(--ui); padding: 10px; border: 2px solid var(--muted); border-radius: 10px; background: #fff; color: #17110a; }
label.chk { display: flex; gap: 10px; align-items: flex-start; line-height: 1.4; margin: 10px 0; }
label.chk input { width: 22px; height: 22px; margin-top: 2px; }
.counter { font: 700 1.05rem var(--type); }
.counter.red { color: var(--red); } .counter.yellow { color: var(--yellow); } .counter.green { color: var(--green); }
.err { color: var(--red); margin: 8px 0 0; }
.ok { color: var(--green); }
.muted { color: var(--muted); }
.preview { display: block; max-width: 100%; max-height: 50vh; margin: 8px auto; border-radius: 10px; }
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; padding: 16px; }
.overlay .panel { background: var(--bg); color: var(--ink); border-radius: 16px; max-width: 420px; width: 100%; max-height: 90vh; overflow: auto; padding: 18px; display: grid; gap: 10px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
