/* ===========================================================================
   Cube — a standalone playable 3D cube fidget.
   Self-contained styles (no framework, no build). Files in this folder:
     index.html   the page
     main.js      entry point — wires the buttons, skins & music
     scene-cube.js the three.js scene/controller
     rubik.js     the cube model + layer-turn logic
     talavera.js  the cube face textures (skins)
     cube.css     these styles
   =========================================================================== */

:root {
  --ember: #e8472b;
  --ember-dark: #c4341c;
  --gold: #f2a93b;
  --shadow: 0 18px 40px -22px rgba(33, 27, 22, 0.55);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Inter", system-ui, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* hover tip that follows the cube */
.intro__tip {
  position: fixed; z-index: 3;
  transform: translate(14px, -50%);
  background: rgba(20, 16, 12, 0.92); color: #fff;
  font-size: 0.78rem; font-weight: 600;
  padding: 0.35rem 0.7rem; border-radius: 8px;
  border: 1px solid rgba(242, 169, 59, 0.5);
  white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity 0.12s ease;
}
.intro__tip.is-on { opacity: 1; }

/* full-screen cube stage */
.play-body { background: #100b06; overflow: hidden; }
.play-canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; }
.play-canvas:active { cursor: grabbing; }

.play-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.9rem 1.4rem;
  background: linear-gradient(to bottom, rgba(16, 11, 6, 0.85), rgba(16, 11, 6, 0));
}
.play-bar__back { color: rgba(255, 255, 255, 0.8); font-weight: 600; font-size: 0.92rem; }
.play-bar__back:hover { color: var(--gold); }
.play-bar__title { font-family: "Bebas Neue", sans-serif; font-size: 1.8rem; letter-spacing: 0.05em; color: #fff; }
.play-bar__actions { display: flex; gap: 0.6rem; }

.play-btn {
  background: var(--ember); color: #fff; border: 1px solid var(--ember);
  font: inherit; font-weight: 600; font-size: 0.9rem;
  padding: 0.55em 1.1em; border-radius: 10px; cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease;
}
.play-btn:hover { transform: translateY(-2px); background: var(--ember-dark); }
.play-btn--ghost { background: transparent; border-color: rgba(255, 255, 255, 0.4); }
.play-btn--ghost:hover { background: rgba(255, 255, 255, 0.1); }

.play-skins {
  position: fixed; top: 4.6rem; left: 50%; transform: translateX(-50%); z-index: 10;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; padding: 0 1rem;
}
.play-skin {
  background: rgba(29, 23, 18, 0.8); color: #f4ece0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  font: inherit; font-weight: 600; font-size: 0.85rem;
  padding: 0.45em 0.95em; border-radius: 999px; cursor: pointer;
  backdrop-filter: blur(4px);
  transition: transform 0.15s ease, border-color 0.2s ease, background 0.2s ease;
}
.play-skin:hover { transform: translateY(-2px); border-color: var(--gold); }
.play-skin.is-active { background: var(--ember); border-color: var(--ember); color: #fff; }

.play-hint {
  position: fixed; bottom: 1.4rem; left: 0; right: 0; z-index: 10;
  text-align: center; color: rgba(255, 255, 255, 0.6); font-size: 0.85rem;
  pointer-events: none; padding: 0 1rem;
}
.play-hint strong { color: var(--gold); font-weight: 600; }

.play-music { position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 11; width: min(340px, 86vw); }
.play-music__toggle {
  display: block; margin-left: auto; margin-bottom: 0.6rem;
  background: #1d1712; color: #f4ece0; border: 1px solid rgba(242, 169, 59, 0.4);
  font: inherit; font-weight: 600; font-size: 0.88rem;
  padding: 0.5em 0.9em; border-radius: 999px; cursor: pointer; box-shadow: var(--shadow);
}
.play-music__toggle:hover { border-color: var(--gold); }
.play-music__panel {
  overflow: hidden; border-radius: 14px; box-shadow: var(--shadow);
  transition: max-height 0.3s ease, opacity 0.25s ease; max-height: 360px; opacity: 1;
}
.play-music__panel.is-collapsed { max-height: 0; opacity: 0; }

@media (max-width: 560px) {
  .play-bar { flex-wrap: wrap; }
  .play-bar__title { order: -1; width: 100%; text-align: center; }
  .play-music { left: 1.2rem; width: auto; }
}
