/* Local game sheet; opening, reactions and farewell use the shared dialogue. */
html body[data-game='palace'] #game.gathering-game-page {display:flex;flex-direction:column;gap:12px;padding:clamp(10px,2cqh,22px) clamp(12px,3cqw,40px);}
#game.gathering-game-page .scene-heading {position:static;flex:none;padding:0;margin:0 45px 0 0;color:#61482d;text-shadow:0 1px 8px #fff5dc;font-size:var(--font-heading);}
#game.gathering-game-page .scene-interaction {position:relative;inset:auto;transform:none;display:block;flex:1;min-height:0;width:min(100%,1050px);max-height:none;align-self:center;box-sizing:border-box;padding:clamp(12px,2cqw,28px);overflow:auto;isolation:isolate;background:#fff7e7eb;border:1px solid #b8956266;border-radius:9px;scrollbar-width:thin;scrollbar-color:#b8956255 transparent;}
#game.gathering-game-page .scene-interaction > .dossier-ornament {z-index:-1;opacity:.18;}
#game.gathering-game-page .gathering-game-copy {padding:0;margin:0;background:none;border:0;border-radius:0;overflow:visible;max-height:none;font-size:var(--font-body);color:#604b34;}
#game.gathering-game-page .dossier-section-heading {display:flex;align-items:center;gap:8px;margin:0 0 12px;font-size:var(--font-heading);color:#715333;}
#game.gathering-game-page .dossier-heading-flower {width:24px;height:24px;}
#game.gathering-game-page p {margin:9px 0;line-height:1.7;text-wrap:pretty;overflow-wrap:anywhere;}
#game.gathering-game-page h4 {margin:10px 0;font-size:var(--font-body);font-weight:600;line-height:1.6;}
#game.gathering-game-page .gathering-game-options {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:16px;overflow:visible;}
html body[data-game='palace'] #game.gathering-game-page .gathering-game-options > button {width:100%;min-width:0;padding:9px 32px;font-size:var(--font-body);text-align:center;}
/* 品茗小会的选择为简短文字，采用居中的窄按钮；收紧纵向占用，三项能完整入画。 */
#game.gathering-game-page .gathering-game-options[data-tea-contest='true'] {
 grid-template-columns:minmax(0,1fr);
 width:76%;max-width:100%;margin:clamp(9px,1.6cqh,16px) auto 0;
 gap:clamp(9px,1.5cqh,14px);
}
html body[data-game='palace'] #game.gathering-game-page .gathering-game-options[data-tea-contest='true'] > button {
 min-height:clamp(42px,7cqh,54px);
 padding:5px clamp(28px,3cqw,42px);
 line-height:1.3;
}
#game.gathering-game-page .gathering-draft {padding:10px 12px;border-block:1px solid #b8956250;background:#dfcda31c;}
#game.gathering-game-page .gathering-game-options[data-card-hand='true'] {grid-template-columns:repeat(3,minmax(0,1fr));align-items:stretch;}
html body[data-game='palace'] #game.gathering-game-page .gathering-game-options[data-card-hand='true'] > button {padding:10px 12px;text-align:left;background:#f7edd955;border-radius:5px;box-shadow:none;}
#game.gathering-game-page .gathering-game-options[data-card-hand='true'] p,
#game.gathering-game-page .gathering-game-options[data-card-hand='true'] small {font-size:var(--font-note);line-height:1.6;color:#8c775c;}
.gathering-used-card {display:inline-block;margin-right:10px;color:#978260;}
.gathering-ranking {width:100%;border-collapse:collapse;font-size:var(--font-body);}
.gathering-ranking th,.gathering-ranking td {padding:9px 7px;text-align:left;line-height:1.6;border-bottom:1px solid #b8956238;overflow-wrap:anywhere;}
.gathering-ranking tr[data-winner='player'] {background:#ddc38a26;}
@container (max-width:780px) {
 #game.gathering-game-page .gathering-game-options {grid-template-columns:1fr;}
 .gathering-ranking th,.gathering-ranking td {padding:7px 4px;}
}

/* A finished joint verse uses the same framed folio in play and dialogue feedback. */
.gathering-poem {width:min(100%,32rem);box-sizing:border-box;margin:12px auto;padding:12px 18px;text-align:center;border:1px solid #b8956255;border-radius:6px;background:#fff9edb8;color:#604b34;}
.gathering-poem small {display:block;color:#8c775c;font-size:var(--font-note);margin-bottom:8px;}
.gathering-poem p {margin:7px 0;line-height:1.65;font-size:var(--font-body);overflow-wrap:anywhere;}

.gathering-grass-ring {background:#f3f0dfcc;border-color:#a7ae8a66;}
.gathering-grass-ring p:first-of-type {font-weight:600;}

/* Finished keepsakes have their own scenic presentation above the dialogue.
   The lower text/continue tray stays untouched, and both cards respect the 16:9 stage. */
#game.scene-frame .gathering-keepsake-stage {
 position:absolute;z-index:6;left:50%;transform:translateX(-50%);
 top:clamp(32px,9%,74px);bottom:clamp(104px,28%,186px);
 width:min(81%,680px);display:flex;align-items:center;justify-content:center;
 pointer-events:none;
}
#game.scene-frame .gathering-keepsake-card {
 position:relative;box-sizing:border-box;width:100%;max-height:100%;
 overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;
 padding:clamp(14px,2.8cqh,30px) clamp(20px,4cqw,50px);
 background:linear-gradient(145deg,rgba(255,251,241,.97),rgba(244,229,202,.97));
 border:1px solid rgba(156,119,74,.63);border-radius:9px;
 color:#5f472f;text-align:center;
 box-shadow:0 9px 32px rgba(49,34,18,.28),inset 0 0 0 5px rgba(255,251,238,.72);
 pointer-events:auto;
}
#game.scene-frame .gathering-keepsake-card::before {
 content:'';position:absolute;inset:8px;border:1px solid rgba(174,139,91,.35);
 border-radius:4px;pointer-events:none;
}
#game.scene-frame .gathering-keepsake-caption {
 position:relative;display:block;margin:0 0 clamp(8px,1.8cqh,16px);
 color:#977757;letter-spacing:.18em;line-height:1.4;
 font-size:calc(var(--font-note) * .94);
}
#game.scene-frame .gathering-poem-card {
 width:min(100%,400px);
}
/* Only the closing poem moves its sole ranking action below the verse.
   The action still uses the normal one-shot scene choice handler. */
#game.scene-frame[data-gathering-keepsake='poem'][data-gathering-stage='closing'] > .dialogue-floating-choices {
 top:70%;width:min(46%,320px);max-height:min(12cqh,76px);
}
#game.scene-frame .gathering-poem-verses {position:relative;display:grid;gap:clamp(3px,.8cqh,9px);}
#game.scene-frame .gathering-poem-verses p {
 margin:0;white-space:nowrap;line-height:1.5;letter-spacing:.15em;font-weight:550;
 font-size:calc(clamp(19px,2.6cqw,30px) * var(--text-scale));
 color:#49392d;
}
#game.scene-frame .gathering-keepsake-signature {
 display:block;margin:clamp(8px,1.8cqh,15px) 0 0;
 color:#997959;letter-spacing:.22em;font-size:calc(var(--font-note) * .86);
}
#game.scene-frame .gathering-grass-card {
 display:grid;grid-template-columns:minmax(100px,.85fr) minmax(0,1.4fr);
 align-items:center;gap:clamp(12px,2.7cqw,30px);text-align:left;
 border-color:rgba(118,135,92,.62);
 background:linear-gradient(138deg,rgba(250,249,232,.98),rgba(225,233,206,.96));
 box-shadow:0 9px 32px rgba(35,49,26,.26),inset 0 0 0 5px rgba(252,252,240,.65);
}
#game.scene-frame .gathering-grass-card::before {border-color:rgba(127,149,106,.36);}
#game.scene-frame .gathering-grass-art {
 position:relative;box-sizing:border-box;justify-self:center;display:grid;place-items:center;
 width:clamp(98px,14cqw,154px);aspect-ratio:1;border-radius:50%;
 border:1px solid rgba(110,137,83,.48);
 background:radial-gradient(circle,rgba(248,251,230,.96) 0 49%,rgba(218,231,194,.52) 51% 66%,rgba(242,247,225,.9) 69%);
 box-shadow:0 4px 15px rgba(81,107,62,.14),inset 0 0 0 6px rgba(255,255,242,.48);
}
#game.scene-frame .gathering-grass-art::before {
 content:'';position:absolute;inset:4px;border-radius:50%;
 background:repeating-conic-gradient(from 8deg,rgba(97,137,73,.7) 0deg 9deg,rgba(179,195,132,.58) 9deg 17deg,transparent 17deg 30deg);
 -webkit-mask:radial-gradient(circle,transparent 0 55%,#000 58% 77%,transparent 80%);
 mask:radial-gradient(circle,transparent 0 55%,#000 58% 77%,transparent 80%);
}
#game.scene-frame .gathering-grass-art span {
 position:relative;z-index:1;font-size:calc(var(--font-note) * .92);
 color:#66804e;letter-spacing:.15em;writing-mode:vertical-rl;
}
#game.scene-frame .gathering-grass-copy {position:relative;min-width:0;}
#game.scene-frame .gathering-grass-copy .gathering-keepsake-caption {margin-bottom:clamp(5px,1.5cqh,13px);letter-spacing:.1em;}
#game.scene-frame .gathering-grass-copy h3 {
 margin:0 0 clamp(5px,1.5cqh,13px);font-size:calc(clamp(23px,3.1cqw,35px) * var(--text-scale));
 color:#4e6440;font-weight:600;letter-spacing:.12em;line-height:1.35;
}
#game.scene-frame .gathering-grass-copy p {
 margin:0;line-height:1.7;color:#566749;
 font-size:calc(clamp(16px,1.75cqw,20px) * var(--text-scale));
 text-wrap:pretty;
}
@container (max-width:760px) {
 #game.scene-frame .gathering-keepsake-stage {
  width:min(84%,540px);top:clamp(29px,9%,56px);bottom:clamp(100px,29%,145px);
 }
 #game.scene-frame .gathering-keepsake-card {padding:12px 20px;}
 #game.scene-frame .gathering-poem-card {width:min(100%,330px);}
 #game.scene-frame .gathering-poem-verses {gap:3px;}
 #game.scene-frame .gathering-poem-verses p {font-size:calc(clamp(18px,3.15cqw,23px) * var(--text-scale));letter-spacing:.1em;line-height:1.4;}
 #game.scene-frame .gathering-keepsake-caption {margin-bottom:7px;}
 #game.scene-frame .gathering-keepsake-signature {margin-top:7px;}
 #game.scene-frame .gathering-grass-card {grid-template-columns:minmax(80px,.7fr) minmax(0,1.4fr);gap:12px;}
 #game.scene-frame .gathering-grass-art {width:clamp(80px,15cqw,112px);}
 #game.scene-frame .gathering-grass-copy h3 {font-size:calc(clamp(21px,3.5cqw,27px) * var(--text-scale));}
 #game.scene-frame .gathering-grass-copy p {font-size:calc(clamp(15px,2.4cqw,18px) * var(--text-scale));line-height:1.5;}
}
@container (max-height:330px) {
 #game.scene-frame .gathering-keepsake-stage {top:25px;bottom:115px;}
 #game.scene-frame .gathering-keepsake-card {padding:9px 16px;}
 #game.scene-frame .gathering-poem-verses p {font-size:calc(17px * var(--text-scale));line-height:1.3;}
 #game.scene-frame .gathering-poem-verses {gap:2px;}
 #game.scene-frame .gathering-keepsake-caption {margin-bottom:4px;}
 #game.scene-frame .gathering-keepsake-signature {margin-top:4px;}
}

/* Whisked tea is the center of its own choice sheet, with no timing meter. */
#game.gathering-game-page .tea-table {display:grid;grid-template-columns:minmax(180px,.9fr) minmax(0,1.1fr);align-items:center;gap:clamp(10px,2cqw,26px);max-width:760px;margin:0 auto;}
html body[data-game='palace'] #game.gathering-game-page .tea-bowl {display:block;box-sizing:border-box;width:100%;max-width:var(--tea-cup-width,320px);min-width:160px;min-height:160px;margin:0 auto;padding:0;border:0;border-radius:50%;background:none;box-shadow:none;color:#715535;touch-action:manipulation;user-select:none;-webkit-tap-highlight-color:transparent;}
#game.gathering-game-page .tea-bowl:disabled {opacity:1;cursor:default;}
#game.gathering-game-page .tea-bowl:focus-visible {outline:2px solid #a57d43;outline-offset:3px;}
.tea-bowl svg {display:block;width:100%;height:auto;overflow:visible;pointer-events:none;}
.tea-shadow {fill:#564027;opacity:.15;}.tea-bowl-body {fill:#3f493e;stroke:#8b8965;stroke-width:2;}.tea-bowl-rim {fill:#263c32;stroke:#a5a27b;stroke-width:4;}.tea-liquid {fill:#7b7751;stroke:#d5c699;stroke-width:2;}.tea-foam-base {fill:#f5efcf;}.tea-bubble {fill:#fbf6df;stroke:#d1c7a2;stroke-width:.7;}.tea-lump {fill:#505b31;}.tea-waterline {fill:none;stroke:#696e42;stroke-width:9;stroke-linecap:round;opacity:.9;}.tea-whisk-handle {fill:#c49b56;stroke:#8f6b36;stroke-width:1;}.tea-whisk-strand {fill:none;stroke:#d8b56c;stroke-width:2.4;stroke-linecap:round;}
#game.gathering-game-page .tea-touch-label {display:block;font-size:var(--font-note);line-height:1.4;margin:-7px 0 7px;}
#game.gathering-game-page .tea-state-note {min-width:0;color:#654d33;}
#game.gathering-game-page .tea-state-note strong {font-size:var(--font-body);font-weight:600;}
#game.gathering-game-page .tea-state-note p {font-size:var(--font-body);margin:8px 0;line-height:1.6;}
#game.gathering-game-page .tea-state-note small,.tea-ranking-result {display:block;font-size:var(--font-note);color:#8b7355;line-height:1.5;}
.tea-bowl[data-moving='true'] .tea-whisk {animation:tea-whisk .18s ease-out;transform-origin:210px 52px;}
@keyframes tea-whisk {0%,100%{transform:rotate(23deg)}50%{transform:rotate(-9deg) translate(-4px,7px)}}
@media (prefers-reduced-motion:reduce){.tea-bowl[data-moving='true'] .tea-whisk {animation:none;}}
@container (max-width:780px){
 #game.gathering-game-page .tea-table {--tea-cup-width:200px;grid-template-columns:minmax(150px,.8fr) minmax(0,1.2fr);gap:12px;}
}
@container (max-width:450px){#game.gathering-game-page .tea-table {--tea-cup-width:210px;grid-template-columns:1fr;}}

#game.gathering-game-page .scene-interaction.tea-game-sheet {display:flex;flex-direction:column;}
#game.gathering-game-page .tea-game-sheet > .gathering-game-copy {flex:1;min-height:0;overflow:auto;scrollbar-width:thin;}
#game.gathering-game-page .tea-game-sheet > .gathering-game-options {flex:none;margin-top:6px;}
#game.gathering-game-page .tea-game-sheet .gathering-game-options > button:only-child {grid-column:1/-1;}
#game.gathering-game-page .tea-context {font-size:var(--font-note);line-height:1.5;margin:5px 0;}
#game.gathering-game-page .tea-game-sheet .dossier-section-heading {margin-bottom:6px;}
