.life-player.is-yours:focus {
  outline: 3px solid #ffe49a;
  outline-offset: 3px;
}

.life-player.life-changed {
  animation: life-pulse .42s ease;
}

.life-change-status {
  display: block;
  min-height: 1.2em;
  margin-top: 4px;
  color: #ffe49a;
  font-weight: 800;
}

.game-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  margin: 0 0 10px;
  padding: 7px 10px;
  border: 1px solid #6e542d;
  border-radius: 8px;
  background: #17120c;
}
.game-room-actions { flex-wrap: wrap; align-items: center; }
.game-room-free-note { align-self: center; margin-right: auto; color: #f1d695; font-size: .88rem; font-weight: 750; }
.game-connection-error { margin: 14px 0 0; padding: 12px 15px; border: 1px solid #ce7062; border-radius: 8px; color: #ffe0d5; background: #421f1b; line-height: 1.45; }

.game-tools.is-collapsed,
.livekit-tile.camera-hidden {
  display: none;
}

.game-coin {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  perspective: 500px;
}

.game-coin img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

.game-coin.is-flipping img {
  animation: coin-flip .9s cubic-bezier(.2,.7,.2,1);
}

@keyframes coin-flip {
  0% { transform: rotateY(0) translateY(0) scale(1); }
  35% { transform: rotateY(540deg) translateY(-24px) scale(1.25); }
  70% { transform: rotateY(1080deg) translateY(-5px) scale(1.08); }
  100% { transform: rotateY(1440deg) translateY(0) scale(1); }
}

.game-tool-result {
  display: grid;
  min-width: 230px;
  margin-right: auto;
}

.game-tool-result small,
.coin-label {
  color: #bfa879;
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .08em;
}

.game-tool-result strong {
  color: #fff0c9;
  font-size: .92rem;
}

.game-room-live .livekit-container {
  height: calc(100% - 209px);
}

.game-room-live.coin-panel-collapsed .livekit-container {
  height: calc(100% - 145px);
}

.camera-check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
  padding: 11px 13px;
  border: 1px solid #6e542d;
  border-radius: 8px;
  background: #17120c;
}

.camera-check div { display: grid; gap: 2px; }
.camera-check strong { color: #fff0c9; }
.camera-check small { color: #bfa879; }
.owner-studio-login,.owner-studio-option { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 10px; padding: 11px 13px; border: 1px solid #5e4930; border-radius: 8px; background: #14110d; }
.owner-studio-login[hidden],.owner-studio-option[hidden] { display: none; }
.owner-studio-login div,.owner-studio-option span { display: grid; gap: 3px; }
.owner-studio-login strong,.owner-studio-option strong { color: #f2d08d; }
.owner-studio-login small,.owner-studio-option small { color: #bfa879; }
.owner-studio-option { justify-content: flex-start; cursor: pointer; border-color: #9b7138; background: #241b10; }
.studio-backgrounds { margin: 12px 0 0; padding: 14px; border: 1px solid #806139; border-radius: 9px; background: #100e0a; }
.studio-backgrounds legend { padding: 0 7px; color: #f1cf7b; font-weight: 900; }
.studio-backgrounds > p { margin: 0 0 11px; color: #b9aa8e; font-size: .84rem; }
.studio-backgrounds > small { display: block; margin-top: 10px; color: #ab9a78; }
.studio-background-grid { display: grid; grid-template-columns: repeat(4,minmax(120px,1fr)); gap: 9px; }
.studio-background-grid label { position: relative; display: grid; min-height: 92px; overflow: hidden; border: 2px solid #43351f; border-radius: 8px; cursor: pointer; background: #050604; }
.studio-background-grid label:has(input:checked) { border-color: #e4b95f; box-shadow: 0 0 0 2px #e4b95f33; }
.studio-background-grid input { position: absolute; z-index: 2; top: 7px; left: 7px; accent-color: #e4b95f; }
.studio-background-grid img { width: 100%; height: 92px; object-fit: cover; }
.studio-background-grid span { position: absolute; inset: auto 0 0; padding: 6px 8px; color: #fff0ca; background: #070806dc; font-size: .77rem; font-weight: 850; text-align: center; }
.studio-background-grid .background-none,.studio-background-grid .background-blur { position: static; display: grid; height: 92px; place-items: center; background: linear-gradient(135deg,#171a17,#050605); }
.studio-background-grid .background-blur { background: linear-gradient(135deg,#43624399,#121712),radial-gradient(circle,#c99a48,#243024); filter: blur(.3px); }
@media (max-width: 720px) { .studio-background-grid { grid-template-columns: repeat(2,1fr); } }
.owner-studio-option input { width: 20px; height: 20px; accent-color: #d7aa50; }

.camera-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.studio-dock { position: sticky; z-index: 40; top: 8px; display: grid; grid-template-columns: 12px minmax(220px,1fr) auto auto; gap: 12px; align-items: center; margin: 8px 14px; padding: 12px 14px; border: 1px solid #c89c4d; border-radius: 9px; background: #17120cf2; box-shadow: 0 8px 28px #0009; }
.studio-dock[hidden] { display: none; }
.studio-dock div { display: grid; gap: 2px; }
.studio-dock strong { color: #f5d68e; }
.studio-dock small { color: #bfa879; }
@media (max-width:720px) { .studio-dock { grid-template-columns: 12px 1fr; } .studio-dock button { grid-column: 2; } }

.camera-preview-tile {
  position: relative;
  min-height: 220px;
  overflow: hidden;
  border: 2px solid #c89c4d;
  border-radius: 9px;
  background: #050604;
}

.camera-preview-tile video { width: 100%; height: 100%; display: block; object-fit: cover; }
.camera-preview-tile span { position: absolute; left: 10px; bottom: 10px; padding: 5px 9px; border-radius: 6px; color: #fff2cf; background: #090806dc; font-weight: 800; }
.local-camera-tile { border: 2px solid #d5a84f; }

.livekit-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
  min-height: 360px;
  overflow: hidden;
  border: 1px solid #4e3b21;
  border-radius: 10px;
  background: #050604;
}
.livekit-container.owner-studio-fixed { display: flex; align-items: center; justify-content: flex-end; min-height: 520px; padding: 32px; background-color: #07100a; background-repeat: no-repeat; }
.livekit-container.owner-studio-fixed.studio-regin { background-image: url('studio-regin-cutout.webp'),radial-gradient(circle at 28% 45%,#243d25 0,#09110b 48%,#030504 100%); background-position: 4% center,center; background-size: auto 88%,cover; }
.livekit-container.owner-studio-fixed.studio-lair { background-image: linear-gradient(90deg,transparent 0 38%,#030504 49%),url('studio-background-lair.webp'); background-position: center,left center; background-size: cover,43% auto; }
.livekit-container.owner-studio-fixed .livekit-tile,.livekit-container.owner-studio-fixed.camera-stage .livekit-tile,.livekit-container.owner-studio-fixed.camera-stage .livekit-tile.is-main-camera { width: min(66%,980px); height: min(78%,650px); min-height: 260px; grid-column: auto; grid-row: auto; border: 4px solid #d0a355; border-radius: 8px; opacity: 1; box-shadow: 0 18px 45px #000c; }
.livekit-container.owner-studio-fixed .livekit-tile video { object-fit: contain; }
.livekit-container.owner-studio-fixed .livekit-tile[data-camera-role="face"] { display: none; }
@media (max-width: 720px) { .livekit-container.owner-studio-fixed { min-height: 420px; padding: 18px; } .livekit-container.owner-studio-fixed.studio-regin { background-size: auto 65%,cover; } .livekit-container.owner-studio-fixed.studio-lair { background-size: cover,54% auto; } .livekit-container.owner-studio-fixed .livekit-tile,.livekit-container.owner-studio-fixed.camera-stage .livekit-tile,.livekit-container.owner-studio-fixed.camera-stage .livekit-tile.is-main-camera { width: 75%; height: 300px; } }

.camera-stage-help {
  margin: 0 0 6px;
  color: #d9c797;
  font-size: .82rem;
  font-weight: 750;
  text-align: right;
}

.livekit-container.camera-stage {
  grid-template-columns: minmax(0, 1fr) minmax(150px, 22%);
  grid-auto-rows: minmax(100px, 1fr);
}

.livekit-container.camera-stage .livekit-tile {
  grid-column: 2;
  min-height: 0;
  cursor: pointer;
  border: 2px solid #70572e;
  opacity: .88;
  transition: border-color .16s ease, opacity .16s ease, transform .16s ease;
}

.livekit-container.camera-stage .livekit-tile:hover,
.livekit-container.camera-stage .livekit-tile:focus-visible {
  border-color: #f0c96e;
  opacity: 1;
  outline: none;
}

.livekit-container.camera-stage .livekit-tile.is-main-camera {
  grid-column: 1;
  grid-row: 1 / span 4;
  min-height: 100%;
  cursor: default;
  border-color: #c89c4d;
  opacity: 1;
}

.livekit-tile {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  background: #080a08;
}

.livekit-tile video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.livekit-tile span {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 5px 9px;
  border: 1px solid #c89c4d88;
  border-radius: 6px;
  color: #fff2cf;
  background: #090806d9;
  font-size: .82rem;
  font-weight: 800;
}

.tile-hide-camera {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  min-height: 32px;
  padding: 4px 9px;
  border: 1px solid #dfbd72;
  border-radius: 6px;
  color: #fff2cf;
  background: #090806e8;
  font: inherit;
  font-size: .76rem;
  font-weight: 850;
  cursor: pointer;
}

.tile-hide-camera:hover,
.tile-hide-camera:focus-visible {
  color: #171008;
  background: #f0c96e;
  outline: none;
}

.stream-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 9px;
  border-radius: 999px;
  color: #c9b98f;
  background: #19140e;
  font-size: .76rem;
  font-weight: 850;
}

.stream-status.is-live {
  color: #fff;
  background: #a91521;
  box-shadow: 0 0 18px #d8293766;
}
.commentator-presence { display: inline-flex; align-items: center; gap: 7px; width: max-content; margin-top: 7px; padding: 5px 9px; border: 1px solid #ef4454; border-radius: 999px; color: #fff; background: #8f1221; box-shadow: 0 0 14px #f3345277; font-size: .8rem; font-weight: 850; }
.commentator-presence[hidden] { display: none; }
.commentator-presence > span { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: #fff1f1; box-shadow: 0 0 9px #fff; animation: commentator-glow 2s ease-in-out infinite; }
@keyframes commentator-glow { 50% { opacity: .48; box-shadow: 0 0 3px #fff; } }
@media (prefers-reduced-motion: reduce) { .commentator-presence > span { animation: none; } }

.stream-consent-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 3px 10px;
  padding: 10px 13px;
  border: 1px solid #755a31;
  border-radius: 8px;
  background: #17120c;
  color: #f5e5bf;
}
.stream-consent-panel label { display: flex; align-items: center; gap: 9px; font-weight: 750; cursor: pointer; }
.stream-consent-panel input { width: 18px; height: 18px; accent-color: #d7aa50; }
.stream-consent-panel span { color: #c9b78f; font-size: .86rem; }
@media (max-width: 760px) { .stream-consent-panel { align-items: flex-start; flex-direction: column; } }

.game-room-live { position: relative; }
.game-card-lookup { position: absolute; z-index: 40; top: 58px; right: 12px; width: min(440px, calc(100% - 24px)); max-height: calc(100% - 72px); overflow: auto; padding: 17px; border: 1px solid #c99b4b; border-radius: 10px; color: #eee3cd; background: #11100ded; box-shadow: 0 18px 55px #000d; backdrop-filter: blur(9px); }
.game-card-lookup-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.game-card-lookup-head small { color: #d7aa50; font-size: .7rem; font-weight: 850; letter-spacing: .12em; }
.game-card-lookup-head h2 { margin: 3px 0 0; font: 700 1.45rem Georgia,serif; }
.game-card-search { display: grid; grid-template-columns: 1fr auto; gap: 7px; margin-top: 14px; }
.game-card-search input { width: 100%; min-height: 40px; padding: 8px 10px; }
.game-card-note { margin: 8px 0 12px; color: #bdae91; font-size: .78rem; line-height: 1.4; }
.game-card-results { display: grid; gap: 6px; max-height: 235px; overflow: auto; }
.game-card-results>p { margin: 6px 0; color: #bdae91; }
.game-card-result { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px; border: 1px solid #403625; border-radius: 6px; color: #eee3cd; background: #1a1711; text-align: left; cursor: pointer; }
.game-card-result:hover,.game-card-result:focus-visible { border-color: #d7aa50; background: #292117; outline: none; }
.game-card-result img { width: 42px; height: 59px; flex: 0 0 42px; border-radius: 3px; object-fit: cover; }
.game-card-result span,.game-card-result strong,.game-card-result small { display: block; min-width: 0; }
.game-card-result small { margin-top: 3px; color: #bdae91; font-size: .7rem; }
.game-card-detail { display: grid; grid-template-columns: 145px minmax(0,1fr); gap: 13px; margin-top: 14px; padding-top: 14px; border-top: 1px solid #5b482c; }
.game-card-detail>img { width: 145px; border-radius: 7px; box-shadow: 0 8px 20px #000a; }
.game-card-detail small { color: #d7aa50; font-size: .65rem; font-weight: 800; letter-spacing: .08em; }
.game-card-detail h3 { margin: 3px 0 5px; font: 700 1.2rem Georgia,serif; }
.game-card-detail strong { color: #d1bf9d; font-size: .75rem; }
.game-card-detail p { white-space: pre-line; margin: 11px 0; padding: 10px; border: 1px solid #403625; border-radius: 6px; color: #f2eadc; background: #080806; font-size: .82rem; line-height: 1.45; }
.game-card-detail a { color: #efc77f; font-size: .78rem; font-weight: 750; }
@media (max-width: 560px) { .game-card-lookup { inset: 8px; width: auto; max-height: calc(100% - 16px); } .game-card-detail { grid-template-columns: 100px minmax(0,1fr); } .game-card-detail>img { width: 100px; } }

@keyframes life-pulse {
  0% { transform: scale(1); }
  45% { transform: scale(1.055); background: #65471f; box-shadow: 0 0 26px #f3c35a99; }
  100% { transform: scale(1); }
}

.game-room-live:fullscreen,
.game-room-live.pseudo-fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  border-radius: 0;
  background: #0b0906;
  padding: 12px;
}

.game-room-live.pseudo-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.game-room-live:fullscreen .livekit-container,
.game-room-live.pseudo-fullscreen .livekit-container {
  height: calc(100vh - 209px);
}

.game-room-live.coin-panel-collapsed:fullscreen .livekit-container,
.game-room-live.coin-panel-collapsed.pseudo-fullscreen .livekit-container {
  height: calc(100vh - 145px);
}

/* Keep the controls available while letting the camera use the whole screen. */
.game-room-live:fullscreen,.game-room-live.pseudo-fullscreen { display:flex; flex-direction:column; overflow:auto; }
.game-room-live:fullscreen .livekit-container,.game-room-live.pseudo-fullscreen .livekit-container,.game-room-live.coin-panel-collapsed:fullscreen .livekit-container,.game-room-live.coin-panel-collapsed.pseudo-fullscreen .livekit-container { flex:1 1 auto; min-height:160px; height:auto; }
.game-room-live.focus-camera #gameInvite,.game-room-live.focus-camera #streamConsentPanel,.game-room-live.focus-camera #lifeOverlay,.game-room-live.focus-camera #gameTools,.game-room-live.focus-camera .camera-stage-help { display:none !important; }
.game-room-live.focus-camera .game-live-bar { flex:0 0 auto; align-items:center; margin-bottom:8px; padding:5px 8px; border:1px solid #796139; border-radius:8px; background:#171812ee; }
.game-room-live.focus-camera .game-live-bar #restoreRemoteCameras,.game-room-live.focus-camera .game-live-bar #toggleOwnCameras,.game-room-live.focus-camera .game-live-bar #toggleCoinPanel,.game-room-live.focus-camera .game-live-bar #toggleCardLookup,.game-room-live.focus-camera .game-live-bar #toggleScreenShare,.game-room-live.focus-camera .game-live-bar #startTwitchStream { display:none !important; }
.game-room-live.focus-camera .livekit-container { min-height: min(65dvh,500px); height: min(75dvh,840px); }
.game-room-live.focus-camera:fullscreen .livekit-container,.game-room-live.focus-camera.pseudo-fullscreen .livekit-container { min-height:160px; height:auto; }
.game-room-live.focus-camera .livekit-container.owner-studio-fixed { justify-content:flex-end; padding:12px; }
.game-room-live.focus-camera .livekit-container.owner-studio-fixed .livekit-tile,.game-room-live.focus-camera .livekit-container.owner-studio-fixed.camera-stage .livekit-tile.is-main-camera { width:min(57%,1000px); height:96%; min-height:0; }
@media(max-width:760px){.game-room-live.focus-camera .game-live-bar{align-items:flex-start;flex-wrap:wrap}.game-room-live.focus-camera .livekit-container.owner-studio-fixed .livekit-tile{width:72%}}

@media (max-width: 760px) {
  .camera-check { align-items: stretch; flex-direction: column; }
  .game-tools { flex-wrap: wrap; }
  .game-tool-result { width: 100%; min-width: 0; }
  .game-room-live .livekit-container { height: 55dvh; grid-template-columns: 1fr; }
  .game-room-live.coin-panel-collapsed .livekit-container { height: 65dvh; }
  .game-room-live .livekit-container.camera-stage { grid-template-columns: minmax(0, 1fr) minmax(105px, 28%); }
  .game-room-live .livekit-container.camera-stage .livekit-tile { grid-column: 2; }
  .game-room-live .livekit-container.camera-stage .livekit-tile.is-main-camera { grid-column: 1; }
  .camera-stage-help { text-align: left; }
}
body.game-room-mode .topbar,
body.game-room-mode .app-shell {
  display: none !important;
}

body.game-room-mode .game-room-screen {
  min-height: 100vh;
}

.game-room-live.invite-collapsed #gameInvite,.game-room-live.life-collapsed #lifeOverlay{display:none !important}
.game-room-live #gameInvite[hidden]{display:none !important}
.game-room-live.focus-camera .game-live-bar #toggleInvitePanel,.game-room-live.focus-camera .game-live-bar #toggleLifePanel{display:none !important}
.game-room-live:fullscreen .game-live-bar,.game-room-live.pseudo-fullscreen .game-live-bar{position:sticky;top:0;z-index:20;max-height:35dvh;overflow:auto;padding:8px 170px 8px 10px;background:#171812f5;border:1px solid #796139;border-radius:8px}
.game-room-live:fullscreen #toggleGameFullscreen,.game-room-live.pseudo-fullscreen #toggleGameFullscreen{position:fixed;top:18px;right:20px;z-index:30;background:#d4a14e;color:#1b1107;border:2px solid #f4cf83;box-shadow:0 4px 15px #000a}
.game-room-live:fullscreen #toggleGameFullscreen::after,.game-room-live.pseudo-fullscreen #toggleGameFullscreen::after{content:' · Esc'}
.game-room-live.focus-camera #toggleCameraFocus{background:#d4a14e;color:#1b1107;border-color:#f4cf83}
@media(max-width:600px){.game-room-live:fullscreen .game-live-bar,.game-room-live.pseudo-fullscreen .game-live-bar{padding-right:12px;padding-top:65px;max-height:42dvh}}

/* Two illustrated seats in the mine beside the join form. */
.game-room-setup-area{display:grid;grid-template-columns:minmax(0,820px) minmax(280px,1fr);gap:18px;align-items:start}
.game-room-setup-area:has(.game-room-setup[hidden]){display:none}
.game-room-setup-area .game-room-setup{width:100%;max-width:none}
.table-board{position:relative;padding:18px;border:1px solid #a57840;border-radius:12px;background:linear-gradient(#101a16e8,#101a16e8),url('/mine-game-arena.webp') center/cover;color:#f3e6c8;box-shadow:0 12px 35px #0009}
.table-board-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:16px}
.table-board-heading small{color:#efbb66;font-size:.75rem;letter-spacing:.14em;font-weight:850}
.table-board-heading h2{font:700 clamp(1.2rem,2vw,1.65rem)/1.15 Georgia,serif;margin:5px 0}
.table-board-heading [role=status]{font-size:.75rem;color:#d6c7aa;text-align:right}
.table-board-list{display:grid;gap:15px}
.mine-table-card{border:1px solid #755d37;background:#10120fe8;border-radius:10px;padding:12px 15px 14px;box-shadow:inset 0 0 0 1px #e9c77b19}
.mine-table-title{display:flex;justify-content:space-between;gap:9px;align-items:center;font-weight:800;font-size:.95rem}
.mine-table-title strong{font-family:Georgia,serif;font-size:1.1rem;color:#f5d690}
.mine-table-state{font-size:.75rem;color:#98c7a7}.mine-table-card.is-playing .mine-table-state{color:#f1bd70}.mine-table-card.is-live .mine-table-state{color:#ff857c}
.mine-table-scene{position:relative;min-height:154px;display:grid;grid-template-rows:1fr 70px 1fr;justify-items:center;align-items:center;margin:9px 0 2px;background:radial-gradient(ellipse at center,#40605428 0%,transparent 72%)}
.mine-table-felt{grid-row:2;width:min(86%,270px);height:68px;border:8px ridge #75512b;border-radius:48%;background:radial-gradient(ellipse,#2c5648,#152c24);box-shadow:0 8px 0 #241509,0 15px 18px #000a,inset 0 0 0 2px #d0a76055;display:grid;place-items:center;font:bold .78rem Georgia,serif;letter-spacing:.12em;color:#f9deaa;text-shadow:0 2px 2px #000}
.mine-table-seat{max-width:95%;min-width:140px;padding:4px 12px;border:2px solid #8a6539;border-radius:9px;background:#352414;box-shadow:0 5px 0 #1b120b;text-align:center;font-size:.82rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mine-table-seat.occupied{border-color:#dfaa59;color:#fff4d5;background:#4b3020}
.mine-table-seat.top{grid-row:1}.mine-table-seat.bottom{grid-row:3}
.table-board-private{margin:17px 0 8px;padding-top:12px;border-top:1px solid #8b704a;color:#f0d9a7;font-weight:750;font-size:.88rem}
.table-board>small{color:#d7c7a5;font-size:.77rem;line-height:1.4;display:block}
@media(max-width:1100px){.game-room-setup-area{grid-template-columns:minmax(0,1fr)}.table-board{max-width:820px}.table-board-list{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:650px){.table-board-list{grid-template-columns:1fr}.game-room-setup-area{gap:14px}}

.studio-live-choice{display:inline-grid;gap:2px;color:#e7c889;font-size:.75rem;font-weight:800}.studio-live-choice[hidden]{display:none}.studio-live-choice select{min-height:34px;padding:4px 8px;border:1px solid #846638;border-radius:6px;color:#fff0d1;background:#121a16}
