:root {
  color-scheme: light;
  --ink: #302822;
  --red: #a12e23;
  --gold: #ad8d54;
  --paper: #f7f3e9;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: #201d1a;
  color: var(--ink);
  font-family: 'Noto Serif JP', 'Yu Mincho', serif;
}
.page {
  max-width: 480px;
  min-height: 100vh;
  margin: auto;
  background: var(--paper);
  box-shadow: 0 0 45px #0004;
  overflow: hidden;
}
.header {
  min-height: 88px;
  padding: 14px 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #211d1a;
  border-bottom: 3px double #a78853;
  color: #f6edda;
}
.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; font-size: 10px; line-height: 1.45; letter-spacing: .18em; }
.brand strong { font-size: 15px; font-weight: 600; }
.seal { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid #b79a65; color: #e0c995; font-size: 12px; letter-spacing: .08em; }
.language { display: flex; align-items: center; gap: 1px; font: 11px sans-serif; color: #a99b82; }
.language button { min-width: 44px; min-height: 44px; border: 0; background: none; color: #d2c7b3; padding: 12px 6px; cursor: pointer; }
.language button[aria-pressed=true] { color: #fff8e8; font-weight: 700; text-decoration: underline; text-decoration-color: #bc9a5c; text-underline-offset: 5px; }
.hero { height: 270px; padding: 10px; background: #211d1a; border-bottom: 1px solid #a78853; }
.hero img { width: 100%; height: 100%; object-fit: cover; object-position: center 70%; border: 1px solid #a78853; }
.entry-content, .inner { position: relative; text-align: center; padding: 42px 36px 46px; background: linear-gradient(135deg, #faf7ef, #f4eee2); }
.entry-content::before, .inner::before { content: ''; position: absolute; inset: 13px; border: 1px solid #d7c7a9; pointer-events: none; }
.entry-content > *, .inner > * { position: relative; }
.eyebrow { font: 10px sans-serif; letter-spacing: .23em; color: #80663f; margin: 0 0 16px; }
h1, h2, p { margin-top: 0; }
h1 { white-space: pre-line; font-size: clamp(30px, 8vw, 39px); font-weight: 600; letter-spacing: .2em; line-height: 1.5; margin: 0 0 12px; }
.entry-invitation { font-size: 13px; letter-spacing: .14em; margin: 0 0 32px; }
form label { display: block; font-size: 13px; letter-spacing: .12em; margin-bottom: 12px; }
input { width: 100%; height: 54px; border: 1px solid #aa9a80; background: #fffdf8; text-align: center; color: var(--ink); font: 16px sans-serif; letter-spacing: .12em; border-radius: 0; }
input::placeholder { color: #897d70; }
.primary { width: 100%; min-height: 58px; border: 1px solid #b99454; outline: 1px solid var(--red); outline-offset: 2px; background: var(--red); color: #fff; font: 600 15px 'Noto Serif JP', serif; letter-spacing: .12em; cursor: pointer; }
.primary:disabled { opacity: .55; }
.error { min-height: 1.5em; margin: 7px 0; color: #982a20; font: 12px/1.5 sans-serif; }
.subtle-link, .text-button { display: inline-block; margin-top: 23px; color: #67594a; text-decoration: underline; text-underline-offset: 5px; font: 12px 'Noto Serif JP', serif; letter-spacing: .06em; }
.subtle-link { padding: 14px 8px; }
.text-button { border: 0; background: none; min-height: 44px; cursor: pointer; }
.inner { padding-top: 52px; min-height: 570px; }
.inner h2 { font-size: 25px; font-weight: 600; letter-spacing: .14em; line-height: 1.6; margin-bottom: 25px; }
.inner h2:focus { outline: none; }
.monkey-photo { height: 300px; padding: 6px; overflow: hidden; background: #211d1a; border: 1px solid #a78853; }
.monkey-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center bottom; border: 1px solid #a78853; }
.invitation { font-size: 14px; letter-spacing: .12em; margin: 30px 0; }
.badge { display: inline-block; border: 1px solid #aa8f61; padding: 5px 11px; font-size: 10px; color: #76552b; letter-spacing: .1em; }
.choices { display: flex; gap: 6px; margin-top: 16px; }
.choices button { flex: 1; min-width: 0; min-height: 44px; background: transparent; border: 1px solid #ad9d83; color: var(--ink); font: 12px 'Noto Serif JP', serif; cursor: pointer; }
.choices button[aria-pressed=true] { border-color: var(--red); color: #8b2119; background: #f4e5dc; }
.waiting { display: flex; flex-direction: column; justify-content: center; align-items: center; }
.waiting h2 { font-size: 17px; }
.waiting-mark { display: grid; place-items: center; width: 78px; height: 78px; border: 3px double var(--gold); color: var(--red); margin-bottom: 35px; animation: breathe 2s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .5; transform: scale(.96); } }
.fortune-card { padding: 42px 23px 30px; border: 3px double #b79a65; background: #fffdf7; min-height: 430px; }
.fortune-card::before { content: '三猿'; display: inline-grid; place-items: center; width: 38px; height: 38px; margin-bottom: 25px; border: 1px solid var(--red); color: var(--red); font-size: 11px; letter-spacing: .08em; }
.fortune-rank { font-size: 35px; letter-spacing: .18em; color: var(--red); margin-bottom: 24px; }
.rule { width: 34px; border-top: 1px solid var(--gold); margin: 0 auto 27px; }
.fortune-message { font-size: 16px; line-height: 2.1; white-space: pre-wrap; overflow-wrap: anywhere; }
.action-label { font-size: 11px; color: #80643c; letter-spacing: .14em; margin: 30px 0 10px; }
.fortune-action { font-size: 14px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; }
time { display: block; color: #756754; font: 11px sans-serif; margin-top: 28px; }
.result-actions { display: flex; gap: 10px; margin-top: 20px; }
.result-actions button { flex: 1; min-width: 0; min-height: 52px; background: transparent; border: 1px solid #9d8c72; color: var(--ink); font: 13px 'Noto Serif JP', serif; cursor: pointer; }
.notice { font: 12px/1.5 sans-serif; color: #67594a; margin: 10px 0 0; }
footer { text-align: center; padding: 28px 20px; border-top: 3px double #a78853; color: #d5c7ad; background: #211d1a; font-size: 10px; letter-spacing: .1em; }
footer small { display: block; margin-top: 9px; color: #ad9a79; font: 9px sans-serif; letter-spacing: .16em; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid #b8542c; outline-offset: 3px; }
@media (max-width: 350px) {
  .header { padding: 12px 18px; }
  .entry-content, .inner { padding-left: 24px; padding-right: 24px; }
  .hero { height: 230px; }
  .monkey-photo { height: 250px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; scroll-behavior: auto !important; } }
