/* Shared page chrome for the hub, Fruit Crush and Fruit Rush. */

:root {
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Arial Black", sans-serif;
  --ink: #2a1204;
  --cream: #fff6dc;
  --gold-1: #fff3a0;
  --gold-2: #ff9a1a;
}

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #3a220d;
  color: var(--cream);
  font-family: var(--font);
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

canvas.stage {
  display: block;
  position: fixed;
  inset: 0;
  touch-action: none;
}

.title {
  margin: 0;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.02em;
  line-height: 1;
  background: linear-gradient(var(--gold-1), var(--gold-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 0.06em var(--ink);
  paint-order: stroke fill;
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.35));
}

.btn {
  appearance: none;
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 0.6em 1.6em;
  font: 900 clamp(18px, 4.5vmin, 26px) var(--font);
  color: var(--ink);
  background: linear-gradient(#fff3a0, #ffb21a);
  box-shadow: 0 5px 0 var(--ink);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.btn:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--ink);
}
.btn.secondary {
  background: linear-gradient(#ffffff, #cfe8ff);
}

.icon-btn {
  appearance: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font: 900 20px var(--font);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
}
.icon-btn svg {
  width: 22px;
  height: 22px;
}

.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.45);
  z-index: 10;
  padding: 16px;
}
.overlay[hidden] {
  display: none;
}
.panel {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 440px;
  width: 100%;
}
.panel .title {
  font-size: clamp(40px, 13vmin, 84px);
}
.panel p {
  margin: 0;
  font-weight: 700;
  font-size: clamp(15px, 3.6vmin, 19px);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5);
}
.panel .big {
  font-weight: 900;
  font-size: clamp(22px, 6vmin, 34px);
}
.panel .row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 6px;
}
.help {
  opacity: 0.9;
  line-height: 1.4;
}

/* Top bar used by the games. */
.hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(env(safe-area-inset-top) + 10px) 12px 0;
  z-index: 5;
  pointer-events: none;
}
.hud[hidden] { display: none; }
.hud > * { pointer-events: auto; }
.stat {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 12px;
  padding: 4px 12px;
  text-align: center;
  min-width: 52px;
}
.stat small {
  display: block;
  font-size: 11px;
  font-weight: 800;
  opacity: 0.75;
  letter-spacing: 0.08em;
}
.stat b { font-size: 22px; font-weight: 900; }
.stat.wide { flex: 1; }

/* Two-player score boxes (fruit picture + name + score); .turn marks whose move it is. */
.stat.player { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 4px 6px; min-width: 0; border: 3px solid transparent; transition: border-color 0.15s; }
.stat.player img { width: 24px; height: 24px; flex: none; }
.stat.player small { letter-spacing: 0; }
.stat.player.turn { border-color: #fff3a0; }

.stars { font-size: 44px; letter-spacing: 6px; }
.stars .off { opacity: 0.25; filter: grayscale(1); }
