/* Tiltwell game page: dark teal brass styling */
:root {
  --brass: #d8a94e;
  --brass-dim: #9a7a38;
  --teal: #53d6c2;
  --ink: #0c2028;
  --card: rgba(10, 26, 32, 0.88);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; background: var(--ink); }
body {
  font-family: ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  color: #e8f4f0;
  -webkit-user-select: none; user-select: none;
  touch-action: none;
}
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#hud { position: fixed; inset: 0; pointer-events: none; }
#hud button { pointer-events: auto; }

#stats {
  position: absolute; top: 10px; left: 12px; right: 12px;
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center;
}
.stat {
  background: var(--card); border: 1px solid rgba(216, 169, 78, 0.35);
  border-radius: 10px; padding: 5px 12px; display: flex; flex-direction: column;
  align-items: center; min-width: 64px;
}
.stat .label { font-size: 9px; letter-spacing: 2px; color: var(--teal); }
.stat b { font-size: 16px; color: var(--brass); font-variant-numeric: tabular-nums; }
#time.warn { color: #ff7b5e; }
#time.pulse { animation: pulse 0.6s infinite alternate; }
@keyframes pulse { to { transform: scale(1.12); } }

#tiltMeter {
  position: absolute; right: 16px; bottom: 16px; width: 84px; height: 84px;
  border-radius: 50%; background: var(--card);
  border: 2px solid rgba(216, 169, 78, 0.4);
}
#tiltMeter::before {
  content: ""; position: absolute; inset: 12px; border-radius: 50%;
  border: 1px dashed rgba(83, 214, 194, 0.35);
}
#tiltMeter.hot { border-color: #ff9a6a; }
#tiltDot {
  position: absolute; left: 50%; top: 50%; width: 14px; height: 14px;
  margin: -7px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe9b8, #d8a94e 60%, #7a5a20);
  box-shadow: 0 0 10px rgba(216, 169, 78, 0.8);
}

#pauseBtn {
  position: absolute; top: 10px; right: 12px; width: 40px; height: 40px;
  border-radius: 10px; border: 1px solid rgba(216, 169, 78, 0.4);
  background: var(--card); color: var(--brass); font-size: 15px; cursor: pointer;
}

#pad { position: absolute; left: 16px; bottom: 16px; width: 148px; height: 148px; display: none; }
@media (pointer: coarse) { #pad { display: block; } }
.pad-btn {
  position: absolute; width: 48px; height: 48px; border-radius: 12px;
  background: var(--card); color: var(--teal); font-size: 18px;
  border: 1px solid rgba(83, 214, 194, 0.45);
}
.pad-btn.on { background: rgba(83, 214, 194, 0.3); }
.pad-btn.up { left: 50px; top: 0; }
.pad-btn.down { left: 50px; bottom: 0; }
.pad-btn.left { left: 0; top: 50px; }
.pad-btn.right { right: 0; top: 50px; }

#overlay {
  position: absolute; inset: 0; display: none;
  align-items: center; justify-content: center;
  background: rgba(4, 12, 16, 0.55); backdrop-filter: blur(3px);
  pointer-events: auto;
}
#overlay.show { display: flex; }
#overlay-card {
  background: var(--card); border: 1px solid rgba(216, 169, 78, 0.5);
  border-radius: 16px; padding: 28px 32px; max-width: min(480px, 90vw);
  text-align: center; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}
#ov-title {
  font-size: 30px; letter-spacing: 6px; color: var(--brass);
  text-shadow: 0 0 18px rgba(216, 169, 78, 0.5); margin-bottom: 10px;
}
#ov-text { font-size: 14px; line-height: 1.6; color: #cfe6e0; margin-bottom: 18px; }
#ov-btn {
  font-size: 16px; font-weight: 700; letter-spacing: 1px;
  padding: 12px 34px; border-radius: 12px; cursor: pointer;
  color: #10241e; background: linear-gradient(180deg, #ffd98a, #d8a94e);
  border: 1px solid #ffd98a; box-shadow: 0 0 22px rgba(216, 169, 78, 0.55);
}

#toast {
  position: absolute; top: 76px; left: 50%; transform: translateX(-50%);
  background: var(--card); border: 1px solid rgba(83, 214, 194, 0.5);
  color: var(--teal); border-radius: 999px; padding: 8px 20px;
  font-size: 14px; opacity: 0; transition: opacity 0.25s; white-space: nowrap;
}
#toast.show { opacity: 1; }

@media (max-width: 480px) {
  .stat { min-width: 52px; padding: 4px 8px; }
  .stat b { font-size: 13px; }
  #ov-title { font-size: 22px; letter-spacing: 4px; }
}
