:root {
  --bg: #FFF8F3;
  --primary: #FF6B9D;
  --primary-dark: #E85585;
  --card: #FFFFFF;
  --text: #2D3142;
  --text-light: #6C7293;
  --shadow: 0 8px 24px rgba(45, 49, 66, 0.12);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Nunito', system-ui, -apple-system, sans-serif;
  overflow: hidden;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

#game-container {
  position: relative;
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  padding: 60px 12px 12px;
}

#ui-overlay {
  position: absolute;
  top: 12px; left: 12px; right: 12px;
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px;
  z-index: 5;
}
.ui-row { display: flex; gap: 6px; flex-wrap: wrap; }
.ui-pill {
  background: rgba(255,255,255,0.92);
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(45,49,66,0.08);
  font-size: 0.85rem;
}
.ui-label { font-weight: 600; color: var(--text-light); margin-right: 4px; font-size: 0.75rem; }
#pause-btn,
#mute-btn {
  background: rgba(255,255,255,0.92);
  border: 0;
  width: 40px; height: 40px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(45,49,66,0.08);
  flex-shrink: 0;
}

#play-area {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  justify-content: center;
}
#game-canvas {
  background: #FFFFFF;
  border-radius: 12px;
  box-shadow: var(--shadow);
  width: auto;
  max-height: calc(100vh - 220px);
  display: block;
}
#next-panel {
  background: var(--card);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 8px;
  text-align: center;
}
.next-label { font-size: 0.7rem; color: var(--text-light); font-weight: 700; margin-bottom: 4px; }

#touch-controls {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  width: 100%;
  max-width: 360px;
}
.tc-btn {
  background: var(--card);
  border: 0;
  padding: 14px 0;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  box-shadow: 0 2px 8px rgba(45,49,66,0.08);
  cursor: pointer;
}
.tc-btn:active { background: var(--primary); color: #fff; }
.tc-btn--wide { background: var(--primary); color: #fff; }
.tc-btn--wide:active { background: var(--primary-dark); }

/* Hide touch controls on hover-capable / wide screens */
@media (hover: hover) and (min-width: 720px) {
  #touch-controls { display: none; }
}

.modal {
  position: absolute; inset: 0;
  background: rgba(45,49,66,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 10; padding: 20px;
}
.modal.hidden { display: none; }
.modal__inner {
  background: var(--card);
  border-radius: 24px;
  padding: 28px 24px;
  text-align: center;
  max-width: 320px; width: 100%;
  box-shadow: var(--shadow);
}
.modal__inner h2 { margin: 0 0 8px; font-size: 1.6rem; }
.modal__inner p { margin: 0 0 16px; color: var(--text-light); }
.big-score { font-size: 1.4rem !important; color: var(--text) !important; font-weight: 800; margin: 4px 0 !important; }
.sub-score { font-size: 0.95rem; }

.btn {
  background: var(--primary); color: #fff;
  border: 0;
  padding: 12px 28px;
  border-radius: 999px;
  font-size: 1rem; font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(255,107,157,0.4);
}
.btn:hover { background: var(--primary-dark); }

.ad-slot { margin-top: 16px; min-height: 100px; }
