/* Tokens de color/tipografía en assets/design-tokens.css (ya se carga
   vía <link> en index.html, junto con las fuentes decorativas propias
   de esta herramienta: Anton, Bangers, Comic Neue, etc.).
   Estos alias solo traducen los nombres locales usados en este
   archivo a los tokens compartidos; no declaran valores nuevos. */
:root{
  --bg: var(--void);
  --panel-2: var(--void-2);
  --line: var(--panel-border);
  --ink-dim: var(--muted);
  --accent: var(--epic);     /* tier asignado en el home: EPIC */
  --accent-2: var(--holo-b); /* acento de marca */
}
*{box-sizing:border-box;}
html,body{margin:0;padding:0;}
body{
  background:var(--bg);
  background-image:
    linear-gradient(rgba(161,92,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(161,92,255,0.05) 1px, transparent 1px);
  background-size:44px 44px;
  color:var(--ink);
  font-family:var(--font-body);
  min-height:100vh;
}
.topbar{
  padding:24px 28px 16px;
  border-bottom:1px solid var(--line);
}
.topbar .kicker{
  font-family:var(--font-mono);
  font-size:12px;
  letter-spacing:0.14em;
  color:var(--accent-2);
  margin-bottom:8px;
}
.topbar h1{
  margin:0;
  font-family:var(--font-display);
  font-weight:700;
  letter-spacing:0.02em;
  font-size:clamp(26px,4.5vw,34px);
  color:var(--ink);
}
.topbar h1 span.accent{
  background:linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
}
.topbar p{margin:8px 0 0; color:var(--ink-dim); font-size:14.5px; line-height:1.5;}

.app{
  display:grid;
  grid-template-columns: 360px 1fr;
  gap:0;
  min-height:calc(100vh - 84px);
}
@media (max-width: 860px){
  .app{grid-template-columns:1fr;}
}

.controls{
  background:linear-gradient(180deg, var(--panel), var(--panel-2));
  border-right:1px solid var(--line);
  padding:22px;
  overflow-y:auto;
  max-height:calc(100vh - 84px);
}
.section{
  margin-bottom:24px;
  padding-bottom:20px;
  border-bottom:1px solid var(--line);
}
.section:last-child{border-bottom:none;}
.section h2{
  font-family:var(--font-mono);
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:0.1em;
  color:var(--accent);
  margin:0 0 12px;
  font-weight:700;
}
label{
  display:block;
  font-family:var(--font-mono);
  font-size:11.5px;
  color:var(--ink-dim);
  margin:12px 0 6px;
  letter-spacing:0.02em;
}
label:first-child{margin-top:0;}
textarea{
  width:100%;
  min-height:70px;
  resize:vertical;
  background:var(--bg);
  border:1px solid var(--line);
  border-radius:4px;
  color:var(--ink);
  padding:10px;
  font-family:var(--font-body);
  font-size:14px;
}
select, input[type="number"]{
  width:100%;
  background:var(--bg);
  border:1px solid var(--line);
  border-radius:4px;
  color:var(--ink);
  padding:8px 10px;
  font-family:var(--font-body);
  font-size:14px;
}
textarea:focus, select:focus, input[type="number"]:focus{
  outline:none;
  border-color:var(--accent);
  box-shadow:0 0 0 1px var(--accent);
}
input[type="range"]{
  width:100%;
  accent-color:var(--accent);
}
input[type="color"]{
  -webkit-appearance:none;
  width:100%;
  height:36px;
  border:1px solid var(--line);
  border-radius:4px;
  background:var(--bg);
  padding:3px;
  cursor:pointer;
}
.row{display:flex; gap:10px;}
.row > div{flex:1;}
.rangeval{
  display:flex;
  justify-content:space-between;
  font-family:var(--font-mono);
  font-size:11px;
  color:var(--ink-dim);
}
.toggle-group{
  display:flex;
  background:var(--bg);
  border:1px solid var(--line);
  border-radius:4px;
  overflow:hidden;
}
.toggle-group button{
  flex:1;
  padding:9px 6px;
  background:transparent;
  border:none;
  color:var(--ink-dim);
  cursor:pointer;
  font-family:var(--font-body);
  font-size:13px;
  font-weight:500;
  transition: background 0.15s ease, color 0.15s ease;
}
.toggle-group button.active{
  background:var(--accent);
  color:#100822;
  font-weight:700;
}
.btn{
  background:#1b1e27;
  border:1px solid var(--line);
  color:var(--ink);
  border-radius:4px;
  padding:9px 10px;
  font-family:var(--font-body);
  font-size:13px;
  font-weight:500;
  cursor:pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.btn:hover{border-color:var(--accent-2); background:#232732;}
.btn.primary{
  background:var(--accent);
  border-color:var(--accent);
  color:#100822;
  font-weight:700;
}
.btn.primary:hover{filter:brightness(1.08);}
.btn:disabled{opacity:.6; cursor:not-allowed; filter:none;}
.btn.primary{display:inline-flex; align-items:center; justify-content:center; gap:8px;}
.btn-spinner{
  width:13px; height:13px;
  border-radius:50%;
  border:2px solid rgba(16,8,34,0.35);
  border-top-color:#100822;
  animation:spin .7s linear infinite;
  flex-shrink:0;
}
@keyframes spin{ to{ transform:rotate(360deg); } }
@media (prefers-reduced-motion: reduce){ .btn-spinner{ animation:none; } }
.btn.small{padding:6px 8px; font-size:12px;}
.hint{font-family:var(--font-mono); font-size:11px; color:var(--ink-dim); margin-top:8px; line-height:1.5;}

.preset-row{
  display:flex;
  gap:8px;
}
.preset-slot{
  flex:1;
  border:1px solid var(--line);
  border-radius:4px;
  padding:8px;
  background:var(--bg);
  text-align:center;
}
.preset-swatch{
  height:26px;
  border-radius:3px;
  margin-bottom:6px;
  border:1px solid #000;
}
.preset-empty{
  height:26px;
  border-radius:3px;
  margin-bottom:6px;
  border:1px dashed var(--line);
  display:flex;
  align-items:center;
  justify-content:center;
  font-family:var(--font-mono);
  font-size:9.5px;
  color:var(--ink-dim);
}
.preset-buttons{display:flex; gap:4px;}
.preset-buttons .btn{flex:1;}

.preview{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  padding:30px;
  gap:18px;
}
.canvas-wrap{
  background-image:
    linear-gradient(45deg,#1c1e28 25%,transparent 25%),
    linear-gradient(-45deg,#1c1e28 25%,transparent 25%),
    linear-gradient(45deg,transparent 75%,#1c1e28 75%),
    linear-gradient(-45deg,transparent 75%,#1c1e28 75%);
  background-size:24px 24px;
  background-position:0 0,0 12px,12px -12px,-12px 0px;
  background-color:#111319;
  border:1px solid var(--line);
  border-radius:6px;
  padding:16px;
  max-width:100%;
  overflow:auto;
  box-shadow:0 20px 50px -24px rgba(0,0,0,.6);
}
#stage{
  display:block;
  max-width:100%;
  touch-action:none;
}
.cursor-grab{cursor:grab;}
.cursor-grabbing{cursor:grabbing;}
