/* صفحه تلویزیون: همه چیز روی صحنه ۱۹۲۰×۱۰۸۰ چیده می‌شود و به اندازه نمایشگر بزرگ/کوچک می‌شود */

body.screen {
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 40%, #2a2560 0%, #14122b 70%);
}

#stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1920px;
  height: 1080px;
  transform-origin: center center;
  overflow: hidden;
}

.topbar {
  position: absolute;
  inset: 0 0 auto 0;
  height: 96px;
  padding: 0 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 20;
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 40px;
}

.logo-mark {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #fff;
  font-weight: 900;
  font-size: 34px;
  box-shadow: 0 6px 20px rgba(255, 93, 143, 0.4);
}

.topbar-mid {
  font-size: 30px;
  font-weight: 700;
  color: var(--muted);
}

.topbar-mid b {
  color: var(--text);
}

.topbar-code {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 8px 10px 8px 20px;
}

.topbar-code img {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  background: #fff;
}

.tc-label {
  font-size: 18px;
  color: var(--muted);
}

.tc-url {
  font-size: 26px;
  font-weight: 800;
  direction: ltr;
  text-align: right;
}

/* ---------- لابی ---------- */

#lobby {
  position: absolute;
  inset: 96px 48px 40px 48px;
  display: flex;
  gap: 48px;
}

.join-panel {
  width: 560px;
  flex: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  border: 1px solid var(--line);
  border-radius: 36px;
  padding: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.join-title {
  font-size: 40px;
  font-weight: 800;
}

.qr-wrap {
  background: #fff;
  padding: 18px;
  border-radius: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.qr-wrap img {
  display: block;
  width: 360px;
  height: 360px;
}

.join-url {
  font-size: 34px;
  font-weight: 700;
  direction: ltr;
  color: var(--muted);
}

.join-url b {
  color: var(--text);
}

.join-or {
  font-size: 24px;
  color: var(--muted);
}

.code-big {
  direction: ltr;
  display: flex;
  gap: 14px;
}

.code-big span {
  width: 96px;
  height: 120px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  font-size: 84px;
  font-weight: 900;
  background: var(--panel2);
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.25);
}

.lobby-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.lobby-section-title {
  font-size: 34px;
  font-weight: 800;
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.lobby-section-title span {
  font-size: 26px;
  color: var(--muted);
  font-weight: 600;
}

.players-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  min-height: 170px;
  align-content: flex-start;
}

.players-empty {
  font-size: 30px;
  color: var(--muted);
  padding: 40px 0;
}

.lp {
  width: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.lp.new {
  animation: pop-in 0.5s cubic-bezier(0.3, 1.6, 0.5, 1);
}

.lp.offline {
  opacity: 0.4;
}

.lp-avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 64px;
  background: color-mix(in srgb, var(--c) 30%, #1d1a3d);
  border: 5px solid var(--c);
  position: relative;
}

.lp-name {
  font-size: 26px;
  font-weight: 700;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lp-tags {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
}

.lp-tags span {
  font-size: 22px;
  background: var(--bg);
  border-radius: 999px;
  padding: 0 6px;
  border: 2px solid var(--line);
}

@keyframes pop-in {
  from {
    transform: scale(0.3);
    opacity: 0;
  }
}

.game-shelf {
  display: flex;
  gap: 20px;
}

.game-tile {
  width: 250px;
  padding: 18px 22px;
  border-radius: 26px;
  background: var(--panel);
  border: 3px solid transparent;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.game-tile .gt-emoji {
  font-size: 56px;
}

.game-tile .gt-name {
  font-size: 30px;
  font-weight: 800;
}

.game-tile .gt-tag {
  font-size: 19px;
  color: var(--muted);
  line-height: 1.5;
}

.game-tile.selected {
  border-color: var(--accent2);
  background: linear-gradient(160deg, #3a2f7a, #2a2458);
  box-shadow: 0 10px 40px rgba(255, 179, 71, 0.25);
}

.game-tile.soon {
  opacity: 0.45;
}

.game-tile .gt-soon {
  align-self: flex-start;
  font-size: 18px;
  padding: 2px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.settings-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-summary span {
  font-size: 17px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
}

.lobby-hint {
  margin-top: auto;
  font-size: 28px;
  font-weight: 700;
  padding: 16px 28px;
  border-radius: 24px;
  background: rgba(255, 179, 71, 0.12);
  border: 1px solid rgba(255, 179, 71, 0.35);
}

/* ---------- بخش بازی ---------- */

#game-root {
  position: absolute;
  inset: 0;
}

.connecting {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 40px;
  color: var(--muted);
  background: var(--bg);
  z-index: 50;
}

.screen-tools {
  position: fixed;
  left: 12px;
  bottom: 12px;
  display: flex;
  gap: 8px;
  z-index: 100;
  opacity: 0.35;
  transition: opacity 0.2s;
}

.screen-tools:hover {
  opacity: 1;
}

.screen-tools button {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 20px;
}
