/* Mango Corp: palette from "Logo pro" — night navy, blue energy, and the mango/letters fire
   (yellow -> orange -> red). */
/* Fonts: Monocraft (community Minecraft-style font, OFL, license in /fonts) for titles in bold and for
   game text; normal text in Noto Sans / Arial. */
@font-face { font-family: "Monocraft"; src: url("/fonts/monocraft.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Monocraft"; src: url("/fonts/monocraft-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #070e21;           /* the background of "Mango con energía" */
  --bg-2: #0a1528;
  --card: #0d1a31;
  --card-2: #11213d;
  --line: #1d3254;
  --line-glow: rgba(96, 208, 224, .35);
  --text: #eef6ff;
  --muted: #8fa6c6;
  --energy: #60d0e0;       /* glow around the mango */
  --energy-soft: #c0f0f0;
  --yellow: #f8bc00;
  --orange: #fc7c00;
  --red-brand: #ff2e0a;
  --leaf: #27902a;
  --green: #7fd435;
  --red: #ff5c6c;
  --fire: linear-gradient(90deg, var(--yellow), var(--orange) 55%, var(--red-brand));
  --radius: 16px;
  --font-display: "Monocraft", ui-monospace, Menlo, monospace;
  --font-game: "Monocraft", ui-monospace, Menlo, monospace;
  --font-body: "Noto Sans", Arial, Helvetica, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  background:
    radial-gradient(900px 520px at 50% -120px, rgba(96, 208, 224, .16) 0%, transparent 70%),
    radial-gradient(600px 400px at 85% 110%, rgba(252, 124, 0, .08) 0%, transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 16px/1.55 var(--font-body);
}

a { color: var(--energy); }

.wrap { max-width: 940px; margin: 0 auto; padding: 24px 16px 64px; }

header.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 36px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-icon { width: 52px; height: 52px; margin: -6px -4px -6px -8px; }
.brand-words { height: 28px; width: auto; }
@media (max-width: 420px) {
  .brand-words { height: 20px; }
  .brand-icon { width: 44px; height: 44px; }
}
nav.links { display: flex; gap: 6px; }
nav.links a {
  color: var(--muted); text-decoration: none; font-family: var(--font-display); font-weight: 600; font-size: 17px;
  padding: 6px 12px; border-radius: 999px; border: 1px solid transparent;
}
nav.links a:hover { color: var(--text); }
nav.links a.on { color: var(--text); border-color: var(--line-glow); background: rgba(96, 208, 224, .08); }

h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(34px, 6vw, 50px); line-height: 1.1; margin: 0 0 16px; }
h1 .accent { background: var(--fire); -webkit-background-clip: text; background-clip: text; color: transparent; }
h2 { font-family: var(--font-display); font-weight: 700; font-size: 24px; line-height: 1.2; margin: 0 0 10px; }
.subtitle {
  font-family: var(--font-game); font-style: italic; text-align: center;
  color: var(--energy-soft); font-size: 15px; letter-spacing: .02em; margin: 4px 0 10px;
}
.tagline {
  font-family: var(--font-display); font-weight: 700; text-align: center;
  font-size: clamp(19px, 3.6vw, 28px); line-height: 1.3; margin: 0 auto 30px; max-width: 680px;
  color: #fff;
}
/* Halloween highlight inside the tagline: bigger, pumpkin orange -> witch purple. */
.tagline .halloween {
  font-size: 1.22em; white-space: nowrap;
  background: linear-gradient(90deg, #ffb238, #ff7a00 40%, #c04dff 85%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 12px rgba(255, 122, 0, .35));
}
.ip-card { text-align: left; margin-bottom: 16px; }
.ip-card .address { justify-content: flex-start; margin: 4px 0 12px; }
/* Small label above a value (e.g. the IP). */
h2.label {
  font-family: var(--font-game); font-weight: 700; font-size: 16px;
  color: var(--energy-soft); margin: 0 0 10px;
}
.ip-card .address code { font-size: clamp(17px, 3.4vw, 22px); padding: 10px 16px; }
p.lead { color: var(--muted); font-size: 18px; margin: 0 0 28px; max-width: 620px; }
p.lead.center { margin-left: auto; margin-right: auto; text-align: center; }
p.lead strong { color: var(--text); }

/* Home hero: the mango with its energy, floating, over the words. */
.hero { text-align: center; margin: 0 0 18px; }
.hero h1 { margin: 0; }
.hero-emblem {
  display: block; margin: -10px auto -6px; width: min(320px, 72vw); height: auto;
  animation: float 5s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) { .hero-emblem { animation: none; } }
.hero-words { width: min(440px, 86vw); height: auto; filter: drop-shadow(0 6px 18px rgba(252, 124, 0, .25)); }
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-8px) rotate(1deg); }
}

.card {
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.stack > * + * { margin-top: 16px; }

.address {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-family: var(--font-game); font-size: 18px;
}
.address code {
  font-family: var(--font-game); font-size: inherit;
  background: var(--bg); border: 1px solid var(--line-glow); border-radius: 10px; padding: 8px 12px;
  box-shadow: 0 0 18px rgba(96, 208, 224, .12) inset;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; padding: 12px 18px; cursor: pointer;
  font: inherit; font-family: var(--font-display); font-size: 17px; font-weight: 700; text-decoration: none;
  background: linear-gradient(180deg, #ffc21a, var(--orange));
  color: #2a1200;
  box-shadow: 0 6px 18px rgba(252, 124, 0, .3), inset 0 -3px 0 rgba(160, 50, 0, .45);
  transition: transform .1s, filter .15s, box-shadow .15s;
}
.btn:hover { filter: brightness(1.06); box-shadow: 0 8px 24px rgba(252, 124, 0, .45), inset 0 -3px 0 rgba(160, 50, 0, .45); }
.btn:active { transform: translateY(1px); }
.btn.ghost {
  background: transparent; color: var(--text); border: 1px solid var(--line-glow);
  box-shadow: none; font-weight: 700;
}
.btn.ghost:hover { background: rgba(96, 208, 224, .08); }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; transform: none; }
.btn.small { padding: 8px 12px; font-size: 15px; }

.feature { transition: border-color .2s, box-shadow .2s; }
.feature:hover { border-color: var(--line-glow); box-shadow: 0 10px 30px rgba(0, 0, 0, .25), 0 0 28px rgba(96, 208, 224, .1); }
.feature .icon { font-size: 28px; }
.feature p { color: var(--muted); margin: 6px 0 16px; }
.tag {
  display: inline-block; font-family: var(--font-game); font-size: 11px; font-weight: 400; vertical-align: middle; padding: 2px 8px; border-radius: 999px;
  color: var(--energy); border: 1px solid var(--line-glow); background: rgba(96, 208, 224, .08);
}

.status { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-family: var(--font-game); font-size: 13px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.dot.on { background: var(--green); box-shadow: 0 0 10px var(--green); }
.dot.off { background: var(--red); }

/* Skin page */
.skin-layout { display: grid; gap: 20px; grid-template-columns: 1fr 1fr; align-items: start; }
@media (max-width: 720px) { .skin-layout { grid-template-columns: 1fr; } }

.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  width: 100%; min-height: 150px; padding: 24px 16px; text-align: center;
  border: 2px dashed var(--line); border-radius: var(--radius); background: rgba(6, 13, 28, .5);
  color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s;
}
.drop:hover, .drop:focus-visible, .drop.over {
  border-color: var(--energy); background: rgba(96, 208, 224, .06); outline: none;
  box-shadow: 0 0 24px rgba(96, 208, 224, .15);
}
.drop-icon { font-size: 30px; line-height: 1; margin-bottom: 4px; }
.drop-title { color: var(--text); font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.drop-hint { font-size: 14px; }
.drop input { display: none; }

.variants { display: flex; gap: 10px; margin: 16px 0; flex-wrap: wrap; }
.variants label {
  flex: 1; min-width: 130px; display: flex; gap: 8px; align-items: center; cursor: pointer;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
}
.variants input { accent-color: var(--orange); }
.variants label:has(input:checked) { border-color: var(--orange); box-shadow: 0 0 14px rgba(252, 124, 0, .18); }

.viewer {
  background: radial-gradient(closest-side, rgba(96, 208, 224, .14), transparent 75%), var(--bg);
  border: 1px solid var(--line); border-radius: var(--radius);
  aspect-ratio: 3 / 4; display: grid; place-items: center; overflow: hidden;
}
.viewer canvas { width: 100% !important; height: 100% !important; }
.viewer .empty { color: var(--muted); padding: 16px; text-align: center; }

.msg { margin-top: 14px; padding: 12px 14px; border-radius: 12px; display: none; }
.msg.show { display: block; }
.msg.ok { background: rgba(127, 212, 53, .12); border: 1px solid rgba(127, 212, 53, .4); }
.msg.err { background: rgba(255, 92, 108, .12); border: 1px solid rgba(255, 92, 108, .4); }
.msg.info { background: rgba(96, 208, 224, .1); border: 1px solid var(--line-glow); }

.hello { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.hello img { width: 44px; height: 44px; border-radius: 8px; image-rendering: pixelated; background: var(--bg-2); }
.muted { color: var(--muted); }

ol.steps { color: var(--muted); padding-left: 20px; }
ol.steps li { margin: 6px 0; }
ol.steps code { color: var(--text); font-family: var(--font-game); font-size: 14px; }

footer { margin-top: 48px; color: var(--muted); font-family: var(--font-game); font-size: 12px; text-align: center; }
footer img { width: 30px; height: 30px; vertical-align: middle; margin-right: 2px; }

/* Phones: the 3D viewer goes under the form, not taller than the screen. */
@media (max-width: 720px) {
  .viewer { aspect-ratio: auto; height: 60vh; max-height: 480px; }
}

/* Player names look like in game. */
#player { font-family: var(--font-game); font-weight: 700; }

/* Narrow phones: keep the header on one line and the subtitle short. */
@media (max-width: 400px) {
  nav.links { gap: 2px; }
  nav.links a { font-size: 14px; padding: 5px 8px; }
  .brand { gap: 6px; }
  .brand-words { height: 17px; }
  .subtitle { font-size: 12px; }
}

/* Voice page */
.voice-layout { display: grid; gap: 20px; grid-template-columns: 1fr 1fr; align-items: start; }
@media (max-width: 720px) { .voice-layout { grid-template-columns: 1fr; } }
.voice-status { display: flex; align-items: center; gap: 8px; margin: 16px 0 10px; font-family: var(--font-game); font-size: 14px; }
.meter { height: 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; }
.meter-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--green), var(--yellow)); transition: width .08s; }
.voice-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 16px; }
.btn.ghost.active { border-color: var(--red); color: var(--red); }
.volume { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.volume input { accent-color: var(--orange); width: 140px; }
ul.peers { list-style: none; padding: 0; margin: 0 0 14px; }
ul.peers li {
  display: flex; justify-content: space-between; gap: 10px; align-items: center;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; background: var(--bg-2);
  transition: border-color .1s, box-shadow .1s;
}
ul.peers li.muted { border-style: dashed; background: transparent; }
ul.peers li.speaking { border-color: var(--green); box-shadow: 0 0 14px rgba(127, 212, 53, .25); }
.peer-name { font-family: var(--font-game); font-weight: 700; }
.peer-info { font-size: 13px; }

/* Voice page: devices and switches */
.device { display: flex; gap: 12px; align-items: flex-start; padding: 12px; margin: 12px 0; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-2); }
.device-icon {
  flex: none; width: 48px; height: 48px; display: grid; place-items: center; font-size: 26px;
  border-radius: 12px; background: rgba(96, 208, 224, .1); border: 1px solid var(--line-glow);
}
.device-body { flex: 1; min-width: 0; display: grid; gap: 8px; }
.device-body label { font-weight: 700; }
.device-row { display: flex; gap: 8px; }
.device-row select { flex: 1; min-width: 0; }
select {
  width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 10px;
}
select:focus { outline: none; border-color: var(--energy); }
.small { font-size: 13px; margin: 0; }
.switch { display: flex; gap: 12px; align-items: center; cursor: pointer; margin: 14px 0 4px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track { flex: none; width: 46px; height: 26px; border-radius: 999px; background: var(--line); position: relative; transition: background .15s; }
.switch-thumb { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + .switch-track { background: var(--green); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(20px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--energy); outline-offset: 2px; }
