/* =======================================================
   ATLAS — STYLE FILE
   Colors come from the variables below. The theme buttons
   recolor the WHOLE site by changing these.
   ======================================================= */

:root {
  --bg:   #0b1026;
  --bg2:  #161d3f;
  --pop:  #5e8bff;
  --pop2: #ffcf5c;
  --text: #eaf0ff;
  --muted: rgba(234, 240, 255, 0.6);
  --line: rgba(255, 255, 255, 0.10);
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* A soft colored glow behind everything — uses the theme color */
.glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60vw 50vh at 50% -10%, color-mix(in srgb, var(--pop) 35%, transparent), transparent 70%),
    radial-gradient(50vw 40vh at 100% 10%, color-mix(in srgb, var(--pop2) 18%, transparent), transparent 70%),
    var(--bg);
  transition: background 0.4s ease;
}

/* Soft pulsing glow */
.glow { animation: glowPulse 9s ease-in-out infinite; }
@keyframes glowPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.78; } }

/* ---------- Floating theme animation ---------- */
.floaters { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.floater {
  position: absolute;
  bottom: -12vh;
  opacity: 0;
  will-change: transform, opacity;
  animation-name: floatUp;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
@keyframes floatUp {
  0%   { transform: translateY(0) translateX(0) rotate(0deg); opacity: 0; }
  12%  { opacity: 0.85; }
  88%  { opacity: 0.85; }
  100% { transform: translateY(-122vh) translateX(var(--sway, 0px)) rotate(45deg); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .floater { display: none; } .glow { animation: none; } }

/* ---------- Top theme bar ---------- */
.theme-bar {
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 14px 4px 6px;
  margin-top: 18px;
  scrollbar-width: thin;
}
.theme-bar::-webkit-scrollbar { height: 6px; }
.theme-bar::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
.theme-bar .theme-chip { flex: 0 0 auto; width: 86px; }

/* ---------- Header ---------- */
header { max-width: 860px; margin: 0 auto; padding: 64px 20px 24px; text-align: center; }

h1 {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: clamp(2.4rem, 7vw, 4rem);
  letter-spacing: -1px;
  line-height: 1.05;
}

.subtitle { color: var(--muted); font-size: 1.15rem; margin-top: 10px; }

.hint { color: var(--muted); font-size: 0.85rem; margin-top: 18px; }

/* Prominent sharing banner (visible right at the top on first visit) */
.livebanner {
  display: inline-block;
  margin-top: 20px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  padding: 12px 22px;
  border-radius: 999px;
  cursor: pointer;
  border: 2px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.livebanner:hover { transform: translateY(-1px); }
.livebanner.locked {
  border-color: var(--pop);
  color: var(--pop);
  animation: livePulse 2.2s ease-in-out infinite;
}
.livebanner.live {
  border-color: #34d399;
  color: #34d399;
  background: rgba(52, 211, 153, 0.10);
  animation: none;
}
@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 0 transparent; }
  50% { box-shadow: 0 0 16px 1px var(--pop); }
}

/* ---------- Nav ---------- */
nav { margin-top: 26px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
nav a, .navbtn {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: all 0.15s ease;
}
nav a:hover, .navbtn:hover { border-color: var(--pop); color: var(--pop); }
.navbtn {
  background: var(--pop);
  color: #05060f;
  border-color: var(--pop);
}
.navbtn:hover { color: #05060f; filter: brightness(1.08); }

/* ---------- Cards ---------- */
.card {
  background: var(--bg2);
  max-width: 760px;
  margin: 22px auto;
  padding: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}
.card.hidden { display: none; }

h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}
h3 { font-family: "Space Grotesk", sans-serif; font-size: 1.05rem; margin: 22px 0 8px; color: var(--pop); }
.muted { color: var(--muted); font-size: 0.95rem; margin-bottom: 8px; }

/* ---------- Editable text ---------- */
.editable {
  border-bottom: 2px dashed color-mix(in srgb, var(--pop) 55%, transparent);
  padding: 0 4px 1px;
  border-radius: 4px;
  cursor: text;
  transition: background 0.15s ease;
  outline: none;
}
.editable:hover { background: rgba(255, 255, 255, 0.06); }
.editable:focus { background: rgba(255, 255, 255, 0.08); border-bottom-color: var(--pop); }
h1.editable { display: inline-block; border-bottom-width: 3px; }

/* ---------- About list ---------- */
.facts { list-style: none; display: grid; gap: 12px; margin-top: 14px; }
.facts li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 12px;
  flex-wrap: wrap;
}
.facts .key { color: var(--muted); font-weight: 600; }
.facts b { font-weight: 700; font-size: 1.05rem; }

/* ---------- Customize panel ---------- */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 10px; margin: 12px 0; }
.theme-chip {
  font-family: inherit; font-size: 0.9rem; font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 6px;
  cursor: pointer;
  line-height: 1.7;
  transition: all 0.15s ease;
}
.theme-chip:hover { transform: translateY(-2px); border-color: var(--pop); }
.theme-chip.active { border-color: var(--pop); box-shadow: 0 0 0 2px var(--pop) inset; }
.bigcolor { width: 88px; height: 48px; border: 1px solid var(--line); border-radius: 12px; background: none; cursor: pointer; }

.edit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; text-align: left; margin: 12px 0 20px; }
.edit-grid label { font-weight: 600; color: var(--muted); display: flex; flex-direction: column; gap: 5px; font-size: 0.9rem; }
.edit-grid input { color: var(--text); font-size: 1.05rem; }

/* ---------- Inputs ---------- */
input {
  font-family: inherit; font-size: 1rem;
  padding: 13px 15px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
}
input::placeholder { color: rgba(234, 240, 255, 0.4); }
input:focus { outline: none; border-color: var(--pop); }
.emoji-input { width: 60px; text-align: center; }

.row, .add-project { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 16px 0; }

/* ---------- Projects ---------- */
.project-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-top: 18px; }
.project {
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
}
.project-emoji { font-size: 2.6rem; }
.project h3 { margin: 8px 0 4px; color: var(--text); }
.project p { color: var(--muted); font-size: 0.92rem; }
.del {
  position: absolute; top: 8px; right: 8px;
  width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(0,0,0,0.3); color: var(--text);
  font-weight: bold; cursor: pointer; line-height: 1;
}
.del:hover { background: #e63946; border-color: #e63946; }

/* ---------- Buttons ---------- */
.buttons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 18px 0; }
button {
  font-family: inherit; font-size: 1rem; font-weight: 600;
  background: var(--pop); color: #05060f;
  border: none; padding: 13px 20px;
  border-radius: 12px; cursor: pointer;
  transition: transform 0.08s ease, filter 0.15s ease;
}
button:hover { filter: brightness(1.08); }
button:active { transform: scale(0.96); }

/* ---------- Output box ---------- */
.output {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  font-size: 1.1rem;
  min-height: 62px;
  margin-top: 6px;
}

/* ---------- Art Studio ---------- */
.palette, .brushes { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 12px 0; }
.swatch { width: 38px; height: 38px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.5); padding: 0; cursor: pointer; }
.pad {
  width: 100%; height: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: block; margin: 10px auto;
  touch-action: none;
  cursor: crosshair;
}

/* ---------- Subscribe crew ---------- */
.crew-title { margin-top: 24px; }
.crew { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.crew li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 16px;
}
.del-inline {
  background: rgba(0,0,0,0.3); color: var(--text);
  border: 1px solid var(--line); border-radius: 50%;
  width: 24px; height: 24px; font-size: 0.85rem; padding: 0; cursor: pointer;
}
.del-inline:hover { background: #e63946; border-color: #e63946; }

/* ---------- Race game ---------- */
.race-stats {
  display: flex; gap: 18px; justify-content: center; flex-wrap: wrap;
  margin: 12px 0; font-size: 1.05rem;
}
.race-stats b { color: var(--pop); }
.steer { min-width: 64px; font-size: 1.4rem; padding: 12px 18px; touch-action: none; }
.race-canvas {
  display: block; margin: 12px auto;
  border: 1px solid var(--line); border-radius: 14px;
  background: #0c1a10;
  touch-action: none; cursor: pointer;
  max-width: 100%; height: auto;
}

footer { padding: 40px 20px; text-align: center; color: var(--muted); }
