:root {
  --brand: #ff5a3c;
  --brand2: #ffd23c;
  --panel: rgba(20, 26, 40, 0.55);
  --slot: rgba(255,255,255,0.14);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: 100%; height: 100%; overflow: hidden;
  font-family: 'Space Grotesk', sans-serif;
  background: #9cd6ff;
  -webkit-user-select: none; user-select: none;
  touch-action: none;
}
#scene-container { position: fixed; inset: 0; }
#scene-container canvas { display: block; cursor: crosshair; }

/* Crosshair */
#crosshair {
  position: fixed; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  font-size: 26px; font-weight: 700;
  color: rgba(255,255,255,0.9);
  text-shadow: 0 0 4px rgba(0,0,0,0.5);
  pointer-events: none; z-index: 5;
}

/* Top HUD */
#top-hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 14px 18px; pointer-events: none;
}
#logo {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800; font-size: clamp(20px, 4vw, 32px);
  color: #fff; letter-spacing: -1px;
  text-shadow: 0 3px 0 rgba(255,90,60,0.9), 0 5px 8px rgba(0,0,0,0.25);
}
#logo span { color: var(--brand2); }
#hud-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
#block-badge {
  background: var(--panel); backdrop-filter: blur(8px);
  color: #fff; padding: 6px 14px; border-radius: 999px;
  font-weight: 700; font-size: 14px;
  border: 2px solid rgba(255,255,255,0.25);
}
#block-count {
  color: #fff; font-size: 12px; font-weight: 500;
  background: rgba(0,0,0,0.25); padding: 3px 10px; border-radius: 999px;
}

/* Button row */
#btn-row {
  position: fixed; top: 58px; right: 14px; z-index: 10;
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end;
  max-width: 60vw;
}
.hud-btn {
  pointer-events: auto; cursor: pointer;
  background: var(--panel); backdrop-filter: blur(8px);
  color: #fff; border: 2px solid rgba(255,255,255,0.2);
  padding: 7px 12px; border-radius: 12px;
  font-family: 'Space Grotesk'; font-weight: 700; font-size: 12px;
  transition: transform .1s, background .2s;
}
.hud-btn:hover { background: rgba(255,90,60,0.7); transform: translateY(-1px); }
.hud-btn:active { transform: scale(0.94); }

/* Hints */
#hints {
  position: fixed; bottom: 96px; left: 14px; z-index: 8;
  background: var(--panel); backdrop-filter: blur(6px);
  color: #fff; padding: 10px 14px; border-radius: 14px;
  font-size: 12px; line-height: 1.7; max-width: 260px;
  border: 2px solid rgba(255,255,255,0.15);
  opacity: 0.85; transition: opacity .3s;
}
#hints:hover { opacity: 1; }
#hints strong { display: block; margin-bottom: 4px; color: var(--brand2); font-size: 13px; }

/* Hotbar */
#hotbar {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px; z-index: 10; padding: 8px;
  background: var(--panel); backdrop-filter: blur(10px);
  border-radius: 18px; border: 2px solid rgba(255,255,255,0.18);
}
.slot {
  position: relative; width: 52px; height: 52px; border-radius: 12px;
  background: var(--slot); border: 2px solid transparent;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: transform .12s, border-color .2s;
}
.slot:hover { transform: translateY(-3px); }
.slot.active {
  border-color: var(--brand2);
  box-shadow: 0 0 14px rgba(255,210,60,0.8), inset 0 0 8px rgba(255,210,60,0.3);
}
.slot .swatch {
  width: 34px; height: 34px; border-radius: 8px;
  box-shadow: inset -3px -3px 0 rgba(0,0,0,0.22), inset 3px 3px 0 rgba(255,255,255,0.28);
}
.slot .num {
  position: absolute; bottom: 2px; right: 5px;
  font-size: 10px; color: #fff; font-weight: 700; opacity: 0.7;
}
@keyframes pulse { 0%{transform:scale(1)} 50%{transform:scale(1.18)} 100%{transform:scale(1)} }
.slot.pulse { animation: pulse .25s ease; }

/* Mobile controls */
#mobile-controls {
  position: fixed; inset: 0; z-index: 9; display: none;
  justify-content: space-between; align-items: flex-end;
  padding: 0 24px 90px; pointer-events: none;
}
#joystick {
  width: 110px; height: 110px; border-radius: 50%;
  background: rgba(255,255,255,0.12); border: 2px solid rgba(255,255,255,0.3);
  position: relative; pointer-events: auto; touch-action: none;
}
#joy-knob {
  position: absolute; left: 50%; top: 50%; width: 46px; height: 46px;
  margin: -23px 0 0 -23px; border-radius: 50%;
  background: rgba(255,255,255,0.7); box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
#mobile-right { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.mbtn {
  pointer-events: auto; touch-action: none;
  width: 84px; height: 60px; border-radius: 16px; border: none;
  font-weight: 800; font-size: 13px; color: #fff;
  background: rgba(30,40,60,0.7); backdrop-filter: blur(6px);
  border: 2px solid rgba(255,255,255,0.2);
}
.mbtn.break { background: rgba(220,60,50,0.75); }
.mbtn.place { background: rgba(60,150,90,0.8); }
.mbtn:active { transform: scale(0.9); }

/* Overlay */
#overlay {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 30%, #bfe8ff, #6ab0 e6 70%, #3a6fb0);
  background: radial-gradient(circle at 50% 30%, #cdeaff, #74b6ea 60%, #3f77bd);
  transition: opacity .5s, visibility .5s;
}
#overlay.hidden { opacity: 0; visibility: hidden; }
.overlay-card {
  text-align: center; max-width: 420px; padding: 32px 28px;
  background: rgba(255,255,255,0.14); backdrop-filter: blur(14px);
  border-radius: 26px; border: 2px solid rgba(255,255,255,0.3);
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  animation: floatIn .6s ease;
}
@keyframes floatIn { from { opacity:0; transform: translateY(24px) scale(0.96);} to {opacity:1;transform:none;} }
#ov-logo {
  font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800;
  font-size: 40px; color: #fff; letter-spacing: -1.5px;
  text-shadow: 0 4px 0 rgba(255,90,60,0.9), 0 8px 14px rgba(0,0,0,0.3);
}
#ov-logo span { color: var(--brand2); }
#ov-tag { color: #fff; font-weight: 700; font-size: 16px; margin-top: 6px; letter-spacing: 2px; opacity: 0.95; }
#ov-desc { color: rgba(255,255,255,0.92); font-size: 14px; line-height: 1.6; margin: 18px 0 24px; }
#enter-btn {
  cursor: pointer; border: none;
  background: linear-gradient(180deg, var(--brand2), var(--brand));
  color: #3a1500; font-family: 'Bricolage Grotesque'; font-weight: 800;
  font-size: 20px; padding: 14px 40px; border-radius: 16px;
  box-shadow: 0 6px 0 #c73a20, 0 10px 20px rgba(0,0,0,0.25);
  transition: transform .1s;
}
#enter-btn:hover { transform: translateY(-2px); }
#enter-btn:active { transform: translateY(3px); box-shadow: 0 3px 0 #c73a20; }
#ov-hint { color: rgba(255,255,255,0.75); font-size: 11px; margin-top: 16px; }

/* Toast */
#toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: rgba(20,26,40,0.9); color: #fff; padding: 10px 20px;
  border-radius: 12px; font-weight: 600; font-size: 13px; z-index: 60;
  opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s;
  border: 2px solid var(--brand2);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Footer */
#footer { position: fixed; bottom: 4px; right: 10px; z-index: 8; }
#footer a {
  color: rgba(255,255,255,0.6); font-size: 11px; text-decoration: none;
}
#footer a:hover { color: #fff; text-decoration: underline; }

@media (max-width: 640px) {
  #btn-row { top: 52px; }
  .slot { width: 44px; height: 44px; }
  .slot .swatch { width: 28px; height: 28px; }
  #footer { bottom: 78px; }
}
</parameter>