/* The room in account mode: one phone-sized column, a round village, one status row. Everything is scoped to body.room2, so the old
   room (legacy mode) is untouched. Design: GPT's mobile-room-full-flow, reconciled in DESIGN/OFFICIAL/03-game-page-contract.md. */
body.room2{background:#faf8ee}
body.room2 .topbar{display:none}
body.room2 #app{max-width:480px;margin:0 auto;padding:0 0 max(6px,env(safe-area-inset-bottom));width:100%}
body.room2 .room-top{margin:0;padding:6px 12px;min-height:56px;background:#fffcf3;border-bottom:1px solid #eae6d6;flex-shrink:0}
body.room2 .room-top h1{font-size:17px;line-height:1.25;margin:0}
body.room2 .room-top small{font-size:11px;color:#657669}
body.room2 .room-actions{gap:6px;flex-wrap:nowrap}
body.room2 .room-actions button{min-width:44px;height:44px;border:1px solid #d7e0d2;border-radius:12px;background:#edf1e8;color:#2b5a43;font-size:14px;font-weight:700;padding:0 10px}
body.room2 #my-profile,body.room2 #close-room,body.room2 #leave-room{display:none!important}
body.room2 #room-menu{display:inline-flex!important;align-items:center;justify-content:center;width:44px;font-size:20px;padding:0}
body.room2 #sound-toggle{display:none}
body.room2 #host-quick,body.room2 .room-bottom{display:none!important}
body.room2 .phase-bar{margin:6px 10px;min-height:52px;padding:4px 8px 4px 12px;border-radius:13px}
body.room2 .phase-bar strong{font-size:14px;line-height:1.3}
body.room2 .phase-bar small{font-size:11px;margin-top:1px}
body.room2 .phase-right{display:flex;align-items:center;gap:8px}
body.room2 .clock{font-size:20px}
.phase-action{height:44px;min-width:82px;border:0;border-radius:10px;background:#f5f1e6;color:#233d2e;font-size:13px;font-weight:700;padding:0 12px}
.phase-action.start{background:#f1c775}
.phase-action:disabled{opacity:.5}
body.room2 .play-layout{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) clamp(190px,30dvh,260px);gap:0;margin:0 10px;flex:1;min-height:0}
body.room2 .village-panel{border:2px solid #719271;border-bottom:0;border-radius:16px 16px 0 0;background:transparent}
body.room2 .map-label{display:none}
body.room2 .map-foot{padding:6px 10px;font-size:12px;background:#fffdf6}
body.room2 .chat-panel{border-radius:0 0 15px 15px;border:1px solid #dddfd4;background:#fffdf8}
body.room2 .chat-title{padding:6px 12px;min-height:34px;border-bottom:1px solid #eceae0}
body.room2 .message img{border:2px solid var(--ring-n)}
body.room2 .deck-strip{margin:0 10px 6px}
body.room2 .seer-bar{margin:0 10px 6px}
body.room2 .offline-banner{top:116px}

/* the round village */
body.room2 .map.circle{background:#92b77c var(--ground,none) repeat center/230px;border-radius:0;aspect-ratio:auto!important}
.map.circle:after{content:"";position:absolute;right:-11px;top:0;bottom:0;width:19px;pointer-events:none;background:var(--river,none) repeat center/110px;box-shadow:-4px 0 0 #c9b785}
.map.circle.night{filter:none}
.map.circle .ring-road{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.map.circle .well{position:absolute;z-index:2;left:50%;top:50%;width:88px;height:75px;transform:translate(-50%,-48%);object-fit:contain;filter:drop-shadow(0 3px 3px #1c422d66);pointer-events:none}
.map.circle .well.small{width:59px;height:52px}
.map.circle .well.plain{border-radius:50%;background:#cfc6ac;border:5px solid #a8987a;height:60px;width:60px}
.map.circle .tree{position:absolute;z-index:1;object-fit:contain;pointer-events:none;filter:drop-shadow(0 2px 2px #1e452f55)}
.map.circle .tree.t1{left:-10px;top:-13px;width:65px;height:65px}.map.circle .tree.t2{right:6px;top:-6px;width:42px;height:62px}.map.circle .tree.t3{left:-8px;bottom:-4px;width:40px;height:60px}.map.circle .tree.t4{right:-6px;bottom:-12px;width:70px;height:70px}
.map.circle .house{position:absolute;aspect-ratio:1/.95;height:auto!important;min-height:44px;transform:translate(-50%,-50%);padding:0;z-index:3;display:block;overflow:visible}
.map.circle .house .roof{position:absolute;left:0;top:0;width:100%;height:100%;object-fit:contain;display:block}
.map.circle .house .roof.art{width:100%;height:100%}
.map.circle .house.flip .roof.art{transform:scaleX(-1)}
.map.circle .house .resident{position:absolute;top:4%;right:2%;left:auto;width:32%;height:auto;aspect-ratio:1;margin:0;border-width:3px;z-index:3}
.map.circle.painted .house .resident,.map.circle .house.flip .resident{top:4%;right:2%;left:auto;margin:0;height:auto}
.map.circle .house.speaking .resident{transform:translateY(-3px) scale(1.12)}
.map.circle .house .house-name{position:absolute;left:50%;top:auto;bottom:-4%;transform:translateX(-50%);max-width:112%;font-size:12px;font-weight:700;padding:2px 8px;background:#fffbea;border:1px solid #e4d3a8;border-radius:8px;line-height:1.35;z-index:3;color:#263e31}
.map.circle.painted .house .house-name{top:auto;bottom:-4%}
.map.circle .house .house-state{position:absolute;left:50%;top:auto;bottom:-24%;transform:translateX(-50%);z-index:3;font-size:9px;white-space:nowrap}
.map.circle.dense .house .house-name{font-size:10.5px;padding:1px 5px;bottom:-2%}
.map.circle.dense .house .house-state{bottom:-20%;font-size:8.5px}
.map.circle .house.eligible .house-name{outline:2px solid #315c48;outline-offset:2px}
.map.circle .house.out .roof{filter:grayscale(.8);opacity:.6}
.map.circle .house-x{position:absolute;left:12%;top:4%;width:76%;height:80%;z-index:4;pointer-events:none}
.map.circle .house .mark{z-index:5}
.map-tag{position:absolute;left:8px;top:8px;z-index:6;background:#fffbeaee;border:1px solid #d9b984;border-radius:10px;padding:5px 10px;font-size:12px;font-weight:600;color:#3d5144;line-height:1.3;text-align:left;pointer-events:none}
button.map-tag.role-tag{pointer-events:auto;min-height:44px;border:2px solid #c0392b;background:#fff7f4;color:#7a1f14}
.map-tag small{display:block;font-weight:400;font-size:10.5px;color:#7a5a52}
.map.circle .scene{z-index:8}

/* the old room hides its header and caps the map on short phones; the round village wants both (a village that fits is the point) */
@media(max-width:700px) and (max-height:720px){
  body.room2.in-room .room-top{display:flex}
  body.room2.in-room .phase-bar small{display:block}
  body.room2.in-room .phase-bar{padding:4px 8px 4px 12px;margin:6px 10px}
  body.room2.in-room .map.circle{width:100%;max-height:none;margin-inline:0}
}
@media(max-width:700px) and (max-height:640px){
  body.room2.in-room:not(.keyboard-open) .play-layout{grid-template-rows:minmax(0,1fr) 150px}
  body.room2.in-room:not(.keyboard-open) .deck-strip{display:none}
  body.room2.in-room:not(.keyboard-open) .room-top{min-height:48px;padding:3px 12px}
}
@media(max-width:700px) and (max-height:500px){
  body.room2.in-room .room-top{display:none}
}
body.room2.keyboard-open .room-top{display:none}
body.room2 #clock:empty{display:none}
body.room2.in-room .village-panel{flex:1 1 0%;min-height:0}
body.room2.in-room .village-stack{min-height:0;display:flex;flex-direction:column}
body.room2.in-room .map.circle{flex:1 1 0%;min-height:0;height:0;width:100%;max-height:none;margin-inline:0}
/* state labels (Host, out, coming back, bot) sit at the top-left of the house so they never cover the names */
.map.circle .house .house-state{top:2%;bottom:auto;left:2%;transform:none;font-size:9px;padding:1px 5px;background:#fffbeacc;border:1px solid #e4d3a8;color:#4a4a42}
.map.circle.dense .house .house-state{top:0;bottom:auto;font-size:8px;padding:0 4px}
.map.circle .house.out .house-state{background:#655b50;color:#fff;border-color:#655b50}
.map.circle .house .house-name .gt{font-style:normal;font-weight:500;font-size:9px;color:#6b6f66;margin-left:3px}
.menu-list button small{display:block;margin-top:2px;font-size:12px;font-weight:400;color:var(--muted)}
.menu-list button.danger small{color:#ffe2de}
.menu-list button b{font-weight:600}

/* the role tag and the vote chip are small notes on the map, not boxes over the houses (the owner asked for this) */
.map-tag{left:6px;top:6px;padding:2px 8px;font-size:11px;font-weight:500;line-height:1.5;border-radius:8px;border-width:1px}
button.map-tag.role-tag{min-height:0;padding:2px 8px;border:1px solid #c0392b;background:#fff7f4cc;font-size:11px;line-height:1.5;border-radius:8px}
button.map-tag.role-tag::after{content:'';position:absolute;inset:-12px -6px -10px -6px}
.map-tag small{display:none}
.map-chip{position:absolute;left:6px;bottom:6px;z-index:6;min-height:0;padding:3px 12px;font-size:12px;font-weight:600;line-height:1.5;border-radius:999px;border:1px solid #cdbf9a;background:#fffbeae6;color:#3d5144}
button.map-chip.abstain{pointer-events:auto}
button.map-chip.abstain::after{content:'';position:absolute;inset:-9px -8px}
body.room2 #action-hint{display:none}
body.room2 .map-foot{padding:0;border-top:0}
body.room2 #verdict-bar{margin:0;border-top:1px solid #e6c9a3}
body.room2 .verdict-bar.compact{display:none}

/* the panels of GPT's design: roles, the Host's control panel and "my profile" (dialogs in the old room, bottom sheets later) */
.role-tabs{display:flex;gap:4px;padding:4px;margin:0 0 12px;background:#edf1e8;border-radius:12px}
.role-tabs button{flex:1;min-height:44px;font-size:14px;background:transparent;border-radius:9px;color:#3d5144}
.role-tabs button[aria-selected=true]{background:var(--green);color:#fff}
.role-head{display:flex;gap:12px;align-items:flex-start;margin-bottom:12px}
.role-card-img{width:112px;aspect-ratio:2/3;object-fit:contain;border-radius:8px;background:#151715;flex:none}
.role-head h3{font-size:22px;margin:0 0 2px}
.you-badge{display:inline-block;background:#c0392b;color:#fff;border-radius:6px;padding:2px 8px;font-size:12px;font-weight:700}
.role-sec{background:#f1f3ea;border-radius:12px;padding:10px 12px;margin:0 0 8px}
.role-sec h4{margin:0 0 4px;font-size:14px}.role-sec p{margin:0;font-size:13px;line-height:1.7}
.role-cards{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:8px 0}
.role-card{display:flex;gap:8px;align-items:center;text-align:left;min-height:84px;padding:6px;background:#fff;border:1px solid #dcdfd2;border-radius:12px;font-weight:400;color:var(--ink)}
.role-card.mine{border:2px solid #c0392b;background:#fff7f4}
.role-card img{width:52px;aspect-ratio:2/3;object-fit:contain;border-radius:6px;background:#151715;flex:none}
.role-card b{display:block;font-size:14px}.role-card small{display:block;font-size:11px;color:var(--muted)}
.role-card em{display:inline-block;font-style:normal;font-size:10px;font-weight:700;background:#c0392b;color:#fff;border-radius:5px;padding:1px 6px;margin-top:3px}
.role-back{background:#edf1e8;color:#2b5a43;font-size:13px;min-height:44px;margin-bottom:10px}
.host-row{display:flex;gap:8px;margin:6px 0 12px}.host-row button{flex:1;min-height:52px;font-size:15px}
.host-row button:disabled{background:#eef1ea;color:#a5ada1}
.host-note{background:#f1f3ea;border-radius:12px;padding:10px 12px;font-size:13px;line-height:1.7}
.host-menu button b{display:block;font-size:15px}.host-menu button small{display:block;margin-top:2px}
.host-menu button.danger{background:#fbeceb;color:#8a1c14}.host-menu button.danger small{color:#a8483f}
.profile-panel{display:flex;flex-direction:column;gap:12px}
.profile-top{display:flex;gap:12px;align-items:center}
.profile-top .card-portrait{width:84px;height:84px;margin:0;border-radius:18px;border:3px solid var(--ring-n)}
.profile-name{font-family:var(--head);font-size:18px}
.photo-pick{display:inline-block;margin-top:6px;padding:10px 12px;background:#edf1e8;border:1px solid #d7e0d2;border-radius:12px;font-size:13px;font-weight:600;color:#2b5a43;cursor:pointer}
.photo-pick input{display:none}
.mood-set{border:0;padding:0;margin:0}.mood-set legend{font-size:14px;font-weight:600;margin-bottom:6px}
.mood-chips{display:flex;flex-wrap:wrap;gap:6px}
.mood-chip{display:inline-block;margin:0}.mood-chip input{position:absolute;opacity:0;width:1px;min-height:0}
.mood-chip span{display:inline-block;min-height:44px;line-height:42px;padding:0 12px;border:1px solid #d7e0d2;border-radius:12px;background:#f3f6ef;font-size:13px;font-weight:500}
.mood-chip input:checked+span{border:2px solid var(--green);background:#e4efe3;line-height:40px}
.mood-chip input:focus-visible+span{outline:3px solid #b87831;outline-offset:2px}
.stat-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;text-align:center}
.stat-cards div{background:#f1f3ea;border-radius:12px;padding:10px 4px}.stat-cards b{display:block;font-size:22px;font-family:var(--head)}.stat-cards small{font-size:11px}
.link-button{background:transparent;color:#2b5a43;text-align:left;padding:0 4px;font-size:14px}

/* the village is laid out against the shorter side of the map (--s): labels scale with it and never reach the neighbouring houses */
body.room2.in-room .map.circle{--n:clamp(9px,calc(var(--s,360px)*.031),12.5px)}
body.room2.in-room .map.circle .house{min-height:0}
body.room2.in-room .map.circle .house .house-name,body.room2.in-room .map.circle.painted .house .house-name{font-size:var(--n);padding:.1em .5em;max-width:132%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;bottom:-7%;line-height:1.4;border-radius:.6em}
body.room2.in-room .map.circle.dense .house .house-name{font-size:max(9px,calc(var(--n)*.92));bottom:-7%}
body.room2.in-room .map.circle.tight .house .house-name{font-size:max(9px,calc(var(--n)*.82));max-width:152%;padding:.05em .4em;bottom:-8%}
body.room2.in-room .map.circle .house .house-name .gt{font-size:.78em}
body.room2.in-room .map.circle .house .house-state,body.room2.in-room .map.circle.dense .house .house-state{top:0;bottom:auto;left:0;transform:none;font-size:max(8.5px,calc(var(--n)*.75));padding:0 .45em;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-radius:.6em;line-height:1.5}
body.room2.in-room .map.circle.tight .house .house-state{font-size:max(9px,calc(var(--n)*.85))}
body.room2.in-room .map.circle.tight .house .resident{width:40%;border-width:2px}
/* Session 3: personal event library inside the six-face dice editor. */
.event-library { display: grid; gap: 12px; margin-top: 18px; }
.event-library label { display: grid; gap: 5px; }
.event-library-row { display: grid; grid-template-columns: minmax(0, 1fr) 66px; gap: 8px; margin: 12px 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.event-library-row small { display: block; overflow-wrap: anywhere; }
.event-library-row button { min-width: 0; }
