@charset "UTF-8";
:root{--paper:#fffaf0;--ink:#493f36;--muted:#968777;--line:#eadfcd;--yellow:#f9cd68;--peach:#f7c5b1;--mint:#dcebdc;--purple:#e6dff2;--white:#fffefa;--shadow:0 7px 0 #e9deca;--round:26px;font-family:ui-rounded,"PingFang SC","Microsoft YaHei",system-ui,sans-serif;color:var(--ink);background:var(--paper);font-synthesis:none}
*{box-sizing:border-box}body{margin:0;background-image:radial-gradient(#e8ddc8 1px,transparent 1px);background-size:22px 22px;min-height:100svh}button,input{font:inherit}button,a,input{-webkit-tap-highlight-color:transparent}button{cursor:pointer;color:inherit}button:disabled{cursor:default;opacity:.6}button:focus-visible,a:focus-visible,summary:focus-visible{outline:3px solid #ad8bc8;outline-offset:4px}input:focus{outline:3px solid #f5d385;outline-offset:2px}button{touch-action:manipulation}a{color:inherit}h1,h2,h3,p{margin:0}h1{font-size:38px;line-height:1.3;letter-spacing:2px;font-weight:900}h2{font-size:25px;letter-spacing:1px;line-height:1.4}h3{font-size:17px}p{line-height:1.8}small{font-size:12px}svg{display:block}#app{max-width:480px;margin:0 auto;padding:26px 22px 28px;position:relative;min-height:100svh}.page-deco{position:fixed;font-size:92px;color:#e9dfc9;pointer-events:none;z-index:-1}.deco-one{left:calc(50% - 430px);top:21%;transform:rotate(-15deg)}.deco-two{right:calc(50% - 410px);bottom:20%;color:#e3e7d7;font-size:120px}
.topbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:28px;min-height:34px}.brand{font-size:15px;font-weight:800;display:flex;align-items:center;gap:8px;letter-spacing:1px}.brand-star{background:var(--yellow);border-radius:11px;width:30px;height:30px;display:grid;place-items:center;font-size:22px}.tiny-button{background:var(--white);border:1px solid var(--line);border-radius:999px;padding:8px 12px;font-size:12px;min-height:36px;max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.hero{text-align:center;padding:3px 0 27px}.eyebrow{display:inline-block;color:#987547;font-size:11px;font-weight:800;letter-spacing:2px;margin-bottom:12px}.pill{background:#f5ebd6;border:1px solid #eadcc0;border-radius:99px;padding:6px 13px;letter-spacing:1px}.hero h1 span{position:relative;display:inline-block}.hero h1 span:after{content:"";height:10px;border-radius:5px;background:#f9d885;position:absolute;bottom:4px;left:-3px;right:-3px;z-index:-1}.hero .subtitle{font-size:13px;color:var(--muted);margin-top:12px}.mascots{width:250px;height:155px;margin:13px auto 3px;position:relative}.mascot{position:absolute;bottom:10px;width:97px;height:105px;filter:drop-shadow(0 5px 0 #e9ddc5)}.mascot.peach{left:20px;transform:rotate(-10deg)}.mascot.mint{right:19px;transform:rotate(9deg)}.float-heart{position:absolute;left:114px;top:6px;color:#d99377;font-size:26px;animation:bob 3s ease-in-out infinite}.sparkle{position:absolute;font-size:23px;color:#d6af58;right:0;top:30px}.sparkle.small{left:5px;top:3px;font-size:15px}.card{background:var(--white);border:1.5px solid var(--line);border-radius:var(--round);padding:22px;box-shadow:var(--shadow);margin-bottom:23px}.card.soft{background:#faf6eb;box-shadow:none}.card-title{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:16px}.card-title small{color:var(--muted)}.tabs{background:#f1ebde;border-radius:15px;display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:4px;margin-bottom:22px}.tab{border:0;border-radius:12px;background:transparent;min-height:43px;font-size:14px;font-weight:700;color:var(--muted)}.tab.selected{background:var(--white);color:var(--ink);box-shadow:0 2px 5px #bfa77d20}.field-label{display:block;font-size:13px;font-weight:700;margin-bottom:9px}.input{width:100%;min-height:54px;border:1.5px solid var(--line);background:var(--paper);border-radius:16px;padding:13px 16px;color:var(--ink);font-size:16px}.input::placeholder{color:#b4a797}.code-input{text-transform:uppercase;letter-spacing:10px;font-weight:800;font-size:25px;text-align:center;padding-left:26px}.helper{font-size:11px;color:var(--muted);margin:9px 0 19px;line-height:1.7}.button{border:1.5px solid transparent;border-radius:17px;min-height:53px;width:100%;display:flex;align-items:center;justify-content:center;gap:8px;font-size:15px;font-weight:800;padding:12px 16px;transition:transform .15s,background .15s;position:relative}.button:not(:disabled):active{transform:translateY(3px);box-shadow:none}.primary{background:var(--yellow);border-color:#e5ba59;box-shadow:0 4px 0 #e7b85b}.secondary{background:var(--mint);border-color:#c7d9c5;box-shadow:0 4px 0 #c8d9c3}.lavender{background:var(--purple);border-color:#d0c6e2;box-shadow:0 4px 0 #d0c5e1}.ghost{background:transparent;font-size:13px;color:var(--muted);box-shadow:none;min-height:44px}.button+.button{margin-top:13px}.button-icon{font-size:20px}.note{text-align:center;font-size:11px;color:var(--muted);line-height:1.7}.how{padding:0 5px;margin:28px 0 23px}.how summary{font-size:13px;font-weight:700;cursor:pointer;list-style:none;display:flex;justify-content:space-between;padding:6px 0}.how summary:after{content:"＋";color:var(--muted)}.how[open] summary:after{content:"－"}.how p{font-size:12px;color:var(--muted);padding:10px 0 0}.footer{text-align:center;font-size:10px;color:#b1a38e;letter-spacing:1px;margin-top:24px}.welcome{padding-top:35px}.welcome .card{text-align:left}.welcome h1{font-size:31px}.welcome .input{margin:5px 0 20px}.nickname-art{margin:15px auto 22px}.nickname-art .mascots{height:140px}.room-heading{text-align:center;margin-bottom:23px}.room-heading h2{margin:5px 0 8px}.room-heading p{font-size:12px;color:var(--muted)}.code-display{display:flex;align-items:center;justify-content:center;gap:18px;margin:15px 0 0}.code-letters{font-size:35px;font-weight:900;letter-spacing:8px;padding-left:8px;font-variant-numeric:tabular-nums}.copy-button{background:#f0e8d9;border:0;border-radius:12px;width:39px;height:39px;display:grid;place-items:center;font-size:18px}.room-code-card{text-align:center;background:#fff5d9;padding:16px 20px 19px;box-shadow:none;border-color:#eeddb5}.room-code-card .eyebrow{margin-bottom:0}.players{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin:26px 0}.player{border:1.5px solid var(--line);background:var(--white);border-radius:22px;text-align:center;padding:20px 7px 17px;min-width:0;position:relative}.player.ready{border-color:#b7cdb4;background:#f1f6ec}.player.empty{border-style:dashed;background:#f8f4e9}.avatar{width:64px;height:68px;margin:0 auto 10px}.player-name{font-size:14px;font-weight:800;overflow-wrap:anywhere;line-height:1.6}.you-tag{font-size:9px;background:#f2eadb;border-radius:6px;padding:2px 5px;margin-left:3px;font-weight:500;white-space:nowrap}.player-status{font-size:11px;margin-top:8px;color:var(--muted)}.player.ready .player-status{color:#759170}.empty-avatar{border:2px dashed #d5c8b2;border-radius:23px;width:60px;height:60px;display:grid;place-items:center;font-size:25px;color:#baa98b;margin:4px auto 14px}.dots:after{content:"…"}.status-strip{border-radius:13px;padding:10px 12px;text-align:center;font-size:12px;background:#f1ebde;color:#8a7c68;margin-bottom:18px}.status-strip.warn{background:#fae6db;color:#a26950}.game-top{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px}.round-tag{font-size:13px;font-weight:800;background:var(--white);border:1px solid var(--line);padding:8px 14px;border-radius:99px}.room-mini{font-size:11px;color:var(--muted);letter-spacing:1px}.timer-wrap{text-align:center;margin:8px 0 22px}.timer{font-size:53px;font-weight:900;letter-spacing:-2px;line-height:1.3;font-variant-numeric:tabular-nums}.timer small{font-size:14px;font-weight:500;margin-left:4px;letter-spacing:0;color:var(--muted)}.timer.urgent{color:#d37d61}.timer-label{color:var(--muted);font-size:11px}.time-track{height:6px;background:#eee6d5;border-radius:9px;overflow:hidden;width:150px;margin:11px auto}.time-track span{display:block;width:100%;height:100%;background:var(--yellow);border-radius:9px;transition:width .2s}.progress-30{width:100%!important}.prompt-card{text-align:center;background:#f7f1e5;padding:20px;box-shadow:none}.prompt-card p{font-size:12px;color:var(--muted)}.prompt-card h2{font-size:21px;margin:4px 0}.word-pair{display:grid;grid-template-columns:1fr 28px 1fr;align-items:center;margin:16px 0 5px;gap:4px}.word-chip{font-size:18px;font-weight:800;background:var(--white);border:1px solid #e6dbc5;border-radius:15px;padding:15px 5px;overflow-wrap:anywhere;line-height:1.5;min-width:0}.pair-plus{font-size:22px;color:#b5a58b}.write-card{padding:22px}.write-card h3{margin-bottom:15px}.word-input{font-size:22px;text-align:center;font-weight:700;min-height:68px}.input-counter{text-align:right;font-size:10px;color:var(--muted);margin:7px 3px 16px}.submit-status{display:flex;justify-content:center;gap:20px;font-size:11px;margin:21px 0 0;color:var(--muted)}.submit-status .done{color:#76986a}.sealed{text-align:center;padding:12px 0 8px}.sealed-icon{font-size:33px;display:block;margin-bottom:10px}.sealed h3{font-size:18px;margin:0 0 10px}.sealed p{font-size:12px;color:var(--muted)}.my-word{display:inline-block;background:#f4ebd5;padding:5px 15px;border-radius:10px;color:var(--ink);font-weight:700;overflow-wrap:anywhere;max-width:100%}.result-heading{text-align:center;margin:15px 0 23px}.result-heading .result-emoji{font-size:35px;display:block;margin-bottom:10px}.result-heading p{font-size:12px;color:var(--muted);margin-top:8px}.answer-cards{display:grid;grid-template-columns:1fr 1fr;gap:13px;margin-bottom:24px}.answer{padding:20px 10px;text-align:center;border-radius:23px;background:#f9e4d9;border:1.5px solid #ebcdbd;min-width:0;position:relative}.answer:nth-child(2){background:#e5eddf;border-color:#cddcc4}.answer .avatar{width:44px;height:48px;margin-bottom:8px}.answer .answer-name{font-size:11px;color:#987c68;overflow-wrap:anywhere}.answer .answer-word{font-size:24px;line-height:1.5;font-weight:800;margin:13px 0 5px;overflow-wrap:anywhere}.blank-word{font-size:16px!important;color:#a1937f}.answer small{font-size:10px;color:#a1937f}.result-actions .helper{text-align:center;margin:13px 0 0}.success .hero{padding-bottom:18px}.success h1{font-size:34px}.success-art{position:relative}.success-art .mascots{height:145px}.success-art:before,.success-art:after{content:"✦";position:absolute;color:#d8ae5c;left:27px;top:35px;font-size:25px;transform:rotate(-16deg)}.success-art:after{left:auto;right:30px;top:80px;color:#c6b6d8;font-size:16px}.score{display:flex;justify-content:center;align-items:baseline;gap:8px;margin:5px 0 14px}.score b{font-size:59px;line-height:1.2}.score span{font-size:15px;color:var(--muted)}.journey{padding:22px 18px}.journey h3{font-size:15px;margin-bottom:18px}.journey-names{display:grid;grid-template-columns:28px 1fr 1fr;gap:7px;color:var(--muted);font-size:10px;text-align:center;margin-bottom:8px;overflow-wrap:anywhere}.history-row{display:grid;grid-template-columns:28px 1fr 1fr;gap:7px;align-items:stretch;margin:9px 0;font-size:13px}.history-num{font-size:10px;color:#ac9c83;display:grid;place-items:center}.history-word{background:#f5eee4;border-radius:10px;padding:10px 6px;text-align:center;overflow-wrap:anywhere;line-height:1.5}.history-word:nth-child(3){background:#eef2e9}.history-row.last .history-word{background:#fff0be;border:1px solid #e6cb85;font-weight:800}.success-subtitle{font-size:12px;color:var(--muted);text-align:center}.success .result-actions{margin-top:28px}.offline{background:#fae6db;color:#9d6852;font-size:11px;border:1px solid #efd2c1;border-radius:12px;padding:9px 12px;text-align:center;margin:-10px 0 16px}.boot{display:grid;min-height:70svh;place-content:center;text-align:center;gap:15px;color:var(--muted);font-size:13px}.loading-orbit{font-size:40px;color:#d6ac56;animation:bob 1.5s ease-in-out infinite}.error-card{text-align:center;margin-top:70px}.error-card p{font-size:13px;color:var(--muted);margin:15px 0 22px}.toast{position:fixed;bottom:max(26px,env(safe-area-inset-bottom));left:50%;transform:translate(-50%,15px);background:#4b443def;color:white;padding:12px 19px;border-radius:16px;font-size:13px;line-height:1.7;width:max-content;max-width:calc(100vw - 40px);z-index:30;opacity:0;transition:opacity .2s,transform .2s;pointer-events:none;text-align:center}.toast.visible{opacity:1;transform:translate(-50%,0)}dialog{border:1.5px solid var(--line);border-radius:28px;background:var(--paper);color:var(--ink);width:calc(100% - 42px);max-width:360px;padding:27px;box-shadow:0 15px 60px #493f3630}dialog::backdrop{background:#493f3659;backdrop-filter:blur(3px)}.dialog-inner{text-align:center}.dialog-inner p{font-size:13px;color:var(--muted);margin:15px 0 25px}.saved-name{text-align:center;font-size:12px;color:var(--muted);margin-top:-6px;margin-bottom:23px}.badges{display:flex;justify-content:center;gap:10px;margin-top:19px}.badge{font-size:10px;letter-spacing:1px;color:#93826c;border:1px solid #e7dbc4;border-radius:99px;padding:5px 10px;background:#fffcf4}.presence-hint{font-size:11px;text-align:center;color:var(--muted);margin-top:17px}.edit-name{background:none;border:0;color:#9b7d56;font-size:12px;text-decoration:underline;text-underline-offset:3px;padding:6px}.fatal-detail{font-size:11px;color:var(--muted);overflow-wrap:anywhere;margin:10px 0 20px;line-height:1.6}.countdown-zero .input{opacity:.5}.success-banner{background:#fff0bd;color:#997a37;padding:9px 12px;border-radius:12px;font-size:11px;text-align:center;margin-bottom:18px}body:has(dialog[open]){overflow:hidden}
@keyframes bob{0%,100%{transform:translateY(0) rotate(-5deg)}50%{transform:translateY(-7px) rotate(5deg)}}
@media(min-width:700px){#app{padding-top:34px}.hero h1{font-size:41px}.welcome{padding-top:30px}body:before{content:"WORDS MEET.\A MINDS CONNECT.";white-space:pre;position:fixed;left:calc(50% + 315px);top:41%;font-size:13px;font-weight:700;letter-spacing:3px;line-height:2.2;color:#c2b395;writing-mode:vertical-rl}.footer{margin-top:27px}}
@media(max-width:360px){#app{padding:20px 16px}.card{padding:18px}.topbar{margin-bottom:20px}h1{font-size:34px}.answer .answer-word{font-size:21px}.mascots{height:135px}.hero{padding-bottom:20px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}}
.success .journey{margin-top:24px}
/* Persistent, thumb-friendly music control; separate from game screen updates. */
#app{padding-bottom:105px}
.music-toggle{position:fixed;right:max(16px,env(safe-area-inset-right));bottom:max(17px,env(safe-area-inset-bottom));z-index:15;width:62px;height:62px;border-radius:22px;border:1.5px solid #e0cfaa;background:#fff9e8;color:#887251;box-shadow:0 4px 0 #e8dcc4,0 5px 18px #6f553518;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;padding:5px;transition:background .2s,transform .15s}
.music-toggle:active{transform:translateY(3px)}
.music-note{font-size:24px;line-height:1.1}.music-caption{font-size:9px;font-weight:700;white-space:nowrap;letter-spacing:.5px}.music-toggle.playing{background:#fbe4a3;border-color:#deba65;color:#84652e}
.music-waves{display:none;position:absolute;right:7px;top:8px;gap:2px;align-items:center;height:10px}.music-waves i{display:block;width:2px;height:7px;background:currentColor;border-radius:2px;animation:music-wave .75s ease-in-out infinite alternate}.music-waves i:nth-child(2){animation-delay:-.25s}.music-waves i:nth-child(3){animation-delay:-.5s}.playing .music-waves{display:flex}
.toast{bottom:max(96px,calc(env(safe-area-inset-bottom) + 80px))}
@keyframes music-wave{from{transform:scaleY(.35)}to{transform:scaleY(1)}}
@media(min-width:700px){.music-toggle{right:28px;bottom:27px}}
/* Sound and tactile feedback are independent of each player's game state. */
button:not(:disabled),summary{transition:transform .12s ease,background .18s ease,box-shadow .12s ease}
button:not(:disabled).is-pressed,summary.is-pressed{transform:translateY(2px) scale(.96);filter:brightness(.98)}
.music-toggle.sound-enabled{background:#fbe4a3;border-color:#deba65;color:#84652e}
.tap-feedback{position:fixed;pointer-events:none;z-index:45;width:28px;height:28px;border:2px solid #e5bc62;border-radius:50%;transform:translate(-50%,-50%);animation:tap-ripple .42s ease-out forwards}
@keyframes tap-ripple{from{opacity:.75;transform:translate(-50%,-50%) scale(.35)}to{opacity:0;transform:translate(-50%,-50%) scale(1.9)}}
@media(prefers-reduced-motion:reduce){.tap-feedback{display:none}button:not(:disabled).is-pressed,summary.is-pressed{transform:none;filter:none}}
