* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #080d18;
  color: #fff;
  font-family: system-ui, Tahoma, Arial;
  touch-action: none;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 15%, #172846, #080d18 65%);
}

#wrap {
  width: min(100vw, 850px);
  height: min(100dvh, 680px);
  display: flex;
  flex-direction: column;
  padding: 10px;
  gap: 8px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.logo {
  font-weight: 900;
  letter-spacing: 1px;
  font-size: clamp(18px, 4vw, 27px);
  color: #65dcff;
  text-shadow: 0 0 18px #168bce;
}

.stats {
  display: flex;
  gap: 8px;
  font-size: 13px;
}

.stat {
  background: #121e32;
  border: 1px solid #29415f;
  border-radius: 12px;
  padding: 7px 11px;
}

#stage {
  position: relative;
  flex: 1;
  min-height: 0;
  border: 1px solid #29415f;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 15px 50px #0008;
  background: #0b1424;
}

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

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #050a13d9;
  backdrop-filter: blur(5px);
  padding: 20px;
  text-align: center;
}

.panel {
  max-width: 390px;
  width: 100%;
  background: linear-gradient(145deg, #172944, #0d1728);
  border: 1px solid #345477;
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 20px 60px #0009;
}

h1 {
  margin: 0 0 8px;
  font-size: clamp(27px, 7vw, 42px);
  color: #69dcff;
}

p {
  color: #c0d0e3;
  line-height: 1.7;
  margin: 8px 0 18px;
}

button {
  border: 0;
  border-radius: 13px;
  padding: 12px 20px;
  font-size: 16px;
  font-weight: 800;
  background: linear-gradient(90deg, #16a6df, #4ed9ef);
  color: #06121d;
  cursor: pointer;
  margin: 4px;
  min-width: 125px;
}

button.secondary {
  background: #263b57;
  color: #fff;
  border: 1px solid #49627f;
}

#hint {
  text-align: center;
  color: #8298b4;
  font-size: 12px;
}

.small-note {
  font-size: 12px;
  margin-bottom: 0;
}

.hidden {
  display: none !important;
}
