@font-face{font-family:MudanGame;src:url('fonts/Jua-Regular.ttf') format('truetype');font-weight:400;font-display:swap}
:root{--game-font:MudanGame,'Malgun Gothic',sans-serif}
body{background:#141026}#app{background:#211537;box-shadow:0 0 80px #06020f88}.screen{color:#fff3df}.bar-title{color:#fff3df}.brand-mudan{font-family:var(--game-font);font-weight:400;letter-spacing:0;color:#fff3df;font-size:24px}.brand-mudan small{display:none}.brand-star{background:#ffca52;color:#542859;box-shadow:0 3px 0 #a4623c;border:2px solid #ffe9a0}.icon-btn{color:#ffefcc;background:#39264e;border:2px solid #685082;box-shadow:0 3px 0 #100b1d;border-radius:13px}.menu-toggle span{background:#ffefcc}
#screen-characters{background:radial-gradient(ellipse at 85% 15%,#63397877,transparent 45%),radial-gradient(ellipse at 10% 48%,#40316f99,transparent 60%),#211537;position:relative;isolation:isolate;padding:0 16px 90px}#screen-characters:before{content:'';position:absolute;inset:60px 0 0;pointer-events:none;z-index:-1;background-image:radial-gradient(#efce854f 1px,transparent 2px),radial-gradient(#cf96ff40 1px,transparent 2px);background-size:67px 89px,107px 73px;background-position:15px 3px,40px 24px}
.welcome{position:relative;text-align:center;padding:11px 0 17px}.welcome:before,.welcome:after{position:absolute;content:'✦';font-size:37px;color:#ffd66b;text-shadow:0 0 22px #ffa93566;transform:rotate(-15deg);top:68px;left:17px}.welcome:after{content:'☾';font-size:49px;left:auto;right:18px;top:38px;transform:rotate(15deg);color:#f9c99c}.welcome .eyebrow{font-family:var(--game-font);font-size:15px;font-weight:400;letter-spacing:.06em;color:#dac0f1}.welcome .char-heading{font-family:var(--game-font);font-size:44px;line-height:1.08;font-weight:400;letter-spacing:-.02em;margin:9px 0 18px;color:#fff3de;text-shadow:0 4px 0 #4b255d,0 6px 0 #10071c}.welcome .char-heading br{display:none}.welcome .char-heading em{display:block;color:#ffdb74;font-size:51px;text-shadow:0 4px 0 #9d5436,0 7px 0 #110820}
.country-shortcuts{gap:7px;margin-top:21px}.country-shortcuts button{border:2px solid #71578b;border-radius:15px;background:#382449;color:#e7d5f5;padding:10px 2px;box-shadow:0 4px 0 #11091d;min-height:62px}.country-shortcuts b{font-family:var(--game-font);font-size:19px;font-weight:400}.country-shortcuts span{font-size:11px;color:#c7acd9;letter-spacing:-.05em}.country-shortcuts button.selected{background:#ffe094;color:#44264e;border-color:#fff1bc;box-shadow:0 4px 0 #ad7239}.country-shortcuts button.selected span{color:#6a4253}
.random-start{background:linear-gradient(110deg,#8b4ddd,#6b3cba);border:2px solid #bc8dfa;box-shadow:0 5px 0 #130a25, inset 0 1px 0 #fff4;border-radius:17px;margin:0 0 21px;padding:10px 14px;gap:12px}.random-start b{font-family:var(--game-font);font-size:24px;font-weight:400;text-shadow:0 2px #49256e}.random-start small{display:inline;font-size:13px;color:#ead7ff;margin:0}.random-start>span:nth-child(2){display:flex;align-items:center;gap:12px}.random-icon{width:36px;height:36px;font-size:30px;background:#b688ec55;color:#ffe39c;border-radius:10px}.random-arrow{font-size:28px;color:#ffe397}.selection-heading{margin:0 2px 11px}.selection-heading h2{font-family:var(--game-font);font-size:23px;font-weight:400;color:#ffedcc}.selection-heading>span{font-size:12px;color:#c1a5d2}
.character-slider-viewport{padding:3px 0 9px}.character-slider-viewport .char-card{flex-basis:94%;padding:0 0 14px;background:#372344;border:2px solid #aa7ec0;box-shadow:0 5px 0 #11081c;border-radius:23px;color:#fff1df;opacity:.5}.character-slider-viewport .char-card.is-selected{border:2px solid #f7cf78;box-shadow:0 5px 0 #11081c,0 0 20px #e8ae4b16;opacity:1}.char-carousel .char-country{flex-direction:row-reverse;justify-content:space-between;align-items:center;padding:15px 16px 12px;gap:7px;background:#372344}.char-country-badge{font-family:var(--game-font);font-size:16px;font-weight:400;background:#594065;border:1px solid #9569a7;color:#ffe7ae;border-radius:9px;padding:6px 9px}.char-carousel .char-method{font-family:var(--game-font);font-size:32px;font-weight:400;color:#ffe09a;text-shadow:0 3px #13091e;letter-spacing:0}
.char-carousel .char-avatar{height:206px;margin:0 0 11px;background-image:linear-gradient(#1e0b2820,#21122e60),url('img/rooms/muni.png');background-size:cover;background-position:50% 40%;border-top:1px solid #b689ac;border-bottom:1px solid #b689ac;overflow:hidden;align-items:flex-end}.char-card[data-character=sol] .char-avatar{background-image:linear-gradient(#1e0b2820,#21122e60),url('img/rooms/sol.png')}.char-card[data-character=mali] .char-avatar{background-image:linear-gradient(#1e0b2820,#21122e60),url('img/rooms/mali.png')}.char-card[data-character=rin] .char-avatar{background-image:linear-gradient(#1e0b2820,#21122e60),url('img/rooms/rin.png')}.char-card[data-character=tao] .char-avatar{background-image:linear-gradient(#1e0b2820,#21122e60),url('img/rooms/tao.png')}.char-avatar:before{width:170px;height:130px;background:#ffe6a4;filter:blur(22px);opacity:.15;bottom:9px}.char-avatar:after{color:#ffe398;top:30px;right:23px;font-size:29px}.char-avatar .cut-art{width:205px!important;height:204px!important;filter:drop-shadow(0 5px 0 #30192655);object-position:center bottom}.char-name{font-family:var(--game-font);font-size:25px;font-weight:400;text-align:center;color:#fff2dd;letter-spacing:0}.char-ko,.char-subtitle{display:none}.char-specialty{font-size:13px;font-weight:500;text-align:center;color:#d4b6df;margin-top:5px}.char-card .char-cta,.char-card:hover .char-cta{font-family:var(--game-font);font-size:23px;font-weight:400;justify-content:center;gap:17px;margin:14px 13px 0;background:#ffcf59;border:2px solid #ffe799;border-radius:13px;color:#452534;padding:11px 10px;box-shadow:0 4px 0 #a35d36;text-shadow:0 1px #fff6}.char-cta>span{font-size:25px}
.slider-controls .carousel-arrow{width:41px;height:41px;flex-basis:41px;border:2px solid #806394;background:#443054;color:#fff0cf;box-shadow:0 3px #100818;font-size:25px}.slider-controls .dot:after{background:#7a5d90;width:9px;height:9px}.slider-controls .dot.active:after{background:#ffcc62}.slider-status{font-family:var(--game-font);font-size:14px;color:#bfa1d0;margin-top:5px}.collection-teaser{display:none}.disclaimer{font-size:10px;color:#a88bbb;line-height:1.5;margin-top:15px}.app-tabbar{background:#2e1d40f2;border-top:2px solid #63477c;box-shadow:0 -5px 20px #12092140}.app-tabbar button{font-family:var(--game-font);font-size:14px;font-weight:400;color:#a687b9}.app-tabbar svg{width:23px;height:23px}body[data-screen=characters] #tab-home,body[data-screen=history] #tab-history{color:#ffda7b}
.bar-title,.side-menu h2,.choice-modal .start-question,.choice-modal .concern-summary,.ritual-guide h2,.result-grade{font-family:var(--game-font);font-weight:400}.flow-steps{color:#9d80b3}.flow-steps .current{color:#f2d187}.flow-steps .current b{background:#ffd172;color:#462a50;border-color:#ffd172}.flow-steps b{border-color:#75578c}#screen-chat .bar-title{font-size:23px}#screen-chat .char-panel{border:2px solid #8f6e9e;box-shadow:0 4px 0 #120b1e}.msg.ai .bubble{background:#463052;color:#fff0e1;border:1px solid #6b4c7b;font-size:14px}.msg.user .bubble{background:#e4c1fc;color:#392046}#screen-chat .chat-inputbar{background:#392549;border:2px solid #725887}.send{background:#ffd16d;color:#4c2b42;border:0}#chat-input{color:#fff0e0}#chat-input::placeholder{color:#b79bc8}.chip{background:#483154;border:1px solid #79578d;color:#ebd3f5}#screen-chat .quick-actions .chip{font-size:12px}.choice-modal[open]{background:#fff1d9!important;border:3px solid #d9a964!important;box-shadow:0 8px 0 #251030,0 25px 80px #11062080}.choice-modal .start-question{font-size:26px!important}.choice-modal .start-opt{font-family:var(--game-font);font-size:19px;font-weight:400;border:2px solid #dac4db;background:#fffaf1;color:#533c65;min-height:54px}.choice-modal .start-opt.primary{background:#7850b3;border-color:#a784d7;color:#fff3db;box-shadow:0 3px #47255b}.choice-modal .direct-draw{background:#ffcf64;border-color:#e9a644;color:#603422;box-shadow:0 3px #be803e}.welcome-character{background:#f2dfef;border:2px solid #e1c8e4}.welcome-character-greeting>span{font-family:var(--game-font);font-size:18px;color:#825099}.welcome-character-greeting p{font-size:14px}.side-menu{background:#312040;color:#fff1d9;border-left:2px solid #745087}.side-menu h2{font-size:33px;color:#ffdc85}.side-menu nav button,.side-menu nav a{color:#efdbf5;border-color:#664777;font-size:17px}.side-menu .eyebrow,.drawer-note,.drawer-footer{color:#bfa1d2}.btn{font-family:var(--game-font);font-size:18px;background:#4b315d;color:#ffe3a8;border:2px solid #8b669e}.btn.primary{background:#ffcf64;color:#593441;border-color:#ffe5a0;box-shadow:0 4px #92563d}.ritual-guide p,.quota,.hint{color:#c1a6cf}.stage{border-color:#75558c;background:radial-gradient(ellipse,#6b419b66,transparent 70%)}.card{background:#38244b;border-color:#6d4d84;color:#efdaef}.card h3{color:#f0cd8b;font-size:16px}.ai-card{background:#482e5b}.ai-note{color:#c09dd0}.result-head{background:#4b2d65;border:2px solid #cca46e;color:#ffedcb}.result-grade,.keyword{color:#ffd679}.result-poem,.result-overview{color:#edcfef}.result-number,.result-kicker{color:#cfaee1}.result-actions{background:#211537ee;border-color:#6d4b80}.history-item{background:#38244b;border-color:#705088}.hi-name,.history-empty h2{color:#ffdfa1}.hi-concern,.hi-fortune,.hi-date,.history-empty p{color:#c6a6d8}
@media(max-width:350px){.welcome .char-heading{font-size:37px}.welcome .char-heading em{font-size:44px}.welcome:before{left:7px;font-size:25px}.welcome:after{right:5px;font-size:36px}.country-shortcuts b{font-size:17px}.country-shortcuts span{font-size:10px}.random-start>span:nth-child(2){gap:8px}.random-start b{font-size:22px}.random-start small{font-size:12px}.char-carousel .char-avatar{height:188px}.char-avatar .cut-art{height:187px!important}.char-specialty{font-size:12px}}

/* One-screen character lobby. Extra-small heights/zoom retain accessible scrolling. */
body[data-screen=characters]{overflow:hidden}
#screen-characters.active{display:flex;flex-direction:column;height:100dvh;min-height:0;padding:0 14px calc(65px + env(safe-area-inset-bottom));overflow:hidden}
#screen-characters>.bar{flex:0 0 53px;min-height:53px;padding:7px 0;margin:0}
#screen-characters .char-body{display:flex;flex-direction:column;flex:1;min-height:0;padding:0}
#screen-characters .welcome{flex:none;padding:8px 0 12px}
#screen-characters .welcome:before,#screen-characters .welcome:after{display:none}
#screen-characters .char-heading,#screen-characters .char-heading em{display:inline;font-size:29px;line-height:1.2;margin:0;text-shadow:0 3px #351340}
#screen-characters .random-start{flex:none;min-height:53px;height:53px;padding:7px 12px;margin:0 0 13px}
#screen-characters .random-start b{font-size:22px}
#screen-characters .random-start small{font-size:12px}
#screen-characters .selection-heading{flex:none;margin:0 2px 7px;min-height:25px}
#screen-characters .selection-heading h2{font-size:21px}
#screen-characters .char-carousel-wrap{flex:1;min-height:0;display:flex}
#screen-characters .character-slider-viewport{height:100%;padding:0 0 6px;box-sizing:border-box}
#screen-characters .char-carousel{height:100%;align-items:stretch}
#screen-characters .char-card{height:100%;box-sizing:border-box;display:flex;flex-direction:column;padding-bottom:11px}
#screen-characters .char-country{flex:none;padding:10px 14px;min-height:47px;box-sizing:border-box}
#screen-characters .char-method{font-size:29px}
#screen-characters .char-avatar{flex:1;min-height:0;height:auto;max-height:none;margin:0 0 8px}
#screen-characters .char-avatar .cut-art{height:96%!important;width:94%!important;max-height:330px;object-fit:contain}
#screen-characters .char-name{flex:none;font-size:23px}
#screen-characters .char-specialty{flex:none;font-size:12px;margin:3px 0 0}
#screen-characters .char-cta{flex:none;min-height:43px;box-sizing:border-box;margin:9px 12px 0;padding:8px 10px;font-size:22px}
#screen-characters .slider-controls{flex:none;height:41px;margin:6px 0 0;position:relative}
#screen-characters .slider-status,#screen-characters .journey,#screen-characters .collection-teaser,#screen-characters .disclaimer{display:none}
@media(max-height:680px){#screen-characters>.bar{min-height:46px;flex-basis:46px}#screen-characters .welcome{padding:5px 0 9px}#screen-characters .char-heading,#screen-characters .char-heading em{font-size:26px}#screen-characters .random-start{height:46px;min-height:46px;margin-bottom:10px}#screen-characters .char-country{padding:7px 12px;min-height:40px}#screen-characters .char-method{font-size:26px}#screen-characters .char-specialty{display:none}#screen-characters .char-name{font-size:21px}}
@media(max-height:480px){body[data-screen=characters]{overflow:auto}#screen-characters.active{height:auto;min-height:600px;overflow:visible}#screen-characters .char-carousel-wrap{flex:none;height:300px}}
.char-method{display:flex;align-items:center;gap:8px;background:none;border:0;padding:0;cursor:pointer;text-align:left;font-family:var(--game-font)}.method-info{display:inline-grid;place-items:center;width:21px;height:21px;border:1px solid #cba36d;border-radius:50%;font-family:var(--game-font);font-size:14px;color:#f1d49a;text-shadow:none}.char-cta{cursor:pointer;width:calc(100% - 24px)}
.fortune-guide{position:fixed;inset:0;margin:auto;width:calc(100% - 26px);max-width:450px;height:min(90dvh,850px);max-height:90dvh;padding:0;border:3px solid #d8ad6b;border-radius:25px;background:#fff0d9;color:#46304d;overflow:hidden;box-shadow:0 9px 0 #24102c,0 30px 90px #0008}.fortune-guide[open]{display:flex;flex-direction:column}.fortune-guide::backdrop{background:#170921b8;backdrop-filter:blur(7px)}.fortune-guide header{display:flex;justify-content:space-between;align-items:center;padding:17px 20px 13px;background:#452957;color:#ffdf94;flex:none}.fortune-guide header span{font-size:13px;color:#dab8e8}.fortune-guide h2{font-family:var(--game-font);font-size:29px;font-weight:400;margin:3px 0 0}.guide-close{border:1px solid #b78ac4;background:#67417a;color:#ffe5b9;width:38px;height:38px;border-radius:12px;font-size:26px;cursor:pointer}.guide-scroll{overflow:auto;padding:17px 20px 22px;min-height:0;overscroll-behavior:contain}.fortune-guide figure{margin:0 0 20px}.fortune-guide figure img{display:block;width:100%;height:190px;object-fit:cover;object-position:50% 35%;border-radius:15px}.fortune-guide figcaption{font-size:11px;color:#a4878a;margin-top:7px}.fortune-guide h3{font-family:var(--game-font);font-size:22px;font-weight:400;margin:22px 0 10px;color:#6b3e76}.fortune-guide p,.fortune-guide li{font-size:15px;line-height:1.8;word-break:keep-all}.fortune-guide ol{padding-left:23px}.fortune-guide li{padding-left:4px;margin-bottom:9px}.fortune-guide .guide-note{font-size:12px;background:#eedde9;padding:13px;border-radius:12px;color:#8b6b8b}.fortune-guide details{margin-top:18px;font-size:13px;color:#806684}.fortune-guide summary{cursor:pointer;min-height:35px}.fortune-guide a{display:block;color:#80558f;margin:8px 0;line-height:1.6}.fortune-guide footer{padding:12px 18px 16px;background:#fff0d9;flex:none;border-top:1px solid #e4cccd}.guide-start{width:100%;background:#ffce60;border:2px solid #efb449;box-shadow:0 3px #ab6b3c;border-radius:13px;padding:10px;font-family:var(--game-font);font-size:23px;color:#653143;cursor:pointer}
#screen-characters.active{padding-bottom:calc(81px + env(safe-area-inset-bottom))}
#screen-characters .random-start{height:60px;min-height:60px}
#screen-characters .random-start>span:nth-child(2){flex:1;min-width:0;overflow:hidden;flex-direction:column;align-items:flex-start;justify-content:center;gap:2px}
#screen-characters .random-start b{flex-shrink:0;white-space:nowrap;font-size:clamp(18px,5.6vw,22px);line-height:1.2}
#screen-characters .random-start small{display:block;max-width:100%;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:11px;line-height:1.3}
#screen-characters .random-icon,#screen-characters .random-arrow{flex-shrink:0}
/* Rice ritual: a normal tap target, not a flex-filled panel. */
#screen-rice .rice-toss-btn{flex:0 0 auto;width:100%;max-width:320px;height:58px;min-height:58px;font-size:22px;margin-top:8px}
#screen-rice .rice-body{flex:1;gap:18px;padding:10px 0 24px;justify-content:center}
#screen-rice .rice-hint{color:#e7d4ef;font-size:16px;text-align:center}
#screen-rice .rice-count:empty{display:none}
@media(max-height:740px){#screen-rice .ritual-guide .teller-art{width:72px;height:72px}#screen-rice .ritual-guide h2{font-size:24px}#screen-rice .rice-body{gap:12px}#screen-rice .rice-bowl{margin-top:0}}
/* Let rice leave the bowl: clipping previously hid the whole throw. */
#screen-rice .rice-bowl{overflow:visible;isolation:isolate;flex-shrink:0}
#screen-rice .rice-grains{z-index:2;pointer-events:none}
#screen-rice .grain{width:11px;height:6px;box-shadow:0 1px 2px #6b512866,inset -1px -1px #d6c9a8}
#screen-rice .rice-bowl.tossing{animation:rice-bowl-lift 1.45s ease-in-out both}
#screen-rice .rice-bowl.tossing .grain{animation:rice-flight 1.45s cubic-bezier(.2,.65,.4,1) both}
@keyframes rice-flight{0%,12%{transform:translate(0,0) rotate(0);opacity:1}24%{transform:translate(0,12px) scale(1.1)}55%{transform:translate(var(--flight-x,35px),var(--flight-y,-160px)) rotate(var(--flight-turn,120deg)) scale(1.3);opacity:1}88%{transform:translate(0,-8px) rotate(180deg);opacity:1}100%{transform:translate(0,0) rotate(180deg);opacity:1}}
@keyframes rice-bowl-lift{0%,100%{transform:translateY(0) rotate(0)}20%{transform:translateY(12px) rotate(-5deg)}32%{transform:translateY(-12px) rotate(4deg)}55%{transform:translateY(0) rotate(-2deg)}75%{transform:rotate(1deg)}}
#screen-rice .rice-count{color:#ffe093;font:28px var(--game-font)}
@media(prefers-reduced-motion:reduce){#screen-rice .rice-bowl.tossing,#screen-rice .rice-bowl.tossing .grain{animation:none}}
