.screen {
  width: min(1180px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 28px 24px;
  display: grid;
  grid-template-columns: 230px minmax(360px, 520px) 190px;
  grid-template-rows: 1fr auto;
  gap: 18px 20px;
  align-items: center;
  justify-content: center;
}

.screen-v2 {
  width: var(--stage-w);
  height: var(--stage-h);
  min-height: 0;
  margin: 0;
  padding:
    calc(var(--safe-top) + var(--stage-pad-top))
    var(--stage-pad-x)
    calc(var(--safe-bottom) + var(--stage-pad-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: var(--hud-gap);
  overflow: hidden;
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(var(--stage-scale));
  transform-origin: center center;
}

.score-and-board {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(var(--board-size), calc(var(--stage-w) - 10px));
  max-width: calc(var(--stage-w) - 10px);
}

.top-bar {
  width: var(--topbar-w);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 8px;
  position: relative;
  min-height: 80px;
  z-index: 60;
}

.top-actions {
  position: absolute;
  left: 0;
  top: calc(100% - 26px);
  z-index: 32;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  border-radius: 18px;
  background: rgba(255, 243, 221, 0.94);
  box-shadow: 0 10px 22px rgba(80, 50, 26, 0.24);
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
  transform-origin: top left;
  pointer-events: none;
  touch-action: none;
  transition: opacity 150ms ease, transform 160ms ease;
}

.top-actions.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.left-column,
.right-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: stretch;
}

.game-card {
  width: min(100%, calc(var(--stage-w) - 10px));
  max-width: calc(var(--stage-w) - 10px);
  aspect-ratio: 1 / 1;
  padding: 14px;
  border-radius: 20px;
  border: 3px solid rgba(111, 71, 38, 0.42);
  background: rgba(255, 244, 218, 0.78);
  box-shadow: 0 10px 0 rgba(93, 57, 27, 0.12), 0 20px 45px rgba(84, 58, 33, 0.18);
  position: relative;
  margin: 0 auto;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

#game {
  width: 100%;
  height: 100%;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

#game canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}

.evolution {
  position: relative;
  z-index: 25;
  width: min(calc(var(--stage-w) - 20px), max-content);
  min-height: var(--evolution-h);
  overflow-x: auto;
  overflow-y: hidden;
  touch-action: pan-x;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 10px 18px 12px;
  margin-top: auto;
  border-radius: 24px;
  background: rgba(47, 72, 31, 0.7);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.16), 0 12px 28px rgba(47, 54, 28, 0.2);
  display: grid;
  grid-template-columns: repeat(11, 56px);
  justify-content: start;
  gap: 7px;
}

.evolution::-webkit-scrollbar {
  display: none;
}
