/* RT · estilo industrial-táctico: acero gris, franjas naranjas, luces cian. */
:root {
  --bg: #0c0f12;
  --steel-1: #151a1f;
  --steel-2: #1c2329;
  --steel-3: #27313a;
  --line: #2f3a44;
  --text: #e8eef3;
  --muted: #93a1ad;
  --orange: #ff7a18;
  --orange-2: #ffb347;
  --cyan: #3fe3ff;
  --green: #45d483;
  --red: #ff5a5a;
  --radius: 6px;
  --display: 'Bebas Neue', Impact, sans-serif;
  --cond: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: 'Barlow', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(63, 227, 255, .07), transparent 60%),
    radial-gradient(900px 400px at 0% 0%, rgba(255, 122, 24, .06), transparent 60%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.012) 0 1px, transparent 1px 4px),
    var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--body);
  min-height: 100vh;
}
h1, h2 { font-family: var(--display); font-weight: 400; letter-spacing: .04em; margin: 0; }
h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); line-height: 1; }
h2 { font-size: 1.6rem; line-height: 1.1; }
code { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; background: var(--steel-3); padding: .1em .4em; border-radius: 4px; color: var(--cyan); }
a { color: var(--cyan); }
[hidden] { display: none !important; }

/* Cabecera */
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem clamp(1rem, 4vw, 2.5rem); background: linear-gradient(180deg, #1a2026, #12161a); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: baseline; gap: .7rem; flex-wrap: wrap; }
.brand-mark { font-family: var(--display); font-size: 2.1rem; line-height: 1; color: #0c0f12; background: var(--orange); padding: .05em .3em 0; clip-path: polygon(0 0, 100% 0, 88% 100%, 0 100%); }
.brand-name { font-family: var(--display); font-size: 1.6rem; letter-spacing: .08em; }
.brand-sub { font-family: var(--cond); color: var(--cyan); text-transform: uppercase; letter-spacing: .18em; font-size: .85rem; }
.who { display: flex; align-items: center; gap: .6rem; font-family: var(--cond); font-weight: 600; font-size: 1.05rem; }
.who img { border-radius: 50%; border: 2px solid var(--cyan); background: var(--steel-3); }
.hazard { height: 8px; background: repeating-linear-gradient(-45deg, var(--orange) 0 14px, #14181c 14px 28px); opacity: .9; }

main { max-width: 1240px; margin: 0 auto; padding: clamp(1rem, 3vw, 2rem); }
.loading { color: var(--muted); text-align: center; font-family: var(--cond); letter-spacing: .1em; text-transform: uppercase; }

/* Paneles */
.panel {
  position: relative;
  background: linear-gradient(180deg, var(--steel-2), var(--steel-1));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 10px 30px rgba(0,0,0,.35);
}
.panel::before { /* remaches de esquina */
  content: ''; position: absolute; inset: 6px; pointer-events: none;
  --rivet: radial-gradient(circle, #4d5a66 0 1.7px, transparent 2.3px);
  background: var(--rivet) 0 0, var(--rivet) 100% 0, var(--rivet) 0 100%, var(--rivet) 100% 100%;
  background-size: 6px 6px; background-repeat: no-repeat;
}
.panel + .panel { margin-top: 1rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: .8rem; }
.eyebrow { font-family: var(--cond); text-transform: uppercase; letter-spacing: .18em; color: var(--cyan); font-size: .85rem; margin: 0 0 .4rem; font-weight: 600; }
.lead { color: #c8d3dc; font-size: 1.1rem; max-width: 52ch; }
.fine { color: var(--muted); font-size: .92rem; margin: .6rem 0 0; }
.fine.warn { color: var(--orange-2); }
.chip { font-family: var(--cond); font-weight: 600; font-size: .9rem; padding: .1rem .6rem; border-radius: 99px; background: var(--steel-3); color: var(--text); border: 1px solid var(--line); white-space: nowrap; }
.chip.bad { color: var(--red); border-color: rgba(255,90,90,.4); }
.chip.ok { color: var(--green); border-color: rgba(69,212,131,.35); }

/* Botones */
.btn, .ghost {
  font-family: var(--cond); font-weight: 700; font-size: 1.1rem; letter-spacing: .06em; text-transform: uppercase;
  border-radius: var(--radius); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  text-decoration: none; transition: transform .08s ease, filter .15s ease, background .15s ease;
}
.btn { background: linear-gradient(180deg, var(--orange-2), var(--orange)); color: #1a0e02; border: 0; padding: .75rem 1.4rem; box-shadow: 0 0 0 1px rgba(0,0,0,.4), 0 6px 18px rgba(255,122,24,.25); }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn:disabled { background: var(--steel-3); color: var(--muted); box-shadow: none; cursor: not-allowed; }
.btn.discord { background: #5865f2; color: #fff; box-shadow: 0 6px 22px rgba(88,101,242,.35); font-size: 1.2rem; padding: .85rem 1.6rem; margin-top: .6rem; }
.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); padding: .6rem 1.1rem; }
.ghost:hover { border-color: var(--cyan); color: var(--cyan); }
.small { font-size: .9rem; padding: .3rem .8rem; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* Vista de login */
#viewLogin { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.hero { padding: clamp(1.5rem, 4vw, 2.6rem); }
.hero h1 { margin-bottom: .6rem; }

/* Vincular */
.link { max-width: 640px; margin: 0 auto; padding: clamp(1.5rem, 4vw, 2.4rem); }
.steps { list-style: none; padding: 0; margin: 1.2rem 0; display: grid; gap: .6rem; }
.steps li { display: flex; gap: .8rem; align-items: center; font-size: 1.05rem; }
.steps span { font-family: var(--display); font-size: 1.4rem; width: 2rem; height: 2rem; display: grid; place-items: center; background: var(--steel-3); border: 1px solid var(--orange); color: var(--orange); border-radius: 4px; flex: none; }
.code-box { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: #0a0d10; border: 1px solid var(--cyan); border-radius: var(--radius); padding: .9rem 1.1rem; margin: 1rem 0 .3rem; box-shadow: 0 0 24px rgba(63,227,255,.12) inset; }
.code-box code { background: none; font-size: clamp(1.4rem, 4vw, 2rem); letter-spacing: .08em; padding: 0; }

/* Panel principal */
.dash { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 1.25rem; align-items: start; }
.wallet { overflow: hidden; }
.wallet::after { content: ''; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; background: radial-gradient(circle, rgba(255,179,71,.18), transparent 65%); pointer-events: none; }
.wallet-head { display: flex; justify-content: space-between; align-items: center; }
.status { font-family: var(--cond); font-weight: 600; font-size: .9rem; color: var(--muted); display: inline-flex; align-items: center; gap: .4rem; }
.status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status.on { color: var(--green); }
.status.on::before { background: var(--green); box-shadow: 0 0 8px var(--green); }
.balance { display: flex; align-items: center; gap: .6rem; margin: .4rem 0 .2rem; }
.balance #balance { font-family: var(--display); font-size: clamp(3rem, 7vw, 4.4rem); line-height: 1; color: var(--orange-2); text-shadow: 0 0 22px rgba(255,122,24,.3); font-variant-numeric: tabular-nums; }
.balance .unit { font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); align-self: flex-end; padding-bottom: .55rem; }
.coin { width: 2.4rem; height: 2.4rem; border-radius: 50%; flex: none; background: radial-gradient(circle at 35% 30%, #ffe2a8, #ffb347 40%, #c76a10 100%); box-shadow: inset 0 0 0 3px rgba(0,0,0,.18), 0 0 14px rgba(255,179,71,.45); position: relative; }
.coin::after { content: 'RT'; position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-size: 1rem; color: rgba(90,45,5,.85); }
.player { margin: .2rem 0 0; color: #c8d3dc; }

.jobs { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.job { display: grid; grid-template-columns: 1fr auto; gap: .15rem .6rem; padding: .55rem .7rem; border-radius: var(--radius); background: rgba(0,0,0,.18); border: 1px solid transparent; }
.job.active { border-color: rgba(63,227,255,.35); background: rgba(63,227,255,.05); }
.job-name { font-family: var(--cond); font-weight: 700; font-size: 1.15rem; letter-spacing: .03em; }
.job.active .job-name::before { content: '▶ '; color: var(--cyan); font-size: .8em; }
.job-level { font-family: var(--display); font-size: 1.3rem; color: var(--cyan); }
.job-desc { grid-column: 1 / -1; color: var(--muted); font-size: .85rem; line-height: 1.3; }
.bar { grid-column: 1 / -1; height: 8px; background: #0a0d10; border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), #9ff3ff); box-shadow: 0 0 10px rgba(63,227,255,.5); }
.job:not(.active) .bar > i { background: #5b6874; box-shadow: none; }

.mail, .sell-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.mail li, .sell-list li { display: flex; justify-content: space-between; gap: .5rem; padding: .4rem .6rem; background: rgba(0,0,0,.18); border-radius: 4px; font-family: var(--cond); font-size: 1.05rem; }
.mail .empty { color: var(--muted); justify-content: center; }
.sell-list { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); margin-top: .6rem; }
.sell summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.sell summary::-webkit-details-marker { display: none; }
.sell summary h2::after { content: ' ▾'; color: var(--muted); font-size: .8em; }
.sell[open] summary h2::after { content: ' ▴'; }

.top-list { margin: .6rem 0 0; padding: 0; list-style: none; counter-reset: pos; display: grid; gap: .3rem; }
.top-list li { counter-increment: pos; display: grid; grid-template-columns: 2rem 1fr auto; align-items: center; gap: .5rem; padding: .35rem .5rem; border-radius: 4px; background: rgba(0,0,0,.18); font-family: var(--cond); font-size: 1.05rem; }
.top-list li::before { content: counter(pos); font-family: var(--display); font-size: 1.3rem; color: var(--muted); text-align: center; }
.top-list li:nth-child(1)::before { color: #ffd36b; }
.top-list li.empty { display: block; text-align: center; color: var(--muted); }
.top-list li.empty::before { content: none; }
.top-list li:nth-child(2)::before { color: #d6dde3; }
.top-list li:nth-child(3)::before { color: #e0965a; }
.top-list .amount { color: var(--orange-2); font-weight: 700; font-variant-numeric: tabular-nums; }
.top-list .sub { color: var(--muted); font-size: .85rem; margin-left: .4rem; }
.unlink { margin-top: 1rem; color: var(--muted); }

/* Tienda */
.tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.tab { font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .95rem; padding: .45rem .9rem; border-radius: 4px; border: 1px solid var(--line); background: var(--steel-1); color: var(--muted); cursor: pointer; }
.tab:hover { color: var(--text); }
.tab[aria-selected='true'] { color: #1a0e02; background: var(--orange); border-color: var(--orange); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .8rem; }
.card { display: flex; flex-direction: column; gap: .35rem; padding: .9rem; border-radius: var(--radius); background: linear-gradient(180deg, #212a31, #192026); border: 1px solid var(--line); transition: border-color .15s ease, transform .15s ease; }
.card:hover { border-color: #46535f; transform: translateY(-2px); }
.card.locked { opacity: .7; }
.card .icon { width: 72px; height: 72px; image-rendering: pixelated; align-self: center; margin: .2rem 0 .3rem; filter: drop-shadow(0 6px 8px rgba(0,0,0,.5)); }
.card .name { font-family: var(--cond); font-weight: 700; font-size: 1.15rem; line-height: 1.15; }
.card .qty { color: var(--muted); font-family: var(--cond); font-weight: 600; }
.card .chips { display: flex; flex-wrap: wrap; gap: .3rem; min-height: 1.6rem; }
.card .price { display: flex; align-items: center; gap: .4rem; font-family: var(--display); font-size: 1.7rem; color: var(--orange-2); margin-top: auto; }
.card .price .coin { width: 1.2rem; height: 1.2rem; }
.card .price .coin::after { content: ''; }
.card .btn { padding: .5rem; font-size: 1rem; }

/* Confirmación y avisos */
dialog { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg, var(--steel-2), var(--steel-1)); color: var(--text); padding: 0; max-width: 380px; width: calc(100% - 2rem); }
dialog::backdrop { background: rgba(5,7,9,.7); backdrop-filter: blur(2px); }
.confirm { padding: 1.4rem; text-align: center; display: grid; gap: .5rem; justify-items: center; }
.confirm img { image-rendering: pixelated; }
.confirm-actions { display: flex; gap: .6rem; margin-top: .6rem; }
.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 150%); background: var(--steel-2); border: 1px solid var(--line); border-left: 4px solid var(--cyan); padding: .8rem 1.1rem; border-radius: var(--radius); max-width: min(92vw, 520px); box-shadow: 0 10px 30px rgba(0,0,0,.5); transition: transform .25s ease; z-index: 10; }
.toast:not(.show) { visibility: hidden; transition: transform .25s ease, visibility 0s .25s; }
.toast.show { transform: translate(-50%, 0); }
.toast.error { border-left-color: var(--red); }
.toast.ok { border-left-color: var(--green); }

@media (max-width: 900px) {
  #viewLogin, .dash { grid-template-columns: 1fr; }
  .brand-sub { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
