@font-face {
  font-family: 'C64';
  src: url('../../fonts/C64_Pro-STYLE.woff2') format('woff2');
  font-display: swap;
}

:root {
  --c64-border: #88CCFF;
  --paper-line: #cceeff;
  --good: #31d27b;
  --bad: #ff5b5b;
}

#squash {
  margin-top: 20px;
}
#squash h2 small {
  font-size: .6em;
  font-weight: 400;
  opacity: .8;
}

/* Layout */
.game-frame {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin-inline: auto;
  padding: 22px 12px 16px;
}

canvas {
  background: transparent;
  display: block;
  width: 100%;
  height: auto;
  max-width: 480px;
  margin: 0 auto;
  border: none;
  outline: none;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  -moz-user-select: none;
  -webkit-touch-callout: none;
}

/* Help button – mobiilissa ei canvasin päällä */
.help-btn {
  position: static;
  display: block;
  margin: 0 auto 12px auto;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  padding: 6px 10px;
  border: 2px solid var(--c64-border);
  background: #eef7ff;
  border-radius: 10px;
  cursor: pointer;
  opacity: .95;
  user-select: none;
  touch-action: manipulation;
  -webkit-user-select: none;
  -ms-user-select: none;
  -moz-user-select: none;
  -webkit-touch-callout: none;
}
.help-btn:hover {
  opacity: 1;
}

@media (max-width: 560px) {
  .game-frame {
    padding-top: 0;
  }
  .help-btn {
    margin-bottom: 20px;
  }
}

/* Touch controls – siirretty pelikentän alta pois */
.touch-controls {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px 0;
  margin-top: 20px;
  pointer-events: none;
  user-select: none;
  touch-action: manipulation;
  -webkit-user-select: none;
  -ms-user-select: none;
  -moz-user-select: none;
  -webkit-touch-callout: none;
}
.touch-controls button {
  pointer-events: auto;
  flex: 1 1 auto;
  font: inherit;
  font-size: 16px;
  padding: 10px 0;
  border-radius: 10px;
  border: 2px solid var(--c64-border);
  background: #eef7ff;
  box-shadow: 0 2px 0 #b7dcff;
  user-select: none;
  touch-action: manipulation;
  -webkit-user-select: none;
  -ms-user-select: none;
  -moz-user-select: none;
  -webkit-touch-callout: none;
}
.touch-controls button:active {
  transform: translateY(1px);
  background-color: #ddeeff;
  box-shadow: 0 1px 0 #aaccee;
}

/* Fullscreen overlay */
.overlay[hidden] {
  display: none;
}
.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(45, 34, 143, 0.6);
  z-index: 1000;
}
.overlay-inner {
  width: min(92vw, 520px);
  max-height: min(86vh, 640px);
  overflow: auto;
  border: 2px dashed var(--c64-border);
  background-image: linear-gradient(to bottom, transparent 95%, var(--paper-line) 95%);
  background-size: 100% 22px;
  padding: 16px 18px;
  color: #223;
  background-color: rgba(255,255,255,0.96);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  font: inherit;
}
.overlay-inner h3 {
  margin: 0 0 12px 0;
  font: inherit;
  font-weight: 700;
  font-size: 18px;
}
.overlay-inner ul {
  margin: 0 0 8px 18px;
  padding: 0;
  font: inherit;
  font-size: 14px;
  line-height: 1.55;
}
.legend {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  gap: 8px 12px;
  align-items: center;
  margin: 8px 0 10px;
}
.tag {
  display: inline-block;
  min-width: 1.2em;
  text-align: center;
  padding: 4px 10px;
  border-radius: 8px;
  color: #001133;
  background: #ddd;
  font: inherit;
  font-weight: 800;
}
.tag.good {
  background: var(--good);
}
.tag.bad {
  background: var(--bad);
}

.primary {
  margin-top: 12px;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 12px;
  border: 2px solid var(--c64-border);
  background: #eef7ff;
  border-radius: 10px;
  cursor: pointer;
}
.subtagline {
  margin: -6px 0 8px 0;
  font-size: 14px;
  opacity: .85;
}
#touchControls {
  display: none;
}
