:root {
  --bg: #101611;
  --panel: rgba(24, 35, 26, .88);
  --panel-2: rgba(245, 231, 187, .08);
  --text: #f7efd8;
  --muted: #cdbf9f;
  --accent: #d79b42;
  --accent-2: #76a15b;
  --danger: #ff7f7f;
  --ok: #93e283;
  --border: rgba(255,255,255,.14);
  --shadow: 0 24px 80px rgba(0,0,0,.42);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body {
  background:
    radial-gradient(circle at 20% 10%, rgba(215,155,66,.22), transparent 30%),
    radial-gradient(circle at 85% 70%, rgba(118,161,91,.18), transparent 30%),
    linear-gradient(135deg, #0d150f, #1a2419 55%, #121611);
}
a { color: var(--accent); }
.auth-shell, .creator-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 24px;
  align-items: center;
  padding: clamp(18px, 4vw, 54px);
}
.creator-shell { grid-template-columns: .85fr 1.15fr; }
.brand-panel, .creator-preview {
  min-height: 560px;
  border: 1px solid var(--border);
  border-radius: 34px;
  padding: clamp(28px, 5vw, 58px);
  background:
    linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.035)),
    url("data:image/svg+xml,%3Csvg width='120' height='120' viewBox='0 0 120 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='rgba(255,255,255,0.06)' stroke-width='1'%3E%3Cpath d='M0 30h120M0 60h120M0 90h120M30 0v120M60 0v120M90 0v120'/%3E%3C/g%3E%3C/svg%3E");
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.brand-panel:after, .creator-preview:after {
  content: "";
  position: absolute;
  inset: auto -10% -25% 15%;
  height: 260px;
  background: radial-gradient(ellipse, rgba(215,155,66,.24), transparent 70%);
}
.logo-mark {
  width: 78px;
  height: 78px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  font-weight: 950;
  letter-spacing: -2px;
  background: linear-gradient(135deg, var(--accent), #f3c270);
  color: #25180a;
  box-shadow: 0 12px 30px rgba(0,0,0,.28);
}
h1 { font-size: clamp(42px, 7vw, 82px); line-height: .92; margin: 32px 0 18px; letter-spacing: -4px; }
h2 { font-size: 32px; margin: 0 0 8px; }
p { font-size: 18px; line-height: 1.55; color: var(--muted); max-width: 680px; }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 34px;
  max-width: 520px;
}
.feature-grid span {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(0,0,0,.18);
  color: #fff8dc;
  font-weight: 700;
}
.auth-card {
  width: min(100%, 480px);
  justify-self: center;
  padding: 34px;
  border-radius: 28px;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.auth-card.wide { width: min(100%, 760px); }
.muted { margin-top: 0; font-size: 15px; }
form { display: grid; gap: 16px; margin-top: 22px; }
.creator-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.creator-form label:first-of-type, .creator-form button { grid-column: 1 / -1; }
label { display: grid; gap: 7px; color: #fff5db; font-size: 14px; font-weight: 800; }
input, select {
  width: 100%;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.28);
  color: var(--text);
  padding: 14px 15px;
  border-radius: 16px;
  font-size: 16px;
  outline: none;
}
select option { color: #111; }
input:focus, select:focus { border-color: rgba(215,155,66,.9); box-shadow: 0 0 0 4px rgba(215,155,66,.16); }
button {
  border: 0;
  border-radius: 16px;
  padding: 15px 18px;
  font-size: 16px;
  font-weight: 950;
  color: #221608;
  background: linear-gradient(135deg, var(--accent), #ffd071);
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0,0,0,.24);
}
button:hover { transform: translateY(-1px); }
.message { min-height: 24px; margin-top: 16px; font-weight: 800; color: var(--danger); }
.message.ok { color: var(--ok); }
.switch { font-size: 15px; margin: 20px 0 0; }
.avatar-preview {
  width: min(330px, 70vw);
  height: 410px;
  margin: 22px auto 34px;
  position: relative;
  filter: drop-shadow(0 22px 28px rgba(0,0,0,.36));
}
.avatar-head { position:absolute; top:70px; left:105px; width:120px; height:120px; border-radius:48% 48% 44% 44%; background:#c99062; }
.avatar-hair { position:absolute; top:50px; left:91px; width:148px; height:82px; border-radius:70px 70px 20px 20px; background:#3b2417; }
.avatar-body { position:absolute; top:190px; left:75px; width:180px; height:150px; border-radius:40px 40px 24px 24px; background:#3f7f5f; }
.avatar-legs { position:absolute; top:330px; left:95px; width:140px; height:72px; border-radius:0 0 34px 34px; background:#514236; }
@media (max-width: 860px) {
  .auth-shell, .creator-shell { grid-template-columns: 1fr; padding: 14px; }
  .brand-panel, .creator-preview { min-height: auto; padding: 28px; border-radius: 26px; }
  .auth-card { width: 100%; padding: 24px; }
  h1 { letter-spacing: -2px; }
  .creator-form { grid-template-columns: 1fr; }
}

/* Producto final: portada e identidad orientadas al jugador */
.logo-mark.small {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  font-size: 18px;
  letter-spacing: -1px;
}
.brand-panel {
  background:
    linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.04)),
    radial-gradient(circle at 55% 25%, rgba(215,155,66,.18), transparent 30%),
    url('../img/primeronline-cover.png') center 18% / min(420px, 72%) auto no-repeat,
    rgba(24, 35, 26, .7);
  padding-top: clamp(310px, 42vw, 430px);
}
.brand-panel .logo-mark { position: absolute; top: 34px; left: 34px; }
.brand-panel h1 { margin-top: 0; }
.brand-panel p { color: #f0dfb5; text-shadow: 0 2px 14px rgba(0,0,0,.55); }
.feature-grid span {
  text-align: center;
  min-height: 54px;
  display: grid;
  place-items: center;
}
.creator-shell-3d {
  grid-template-columns: minmax(360px, .92fr) minmax(520px, 1.08fr);
  align-items: stretch;
}
.creator-preview-3d {
  padding: 26px;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  min-height: calc(100vh - clamp(36px, 8vw, 108px));
}
.creator-brand-mini {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 950;
  color: #fff3cf;
  letter-spacing: -.4px;
  z-index: 2;
}
.character-stage {
  min-height: 470px;
  position: relative;
  display: grid;
  place-items: center;
  isolation: isolate;
}
#characterCanvas {
  width: 100%;
  height: 100%;
  min-height: 470px;
  display: block;
  cursor: grab;
  touch-action: none;
  position: relative;
  z-index: 2;
}
#characterCanvas:active { cursor: grabbing; }
.stage-glow {
  position: absolute;
  width: min(74%, 430px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255,207,112,.42), rgba(118,161,91,.18) 42%, transparent 72%);
  filter: blur(12px);
  z-index: 1;
  bottom: 9%;
}
.preview-copy {
  position: relative;
  z-index: 3;
  padding: 0 10px 4px;
}
.preview-copy h1 {
  font-size: clamp(36px, 5vw, 62px);
  margin: 12px 0 12px;
}
.preview-copy p { font-size: 16px; margin: 0; }
.creator-rotate-hint {
  width: fit-content;
  margin: 18px auto 0;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(0,0,0,.24);
  color: #f6e7bd;
  font-size: 13px;
  font-weight: 800;
  position: relative;
  z-index: 3;
}
.creator-card {
  align-self: center;
  max-height: calc(100vh - clamp(36px, 8vw, 108px));
  overflow: auto;
  scrollbar-width: thin;
}
.creator-headline {
  position: sticky;
  top: -34px;
  margin: -34px -34px 20px;
  padding: 30px 34px 20px;
  background: linear-gradient(180deg, rgba(24,35,26,.98), rgba(24,35,26,.91));
  backdrop-filter: blur(10px);
  z-index: 5;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 950;
}
.creator-form.upgraded {
  grid-template-columns: 1fr;
  gap: 14px;
}
.creator-form.upgraded .full { grid-column: 1 / -1; }
fieldset {
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 18px;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  background: rgba(255,255,255,.035);
}
legend {
  padding: 0 10px;
  color: #ffe0a0;
  font-size: 15px;
  font-weight: 950;
}
input[type="color"] {
  height: 50px;
  padding: 7px;
  cursor: pointer;
}
.creator-card button[type="submit"] {
  min-height: 54px;
  margin-top: 4px;
  background: linear-gradient(135deg, #f4b24f, #ffe08d 52%, #c8842f);
}

@media (max-width: 1080px) {
  .creator-shell-3d { grid-template-columns: 1fr; }
  .creator-preview-3d { min-height: 620px; }
  .creator-card { max-height: none; }
}
@media (max-width: 680px) {
  .brand-panel { padding-top: 280px; background-size: 300px auto; }
  .brand-panel .logo-mark { top: 22px; left: 22px; }
  .creator-preview-3d { min-height: 560px; padding: 18px; }
  .character-stage { min-height: 360px; }
  #characterCanvas { min-height: 360px; }
  fieldset { grid-template-columns: 1fr; padding: 15px; }
  .creator-headline { top: -24px; margin: -24px -24px 18px; padding: 24px 24px 16px; }
}
