#game-screen {
  background: transparent;
}

.game-container {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(1.1rem, 2vw, 1.7rem);
  min-height: 100%;
  padding-top: clamp(4.8rem, 10vh, 6rem);
}

.game-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.game-header-copy {
  display: grid;
  gap: 0.65rem;
  max-width: 34rem;
}

.game-header h2 {
  font-size: clamp(2.6rem, 6vw, 4.8rem);
  text-shadow: 0 18px 34px rgba(0, 0, 0, 0.34);
}

.game-subcopy {
  max-width: 30rem;
  line-height: 1.65;
}

.game-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  width: min(34rem, 100%);
  padding: 0.35rem 0 0.15rem;
}

.status-chip {
  display: grid;
  gap: 0.3rem;
  padding: 0.15rem 0 0.85rem;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.status-chip:last-child {
  border-right: none;
}

.status-label {
  font-size: var(--font-size-xs);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-subtle);
}

.status-chip strong {
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  color: var(--color-text);
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: clamp(1.2rem, 2vw, 1.8rem);
  align-items: start;
}

.game-sidebar {
  position: sticky;
  top: 1.2rem;
  display: grid;
  gap: 1rem;
  padding: 0.45rem 1.25rem 0.2rem 0;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.game-sidebar::before {
  content: "";
  position: absolute;
  top: 0.4rem;
  bottom: 0.4rem;
  right: 0;
  width: 1px;
  background: linear-gradient(180deg, rgba(205, 162, 104, 0.5), rgba(255, 255, 255, 0.04));
}

.sidebar-block {
  display: grid;
  gap: 0.65rem;
  padding-bottom: 1.05rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.sidebar-block h3 {
  font-size: clamp(1.4rem, 2vw, 1.9rem);
  line-height: 0.98;
}

.sidebar-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.sidebar-metric {
  display: grid;
  gap: 0.2rem;
  padding: 0;
}

.sidebar-label {
  font-size: var(--font-size-xs);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-subtle);
}

.sidebar-metric strong {
  font-size: 1.5rem;
  color: var(--color-text);
}

.sidebar-note {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  line-height: 1.68;
}

.players-grid {
  display: grid;
  gap: 0;
  align-content: start;
  padding-top: 0.15rem;
}

.player-portrait {
  position: relative;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: clamp(0.75rem, 1.5vw, 1.15rem);
  align-items: center;
  padding: 1.05rem 1rem 1.05rem 1rem;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: linear-gradient(90deg, rgba(205, 162, 104, 0.02), transparent 55%);
  transition:
    transform var(--transition-base),
    background var(--transition-fast),
    border-color var(--transition-fast);
  animation: riseIn 460ms cubic-bezier(0.22, 1, 0.36, 1);
  animation-delay: calc(var(--item-index, 0) * 55ms);
  animation-fill-mode: both;
  cursor: pointer;
  min-width: 0;
}

.player-portrait::before {
  content: "";
  position: absolute;
  top: 18%;
  bottom: 18%;
  left: 0;
  width: 2px;
  border-radius: 999px;
  background: transparent;
  transition: background var(--transition-fast), opacity var(--transition-fast);
  opacity: 0.8;
}

.player-portrait:last-child {
  border-bottom: none;
}

.player-portrait:hover {
  transform: translateY(-1px);
  background: linear-gradient(90deg, rgba(205, 162, 104, 0.05), transparent 58%);
}

.player-portrait.rank-1 {
  background: rgba(214, 164, 91, 0.025);
}

.player-portrait.rank-2 {
  background: rgba(182, 196, 214, 0.02);
}

.player-portrait.rank-3 {
  background: rgba(192, 125, 88, 0.02);
}

.player-portrait.rank-1::before {
  background: rgba(214, 164, 91, 0.78);
}

.player-portrait.rank-2::before {
  background: rgba(182, 196, 214, 0.72);
}

.player-portrait.rank-3::before {
  background: rgba(192, 125, 88, 0.72);
}

.player-rank-badge {
  display: grid;
  gap: 0.1rem;
  min-width: 3.35rem;
}

.player-rank-number {
  font-size: 1.3rem;
  font-family: var(--font-display);
  color: var(--color-text);
  line-height: 0.95;
}

.player-rank-caption {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-text-subtle);
}

.player-avatar-container {
  position: relative;
}

.player-avatar-container::before {
  content: "";
  position: absolute;
  inset: 0.2rem;
  border-radius: 20px;
  background: radial-gradient(circle, rgba(205, 162, 104, 0.18), transparent 70%);
  filter: blur(10px);
  opacity: 0.45;
  pointer-events: none;
}

.player-portrait .player-avatar {
  width: 4.4rem;
  height: 4.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 22px;
  border: 1px solid rgba(205, 162, 104, 0.16);
  background:
    radial-gradient(circle at top, rgba(205, 162, 104, 0.18), transparent 68%),
    rgba(255, 255, 255, 0.02);
  font-size: 2.15rem;
  overflow: hidden;
  transition:
    transform var(--transition-fast),
    border-color var(--transition-fast);
}

.player-portrait .player-avatar:hover {
  transform: scale(1.03);
  border-color: rgba(214, 164, 91, 0.34);
}

.exclamation-indicator {
  position: absolute;
  top: -0.25rem;
  right: -0.15rem;
  width: 1.45rem;
  height: 1.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--color-danger);
  color: #150607;
  font-size: 0.9rem;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(240, 103, 103, 0.28);
}

.player-body {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.player-topline,
.player-bottomline {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 0.35rem 0.8rem;
  min-width: 0;
}

.player-copy {
  min-width: 0;
}

.player-portrait .player-name {
  font-size: clamp(1.05rem, 1.6vw, 1.22rem);
  font-weight: 800;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-meta,
.player-history,
.player-action-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-subtle);
}

.player-meta {
  letter-spacing: 0.03em;
}

.player-history {
  color: var(--color-text-muted);
  line-height: 1.5;
}

.player-action-label {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 800;
  color: rgba(214, 164, 91, 0.72);
}

.player-state-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.7rem;
  padding: 0.1rem 0.6rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.03);
}

.player-state-pill.is-ready {
  color: var(--color-text-muted);
  border-color: rgba(255, 255, 255, 0.08);
}

.player-state-pill.is-pending {
  color: #ff9f99;
  border-color: rgba(240, 103, 103, 0.24);
  background: rgba(240, 103, 103, 0.08);
}

.player-state-pill.is-complete {
  color: #8de0bb;
  border-color: rgba(107, 201, 161, 0.24);
  background: rgba(107, 201, 161, 0.08);
}

.player-score-block {
  display: grid;
  justify-items: end;
  align-content: center;
  gap: 0.25rem;
  min-width: clamp(4.8rem, 8vw, 6rem);
  padding-left: clamp(0.85rem, 1.5vw, 1.1rem);
  border-left: 1px solid rgba(255, 255, 255, 0.07);
}

.player-score-label {
  font-size: var(--font-size-xs);
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-text-subtle);
}

.player-score {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3vw, 2.4rem);
  line-height: 0.95;
  color: var(--color-text);
}

.player-portrait.rank-1 .player-score {
  color: var(--color-rank-gold);
}

.player-portrait.rank-2 .player-score {
  color: var(--color-rank-silver);
}

.player-portrait.rank-3 .player-score {
  color: var(--color-rank-bronze);
}

.game-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0 calc(1rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.game-footer-copy {
  display: grid;
  gap: 0.45rem;
}

.footer-note {
  max-width: 28rem;
  font-size: var(--font-size-sm);
}

.footer-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.share-feedback {
  min-height: 1.2rem;
  font-size: var(--font-size-xs);
  letter-spacing: 0.04em;
  color: var(--color-accent);
}

.share-feedback.is-error {
  color: #ff9b9b;
}

.game-footer .btn {
  min-width: 12rem;
}

@media (max-width: 980px) {
  .game-layout {
    grid-template-columns: 1fr;
  }

  .game-sidebar {
    position: relative;
    top: auto;
    padding-right: 0;
    border-right: none;
  }

  .game-sidebar::before {
    display: none;
  }
}

@media (max-width: 820px) {
  .game-header {
    flex-direction: column;
    align-items: start;
  }

  .game-status {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .player-portrait {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.8rem;
    padding: 0.95rem 0.75rem 0.95rem 0.75rem;
  }

  .player-rank-badge {
    display: none;
  }

  .player-topline,
  .player-bottomline {
    gap: 0.3rem 0.65rem;
  }

  .player-score-block {
    min-width: 4.2rem;
    padding-left: 0.65rem;
  }

  .game-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .footer-actions {
    width: 100%;
    justify-content: stretch;
  }

  .game-footer .btn {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .game-status {
    grid-template-columns: 1fr;
  }

  .status-chip {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .status-chip:last-child {
    border-bottom: none;
  }

  .sidebar-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .player-portrait .player-avatar {
    width: 3.8rem;
    height: 3.8rem;
    border-radius: 20px;
    font-size: 1.95rem;
  }

  .player-score {
    font-size: 1.85rem;
  }

  .player-history,
  .player-action-label {
    white-space: normal;
  }
}
