.games-screen .function-hero { margin-bottom: 20px; }
.game-entry {
  display: grid;
  grid-template-columns: minmax(110px, 36%) 1fr;
  gap: 18px;
  align-items: center;
  max-width: 640px;
  color: var(--color-text-primary);
  text-decoration: none;
}
.game-entry-art {
  position: relative;
  min-height: 110px;
  border-radius: var(--r-md);
  overflow: hidden;
  background:
    radial-gradient(circle at 64% 32%, #eefff7 0 3px, #78f2cb 4px, transparent 9px),
    repeating-linear-gradient(135deg, transparent 0 9px, #80d6c620 10px 11px),
    linear-gradient(145deg, #112a38, #091722);
}
.game-entry-art::after {
  content: '';
  position: absolute;
  inset: 17px 0;
  margin: auto;
  width: 76px;
  height: 76px;
  border: 4px solid #78f2cb;
  border-right-color: transparent;
  border-radius: 50%;
  transform: rotate(-20deg);
}
.game-entry-info { display: grid; gap: 5px; min-width: 0; }
.game-entry-info strong { font-size: 1.125rem; }
.game-entry-info > span { color: var(--color-text-secondary); font-size: var(--fs-sm); }
.game-entry-info .game-entry-play { display: flex; align-items: center; gap: 6px; margin-top: 5px; color: var(--accent2); font-weight: 750; }
.game-entry:hover .game-entry-play { text-decoration: underline; }

.game-shell { max-width: 620px; margin-inline: auto; }
.game-difficulty { min-width: 0; border: 0; padding: 0; margin: 0 0 14px; }
.game-difficulty legend { margin-bottom: 6px; color: var(--color-text-secondary); font-size: var(--fs-sm); font-weight: 700; }
.game-difficulty > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.game-difficulty label { position: relative; }
.game-difficulty input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.game-difficulty span { display: grid; place-items: center; min-height: 44px; padding: 4px; border: 1px solid var(--border); border-radius: var(--r-md); font-weight: 700; }
.game-difficulty input:checked + span { background: var(--accent); color: var(--color-on-primary); }
.game-difficulty input:focus-visible + span { outline: 2px solid var(--accent2); outline-offset: 2px; }
.game-difficulty input:disabled { cursor: default; }
.game-stats { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; margin-bottom: 10px; color: var(--color-text-secondary); font-size: var(--fs-sm); }
.game-stats strong { display: inline-block; margin-inline-start: 4px; color: var(--color-text-primary); font-variant-numeric: tabular-nums; }
.game-stats .game-time-low { color: var(--color-danger-text); }
.game-arena {
  position: relative;
  display: grid;
  place-items: center;
  border-radius: var(--r-lg);
  background: radial-gradient(ellipse at center, #1a3243 0%, #101e2d 49%, #08121d 100%);
  overflow: hidden;
}
.game-arena canvas { display: block; width: 100%; height: auto; max-width: 480px; }
.game-aim { position: absolute; inset: 0; border: 0; background: transparent; color: inherit; cursor: crosshair; touch-action: manipulation; }
.game-aim:focus-visible { outline: 2px solid #78f2cb; outline-offset: -4px; }
.game-status { font-weight: 750; text-align: center; margin: 12px 0 4px; }
.game-instructions { color: var(--color-text-secondary); text-align: center; font-size: var(--fs-sm); margin: 0; }
.game-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.game-controls .btn { min-height: 44px; min-width: 44px; }

.game-list { display: grid; gap: 12px; }
.game-entry-art--tower {
  background:
    radial-gradient(circle at 52% 18%, #d9fff2 0 5px, #69d4b5 6px, transparent 10px),
    repeating-linear-gradient(135deg, transparent 0 9px, #94baff16 10px 11px),
    linear-gradient(145deg, #1a2950, #101b31);
}
.game-entry-art--tower::after {
  inset: 30px 0 auto;
  width: 84px;
  height: 16px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(95deg, #ffcb67 58%, #f77d8b 58%);
  box-shadow: 0 17px #5278a7, 0 34px #ffcb67, 0 51px #5278a7;
  transform: none;
}
.game-entry-art--defense {
  background:
    linear-gradient(90deg, transparent 27%, #7cadba 27% 35%, transparent 35%) 0 100% / 100% 38% no-repeat,
    repeating-linear-gradient(90deg, #567b62 0 12px, #71977a 12px 24px) 0 100% / 100% 38% no-repeat,
    linear-gradient(145deg, #23394c, #162b39);
}
.game-entry-art--defense::after {
  inset: auto 0 31%;
  width: min(88px, 80%);
  height: 49px;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(#cc806a 0 23%, transparent 23%),
    repeating-linear-gradient(90deg, #e0c7a1 0 9px, #56636a 9px 16px);
  clip-path: polygon(0 24%, 50% 0, 100% 24%, 100% 100%, 0 100%);
  transform: none;
}
.game-entry-art--unepoly {
  background: #bdcdd4 url("../images/game-unepoly.webp") center / cover no-repeat;
}
.game-entry-art--unepoly::after { content: none; }
.tower-arena {
  background:
    repeating-linear-gradient(135deg, transparent 0 19px, #91c9ff0a 20px 21px),
    radial-gradient(ellipse at center, #253758 0%, #0c162a 100%);
  cursor: grab;
  touch-action: none;
}
.tower-arena:active { cursor: grabbing; }
.tower-arena:focus-visible { outline: 2px solid #78f2cb; outline-offset: -4px; }
.tower-arena canvas { max-width: 400px; }
.tower-controls { margin: 8px 0 12px; }
.tower-smash { display: inline-flex; align-items: center; gap: 6px; touch-action: none; user-select: none; }
.tower-smash.tower-charging { background: var(--color-primary); color: var(--color-on-primary); }
.tower-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: center; margin-bottom: 8px; font-size: var(--fs-sm); }
.tower-legend span::before { content: ''; display: inline-block; width: .65em; height: .65em; border-radius: 50%; margin-inline-end: 6px; background: #ffd371; }
.tower-legend span:last-child::before { background: #be8bff; border-radius: 2px; transform: rotate(45deg); }
.tower-legend + .game-instructions { margin-bottom: 4px; }
