/* Cubewild — shared styles */
:root {
  --ink: #1c2130;
  --paper: #f4f1e8;
  --sand: #e8d9b0;
  --clay: #d97a3c;
  --moss: #5f8a4e;
  --sky: #7fb2e0;
  --stone: #8a8f9a;
  --line: #2a2f3d;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Avenir Next", "Futura", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #10141d 0%, #232a3a 100%);
}
a { color: inherit; text-decoration: none; }

/* nav */
.nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.4rem; position: sticky; top: 0; z-index: 10;
  background: rgba(16, 20, 29, 0.72); backdrop-filter: blur(6px);
}
.logo { font-weight: 800; letter-spacing: 0.18em; font-size: 1.05rem; color: var(--sand); }
.btn {
  display: inline-block; padding: 0.65rem 1.6rem; border-radius: 10px;
  background: var(--clay); color: #fff; font-weight: 700; letter-spacing: 0.04em;
  border: 0; cursor: pointer; transition: transform 0.15s, background 0.2s;
}
.btn:hover { transform: translateY(-2px); background: #e08a4d; }
.btn-small { padding: 0.45rem 1rem; font-size: 0.9rem; }
.btn-primary {
  padding: 0.9rem 2.2rem; font-size: 1.05rem; border-radius: 12px;
  box-shadow: 0 6px 18px rgba(217, 122, 60, 0.35);
}

/* hero */
.hero {
  min-height: 78vh; display: flex; align-items: center;
  background:
    radial-gradient(1200px 600px at 70% 30%, rgba(127, 178, 224, 0.18), transparent 60%),
    linear-gradient(180deg, #10141d 0%, #1b2233 100%);
  padding: 2.5rem 1.4rem;
}
.hero-inner { display: flex; gap: 2rem; align-items: center; width: 100%; }
.hero-copy h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1.05; color: var(--sand); margin: 0 0 0.4rem; }
.tagline { font-size: 1.05rem; color: #cfd8e6; margin: 0 0 1.4rem; }
.sub { margin-top: 1rem; color: #8f9ab5; font-size: 0.92rem; }
.hero-visual { flex: 1; min-width: 0; }
#hero-preview {
  width: 100%; height: 340px; border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}
@media (max-width: 760px) {
  .hero-inner { flex-direction: column; }
  .hero-visual { width: 100%; }
  #hero-preview { height: 260px; }
}

/* bands */
.band { padding: 3rem 1.4rem; max-width: 1080px; margin: 0 auto; }
.band.alt { background: rgba(255, 255, 255, 0.04); }
.band h2 {
  font-size: 1.5rem; color: var(--sand); letter-spacing: 0.06em;
  text-transform: uppercase; margin: 0 0 1.2rem;
}
.muted { color: #8f9ab5; }
#features { list-style: none; padding: 0; margin: 0; }
#features li {
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px; padding: 0.9rem 1.2rem; margin-bottom: 0.7rem;
  color: #dfe4ef;
}
#controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0.8rem; }
#controls div {
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px; padding: 0.8rem 1.1rem; color: #dfe4ef;
}

/* gallery */
#gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
#gallery img {
  width: 100%; height: 200px; object-fit: cover; border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12); display: block;
}

/* footer */
.foot { padding: 2rem 1.4rem; color: #6d7790; text-align: center; }

/* game page */
body.playing { background: #0b0e14; overflow: hidden; }
#game-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#ui { position: absolute; inset: 0; pointer-events: none; }
#ui > * { pointer-events: auto; }

#start {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(10, 12, 20, 0.82); pointer-events: auto;
}
#start .card {
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px; padding: 1.6rem 2rem; max-width: 420px; text-align: center;
  color: #dfe4ef;
}
#start .card h2 { margin: 0 0 0.6rem; color: var(--sand); }
#start .card p { margin: 0 0 1rem; color: #a9b2c6; }

#hud {
  position: absolute; top: 12px; left: 12px; display: flex; flex-direction: column; gap: 8px;
  font-size: 0.8rem; color: #cfd8e6; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
#hud .pill {
  background: rgba(10, 12, 20, 0.55); border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px; padding: 4px 10px;
}
#toast {
  position: absolute; bottom: 110px; left: 50%; transform: translateX(-50%);
  background: rgba(10, 12, 20, 0.7); border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px; padding: 8px 16px; color: #e8e2d0; font-size: 0.85rem;
  transition: opacity 0.4s; opacity: 0;
}
#toast.show { opacity: 1; }

/* hotbar */
#hotbar {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px; padding: 8px;
  background: rgba(10, 12, 20, 0.55); border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
}
#hotbar .slot {
  width: 44px; height: 44px; border-radius: 8px; cursor: pointer;
  background: #1a1f2b; border: 2px solid transparent;
  display: flex; align-items: center; justify-content: center;
}
#hotbar .slot[aria-selected="true"] { border-color: var(--sand); }
#hotbar .swatch { width: 30px; height: 30px; border-radius: 5px; }
#hotbar .slot-name {
  position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%);
  font-size: 0.62rem; color: #a9b2c6; white-space: nowrap;
}

/* touch controls */
#touch-ui { display: none; }
@media (hover: none) { #touch-ui { display: block; } }
#touch-ui { position: absolute; inset: 0; pointer-events: none; }
#touch-ui > * { pointer-events: auto; }
.tpad {
  position: absolute; left: 18px; bottom: 90px; width: 130px; height: 130px;
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%; touch-action: none;
}
.tbtn {
  position: absolute; width: 64px; height: 64px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.22);
  color: #e8e2d0; font-size: 0.7rem; display: flex; align-items: center; justify-content: center;
  touch-action: none;
}
.tbtn.break { right: 18px; bottom: 110px; }
.tbtn.place { right: 18px; bottom: 30px; }
.tbtn.jump { right: 96px; bottom: 110px; }
