/* Multiplayer 2–5 / selectable bot difficulty — JulianMC V163 */
.jmc-room-shade{position:fixed;inset:0;z-index:99999;display:grid;place-items:center;padding:14px;background:rgba(2,9,18,.85);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px)}
.jmc-room-shade[hidden],.jmc-room-setup[hidden],.jmc-room-wait[hidden],.jmc-room-countdown[hidden],.jmc-room-finish[hidden],.jmc-room-board[hidden]{display:none!important}
.jmc-room-window{width:min(535px,100%);max-height:min(90dvh,820px);overflow:auto;padding:24px;border:1px solid rgba(122,201,255,.35);border-radius:19px;background:linear-gradient(145deg,#122d41,#06111d 77%);box-shadow:0 24px 80px rgba(0,0,0,.55);color:#ecf7ff;font-family:Inter,system-ui,sans-serif}
.jmc-room-eyebrow{font-size:10px;letter-spacing:.16em;font-weight:900;color:#8edcff}.jmc-room-heading{margin:7px 0;font-size:clamp(22px,5vw,30px);letter-spacing:-.035em}.jmc-room-intro,.jmc-room-waitcopy{margin:9px 0 19px;color:#afc4d4;line-height:1.5;font-size:13px}
.jmc-room-setup{display:grid;gap:13px}.jmc-room-setup label,.jmc-room-pair label{display:grid;gap:5px;font-size:11px;letter-spacing:.05em;font-weight:800;text-transform:uppercase;color:#c2dded}
.jmc-room-setup input,.jmc-room-setup select{height:45px;min-width:0;width:100%;background:#061321;border:1px solid rgba(123,191,233,.38);border-radius:9px;color:#fff;padding:0 12px;outline:0;font:700 15px/1 Inter,system-ui,sans-serif}
.jmc-room-setup :is(input,select):focus{border-color:#78d8ff;box-shadow:0 0 0 3px rgba(120,216,255,.12)}.jmc-room-pair{display:grid;grid-template-columns:1fr 1fr;gap:10px}.jmc-room-codejoin{display:grid;grid-template-columns:1fr auto;gap:8px}.jmc-room-codejoin input{text-transform:uppercase;letter-spacing:.2em}.jmc-room-codejoin .btn{min-height:45px}.jmc-room-divide{text-align:center;font-size:10px;letter-spacing:.12em;color:#8db4ca;font-weight:900}.jmc-room-solo{justify-self:start}
.jmc-room-codebox{display:grid;grid-template-columns:1fr auto;gap:4px 15px;align-items:center;padding:13px 14px;border:1px solid rgba(114,216,255,.3);border-radius:12px;background:rgba(99,184,240,.1)}.jmc-room-codebox small{grid-column:1/-1;font-size:10px;letter-spacing:.13em;font-weight:900;color:#9acbe5}.jmc-room-codebox strong{font-size:29px;letter-spacing:.2em;color:#fff}.jmc-room-codebox button{min-height:37px}.jmc-room-players,.jmc-room-results,.jmc-room-boardplayers{display:grid;gap:6px}.jmc-room-player{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:10px 12px;border:1px solid rgba(255,255,255,.1);border-radius:9px;background:rgba(255,255,255,.04);color:#e5f5fc;font-size:13px}.jmc-room-player.is-self{border-color:rgba(110,212,255,.6);background:rgba(90,195,255,.1)}.jmc-room-playername{font-weight:800;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.jmc-room-player strong{font-size:11px;color:#93e2ff;white-space:nowrap}.jmc-room-waitbuttons{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:14px}.jmc-room-waitbuttons button:last-child{grid-column:1/-1}.jmc-room-waitbuttons button{min-height:42px}.jmc-room-waitbuttons button[hidden]{display:none!important}.jmc-room-countdown{text-align:center}.jmc-room-countdown div{font-size:12px;letter-spacing:.12em}.jmc-room-countdown strong{display:block;font-size:100px;line-height:1.15;color:#9ce2ff}.jmc-room-countdown p{color:#cde6f6}.jmc-room-result{font-size:28px;margin:0 0 7px}.jmc-room-resultdetails{font-size:13px;color:#afc4d4;margin:0 0 16px}.jmc-room-back{margin-top:17px}.jmc-room-message{min-height:16px;margin-top:10px;font-size:12px;color:#8ff1b8}.jmc-room-message.error{color:#ff9fa8}
.jmc-room-board{position:relative;z-index:4;margin:12px 0 18px;padding:13px;border-radius:13px;border:1px solid rgba(123,195,255,.24);background:linear-gradient(120deg,rgba(25,51,71,.9),rgba(7,19,30,.9));box-shadow:0 12px 35px rgba(0,0,0,.2);color:#edf8ff}.jmc-room-boardheader{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:9px}.jmc-room-boardheader strong{font-size:13px}.jmc-room-timer{font-size:12px;color:#9fd9ff;font-weight:900}.jmc-room-boardplayers{grid-template-columns:repeat(auto-fit,minmax(170px,1fr))}.jmc-room-boardplayers .jmc-room-player{padding:8px 9px;font-size:12px}
@media(max-width:520px){.jmc-room-shade{padding:8px}.jmc-room-window{padding:17px 14px;max-height:95dvh}.jmc-room-codebox strong{font-size:24px}.jmc-room-waitbuttons{grid-template-columns:1fr}.jmc-room-waitbuttons button:last-child{grid-column:1}.jmc-room-boardplayers{grid-template-columns:1fr 1fr}.jmc-room-player{padding:8px;font-size:11px}.jmc-room-player strong{font-size:10px}}

/* V159: clearer difficulty selector on mobile, desktop and TV */
.jmc-room-difficulty-hint{margin:-7px 0 2px;padding:9px 11px;border-left:3px solid #61cdf9;border-radius:6px;background:rgba(100,201,253,.085);color:#b9d9ea;font-size:12px;line-height:1.45}
.jmc-room-setup select.jmc-room-difficulty{font-weight:900;letter-spacing:.045em;cursor:pointer}
.jmc-room-setup :is(select,input,button,a):focus-visible{outline:3px solid #8ee9ff;outline-offset:3px}
@media(max-width:520px){.jmc-room-difficulty-hint{margin:-8px 0 1px;padding:8px 10px;font-size:11px}}

.jmc-room-boarddifficulty{color:#a6eac6;font-size:11px;letter-spacing:.055em;font-weight:950}
@media(max-width:520px){.jmc-room-boardheader{flex-wrap:wrap}.jmc-room-boarddifficulty{order:3;flex-basis:100%}}

.jmc-room-shade,.jmc-room-window,.jmc-room-window *{box-sizing:border-box}


/* V160 — clearer room popup, hide giant game title behind it */
.jmc-room-shade{align-items:flex-start!important;justify-content:center!important;overflow:auto!important;padding:clamp(10px,2.2vw,26px)!important;background:linear-gradient(180deg,rgba(1,7,15,.92),rgba(3,12,21,.88))!important}
.jmc-room-window{width:min(760px,calc(100vw - 34px))!important;max-height:min(88dvh,920px)!important;margin:clamp(10px,4vh,48px) auto!important;padding:clamp(16px,2.2vw,28px)!important;border-radius:22px!important}
.jmc-room-heading{line-height:1.04!important;text-wrap:balance}
.jmc-room-intro{max-width:62ch!important}
.jmc-room-player,.jmc-room-codebox,.jmc-room-difficulty-hint{backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px)}
.game-shell.jmc-room-cover>.canvas-wrap,.game-shell.jmc-room-cover>.game-meta,.game-shell.jmc-room-cover>.mobile-controls,.game-shell.jmc-room-cover>.jmc-self-head,.game-shell.jmc-room-cover>.jmc-room-board{transition:filter .18s ease,opacity .18s ease;filter:blur(5px) brightness(.18) saturate(.65)}
.game-shell.jmc-room-cover>.canvas-wrap{position:relative!important}
.game-shell.jmc-room-cover>.canvas-wrap::after{content:'';position:absolute;inset:0;z-index:3;pointer-events:none;background:rgba(2,8,14,.68)}
@media(min-width:1100px){.jmc-room-window{width:min(820px,calc(100vw - 140px))!important}}
@media(max-width:700px){.jmc-room-window{width:min(100%,calc(100vw - 16px))!important;margin:8px auto!important}}
@media(max-width:520px){.jmc-room-window{max-height:min(94dvh,940px)!important}.jmc-room-pair,.jmc-room-codejoin{grid-template-columns:1fr!important}}


/* V162 — room popup should fully dominate the screen */
body.jmc-room-open .game-head{
  opacity:.02!important;filter:blur(10px)!important;pointer-events:none!important;user-select:none!important;
}
body.jmc-room-open .game-head *{visibility:hidden!important}


/* V163 — hard hide gameplay title while room modal is open */
html.jmc-room-open .game-head,
body.jmc-room-open .game-head{
  display:none!important;
}
html.jmc-room-open .game-shell{position:relative!important;z-index:1!important}
html.jmc-room-open .jmc-room-shade,
body.jmc-room-open .jmc-room-shade{z-index:2147483647!important}
html.jmc-room-open .game-shell.jmc-room-cover>.canvas-wrap,
body.jmc-room-open .game-shell.jmc-room-cover>.canvas-wrap,
html.jmc-room-open .game-shell.jmc-room-cover>.game-meta,
body.jmc-room-open .game-shell.jmc-room-cover>.game-meta,
html.jmc-room-open .game-shell.jmc-room-cover>.mobile-controls,
body.jmc-room-open .game-shell.jmc-room-cover>.mobile-controls,
html.jmc-room-open .game-shell.jmc-room-cover>.jmc-self-head,
body.jmc-room-open .game-shell.jmc-room-cover>.jmc-self-head,
html.jmc-room-open .game-shell.jmc-room-cover>.jmc-room-board,
body.jmc-room-open .game-shell.jmc-room-cover>.jmc-room-board{
  filter:blur(6px) brightness(.15) saturate(.55)!important;
}

.jmc-room-codebox{grid-template-columns:minmax(0,1fr) auto auto}
.jmc-room-codebox .jmc-room-invite{white-space:nowrap}
@media(max-width:520px){.jmc-room-codebox{grid-template-columns:1fr 1fr}.jmc-room-codebox strong{grid-column:1/-1}.jmc-room-codebox button{min-width:0;padding:0 8px;font-size:10px}}

/* V165 — host-only round duration picker, visible to all room members. */
.jmc-room-durationbox{display:grid;gap:9px;margin:13px 0;padding:14px 15px;border-radius:12px;border:1px solid rgba(133,218,255,.35);background:rgba(102,196,238,.085)}
.jmc-room-durationheadline{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px}
.jmc-room-durationheadline strong{font-size:12px;color:#c7efff;letter-spacing:.06em}
.jmc-room-durationvalue{font-size:18px;font-weight:950;color:#a1f0ff}
.jmc-room-hostduration{display:grid;gap:6px;color:#c4e4f3;font-size:11px;font-weight:800;letter-spacing:.045em;text-transform:uppercase}
.jmc-room-hostduration[hidden]{display:none!important}
.jmc-room-hostduration select{width:100%;min-height:44px;padding:0 12px;border:1px solid rgba(123,191,233,.45);border-radius:9px;background:#061321;color:#fff;font:800 15px/1 Inter,system-ui,sans-serif;cursor:pointer}
.jmc-room-durationhint{font-size:11px;color:#a7cddd;line-height:1.45}
.jmc-room-hostduration select:disabled{opacity:.55;cursor:wait}

/* V173: keep the replay button host-only, including under .btn display rules. */
.jmc-room-rematch[hidden]{display:none!important}
.jmc-room-rematch{width:100%;min-height:46px;margin-top:16px}

/* V207 — public / code-only room selector and host privacy switch */
.jmc-room-visibility-picker{min-width:0;margin:0;padding:12px;display:grid;gap:9px;border:1px solid rgba(123,191,233,.35);border-radius:12px;background:rgba(7,24,38,.8)}
.jmc-room-visibility-picker legend{padding:0 6px;color:#bde8ff;font-size:12px;font-weight:950;text-transform:uppercase;letter-spacing:.07em}
.jmc-room-setup .jmc-room-visibility-option{display:flex;align-items:center;gap:12px;min-width:0;padding:12px;border:1px solid rgba(120,183,217,.28);border-radius:10px;background:rgba(255,255,255,.035);cursor:pointer;text-transform:none;letter-spacing:normal}
.jmc-room-setup .jmc-room-visibility-option:has(input:checked){border-color:#74d9ff;background:rgba(91,175,228,.15)}
.jmc-room-setup .jmc-room-visibility-option input{flex:0 0 20px;width:20px;height:20px;min-width:20px;margin:0;padding:0;accent-color:#62d1ff;box-shadow:none}
.jmc-room-visibility-option span{display:grid;gap:4px;min-width:0}.jmc-room-visibility-option strong{font-size:14px;color:#f4fbff}.jmc-room-visibility-option small{color:#b5d1e1;font-size:12px;font-weight:500;line-height:1.4}
.jmc-room-sharing{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px;margin-bottom:13px;padding:12px;border-radius:10px;border:1px solid rgba(123,191,233,.3);background:rgba(8,25,42,.75)}
.jmc-room-sharing-status{font-size:13px;font-weight:850;color:#e5f6ff}.jmc-room-change-visibility{font-size:11px;min-height:38px}.jmc-room-change-visibility[hidden]{display:none!important}
@media(max-width:520px){.jmc-room-sharing{align-items:stretch;flex-direction:column}.jmc-room-sharing .btn{width:100%}.jmc-room-visibility-picker{padding:9px}}
/* V209: hide the legacy join controls completely on the creation screen. */
.jmc-room-codejoin[hidden],.jmc-room-retry[hidden]{display:none!important}
.jmc-room-retry{display:grid;gap:8px;border:1px solid rgba(140,185,226,.25);padding:10px;border-radius:8px;margin-top:10px}
.jmc-room-retry p{font-size:12px;color:#b6d4e7;margin:0}

/* V216 — assigned room-only username and live join alert. */
.jmc-room-my-nick{padding:10px 12px;margin:10px 0 7px;border:1px solid rgba(93,213,255,.38);border-radius:9px;background:rgba(60,171,218,.12);color:#d8f2ff;font-size:12px;font-weight:800}
.jmc-room-self-nick{color:#7fedb5;font-size:15px;word-break:break-word}
.jmc-room-arrival{min-height:17px;margin:5px 0 8px;color:#87eab5;font-size:12px;font-weight:800}
