:root {
  --bg-top: #031523;
  --bg-bottom: #09253a;
  --panel-bg: rgba(4, 23, 38, 0.74);
  --text: #f3fbff;
  --accent: #38c4ff;
  --accent-soft: rgba(56, 196, 255, 0.22);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 20% 10%, #0d3e61 0%, var(--bg-top) 38%, var(--bg-bottom) 100%);
  color: var(--text);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

body {
  touch-action: none;
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.panel {
  background: var(--panel-bg);
  border: 1px solid rgba(166, 228, 255, 0.35);
  border-radius: 14px;
  backdrop-filter: blur(2px);
}

#hud {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: calc(12px + env(safe-area-inset-left, 0px));
  margin: 0;
  padding: 10px 12px;
  line-height: 1.25;
  font-size: clamp(0.88rem, 2.5vw, 1rem);
  z-index: 3;
  min-width: 170px;
}

#cacheResetButton {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 7px 12px;
  font-size: clamp(0.72rem, 2.2vw, 0.82rem);
  letter-spacing: 0.06em;
  z-index: 3;
  background: var(--panel-bg);
  border: 1px solid rgba(166, 228, 255, 0.35);
  border-radius: 14px;
  line-height: 1.1;
  color: rgba(243, 251, 255, 0.9);
  cursor: pointer;
  backdrop-filter: blur(2px);
}

#cacheResetButton:active {
  transform: translateX(-50%) scale(0.98);
}

#cacheResetButton:disabled {
  opacity: 0.86;
  cursor: wait;
}

#buildVersionValue {
  font-weight: 700;
  color: #d7f4ff;
}

#hud p {
  margin: 0 0 4px;
}

#hud p:last-child {
  margin-bottom: 0;
}

.overlay {
  position: absolute;
  inset: 0;
  margin: auto;
  width: min(92vw, 420px);
  height: fit-content;
  padding: 20px;
  text-align: center;
  z-index: 4;
  display: none;
}

.overlay.visible {
  display: block;
}

h1,
h2 {
  margin: 0 0 10px;
  letter-spacing: 0.02em;
}

p {
  margin: 8px 0;
}

button {
  margin-top: 10px;
  background: linear-gradient(180deg, #47ceff, #159dd5);
  border: none;
  border-radius: 999px;
  color: #001622;
  font-weight: 700;
  padding: 10px 18px;
  font-size: 1rem;
}

button:active {
  transform: scale(0.98);
}
