:root{--bg:#f3efe6;--card:#fbf9f3;--ink:#2b3a36;--soft:#6f7d78;--accent:#3d6b5e;--accent-ink:#fff;--tile:#e4ddcb;--tile-use:#c9d8cf;--found:#dfe9e1;--miss:#ece6d8;--line:#d8d1be}
@media (prefers-color-scheme:dark){:root{--bg:#1d2623;--card:#25302c;--ink:#e6e9e3;--soft:#98a59f;--accent:#7fb5a2;--accent-ink:#13201c;--tile:#33423c;--tile-use:#41594f;--found:#2f4a40;--miss:#2b3532;--line:#3a4742}}
*{box-sizing:border-box}
html,body{margin:0;background:var(--bg);color:var(--ink);font:17px/1.45 system-ui,-apple-system,"Segoe UI",sans-serif}
#app{max-width:560px;margin:0 auto;padding:max(20px,env(safe-area-inset-top)) 16px max(24px,env(safe-area-inset-bottom))}
.screen{display:flex;flex-direction:column;gap:16px;align-items:center;text-align:center}
[hidden]{display:none!important}
h1{font-size:2.4rem;margin:40px 0 0;letter-spacing:.02em}h2{margin:8px 0 0;font-size:1.3rem}
.sub{margin:0;color:var(--soft)}.msg{min-height:1.4em;margin:0;color:var(--soft)}
form{display:flex;gap:8px;width:100%}
input{flex:1;min-width:0;font:inherit;padding:12px 14px;border-radius:12px;border:1px solid var(--line);background:var(--card);color:var(--ink)}
button{font:inherit;padding:12px 18px;border-radius:12px;border:1px solid var(--line);background:var(--card);color:var(--ink);cursor:pointer;min-height:44px}
button.primary{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
button.ghost{background:transparent}button.small{padding:6px 12px;min-height:36px}
button:focus-visible,input:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
header{display:flex;justify-content:space-between;align-items:center;width:100%}
.score{color:var(--soft)}.score span{color:var(--ink);font-weight:600}
#tiles{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin-top:8px}
.tile{width:52px;height:56px;font-size:1.5rem;text-transform:uppercase;padding:0;background:var(--tile);border-radius:12px;transition:transform .12s,background .12s}
.tile.used{background:var(--tile-use);opacity:.45;transform:scale(.92)}
#guess{min-height:52px;font-size:1.9rem;letter-spacing:.12em;text-transform:uppercase;border-bottom:2px solid var(--line);min-width:60%;padding:4px 12px}
.actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:center}
.chips{list-style:none;padding:0;margin:0;display:flex;flex-wrap:wrap;gap:6px;justify-content:center}
.chips li{background:var(--found);padding:3px 10px;border-radius:999px;font-size:.95rem}
.chips li small{color:var(--soft)}
#all li{background:var(--miss);color:var(--soft)}#all li.got{background:var(--found);color:var(--ink);font-weight:700}
.theme-line{margin:0;color:var(--accent);font-size:.95rem}
.chips li.theme,#all li.theme{text-decoration:underline;text-decoration-color:var(--accent);text-underline-offset:3px}
.shake{animation:shake .25s}@keyframes shake{25%{transform:translateX(-5px)}75%{transform:translateX(5px)}}
@media (prefers-reduced-motion:reduce){.shake{animation:none}.tile{transition:none}}

/* speed meter: the bonus the next 4+ letter word earns, and a bar that drains over the 3-second window */
.speed { font-size: .85rem; opacity: .85; display: flex; align-items: center; gap: .6rem; margin-top: .2rem; }
.speedbar { flex: 0 0 6rem; height: .3rem; border-radius: .2rem; background: rgba(255,255,255,.12); overflow: hidden; }
.speedbar i { display: block; height: 100%; width: 0; background: currentColor; transition: width .25s linear; }
.speed.hot { opacity: 1; }

.tune { font-size: .85rem; margin-top: .4rem; opacity: .9; }
.tune summary { cursor: pointer; opacity: .7; }
.tune label { display: flex; align-items: center; gap: .6rem; margin: .35rem 0; }
.tune input[type=range] { flex: 1 1 8rem; max-width: 14rem; }
.tune b { min-width: 2.5rem; text-align: right; font-weight: 500; }

.theme-rule { font-size: .85rem; opacity: .8; margin: -.2rem 0 .4rem; }

.speed[hidden] { display: none; }

/* bonus slot: golden tile, the bonus bar, the shout, and bonus-only words */
.tile.gold { box-shadow: 0 0 0 2px #f2c94c, 0 0 14px 2px rgba(242,201,76,.55); animation: glow 1.8s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 2px #f2c94c, 0 0 22px 5px rgba(242,201,76,.8); } }
.bonusbar { text-align: center; font-size: .9rem; margin: .2rem 0; color: #f2c94c; }
.bonusbar[hidden], #endRepeat[hidden], #endNames[hidden], #endWild[hidden], .wildpicker[hidden], .bounties[hidden], #endBounties[hidden], .shout[hidden] { display: none; }
.shout { position: fixed; left: 50%; top: 18%; transform: translateX(-50%); font-family: "Instrument Serif", serif; font-size: 3rem; color: #f2c94c; text-shadow: 0 2px 18px rgba(0,0,0,.6); pointer-events: none; animation: pop 1.6s ease-out forwards; z-index: 5; }
@keyframes pop { 0% { opacity: 0; transform: translateX(-50%) scale(.6); } 15% { opacity: 1; transform: translateX(-50%) scale(1.1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateX(-50%) scale(1); } }
.chips li.extra { border-style: dashed; }
#endRepeat h3, #endNames h3 { margin: 1rem 0 .3rem; font-weight: 500; }
#endRepeat h3 small, #endNames h3 small { opacity: .6; font-weight: 400; }
.tune h4 { margin: .7rem 0 .1rem; font-weight: 500; opacity: .75; }
.tune label.check { gap: .4rem; }

/* wildcard tile (set apart at the end of the row), its A-Z picker, and the bounty list */
.tile.wild { margin-left: 14px; background: transparent; border: 2px dashed #b794f6; color: #b794f6; box-shadow: 0 0 12px rgba(183,148,246,.4); }
.tile.wild.set { background: rgba(183,148,246,.25); color: inherit; }
.wildpicker { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin: .5rem 0; }
.wildpicker button { width: 32px; height: 34px; padding: 0; text-transform: uppercase; border-radius: 8px; }
.bounties { list-style: none; padding: 0; margin: .4rem 0; font-size: .88rem; text-align: center; }
.bounties li { margin: .15rem 0; opacity: .85; }
.bounties li.done { opacity: .55; text-decoration: line-through; }
.bounties li b { color: #b794f6; font-weight: 500; }

/* hints: the nudge under the message line, and the tiles that glow at level 3 */
.hintbox { text-align: center; font-size: .92rem; margin: .3rem 0; color: #7fd1c4; }
.hintbox[hidden] { display: none; }
.hintbox button { margin-left: .5rem; }
.hintbox .hintoffer:not([hidden]) { color: #7fd1c4; border-color: #7fd1c4; animation: hintpulse 1.6s ease-in-out infinite; }
@keyframes hintpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(127,209,196,.0); } 50% { box-shadow: 0 0 10px 3px rgba(127,209,196,.55); } }
.tile.hintglow { box-shadow: 0 0 0 2px #7fd1c4, 0 0 12px 2px rgba(127,209,196,.5); }

/* end-of-round word cards */
.cards { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; margin: 1rem 0; }
.card { flex: 1 1 14rem; max-width: 20rem; border: 1px solid rgba(127,181,162,.45); border-radius: 14px; padding: .8rem 1rem; text-align: left; }
.card h4 { margin: 0 0 .2rem; font-weight: 500; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; opacity: .65; }
.card .big { font-size: 1.6rem; font-family: "Instrument Serif", serif; margin: .1rem 0; }
.card .meta { font-size: .8rem; opacity: .75; margin-bottom: .3rem; }
.card p { margin: .25rem 0; font-size: .88rem; }
.card .story { font-style: italic; opacity: .9; }

/* solo match (session 12b) */
.roundno { color: var(--soft); }
.matchbanner { margin: .2rem 0 .8rem; }
.titlecard .big { font-family: 'Instrument Serif', serif; font-size: 1.9rem; }

/* feedback panel and tracker (session 12c) */
.feedbackbtn { position: fixed; right: .6rem; bottom: calc(.6rem + env(safe-area-inset-bottom, 0px)); opacity: .75; z-index: 5; }
dialog.feedback { background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 1rem; width: min(30rem, 92vw); max-height: 90vh; overflow: auto; }
dialog.feedback::backdrop { background: rgba(0,0,0,.6); }
dialog.feedback textarea, dialog.feedback input[type=text] { width: 100%; box-sizing: border-box; background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: .5rem; font: inherit; margin: .4rem 0; }
dialog.feedback img { max-width: 100%; max-height: 14rem; border-radius: 8px; display: block; margin: .4rem 0; border: 1px solid var(--line); }
.fbtabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .5rem; }
.fbtabs button.on { border-color: #7fd1c4; color: #7fd1c4; }
#fbRejected li { cursor: pointer; } #fbRejected li.on { outline: 2px solid #7fd1c4; }

/* mood check-ins (session 12c) */
.moodbar { display: flex; align-items: center; justify-content: center; gap: .6rem; flex-wrap: wrap; margin: .5rem 0; color: var(--soft); }
.moodbar[hidden] { display: none; }
.moodfaces { display: inline-flex; gap: .3rem; }
button.mood { background: #1b1a22; border: 2px solid transparent; border-radius: 10px; padding: .25rem; cursor: pointer; line-height: 0; }
button.mood:hover, button.mood:focus-visible { border-color: var(--accent); }
button.mood img { width: 2.6rem; height: 2.6rem; display: block; image-rendering: pixelated; }

/* typing on a phone (session 12c): an invisible text box over the guess line opens the phone's keyboard */
.guesswrap { position: relative; display: flex; justify-content: center; }
.guesswrap #guess { cursor: text; }
.typein { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; font-size: 16px; border: 0; padding: 0; background: transparent; color: transparent; caret-color: transparent; }
