.game-screen {
  min-height: calc(100svh - 44px);
}

.game-header {
  min-height: 48px;
  padding-left: 60px !important;
}

.brand--compact .brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.icon-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 76%, transparent);
}

.icon-button:hover {
  border-color: color-mix(in srgb, var(--blue) 42%, transparent);
  color: var(--blue);
}

.status-line {
  min-height: 36px;
  margin: 6px 0 9px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 66%, transparent);
  font-size: 0.73rem;
  text-align: center;
}

.status-line[data-tone="field"] {
  border-color: color-mix(in srgb, var(--blue) 34%, transparent);
  color: var(--blue);
  background: var(--color-secondary-soft);
}

.status-line[data-tone="pulse"] {
  border-color: color-mix(in srgb, var(--lime-dark) 40%, transparent);
  color: var(--ink);
  background: var(--color-primary-soft);
}

.status-line[data-tone="attention"] {
  border-color: color-mix(in srgb, var(--coral) 40%, transparent);
  color: var(--ink);
  background: var(--color-attention-soft);
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 300px);
  grid-template-areas:
    "board field"
    "board controls";
  align-items: start;
  gap: 12px 22px;
}

.board-panel {
  grid-area: board;
  min-width: 0;
  display: grid;
  place-items: center;
}

.canvas-frame {
  position: relative;
  width: min(100%, calc((100svh - 145px) * 0.9444), 680px);
  aspect-ratio: 680 / 720;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  box-shadow: var(--shadow);
}

#playfield {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 23px;
  touch-action: none;
}

.launch-chip {
  position: absolute;
  left: 50%;
  bottom: 38px;
  min-width: 200px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 8px 20px rgba(31, 37, 34, 0.1);
  font-size: 0.62rem;
  font-weight: 850;
  text-align: center;
  transform: translateX(-50%);
  pointer-events: none;
}

.polarity-button {
  grid-area: field;
  min-width: 0;
  min-height: 76px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border: 1px solid color-mix(in srgb, var(--coral) 42%, transparent);
  border-radius: 20px;
  color: var(--ink);
  background: var(--color-attention-soft);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.polarity-button:hover {
  transform: translateY(-2px);
}

.polarity-button[data-polarity="left"] {
  border-color: color-mix(in srgb, var(--blue) 42%, transparent);
  background: var(--color-secondary-soft);
}

.polarity-button__arrow {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: var(--canvas);
  background: var(--coral);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.8rem;
  font-weight: 800;
}

[data-polarity="left"] .polarity-button__arrow {
  background: var(--blue);
}

.polarity-button small,
.polarity-button strong {
  display: block;
}

.polarity-button small {
  color: var(--muted);
  font-size: 0.55rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.polarity-button strong {
  margin-top: 2px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
}

.polarity-button__switch {
  position: relative;
  width: 40px;
  height: 23px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 13%, transparent);
}

.polarity-button__switch i {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--coral);
  transition: transform 180ms ease, background 180ms ease;
}

[data-polarity="left"] .polarity-button__switch i {
  background: var(--blue);
  transform: translateX(-17px);
}

.control-panel {
  grid-area: controls;
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  box-shadow: var(--shadow-soft);
}

.game-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
}

.stat-card {
  min-width: 0;
  min-height: 58px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.5);
}

.stat-card span,
.level-card span {
  color: var(--muted);
  font-size: 0.55rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stat-card strong {
  margin-top: 2px;
  overflow: hidden;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.24rem;
  font-weight: 700;
  text-overflow: ellipsis;
}

.stat-card .lives-value {
  color: var(--coral);
  font-family: inherit;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
}

.level-card {
  display: grid;
  grid-template-columns: 53px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  min-height: 61px;
  padding: 8px 10px;
  border-radius: 14px;
  background: var(--color-primary-soft);
}

.level-card .level-number {
  width: 53px;
  height: 43px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: var(--ink);
  background: var(--lime);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  letter-spacing: 0;
}

.level-card strong {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.96rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brick-legend {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.brick-legend > span {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 7px 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.38);
  font-size: 0.55rem;
  font-weight: 800;
  text-align: center;
}

.legend-brick {
  width: 31px;
  height: 14px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 4px;
  color: var(--ink);
  background: var(--lime);
  font-size: 0.58rem;
  font-style: normal;
  line-height: 1;
}

.legend-brick--armored {
  border-width: 2px;
  background: var(--blue);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.36);
}

.legend-brick--pulse {
  background: var(--coral);
  font-weight: 900;
}

.control-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.58rem;
  text-align: center;
}

kbd {
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink);
  background: white;
  box-shadow: 0 1px 0 var(--line);
  font: inherit;
  font-weight: 900;
}
