* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f6f7fb;
  margin: 0;
  padding: 16px;
  color: #1f2330;
}
.wrap {
  max-width: 460px;
  margin: 0 auto;
  text-align: center;
  position: relative;
}
.status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
  font-size: 16px;
}
#newbtn {
  background: #4f46e5; color: white; border: 0; padding: 8px 14px;
  border-radius: 6px; cursor: pointer;
}
#newbtn:hover { background: #4338ca; }
#board {
  background: #1f2330;
  border-radius: 6px;
  width: 100%;
  max-width: 400px;
  height: auto;
  aspect-ratio: 1 / 1;
  display: block;
  margin: 0 auto;
  touch-action: none;
}
#board:focus { outline: 2px solid #4f46e5; }
.hint { color: #6b7280; font-size: 13px; margin-top: 8px; }
.overlay {
  position: absolute;
  left: 50%;
  top: calc(50% + 8px);
  transform: translate(-50%, -50%);
  background: rgba(31, 35, 48, 0.92);
  color: white;
  padding: 14px 22px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  pointer-events: none;
  max-width: 80%;
  text-align: center;
}
.overlay.hidden { display: none; }
.overlay.clickable { pointer-events: auto; cursor: pointer; }

/* On-screen rotation controls — always visible (Hextris is small enough
   that the buttons read as part of the UI on desktop too, and they are
   the most-reliable input on mobile/iframe contexts). */
.game-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 12px 0 4px;
}
.game-controls button {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  border: 0;
  background: rgba(31, 35, 48, 0.92);
  color: #f6f7fb;
  font-size: 28px;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.game-controls button:active { transform: scale(0.96); background: #4f46e5; }
