[hidden] { display: none !important; }
/* Layout: terminal de bolsa (gráfico + panel del CEO) invadido por portadas de tabloide amarillista. Look único oscuro, a propósito. */
:root {
  --ink: #0f1320;        /* fondo terminal */
  --panel: #171c2c;      /* paneles */
  --line: #2a3150;       /* bordes y grilla */
  --paper: #f3eee2;      /* papel de tabloide */
  --text: #e9ecf5;
  --muted: #9aa3c0;
  --tabloid: #e3222c;    /* rojo escándalo */
  --flash: #ffd23f;      /* amarillo prensa */
  --up: #3ddc97;
  --down: #ff5a5f;
  --display: "Archivo Black", "Arial Black", "Helvetica Neue", sans-serif;
  --body: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  color-scheme: dark;
}
html, body { height: 100%; }
body { background: var(--ink); color: var(--text); font-family: var(--body); font-size: 15px; line-height: 1.45; }
button { font: inherit; cursor: pointer; }
button:focus-visible { outline: 3px solid var(--flash); outline-offset: 2px; }
.app {
  max-width: 1180px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 14px 24px;
  display: flex; flex-direction: column; gap: 14px;
}
/* header */
.top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 20px; border-bottom: 2px solid var(--line); padding-bottom: 10px; }
.brand { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.logo { margin: 0; font-weight: 400; font-family: var(--display); font-size: 34px; letter-spacing: .02em; line-height: 1; color: var(--text); }
.logo b { color: var(--up); font-weight: 400; }
.sym { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.quote { display: flex; align-items: baseline; gap: 12px; font-family: var(--mono); font-variant-numeric: tabular-nums; }
#price { font-size: 30px; font-weight: 600; }
#chg { font-size: 16px; font-weight: 600; }
.up { color: var(--up); } .down { color: var(--down); }

/* grid */
.grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 14px; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; font-family: var(--mono); font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.chart-wrap { position: relative; height: 320px; }
#chart { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; background: var(--tabloid); }
.legend .lg-pap::before { border-radius: 2px; background: var(--flash); }
.legend .lg-floor::before { height: 2px; border-radius: 0; background: var(--down); vertical-align: 3px; }

/* CEO */
.ceo { display: flex; flex-direction: column; gap: 12px; }
.ceo svg { width: 150px; height: auto; align-self: center; }
.ceo-name { text-align: center; }
.ceo-name strong { font-family: var(--display); font-size: 24px; font-weight: 400; letter-spacing: .02em; display: block; line-height: 1.1; }
.ceo-name small { color: var(--muted); font-size: 12px; }
.meter-label { display: flex; justify-content: space-between; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 4px; }
.meter-label b { color: var(--text); font-weight: 600; text-transform: none; letter-spacing: 0; }
.meter { height: 12px; background: var(--ink); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
#meterFill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--flash), var(--tabloid)); transition: width .25s; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.stats div { background: var(--ink); border: 1px solid var(--line); border-radius: 4px; padding: 6px 8px; }
.stats dt { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.stats dd { margin: 0; font-family: var(--mono); font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* event card = recorte de tabloide */
.lower { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; }
.event { background: var(--paper); color: #16131a; border-radius: 4px; padding: 16px; min-height: 196px; display: flex; flex-direction: column; gap: 10px; position: relative; overflow: hidden; }
.event .kicker { align-self: flex-start; background: var(--tabloid); color: #fff; font-family: var(--display); font-size: 14px; letter-spacing: .08em; padding: 2px 8px; }
.event p { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.35; max-width: 62ch; text-wrap: pretty; }
.event.idle p { color: #5d5866; font-weight: 400; font-style: italic; }
.event.idle .kicker { background: #5d5866; }
.timer { height: 6px; background: #ddd5c3; border-radius: 3px; overflow: hidden; }
#timerFill { height: 100%; width: 100%; background: var(--tabloid); }
.choices { display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; }
.btn { border: 2px solid #16131a; border-radius: 4px; padding: 10px 16px; font-weight: 800; font-size: 15px; background: transparent; color: #16131a; display: inline-flex; align-items: center; gap: 8px; }
.btn kbd { font-family: var(--mono); font-size: 11px; border: 1px solid currentColor; border-radius: 3px; padding: 0 5px; opacity: .7; }
.btn-cede { background: var(--tabloid); border-color: var(--tabloid); color: #fff; }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn:not(:disabled):hover { transform: translateY(-1px); }

.actions { display: flex; flex-direction: column; gap: 10px; }
.act { width: 100%; text-align: left; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; }
.act strong { font-size: 15px; }
.act small { grid-column: 1; color: var(--muted); font-size: 12px; }
.act .cd { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-family: var(--mono); font-size: 12px; color: var(--flash); }
.act:not(:disabled):hover { border-color: var(--flash); }
.act:disabled { opacity: .5; cursor: not-allowed; }

/* news feed */
.news h2 { font-family: var(--display); font-weight: 400; font-size: 18px; letter-spacing: .06em; margin: 0 0 8px; color: var(--flash); }
#news { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
#news li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; font-size: 14px; border-top: 1px solid var(--line); padding-top: 6px; }
#news li time { font-family: var(--mono); font-size: 12px; color: var(--muted); padding-top: 2px; }
#news li.bad span { color: #ffc2c4; }
#news li.good span { color: #c4f5df; }

.disclaimer { font-size: 12px; color: var(--muted); max-width: 80ch; }

/* flash */
#flash { position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 18%); transform: translate(-50%, 0) rotate(-3deg) scale(.6); opacity: 0; pointer-events: none; z-index: 30; background: var(--flash); color: #16131a; font-family: var(--display); font-size: clamp(26px, 6vw, 54px); padding: 6px 22px; border: 4px solid #16131a; text-align: center; line-height: 1.05; max-width: 90vw; transition: transform .2s, opacity .2s; }
#flash small { display: block; font-family: var(--body); font-weight: 800; font-size: clamp(13px, 2vw, 17px); }
#flash.show { opacity: 1; transform: translate(-50%, 0) rotate(-3deg) scale(1); }

/* overlays */
.overlay { position: fixed; inset: 0; z-index: 40; background: rgba(8, 10, 18, .82); display: flex; align-items: center; justify-content: center; overflow-y: auto;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.front { background: var(--paper); color: #16131a; width: min(560px, 100%); padding: 22px; border-radius: 3px; box-shadow: 0 20px 60px rgba(0,0,0,.5); display: flex; flex-direction: column; gap: 12px; margin: auto; }
.masthead { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 3px double #16131a; padding-bottom: 6px; gap: 8px; flex-wrap: wrap; }
.masthead span:first-child { font-family: var(--display); font-size: 22px; letter-spacing: .04em; color: var(--tabloid); }
.masthead span:last-child { font-family: var(--mono); font-size: 11px; text-transform: uppercase; }
.front .front-h { font-family: var(--display); font-weight: 400; font-size: clamp(32px, 7vw, 48px); line-height: 1; margin: 0; text-transform: uppercase; text-wrap: balance; }
.front .dek { font-size: 16px; margin: 0; }
.front ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.front .go { align-self: flex-start; background: var(--tabloid); color: #fff; border: none; border-radius: 4px; padding: 12px 22px; font-family: var(--display); font-size: 20px; letter-spacing: .05em; }
.front .go:hover { filter: brightness(1.1); }
.endstats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
.endstats div { border-top: 2px solid #16131a; padding-top: 4px; }
.endstats dt { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.endstats dd { margin: 0; font-family: var(--mono); font-size: 20px; font-weight: 600; }
.rank { background: #16131a; color: var(--flash); font-family: var(--display); font-size: 22px; padding: 6px 12px; align-self: flex-start; letter-spacing: .03em; }
.fine { font-size: 12px; color: #5d5866; margin: 0; }

@media (max-width: 860px) {
  .grid, .lower { grid-template-columns: minmax(0, 1fr); }
  .ceo { display: grid; grid-template-columns: 110px minmax(0, 1fr); align-items: center; }
  .ceo svg { width: 110px; grid-row: 1 / span 2; }
  .ceo-name { text-align: left; }
  .ceo .meterbox, .ceo .stats { grid-column: 1 / -1; }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .chart-wrap { height: 240px; }
  .actions { flex-direction: row; flex-wrap: wrap; }
  .act { flex: 1 1 200px; }
}
@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .logo { font-size: 28px; }
  #price { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, #flash { transition: none !important; }
}

/* ---- site additions ---- */
:root {
  /* tokens the shared share sheet and exit modal read */
  --tile: var(--paper); --tile-2: #e6dfcd; --ink-soft: #4d4858; --pop: var(--tabloid); --pop-deep: #b8141d;
  --f-body: var(--body); --f-display: var(--display); --f-mono: var(--mono); --sky: var(--flash);
}
.share-panel, .exit-box { --ink: #16131a; }
.share-preview { color: #16131a; }
.logo-wrap { display: flex; flex-direction: column; gap: 2px; }
.tag { font-size: 12px; color: var(--up); font-style: italic; }
.tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tool { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 6px; height: 36px; padding: 0 12px; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.tool:hover { border-color: var(--flash); }
.tool svg { width: 16px; height: 16px; }
select.tool { padding-right: 8px; }
.top-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
@media (max-width: 560px) { .top-right { align-items: flex-start; } .tool .lbl { display: none; } }
.pop { position: fixed; z-index: 35; pointer-events: none; font-family: var(--display); font-size: 26px; color: var(--flash); text-shadow: 0 2px 0 #16131a; animation: pop-up 1s ease-out forwards; white-space: nowrap; }
.pop.combo { color: var(--tabloid); font-size: 34px; text-shadow: 0 2px 0 #fff; }
@keyframes pop-up { from { transform: translate(-50%, 0) scale(.7); opacity: 1; } 70% { opacity: 1; } to { transform: translate(-50%, -70px) scale(1.1); opacity: 0; } }
.combo-badge { position: absolute; top: 12px; right: 12px; background: #16131a; color: var(--flash); font-family: var(--display); font-size: 18px; padding: 2px 10px; letter-spacing: .04em; }
.shake { animation: shake .35s; }
@keyframes shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
.best-chip { font-family: var(--mono); font-size: 13px; background: #16131a; color: var(--flash); padding: 4px 10px; align-self: flex-start; }
.end-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.go.alt { background: #16131a; }
.hint-key { font-size: 12px; color: #5d5866; }
.trial { display: flex; gap: 10px; align-items: center; border: 2px solid #16131a; border-radius: 6px; padding: 8px 12px; color: #16131a; text-decoration: none; background: #fff; }
.trial:hover { background: #fff8d6; }
.trial-spark { font-size: 22px; line-height: 1; }
.trial strong { display: block; font-size: 15px; }
.trial small { display: block; font-size: 12px; color: #5d5866; }
.newbest { background: var(--flash); color: #16131a; font-weight: 800; padding: 4px 10px; align-self: flex-start; }
.endstats { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
@media (prefers-reduced-motion: reduce) { .pop, .shake { animation: none !important; } .pop { display: none; } }

/* ---- how to play ---- */
.front-kicker { margin: 0; font-family: var(--display); font-size: 20px; line-height: 1.1; text-transform: uppercase; color: var(--tabloid); text-wrap: balance; }
.how-title { margin: 0; font-family: var(--display); font-weight: 400; font-size: 34px; line-height: 1; text-transform: uppercase; }
.goal { margin: 0; background: #16131a; color: var(--paper); padding: 10px 12px; font-size: 16px; }
.goal b { color: var(--flash); }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.steps li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; font-size: 15px; line-height: 1.5; }
.steps .num { width: 30px; height: 30px; border-radius: 50%; background: var(--tabloid); color: #fff; font-family: var(--display); font-size: 17px; display: grid; place-items: center; }
.mk { display: inline-block; border: 2px solid #16131a; border-radius: 4px; padding: 0 6px; font-weight: 800; font-size: 13px; line-height: 1.5; white-space: nowrap; }
.mk-red { background: var(--tabloid); border-color: var(--tabloid); color: #fff; }
b.dn { color: #c41820; } b.upc { color: #11804f; }

/* ---- one-screen layout on desktop ---- */
.play { display: flex; flex-direction: column; gap: 14px; }
.col-main, .col-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
@media (min-width: 861px) {
  html, body { height: 100%; }
  .app { height: 100%; max-width: 1400px; gap: 10px; padding-block: 10px; }
  .top { padding-bottom: 8px; }
  .play { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 330px; grid-template-rows: minmax(0, 1fr); gap: 12px; }
  .col-main, .col-side { gap: 10px; min-height: 0; }
  .chartp { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .chart-wrap { flex: 1; height: auto; min-height: 140px; }
  .event { min-height: 0; padding: 14px; gap: 8px; }
  .event p { font-size: 17px; min-height: 2.7em; }
  .panel { padding: 12px; }
  .ceo { display: grid; grid-template-columns: 76px minmax(0, 1fr); align-items: center; gap: 8px 12px; }
  .ceo svg { width: 76px; grid-row: 1 / span 2; }
  .ceo-name { text-align: left; }
  .ceo-name strong { font-size: 21px; }
  .ceo-name small { font-size: 11px; line-height: 1.3; display: block; }
  .ceo .meterbox, .ceo .stats { grid-column: 1 / -1; }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .stats div { padding: 4px 6px; }
  .stats dt { font-size: 9px; letter-spacing: .03em; }
  .stats dd { font-size: 16px; }
  .act { padding: 9px 12px; }
  .news { flex: 1; min-height: 0; overflow-y: auto; }
  .news h2 { font-size: 16px; margin-bottom: 4px; }
  #news li { font-size: 13px; grid-template-columns: 52px minmax(0, 1fr); }
  .disclaimer { margin: 0; font-size: 11px; }
  .legend { margin-top: 4px; }
}
@media (min-width: 861px) and (max-height: 720px) {
  .logo { font-size: 26px; } #price { font-size: 22px; } .tag { display: none; }
  .ceo-name small, .legend, .act small { display: none; }
  .disclaimer { display: none; }
}
.pause-box { width: min(420px, 100%); }
@media (min-width: 861px) {
  .top { flex-wrap: nowrap; align-items: center; }
  .top-right { flex-direction: row; align-items: center; gap: 16px; }
}

.lang-front { font: 600 14px var(--body); color: #16131a; background: #fff; border: 2px solid #16131a; border-radius: 4px; padding: 4px 6px; }
.front-kicker { font-size: 18px; }
.how-title { font-size: 28px; }
.logo { letter-spacing: -.01em; }
