/* Table Tennis Tap — styles for the page and menus. */

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #06111f;
  color: #fff;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

#game {
  position: fixed;
  inset: 0;
  display: block;
}

/* Full-screen overlay menus */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.2vmin;
  padding: 4vmin;
  text-align: center;
  background: rgba(4, 12, 24, 0.82);
  backdrop-filter: blur(4px);
  overflow-y: auto;          /* scroll if there are lots of rows on a short screen */
  z-index: 10;
}
.screen.overlay { background: rgba(4, 12, 24, 0.95); z-index: 20; }
.hidden { display: none !important; }

h1 {
  font-size: clamp(28px, 7vmin, 72px);
  margin: 0 0 1vmin;
  color: #4dd0ff;
  text-shadow: 0 0 18px rgba(77, 208, 255, 0.6);
}
h2 { font-size: clamp(24px, 5vmin, 52px); margin: 0 0 1vmin; }
.sub { opacity: 0.85; font-size: clamp(14px, 2.6vmin, 24px); margin: 0; }
.byline {
  margin: -0.5vmin 0 0.5vmin;
  font-size: clamp(13px, 2.4vmin, 22px);
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #ffd400;
  text-shadow: 0 0 10px rgba(255, 212, 0, 0.4);
}

/* Big tappable buttons */
button { font-family: inherit; cursor: pointer; border: none; }

.big {
  min-width: 46vmin;
  padding: 2.4vmin 4vmin;
  font-size: clamp(18px, 3.6vmin, 34px);
  font-weight: 700;
  color: #06111f;
  background: linear-gradient(#7fe0ff, #29b6f6);
  border-radius: 999px;
  box-shadow: 0 6px 0 #0277bd, 0 10px 22px rgba(0,0,0,0.4);
  transition: transform 0.05s ease;
}
.big:active { transform: translateY(3px); box-shadow: 0 3px 0 #0277bd, 0 6px 12px rgba(0,0,0,0.4); }
.big.secondary { background: linear-gradient(#c7d3e0, #93a4b8); box-shadow: 0 6px 0 #556, 0 10px 22px rgba(0,0,0,0.4); }

/* Settings rows */
.row {
  display: flex;
  align-items: center;
  gap: 2vmin;
  flex-wrap: wrap;
  justify-content: center;
  font-size: clamp(14px, 2.6vmin, 24px);
}
.row label { min-width: 30vmin; text-align: right; opacity: 0.9; }
.choices { display: flex; gap: 1.4vmin; flex-wrap: wrap; }

.choice {
  min-width: 9vmin;
  padding: 1.4vmin 2.2vmin;
  font-size: clamp(16px, 3vmin, 28px);
  font-weight: 700;
  color: #fff;
  background: rgba(255,255,255,0.12);
  border: 2px solid transparent;
  border-radius: 14px;
}
.choice.selected { background: #29b6f6; color: #06111f; border-color: #fff; }

.swatch {
  width: 8vmin; height: 8vmin;
  max-width: 52px; max-height: 52px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.25);
}
.swatch.selected { border-color: #fff; box-shadow: 0 0 0 3px #29b6f6; }

.toggles { gap: 2vmin; margin-top: 1vmin; }
.toggle {
  padding: 1.6vmin 3vmin;
  font-size: clamp(15px, 2.8vmin, 26px);
  font-weight: 700;
  color: #fff;
  background: rgba(255,80,80,0.25);
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.2);
}
.toggle.on { background: rgba(77,217,100,0.3); }

/* Top bar during play */
#topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.6vmin 2.4vmin;
  z-index: 5;
  pointer-events: none;
}
#topbar .score {
  font-size: clamp(18px, 3.4vmin, 32px);
  font-weight: 800;
  background: rgba(4,12,24,0.5);
  padding: 0.8vmin 2vmin;
  border-radius: 999px;
}
#topbar .tag { font-size: 0.6em; opacity: 0.7; }
#topbar .dash { opacity: 0.6; margin: 0 0.4em; }
#topbar .controls { display: flex; gap: 1.4vmin; pointer-events: none; }
.icon-btn {
  pointer-events: auto;
  width: 8vmin; height: 8vmin;
  max-width: 54px; max-height: 54px;
  font-size: clamp(20px, 4vmin, 30px);
  color: #fff;
  background: rgba(4,12,24,0.5);
  border-radius: 50%;
}

.rotate-icon { font-size: clamp(48px, 14vmin, 120px); animation: wob 1.4s ease-in-out infinite; }
@keyframes wob { 0%,100% { transform: rotate(-12deg);} 50% { transform: rotate(12deg);} }
