.social-game {max-width:1120px;margin:1rem auto;padding:0 1rem;color:#20352f}
.social-cover {width:100%;height:100%;object-fit:cover;display:block}
.social-setup,.social-stage {display:grid;gap:.8rem}
.social-setup {max-width:680px;margin:auto}
.word-panel .social-setup,.word-panel .mahjong-setup {max-width:none;margin:0}
.word-panel :is(.social-setup,.mahjong-setup) h2 {margin-bottom:0}
.game-arena .shared-game-board {width:100%;max-width:none;box-sizing:border-box;margin:0;padding:0}
.shared-game-board[hidden] {display:none}
.social-setup[hidden],.social-stage:empty,.social-error:empty {display:none}
.social-setup .game-thumb {width:min(100%,320px);aspect-ratio:3/2;height:auto}
.social-setup label,.social-game label {display:grid;gap:.25rem;min-width:0}
:is(.social-setup,.social-game) :is(textarea,input) {border:1px solid #a6bcaf;background:#fff;color:#223b34;padding:.55rem;border-radius:6px;font:inherit;max-width:100%;min-width:0}
.social-game textarea {resize:vertical}
.social-actions {display:flex;align-items:end;flex-wrap:wrap;gap:.55rem}
.social-error {color:#992e24}
.social-game .button {white-space:normal}
.social-stage:not(:empty) {min-height:480px;padding:clamp(.75rem,2vw,1.5rem);background:#e5eee5;border:5px solid #6c5541;border-radius:8px;align-content:start}
.social-stage h2,.social-stage p {margin:0}
.social-stage-head {display:flex;align-items:center;justify-content:space-between;gap:.5rem;border-bottom:1px solid #20373146;padding-bottom:.55rem}
.social-stage-head h2 {font-size:1.45rem}
.social-stage-head p {font-size:.88rem}
.social-focus {display:grid;justify-items:center;gap:.75rem;text-align:center}
.social-focus img {width:132px;height:96px;object-fit:contain;background:#fffcf1;border-radius:6px}
.social-secret {font:700 2rem/1.2 serif;color:#382a1f;background:#fff6db;border:1px solid #bb9858;border-radius:6px;padding:.75rem 1rem}
[data-scene=undercover] .social-stage {background:#163e38;color:#f8f0d9;border-color:#62432e}
[data-scene=undercover] .social-stage-head {border-color:#91b9a2}
.social-council {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,100px),1fr));gap:.55rem;padding:1rem 0}
.social-council span {border:1px solid #96baa6;background:#26594e;text-align:center;border-radius:6px;padding:.55rem;overflow-wrap:anywhere}
.social-council [data-current=true] {background:#f8e1a7;color:#2b3027;border-color:#f4bd64}
[data-scene=word-code] .social-stage {background:#e5eced;border-color:#294950}
.social-code-grid {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.6rem}
.social-card {display:flex;flex-direction:column;justify-content:center;align-items:center;gap:.25rem;min-height:100px;padding:.3rem;background:#fff9e8;color:#26352a;border:1px solid #aeaa90;border-bottom:4px solid #b29f77;border-radius:6px;font:600 1rem/1.2 system-ui;overflow-wrap:anywhere}
.social-card:disabled {opacity:1}
.social-card img {width:min(100%,90px);height:56px;object-fit:contain}
.social-card small {font-size:.73rem}
.social-card[data-role=red] {background:#f4c9bb;border-color:#a95045}
.social-card[data-role=blue] {background:#c4e1ef;border-color:#447891}
.social-card[data-role=trap] {background:#343736;border-color:#141b18;color:#fff}
.social-card[data-role=neutral] {background:#ddd8c1}
[data-scene=word-bridge] .social-stage {background:#d6e9ec;border-color:#675a45}
.social-bridge {display:flex;flex-wrap:wrap;gap:.6rem;list-style:none;padding:1rem .15rem;margin:0;border-block:2px solid #90bac3;background:#b9dbe2}
.social-bridge li {padding:.55rem .7rem;border-radius:6px;background:#f7eccf;border:1px solid #968d74;box-shadow:0 4px #7e8c7f}
.social-bridge li:last-child {outline:2px solid #9c642a}
.social-bridge-bank {display:flex;flex-wrap:wrap;gap:.45rem}
.social-bridge-bank .button {min-width:4.3rem;background:#fff9e8;border:1px solid #a79b7b;color:#234239}
.social-bridge-bank [data-target=true] {border:2px solid #217268}
.social-bridge-bank [data-hint=true] {background:#ffdf92;border-color:#9c642a}
[data-scene=story-stage] .social-stage {border:0;border-inline:clamp(7px,2vw,20px) solid #8a353a;background:#f7e9d6}
.social-script {padding:0;list-style:none;display:grid;gap:.35rem;margin:0}
.social-script li {display:flex;gap:.6rem;flex-wrap:wrap;border-bottom:1px solid #cbb69c;padding:.4rem}
.social-script strong {color:#733533}
.social-script span {overflow-wrap:anywhere;min-width:0}
.social-story-form {display:flex;align-items:end;flex-wrap:wrap;gap:.5rem}
@media(max-width:520px) {
  .social-code-grid {grid-template-columns:repeat(3,minmax(0,1fr));gap:.35rem}
  .social-card {min-height:78px}
  .social-card img {height:44px}
}
