:root {
  --paper: #fffdf8;
  --ground: #f3efe6;
  --ink: #18262a;
  --muted: #718085;
  --line: #d9d5ca;
  --accent: #f04d32;
  --accent-dark: #d93d27;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--ground); color: var(--ink); scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: radial-gradient(circle at 10% 0%, rgba(240, 77, 50, 0.08), transparent 25rem), linear-gradient(180deg, #f8f5ee 0%, var(--ground) 100%);
  color: var(--ink);
  font-family: "Helvetica Neue", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.modal-open, body.hint-open, body.notice-open { overflow: hidden; }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.site-shell { width: min(100%, 1120px); margin: 0 auto; padding: 0 28px 40px; }
.site-header { padding: 78px 0 62px; text-align: center; }
.site-header h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(3.8rem, 10vw, 7rem); font-weight: 500; letter-spacing: -.075em; line-height: .95; word-spacing: .14em; }
.title-osaka-word { display: inline-flex; align-items: baseline; gap: 2.75px; letter-spacing: 0; word-spacing: 0; }
.osaka-easter-egg { display: inline-block; margin: 0; font-size: .5pt; font-weight: 500; letter-spacing: 0; line-height: 1; vertical-align: baseline; word-spacing: 0; }
.title-rule { position: relative; width: 138px; height: 13px; margin: 22px auto 20px; border-top: 1px solid var(--ink); }
.title-rule span { position: absolute; top: -4px; left: 50%; width: 7px; height: 7px; background: var(--accent); transform: translateX(-50%) rotate(45deg); }
.intro { margin: 0; color: #536368; font-size: clamp(.86rem, 2.5vw, 1rem); letter-spacing: .08em; }
.puzzle-section { margin-bottom: 76px; }
.section-heading { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 14px; margin-bottom: 20px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.section-heading p, .answer-number { margin: 0; color: var(--accent); font-size: .7rem; font-weight: 800; letter-spacing: .16em; }
.section-heading h2, .answer-section h2 { margin: 0; font-size: 1rem; font-weight: 750; letter-spacing: .1em; }
.section-heading span { color: var(--muted); font-size: .72rem; letter-spacing: .04em; }
.puzzle-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.puzzle-card { position: relative; display: block; width: 100%; padding: 10px 10px 13px; overflow: hidden; border: 1px solid rgba(24, 38, 42, .14); border-radius: 4px; background: var(--paper); box-shadow: 0 11px 35px rgba(45, 43, 36, .08); color: var(--ink); cursor: zoom-in; text-align: left; transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease; }
.puzzle-card:hover, .puzzle-card:focus-visible { border-color: rgba(240, 77, 50, .65); box-shadow: 0 16px 42px rgba(45, 43, 36, .14); outline: none; transform: translateY(-3px); }
.puzzle-label { position: absolute; z-index: 2; top: 18px; left: 18px; display: grid; min-width: 34px; height: 34px; padding: 0 10px; place-items: center; border-radius: 2px; background: var(--ink); box-shadow: 0 4px 12px rgba(0, 0, 0, .18); color: #fff; font-size: .72rem; font-weight: 800; letter-spacing: .08em; }
.image-frame { display: grid; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; place-items: center; background: #fff; }
.image-frame img { display: block; width: 100%; height: 100%; object-fit: contain; }
.expand-hint { display: flex; align-items: center; justify-content: flex-end; gap: 7px; padding: 10px 4px 0; color: var(--muted); font-size: .6rem; font-weight: 700; letter-spacing: .14em; }
.expand-hint span { color: var(--accent); font-size: 1rem; font-weight: 400; line-height: .8; }
.final-section { width: min(100%, 820px); margin-right: auto; margin-left: auto; }
.final-card .image-frame { aspect-ratio: 1.52 / 1; }
.answer-section { width: min(100%, 560px); margin: 0 auto 90px; padding: 40px clamp(20px, 5vw, 52px) 30px; border-top: 3px solid var(--ink); background: var(--paper); box-shadow: 0 18px 55px rgba(45, 43, 36, .09); text-align: center; }
.answer-number { margin-bottom: 7px; }
.answer-section h2 { margin-bottom: 27px; font-size: 1.14rem; }
.answer-form { display: grid; grid-template-columns: 1fr; gap: 12px; }
.answer-form input { width: 100%; min-width: 0; height: 54px; padding: 0 18px; border: 1px solid #c9c7c0; border-radius: 3px; background: #fff; color: var(--ink); font-size: 1rem; letter-spacing: .08em; outline: none; transition: border-color 160ms ease, box-shadow 160ms ease; }
.answer-form input::placeholder { color: #a2a6a7; letter-spacing: .02em; }
.answer-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(240, 77, 50, .12); }
.answer-form button { width: 100%; height: 54px; border: 0; border-radius: 3px; background: var(--accent); color: #fff; font-weight: 750; letter-spacing: .15em; cursor: pointer; transition: background 160ms ease, transform 160ms ease, opacity 160ms ease; }
.answer-form button:not(:disabled):hover, .answer-form button:not(:disabled):focus-visible { background: var(--accent-dark); outline: none; transform: translateY(-1px); }
.answer-form button:disabled { background: #b8b9b5; cursor: not-allowed; opacity: .7; }
.judge-message { min-height: 3.2em; margin: 17px 0 0; color: #d92f25; font-size: .95rem; font-weight: 750; letter-spacing: .08em; line-height: 1.65; opacity: 0; white-space: pre-line; transform: translateY(-4px); transition: opacity 160ms ease, transform 160ms ease; }
.judge-message.is-visible { opacity: 1; transform: translateY(0); }
footer { display: grid; gap: 8px; padding: 22px 0 12px; border-top: 1px solid var(--line); color: #8a8f8e; font-family: Georgia, "Times New Roman", serif; font-size: .82rem; letter-spacing: .12em; text-align: center; }
.creator-credit { color: #9da4a4; font-size: .68rem; letter-spacing: .1em; }
.creator-credit strong { color: var(--ink); font-weight: 600; }
.puzzle-modal { position: fixed; z-index: 100; inset: 0; display: grid; padding: clamp(52px, 8vw, 80px) clamp(14px, 4vw, 52px) 24px; place-items: center; background: rgba(13, 22, 25, .92); cursor: zoom-out; animation: modal-in 180ms ease both; backdrop-filter: blur(8px); }
.modal-image-wrap { position: relative; display: grid; max-width: min(1180px, 96vw); max-height: 88svh; place-items: center; }
.modal-image-wrap img { display: block; max-width: 100%; max-height: calc(88svh - 50px); border-radius: 3px; background: #fff; box-shadow: 0 24px 80px rgba(0, 0, 0, .38); object-fit: contain; }
.modal-image-wrap p { margin: 12px 0 0; color: rgba(255, 255, 255, .65); font-size: .7rem; letter-spacing: .09em; }
.modal-label { position: absolute; z-index: 2; top: 12px; left: 12px; padding: 8px 12px; border-radius: 2px; background: var(--ink); color: #fff; font-size: .72rem; font-weight: 800; letter-spacing: .08em; }
.modal-close { position: fixed; z-index: 3; top: max(14px, env(safe-area-inset-top)); right: 18px; display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid rgba(255, 255, 255, .3); border-radius: 50%; background: transparent; color: #fff; cursor: pointer; font-size: 1.65rem; font-weight: 200; line-height: 1; }
.hint-trigger { position: fixed; z-index: 90; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); display: flex; height: 54px; padding: 0 20px 0 14px; align-items: center; gap: 9px; border: 0; border-radius: 999px; background: var(--ink); box-shadow: 0 10px 28px rgba(24, 38, 42, .24); color: #fff; cursor: pointer; font-size: .86rem; font-weight: 750; letter-spacing: .08em; transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease; }
.hint-trigger:hover, .hint-trigger:focus-visible { background: #263b40; box-shadow: 0 13px 32px rgba(24, 38, 42, .3); outline: none; transform: translateY(-2px); }
.hint-trigger-mark { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 50%; background: var(--accent); color: #fff; font-family: Georgia, "Times New Roman", serif; font-size: 1rem; font-weight: 700; line-height: 1; }
.hint-layer { position: fixed; z-index: 120; inset: 0; display: grid; grid-template-columns: 1fr min(420px, calc(100% - 24px)); }
.hint-backdrop { position: absolute; inset: 0; background: rgba(13, 22, 25, .58); backdrop-filter: blur(4px); }
.hint-drawer { position: relative; z-index: 1; grid-column: 2; height: 100%; padding: max(30px, env(safe-area-inset-top)) 28px max(30px, env(safe-area-inset-bottom)); overflow-y: auto; background: var(--paper); box-shadow: -18px 0 55px rgba(13, 22, 25, .2); animation: hint-drawer-in 230ms ease both; }
.hint-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 34px; padding-bottom: 20px; border-bottom: 2px solid var(--ink); }
.hint-header p { margin: 0 0 5px; color: var(--accent); font-size: .65rem; font-weight: 800; letter-spacing: .24em; }
.hint-header h2 { margin: 0; font-size: 1.35rem; letter-spacing: .08em; }
.hint-close { min-width: 74px; height: 42px; padding: 0 17px; border: 1px solid rgba(24, 38, 42, .25); border-radius: 999px; background: transparent; color: var(--ink); cursor: pointer; font-size: .78rem; font-weight: 750; letter-spacing: .08em; transition: border-color 160ms ease, background 160ms ease; }
.hint-close:hover, .hint-close:focus-visible { border-color: var(--accent); background: rgba(240, 77, 50, .07); outline: none; }
.hint-list { border-top: 1px solid var(--line); }
.hint-item { border-bottom: 1px solid var(--line); }
.hint-toggle { display: flex; width: 100%; min-height: 62px; padding: 16px 4px; align-items: center; justify-content: space-between; gap: 20px; border: 0; background: transparent; color: var(--ink); cursor: pointer; text-align: left; }
.hint-toggle:hover, .hint-toggle:focus-visible { color: var(--accent-dark); outline: none; }
.hint-toggle > span:first-child { font-size: .92rem; font-weight: 750; letter-spacing: .04em; }
.hint-chevron { flex: 0 0 auto; width: 10px; height: 10px; margin-right: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform 180ms ease; }
.hint-toggle[aria-expanded="true"] .hint-chevron { transform: rotate(225deg) translate(-2px, -2px); }
.hint-content { margin: 0 4px 18px; padding: 17px 18px; border-left: 3px solid var(--accent); background: #f5f1e8; color: #495a5f; }
.hint-content p { margin: 0; font-size: .9rem; line-height: 1.8; }
.hint-content p + p { margin-top: .85em; }
.notice-trigger { position: fixed; z-index: 90; top: max(16px, env(safe-area-inset-top)); left: max(18px, env(safe-area-inset-left)); display: grid; width: 42px; height: 42px; padding: 0; place-items: center; border: 1px solid rgba(24, 38, 42, .18); border-radius: 50%; background: rgba(255, 253, 248, .94); box-shadow: 0 8px 24px rgba(24, 38, 42, .15); color: var(--ink); cursor: pointer; font-family: Georgia, "Times New Roman", serif; font-size: 1.05rem; font-weight: 700; line-height: 1; transition: border-color 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease; backdrop-filter: blur(8px); }
.notice-trigger:hover, .notice-trigger:focus-visible { border-color: var(--accent); box-shadow: 0 10px 28px rgba(24, 38, 42, .2); color: var(--accent-dark); outline: none; transform: translateY(-2px); }
.notice-layer { position: fixed; z-index: 130; inset: 0; display: grid; padding: 20px; place-items: center; }
.notice-backdrop { position: absolute; inset: 0; background: rgba(13, 22, 25, .68); backdrop-filter: blur(6px); }
.notice-card { position: relative; z-index: 1; width: min(100%, 560px); max-height: min(84svh, 720px); padding: clamp(34px, 6vw, 52px); overflow-y: auto; border-top: 4px solid var(--accent); border-radius: 4px; background: var(--paper); box-shadow: 0 28px 90px rgba(13, 22, 25, .34); animation: notice-card-in 220ms ease both; }
.notice-close { position: absolute; top: 14px; right: 14px; display: grid; width: 40px; height: 40px; padding: 0; place-items: center; border: 1px solid rgba(24, 38, 42, .2); border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer; font-size: 1.45rem; font-weight: 300; line-height: 1; }
.notice-close:hover, .notice-close:focus-visible { border-color: var(--accent); color: var(--accent-dark); outline: none; }
.notice-kicker { margin: 0 0 8px; color: var(--accent); font-size: .64rem; font-weight: 800; letter-spacing: .24em; }
.notice-card h2 { margin: 0 0 26px; font-size: 1.4rem; letter-spacing: .1em; }
.notice-card ul { display: grid; gap: 13px; margin: 0; padding: 0 0 0 1.25em; color: #495a5f; }
.notice-card li { padding-left: .25em; font-size: .9rem; line-height: 1.75; }
.clear-screen { position: relative; display: grid; min-height: 100svh; overflow-x: hidden; padding: 30px; place-items: center; background: var(--ink); color: #fff; }
.clear-screen::before, .clear-screen::after { position: absolute; width: 44vw; height: 44vw; border: 1px solid rgba(255, 255, 255, .08); border-radius: 50%; content: ""; }
.clear-screen::before { top: -22vw; left: -13vw; }
.clear-screen::after { right: -18vw; bottom: -25vw; }
.clear-glow { position: absolute; width: min(78vw, 760px); height: min(78vw, 760px); border-radius: 50%; background: radial-gradient(circle, rgba(240, 77, 50, .18), transparent 66%); animation: glow-pulse 3.8s ease-in-out infinite; }
.clear-card { position: relative; z-index: 1; width: min(94vw, 820px); text-align: center; }
.clear-kicker { margin: 0 0 38px; color: var(--accent); font-size: .72rem; font-weight: 800; letter-spacing: .34em; animation: fade-up 650ms ease both; }
.anagram-logo { position: relative; width: 7.2em; height: 1.2em; margin: 0 auto; font-family: Georgia, "Times New Roman", serif; font-size: clamp(3.2rem, 13vw, 7.8rem); font-weight: 500; line-height: 1; }
.anagram-letter { position: absolute; top: 0; left: calc(var(--from) * 1em); width: .9em; color: #fff; text-align: center; transition: left 1.35s cubic-bezier(.65, 0, .2, 1) var(--delay), color 700ms ease 800ms, transform 1.35s cubic-bezier(.65, 0, .2, 1) var(--delay); }
.anagram-logo.is-solved .anagram-letter { left: calc(var(--to) * 1em); color: var(--accent); transform: rotate(360deg); }
.anagram-logo.is-solved .anagram-letter:nth-child(even) { color: #fff; transform: rotate(-360deg); }
.clear-copy { margin-top: 46px; opacity: 0; transform: translateY(18px); transition: opacity 700ms ease 1.45s, transform 700ms ease 1.45s; }
.clear-copy.is-visible { opacity: 1; transform: translateY(0); }
.clear-copy h1 { margin: 0; font-size: clamp(1.5rem, 5vw, 2.25rem); letter-spacing: .06em; }
.clear-copy > h1 + p { margin: 15px 0 0; color: rgba(255, 255, 255, .68); font-size: clamp(.82rem, 2.5vw, .98rem); }
.clear-extra-note { margin: 8px 0 0; color: rgba(255, 255, 255, .45); font-size: .68rem; letter-spacing: .04em; }
.x-share-button { display: inline-flex; min-height: 50px; margin-top: 34px; padding: 0 22px; align-items: center; justify-content: center; gap: 11px; border: 1px solid rgba(255, 255, 255, .2); border-radius: 999px; background: #080c0d; box-shadow: 0 10px 28px rgba(0, 0, 0, .24); color: rgba(255, 255, 255, .82); font-size: .86rem; font-weight: 700; letter-spacing: .07em; text-decoration: none; transition: border-color 180ms ease, background 180ms ease, color 180ms ease, transform 180ms ease, box-shadow 180ms ease; }
.x-share-button:hover, .x-share-button:focus-visible { border-color: rgba(240, 77, 50, .72); background: #020303; box-shadow: 0 12px 32px rgba(0, 0, 0, .34); color: #fff; outline: none; transform: translateY(-2px); }
.x-share-mark { display: grid; width: 25px; height: 25px; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-family: "Helvetica Neue", Arial, sans-serif; font-size: .72rem; font-weight: 700; letter-spacing: 0; line-height: 1; }
.clear-explanation { width: min(100%, 660px); margin: 28px auto 0; border: 1px solid rgba(255, 255, 255, .17); border-radius: 4px; background: rgba(255, 255, 255, .035); text-align: left; }
.clear-explanation summary { position: relative; padding: 17px 50px 17px 20px; color: rgba(255, 255, 255, .78); cursor: pointer; font-size: .8rem; font-weight: 750; letter-spacing: .1em; list-style: none; }
.clear-explanation summary::-webkit-details-marker { display: none; }
.clear-explanation summary::after { position: absolute; top: 50%; right: 20px; color: var(--accent); content: "+"; font-size: 1.25rem; font-weight: 300; line-height: 1; transform: translateY(-50%); }
.clear-explanation[open] summary { border-bottom: 1px solid rgba(255, 255, 255, .12); }
.clear-explanation[open] summary::after { content: "−"; }
.clear-explanation-content { padding: 22px 20px 24px; color: rgba(255, 255, 255, .7); font-size: .78rem; line-height: 1.9; }
.clear-explanation-content p { margin: 0; }
.clear-explanation-content p + p { margin-top: 14px; }
.clear-explanation-question { margin-top: 24px !important; color: var(--accent); font-weight: 700; text-align: center; }
.clear-credits { margin-top: 34px; color: rgba(255, 255, 255, .48); font-size: .68rem; letter-spacing: .07em; line-height: 1.8; }
.clear-credits p { margin: 0; }
.clear-credits .clear-credits-title { margin-bottom: 7px; color: rgba(255, 255, 255, .7); font-size: .62rem; font-weight: 800; letter-spacing: .2em; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@keyframes modal-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes hint-drawer-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }
@keyframes hint-drawer-up { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes notice-card-in { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes glow-pulse { 0%, 100% { opacity: .75; transform: scale(.94); } 50% { opacity: 1; transform: scale(1.04); } }

@media (max-width: 640px) {
  .site-shell { padding: 0 14px 28px; }
  .site-header { padding: 54px 0 45px; }
  .puzzle-section { margin-bottom: 58px; }
  .puzzle-grid { gap: 10px; }
  .puzzle-card { padding: 5px 5px 8px; }
  .puzzle-label { top: 10px; left: 10px; min-width: 27px; height: 27px; padding: 0 7px; font-size: .62rem; }
  .expand-hint { gap: 4px; padding: 7px 2px 0; font-size: .48rem; letter-spacing: .09em; }
  .section-heading { grid-template-columns: auto 1fr; }
  .section-heading > span { display: none; }
  .answer-section { margin-bottom: 60px; }
  .answer-form { gap: 10px; }
  .answer-form input { padding: 0 12px; font-size: .94rem; }
  .puzzle-modal { padding-right: 8px; padding-left: 8px; }
  .modal-label { top: 7px; left: 7px; }
  .hint-trigger { right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); height: 50px; padding-right: 17px; padding-left: 11px; }
  .hint-trigger-mark { width: 27px; height: 27px; }
  .notice-trigger { top: max(12px, env(safe-area-inset-top)); left: max(12px, env(safe-area-inset-left)); width: 40px; height: 40px; }
  .notice-layer { padding: 12px; }
  .notice-card { max-height: 88svh; padding: 36px 22px 28px; }
  .hint-layer { grid-template-columns: 1fr; align-items: end; }
  .hint-drawer { grid-column: 1; width: 100%; height: min(80svh, 720px); padding: 24px 18px max(24px, env(safe-area-inset-bottom)); border-radius: 16px 16px 0 0; animation-name: hint-drawer-up; }
  .hint-header { margin-bottom: 24px; }
  .clear-screen { padding: 20px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0ms !important; }
}
