/* Airuco game demos — shared modern shell */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  min-height: 560px;
  width: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}

body.game-app {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: radial-gradient(ellipse 120% 80% at 50% 0%, #1a0808 0%, #0a0a0a 55%);
  color: #fff;
}

.game-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 1.25rem;
  background: rgba(10, 10, 10, .85);
  border-bottom: 1px solid rgba(232, 20, 22, .25);
  backdrop-filter: blur(10px);
}

.game-header h1 {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  font-weight: 900;
  color: #fff;
  letter-spacing: -.02em;
}

.game-header .badge {
  font-size: .65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: #E81416;
  background: rgba(232, 20, 22, .12);
  border: 1px solid rgba(232, 20, 22, .35);
  padding: .3rem .65rem;
  border-radius: 999px;
}

.game-hint {
  font-size: .78rem;
  color: #a1a1aa;
  font-weight: 600;
}

.game-hint kbd {
  display: inline-block;
  background: #222;
  border: 1px solid #444;
  border-radius: 6px;
  padding: .15rem .45rem;
  font-size: .7rem;
  margin: 0 .1rem;
}

.game-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.25rem 1.25rem;
  min-height: 0;
  position: relative;
}

.game-canvas-wrap {
  position: relative;
  width: min(100%, 720px);
  height: min(100%, calc(100vh - 140px));
  max-height: 560px;
  aspect-ratio: var(--game-ar, 1);
  border-radius: 1.25rem;
  overflow: hidden;
  border: 2px solid #E81416;
  box-shadow: 0 0 0 1px rgba(232, 20, 22, .2), 0 24px 64px rgba(0, 0, 0, .55), 0 0 80px rgba(232, 20, 22, .08);
  background: #111;
}

.game-canvas-wrap canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.game-footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem 2.5rem;
  padding: .85rem 1.25rem 1.1rem;
  background: rgba(10, 10, 10, .9);
  border-top: 1px solid rgba(232, 20, 22, .2);
}

.stat-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .15rem;
}

.stat-pill .label {
  font-size: .65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: #71717a;
}

.stat-pill .value {
  font-size: clamp(1.25rem, 4vw, 1.75rem);
  font-weight: 900;
  color: #E81416;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* Memory / DOM games */
.game-board {
  width: min(100%, 520px);
  margin: 0 auto;
}

/* Touch D-pad for mobile */
.touch-pad {
  display: none;
  grid-template-columns: repeat(3, 56px);
  grid-template-rows: repeat(3, 56px);
  gap: 6px;
  margin-top: 1rem;
  justify-content: center;
}
.touch-pad button {
  border: none;
  border-radius: 12px;
  background: rgba(232, 20, 22, .15);
  border: 1px solid rgba(232, 20, 22, .4);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 900;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.touch-pad button:active { background: #E81416; transform: scale(.95); }
.touch-pad .empty { visibility: hidden; pointer-events: none; }

@media (max-width: 768px), (pointer: coarse) {
  .touch-pad.show-snake { display: grid; }
  .game-canvas-wrap { max-height: min(52vh, 420px); width: 100%; }
}

@media (min-width: 900px) {
  .game-canvas-wrap { max-height: 520px; }
}
