@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+JP:wght@400;500;600&family=Zen+Kaku+Gothic+New:wght@400;500;700&display=swap');
:root{color-scheme:light;--ink:#423d38;--paper:#fffaf1;--blue:#476f82;--line:rgba(72,67,57,.2);font-family:'Zen Kaku Gothic New',sans-serif;color:var(--ink);font-synthesis:none}
*{box-sizing:border-box}body{margin:0;overflow:hidden;background:#e8ddce}button,a{-webkit-tap-highlight-color:transparent}button{font:inherit;color:inherit;cursor:pointer}a{color:inherit;text-decoration:none}button:disabled{cursor:wait;opacity:.5}button:focus-visible,a:focus-visible,canvas:focus-visible{outline:3px solid #5a94b1;outline-offset:5px}button{border:0}button:hover{filter:brightness(1.045)}[hidden]{display:none!important}#room{height:100svh;height:100dvh;min-height:440px;width:100%;position:relative;isolation:isolate}#world{position:absolute;inset:0;width:100%;height:100%;display:block;touch-action:none}.vignette{position:absolute;inset:0;pointer-events:none;background:linear-gradient(180deg,rgba(255,249,235,.35),transparent 18%,transparent 60%,rgba(32,29,23,.16));z-index:1}.topbar{position:absolute;z-index:4;top:0;left:0;width:100%;padding:25px 38px;display:flex;align-items:center;gap:28px}.brand{font-family:Georgia,serif;font-size:30px;letter-spacing:2px}.brand span{font-size:15px;vertical-align:top;color:#a98956}.room-label{font-size:10px;letter-spacing:.23em;margin-top:5px}.tools{margin-left:auto;display:flex;gap:8px}.tools button{background:rgba(255,252,245,.74);border:1px solid rgba(255,255,255,.6);border-radius:30px;padding:9px 14px;backdrop-filter:blur(12px);font-size:12px}.tools span{margin-left:4px;font-size:10px}.entry{position:absolute;z-index:3;left:6.2%;bottom:12%;max-width:370px;padding:30px 34px;background:rgba(255,250,239,.77);border:1px solid rgba(255,255,255,.68);border-radius:2px 36px 2px 2px;backdrop-filter:blur(16px);box-shadow:0 14px 70px #41301c0d}.eyebrow{font-size:9px;font-weight:500;letter-spacing:.19em;color:#817361;margin:0 0 15px}.entry h1{font-family:'Noto Serif JP',serif;font-weight:400;font-size:42px;line-height:1.65;letter-spacing:.11em;margin:0 0 16px}.intro-copy{font-size:14px;line-height:2;letter-spacing:.06em;margin:0 0 22px}.primary{display:inline-flex;align-items:center;justify-content:space-between;gap:25px;background:#4e7080;color:#fffaf1;border:1px solid #ffffff26;padding:15px 24px;border-radius:50px;min-height:49px;box-shadow:0 5px 18px #46637418;font-size:14px}.hint{font-size:10px;line-height:1.8;letter-spacing:.05em;opacity:.75;margin:13px 0 0}.room-footer{position:absolute;z-index:4;bottom:0;width:100%;padding:20px 38px max(20px,env(safe-area-inset-bottom));display:flex;gap:25px;align-items:center;justify-content:space-between;font-size:10px;color:#fff9ef;text-shadow:0 1px 8px #22170e}.room-footer a{border-bottom:1px solid #ffffff60;padding:4px 0}.room-footer button{background:#fff9efdc;color:var(--ink);padding:8px 12px;border-radius:25px;font-size:10px}.dialogue{position:absolute;z-index:4;bottom:11%;left:50%;transform:translateX(-50%);width:min(530px,90%);padding:24px 29px;border-radius:23px;background:rgba(255,251,242,.94);box-shadow:0 12px 60px #30251b24;border:1px solid #ffffffc9;backdrop-filter:blur(20px)}.speaker{display:flex;align-items:center;gap:10px}.speaker h2{font-size:13px;font-weight:700;margin:0;letter-spacing:.14em}.speaker-dot{width:7px;height:7px;border-radius:50%;background:#759baf}.speaker-note{font-size:9px;color:#978573;letter-spacing:.1em}.dialogue #speech{font-family:'Noto Serif JP',serif;font-size:16px;line-height:2;min-height:3.5em;margin:13px 0 19px;white-space:pre-line}.answers{display:flex;gap:10px;flex-wrap:wrap}.answers button,.card-buttons button{border:1px solid #718d984d;background:#f4f8f7;border-radius:40px;padding:12px 20px;font-size:13px;min-height:45px}.answers button:hover,.card-buttons button:hover{background:#e3edf1}.answers button:first-child{color:#355e73}.walk-hint{position:absolute;bottom:13%;width:100%;text-align:center;font-family:'Noto Serif JP',serif;font-size:15px;color:#fffaf4;text-shadow:0 2px 12px #24190c;z-index:3}.card-controls{position:absolute;z-index:4;left:50%;transform:translateX(-50%);bottom:10%;width:min(600px,94%);text-align:center}.card-controls>p{font-family:'Noto Serif JP',serif;color:#fffdf6;text-shadow:0 1px 8px #34220f;font-size:16px}.card-buttons{display:flex;justify-content:center;gap:12px}.card-buttons button{backdrop-filter:blur(15px);background:#fffaf0e6;box-shadow:0 5px 20px #2016090e;font-size:12px}.quiet{font-size:12px;background:none;border-bottom:1px solid var(--line);padding:8px 0}dialog{border:1px solid #fffaf0;border-radius:25px;background:#fffaf3;color:var(--ink);width:min(510px,92vw);padding:35px;max-height:85dvh;box-shadow:0 30px 100px #1b140d50;overflow:auto}dialog::backdrop{background:#26313875;backdrop-filter:blur(6px)}dialog .close{position:absolute;right:17px;top:12px;background:none;font-size:29px;line-height:38px;width:40px}dialog h2{font:400 28px/1.6 'Noto Serif JP',serif;margin:20px 0}.voice{font:400 18px/1.9 'Noto Serif JP',serif;color:#487184;padding-bottom:20px;border-bottom:1px solid var(--line)}#reading-main{font-size:14px;line-height:2.1}.reading-note{background:#edf2f1;padding:16px 18px;border-radius:12px;margin:20px 0}.reading-note h3{font-size:11px;letter-spacing:.08em;margin:0 0 8px}.reading-note p{font-size:14px;line-height:1.9;margin:0}.question{font-family:'Noto Serif JP',serif;font-size:14px;line-height:2;margin:20px 0}.outline{border:1px solid var(--line);background:transparent;padding:12px 19px;border-radius:30px;font-size:12px;min-height:44px}.small-print{font-size:10px;line-height:1.8;color:#887b6d;margin:24px 0 0}#save-status{font-size:11px}.fallback{position:absolute;z-index:6;inset:0;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;padding:30px;background:#f4efe5}.fallback h1{font:400 26px/1.7 'Noto Serif JP',serif}.fallback p{max-width:420px;line-height:2}.fallback .outline{margin-top:15px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.no-script{position:fixed;inset:30%;z-index:10;background:#fff;padding:25px}
@media(min-width:1600px){.entry{left:10%;bottom:17%}}
@media(max-width:700px){.topbar{padding:18px 20px;gap:10px}.brand{font-size:25px}.room-label{display:none}.tools{gap:6px}.tools button{font-size:10px;padding:8px 11px}.entry{left:20px;right:20px;bottom:11%;padding:20px 24px;max-width:none;background:#fff8eecf;backdrop-filter:blur(12px);border-radius:3px 27px 3px 3px}.entry h1{font-size:29px;line-height:1.55;margin-bottom:10px}.entry h1 br{display:none}.eyebrow{font-size:8px;margin-bottom:10px}.intro-copy{font-size:12px;margin-bottom:15px;line-height:1.8}.intro-copy br{display:none}.entry .primary{width:100%;font-size:13px;padding:12px 21px;min-height:45px}.entry .hint{font-size:9px;margin-top:9px}.room-footer{padding:16px 20px max(17px,env(safe-area-inset-bottom));gap:8px;font-size:9px}.room-footer>span{display:none}.dialogue{bottom:11%;padding:20px 22px}.dialogue #speech{font-size:14px;line-height:1.9;margin:12px 0 15px}.answers{gap:8px}.answers button{font-size:12px;padding:10px 15px}.card-buttons{gap:7px}.card-buttons button{padding:11px 12px;font-size:11px}.card-controls>p{font-size:13px}.card-controls{bottom:12%}dialog{padding:27px 24px;max-height:84dvh}dialog h2{font-size:24px}.voice{font-size:16px}}
@media(max-height:650px){.entry{bottom:12%;padding:17px 23px}.entry h1{font-size:26px;line-height:1.5}.entry .intro-copy{display:none}.dialogue{bottom:12%;padding:15px 22px}.dialogue #speech{font-size:13px;min-height:0}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation:none!important;transition:none!important}}/* Speech belongs to Merume; the physical card has its own space to the right. */
.dialogue::before{content:"";position:absolute;top:-14px;left:calc(var(--tail-x,50%) - 14px);width:25px;height:25px;background:#fffaf2;border-radius:5px 0 0 0;transform:rotate(45deg);border-left:1px solid #ffffffc9;border-top:1px solid #ffffffc9}

.pet-reaction{position:absolute;z-index:5;padding:12px 13px;background:#fffaf5f5;border:1px solid #e9d8c8;border-radius:22px;font:400 13px/1.6 'Noto Serif JP',serif;text-align:center;pointer-events:none;box-shadow:0 6px 24px #70563812}
.pet-reaction::after{content:"";position:absolute;bottom:-7px;left:calc(50% - 7px);width:13px;height:13px;background:#fffaf5;transform:rotate(45deg);border-right:1px solid #e9d8c8;border-bottom:1px solid #e9d8c8}
.pet-heart{position:absolute;z-index:5;pointer-events:none;color:#bc8790;font-size:27px;text-shadow:0 1px 8px #fff6e9;animation:pet-float 1.25s ease-out both}
@keyframes pet-float{0%{opacity:0;transform:translateY(0) scale(.7)}20%{opacity:1}100%{opacity:0;transform:translateY(-65px) scale(1.05)}}
@media(max-width:700px){.topbar{padding-left:17px;padding-right:17px}.tools{gap:5px}.tools button{padding:8px 9px}.tools #pet-button{font-size:10px}.pet-reaction{font-size:12px;padding:10px 9px}}


/* Keep the room and the character visible while reading the complete card. */
#pet-hearts{position:absolute;inset:0;overflow:hidden;pointer-events:none;z-index:5}

.reading-panel{position:absolute;z-index:4;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#c9ba9d transparent;border-radius:25px;background:#fffbf3f2;border:1px solid #fffefa;box-shadow:0 12px 60px #30251b15;backdrop-filter:blur(18px);padding:26px 27px 30px;touch-action:pan-y;outline-offset:3px}
.reading-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.reading-heading .eyebrow{margin:0;font-size:9px}.reading-heading .quiet{font-size:11px;flex-shrink:0}
.reading-panel h2{font:400 26px/1.6 'Noto Serif JP',serif;margin:18px 0 5px}.reading-keyword{font-size:12px;color:#86755e;margin:0 0 20px}
.reading-panel #reading-main{font-size:14px;line-height:2;white-space:pre-line;margin:0 0 22px}
.reading-details{margin:0 0 23px}.reading-details>div{border-top:1px solid #e5dccc;padding:17px 0}.reading-details dt{font-size:11px;font-weight:700;letter-spacing:.05em;margin-bottom:8px;color:#5a7883}.reading-details dt span{font-size:8px;font-weight:400;letter-spacing:.14em;margin-left:8px;color:#9d8f7a}.reading-details dd{margin:0;font-size:13px;line-height:1.9}.reading-panel .small-print{font-size:10px;line-height:1.8;color:#8c7f70;margin:23px 0 0}
@media(max-width:700px){.interaction-hint{font-size:8px!important;margin-top:8px!important}.reading-panel{padding:18px 21px 26px;border-radius:22px}.reading-panel h2{font-size:22px;margin-top:12px}.reading-panel #reading-main{font-size:13px;line-height:1.95}.reading-keyword{font-size:11px}.reading-details dd{font-size:13px}}
@media(max-width:700px){.brand{font-size:23px;letter-spacing:1px}.topbar{padding:17px 14px;gap:6px}.tools button{padding:8px;white-space:nowrap;flex-shrink:0}.tools{gap:4px}.tools span{margin-left:2px}}
@media(max-height:700px){.interaction-hint{display:none}.reading-panel{padding:16px 19px}.reading-panel h2{font-size:21px}}
@media(max-height:550px) and (min-width:701px){#room{min-height:360px}.topbar{padding:14px 25px}.room-footer{padding:10px 25px}.room-label{display:none}.reading-panel{padding:14px 18px}.reading-panel h2{font-size:20px}.reading-heading{display:block}.reading-heading .quiet{margin-top:5px}}

/* Balanced choices and generous hit targets, including the narrowest phones. */
.entry{left:4%;bottom:9%;padding:25px 28px;max-width:330px}
.entry h1{font-size:29px;line-height:1.5;margin-bottom:12px}.entry h1 br{display:none}
.intro-copy{font-size:13px;line-height:1.9}
.theme-answers{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.theme-answers button{padding:11px 5px;font-size:11px;white-space:nowrap;border-radius:16px}

.reading-panel{height:auto;transition:box-shadow .2s,border-color .2s}
.pet-reaction span{display:inline-block;white-space:nowrap}
#save-status:empty{display:none}
@media(max-width:700px){
  .entry{left:16px;right:16px;bottom:10%;max-width:none;padding:19px 22px}
  .entry h1{font-size:28px;line-height:1.5}
  .intro-copy{font-size:12px;margin-bottom:15px}
  .theme-answers{grid-template-columns:1fr;gap:7px}
  .theme-answers button{font-size:12px;padding:10px 14px;min-height:43px}
  .dialogue:has(.theme-answers) #speech{min-height:0}

  .pet-reaction span{display:block}
  .tools #sound{font-size:9px}
}
@media(max-height:550px) and (min-width:701px){
  .entry{padding:16px 22px;bottom:15%}.entry h1{font-size:26px}.entry .eyebrow{margin-bottom:8px}
}

.spoken-phrase{display:inline-block;white-space:nowrap;max-width:100%}/* Art-only card inspection. The real 3D card keeps its paper edge and reverse. */

.card-zoom-trigger{position:absolute;z-index:3;background:transparent;border:0;border-radius:12px;pointer-events:none;opacity:0}
.card-zoom-trigger:focus-visible{opacity:1;outline:2px solid #759baf;outline-offset:6px}
.card-viewer{position:fixed;inset:0;width:100vw;height:100dvh;max-width:none;max-height:none;margin:0;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;overflow:hidden}
.card-viewer::backdrop{background:rgba(28,35,38,.38);backdrop-filter:blur(5px)}
.card-viewer-content{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:min(520px,calc(100vw - 32px),calc((100dvh - 94px)*.666667));aspect-ratio:2/3}
.zoom-stage{width:100%;height:100%;transform-origin:center;filter:drop-shadow(0 20px 30px #15202745)}
#zoom-world{display:block;width:100%;height:100%;touch-action:none;cursor:grab}
#zoom-world:active{cursor:grabbing}
.close-card-viewer{position:absolute;top:max(18px,env(safe-area-inset-top));right:max(18px,env(safe-area-inset-right));width:44px;height:44px;border:1px solid #ffffff88;border-radius:50%;background:#fffaf1f2;font:300 29px/1 sans-serif;color:#4c514f;box-shadow:0 3px 15px #10262b18}


/* Keep the chosen topic easy to find after the card's main message. */
.reading-panel #reading-main{font-size:15px;line-height:2}
.reading-details>.reading-focus{border:0;background:#edf3f3;border-radius:14px;padding:16px 17px;margin-bottom:17px}
.reading-details>.reading-focus dt{color:#365d6d}
.reading-details>.reading-focus dd{color:#354f59;font-size:14px}
@media(max-width:700px),(max-height:700px){.reading-panel #reading-main{font-size:13px}.reading-details>.reading-focus{padding:13px 14px;margin-bottom:14px}.reading-details>.reading-focus dd{font-size:13px}}

/* Readable Japanese at normal zoom, including smaller screens. */
.intro-copy{font-size:16px;line-height:1.9}
.entry h1{font-size:32px}.entry .eyebrow{font-size:11px}
.primary,.entry .primary,.outline{font-size:16px;min-height:48px}
.card-controls>p{font-size:18px}
.card-controls{bottom:max(10%,80px)}
.dialogue{bottom:max(11%,80px)}
.room-footer{pointer-events:none}.room-footer a,.room-footer button{pointer-events:auto}
.tools button,.tools #pet-button,.tools #sound{font-size:14px;min-height:44px}
.tools span{font-size:12px}.room-footer{font-size:14px}.room-footer button{font-size:14px;min-height:44px}
.dialogue{width:min(620px,calc(100% - 32px));padding:24px 28px}
.dialogue #speech{font-size:19px;line-height:1.85}.speaker h2{font-size:15px;line-height:1.5}
.speaker-note{font-size:12px;letter-spacing:.04em;color:#746b5e}
.answers button,.card-buttons button{font-size:16px;min-height:48px}
.dialogue:has(.theme-answers){width:min(660px,calc(100% - 32px))}
.theme-answers button{font-size:15px;padding:12px 9px}
.spoken-phrase{white-space:normal;line-break:strict;overflow-wrap:anywhere;text-wrap:pretty}
.pet-reaction{font-size:18px;line-height:1.8;padding:13px 16px;color:#344f5e}
.reading-panel h2{font-size:30px;line-height:1.55}
.reading-panel #reading-main{font-size:18px;line-height:1.95;color:#45423c}
.reading-keyword{font-size:15px;line-height:1.8;color:#776650}
.reading-heading .eyebrow{font-size:11px}.reading-heading .quiet{font-size:15px;min-height:44px}
.reading-details dt{font-size:15px;line-height:1.6;color:#466776}.reading-details dt span{font-size:11px;color:#82715b}
.reading-details dd,.reading-details>.reading-focus dd{font-size:17px;line-height:1.9}
.reading-panel .small-print{font-size:13px;line-height:1.85;color:#776b5c}
#save-status{font-size:14px;line-height:1.8}/* An angled, soft tail points beside the central window mullion. */
.pet-reaction::after{width:30px;height:21px;top:auto;bottom:-19px;left:calc(var(--tail-x,50%) - 3px);transform:none;border:0;border-radius:0;clip-path:polygon(0 0,100% 0,10% 100%);clip-path:path('M 0 0 H 30 Q 24 13 3 21 Q 10 11 0 0 Z')}
@media(max-width:700px){
  .topbar{padding:14px 12px;gap:4px}.brand{font-size:23px}.tools{gap:3px}.tools button{padding:8px 7px}.tools span{margin-left:2px}
  .entry h1{font-size:30px}.entry .intro-copy{font-size:16px}
  .dialogue{padding:20px}.dialogue #speech{font-size:18px;line-height:1.85}
  .answers{display:grid;grid-template-columns:1fr;gap:8px}.answers button,.theme-answers button{font-size:16px;min-height:48px}.speaker h2{font-size:14px}.speaker-note{font-size:12px}
  .pet-reaction{font-size:17px;padding:12px 13px}
  .reading-panel h2{font-size:26px}.reading-panel #reading-main{font-size:17px}
  .reading-keyword{font-size:14px}.reading-details dd,.reading-details>.reading-focus dd{font-size:16px}
  .reading-panel{padding:18px 20px 24px}.room-footer{padding:12px 16px max(12px,env(safe-area-inset-bottom));gap:10px}
  .room-footer>span{display:none}
}
@media(max-width:360px){.brand{font-size:20px;letter-spacing:0}.tools button{padding:8px 4px}}
@media(max-height:550px) and (min-width:701px){
  .reading-panel h2{font-size:25px}.reading-panel #reading-main{font-size:17px}.reading-details dd,.reading-details>.reading-focus dd{font-size:16px}
  .dialogue{padding:16px 22px}.dialogue #speech{font-size:18px;min-height:0;margin:8px 0 12px}.answers button{min-height:44px;padding:10px 14px}
}

/* Keep Merume's card message in the same reading flow as the result. */
.reading-merume{margin:0 0 24px;padding:0 0 0 15px;border-left:2px solid #aac4cf}
.reading-merume h3{margin:0 0 9px;font-size:14px;font-weight:700;line-height:1.6;color:#5a7480;letter-spacing:.04em}
.reading-merume #reading-voice{margin:0;font:400 19px/1.9 'Noto Serif JP',serif;color:#344f5e;line-break:strict;overflow-wrap:anywhere;text-wrap:pretty}
@media(max-width:700px){.reading-merume{margin-bottom:22px;padding-left:13px}.reading-merume h3{font-size:13px}.reading-merume #reading-voice{font-size:18px;line-height:1.85}}
