:root {
  --bg: #120d14;
  --bg-2: #1c1420;
  --panel: #231a28;
  --panel-2: #2c2132;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f7eef3;
  --muted: #b7a6b2;
  --accent: #e8457c;
  --accent-2: #f5d7a1;
  --ok: #4ecb8f;
  --warn: #f2a65a;
  --danger: #ff5d6c;
  --radius: 16px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "DM Sans", system-ui, -apple-system, sans-serif;
  background: radial-gradient(1200px 700px at 50% -10%, #3a1730 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: "Playfair Display", Georgia, serif; font-weight: 700; margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 12px 22px; cursor: pointer;
  background: var(--panel-2); color: var(--text); font-weight: 600;
  transition: transform .15s ease, background .2s ease, opacity .2s ease;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #b8326a);
  box-shadow: 0 10px 30px rgba(232, 69, 124, .35);
}
.btn-ghost { background: transparent; border: 1px solid var(--line); }
.btn-small { padding: 7px 14px; font-size: 14px; }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid rgba(255,93,108,.35); }
.btn:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* ============================================================
   PÁGINA DEL CLIENTE
   ============================================================ */
.player {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center;
  padding: max(20px, env(safe-area-inset-top)) 16px calc(32px + env(safe-area-inset-bottom));
  text-align: center;
}
#state-game { display: flex; flex-direction: column; align-items: center; }
.player header { margin-bottom: 6px; }
.player .eyebrow { letter-spacing: .25em; text-transform: uppercase; font-size: 12px; color: var(--accent-2); }
.player h1 { font-size: clamp(26px, 7vw, 44px); margin-top: 6px; overflow-wrap: anywhere; }
.player .sub { color: var(--muted); margin: 6px 0 0; }

/* La rueda ocupa lo máximo posible sin que el botón quede fuera de la pantalla */
.wheel-wrap {
  position: relative; aspect-ratio: 1; margin: 22px auto 22px;
  width: min(92vw, 60vh, 480px);
  width: min(92vw, 60dvh, 480px);
  min-width: 240px;
  filter: drop-shadow(0 25px 45px rgba(0,0,0,.55));
  -webkit-user-select: none; user-select: none;
}
.wheel-wrap canvas { width: 100%; height: 100%; display: block; }
.pointer {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0; z-index: 2;
  border-left: 18px solid transparent; border-right: 18px solid transparent;
  border-top: 34px solid var(--accent-2);
  filter: drop-shadow(0 4px 4px rgba(0,0,0,.5));
}
.pointer.tick { animation: tick .12s ease; }
@keyframes tick { 50% { transform: translateX(-50%) rotate(-12deg); } }

.spin-btn {
  font-size: 19px; padding: 16px 44px; letter-spacing: .06em;
  width: min(100%, 340px); min-height: 58px;
}

.status-card {
  margin: 22px auto 0; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 22px; max-width: 440px; width: 100%;
}
.status-card strong { color: var(--accent-2); }

.state-msg { max-width: 420px; margin: 18vh auto 0; }
.state-msg h2 { font-size: 26px; margin-bottom: 10px; }
.spinner {
  width: 38px; height: 38px; border-radius: 50%; margin: 0 auto 16px;
  border: 3px solid var(--line); border-top-color: var(--accent); animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Modal de resultado */
.modal {
  position: fixed; inset: 0; background: rgba(8, 4, 10, .72); backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 16px; z-index: 50;
  animation: fade .25s ease;
}
.modal-card {
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  border: 1px solid rgba(245,215,161,.25); border-radius: 22px; padding: 30px 26px;
  max-width: 380px; width: 100%; text-align: center; box-shadow: var(--shadow);
  animation: pop .35s cubic-bezier(.2,1.4,.4,1);
}
.modal-card .eyebrow { color: var(--accent-2); letter-spacing: .2em; text-transform: uppercase; font-size: 12px; }
.modal-card h2 { font-size: 30px; margin: 10px 0 8px; overflow-wrap: anywhere; }
.modal-card h2.long { font-size: 22px; line-height: 1.3; }
.used-msg { display: block; margin: 6px 0 2px; }
.used-msg:empty { display: none; }
.prize-chip {
  display: inline-block; padding: 10px 18px; border-radius: 999px; font-weight: 700; margin: 8px 0 14px;
}
.modal-card p { color: var(--muted); margin: 0 0 18px; line-height: 1.5; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.85); opacity: 0; } }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; }

.sound-btn {
  position: fixed; z-index: 45;
  top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right));
  width: 44px; height: 44px; border-radius: 50%; font-size: 20px; line-height: 1; cursor: pointer;
  background: rgba(35, 26, 40, .8); border: 1px solid var(--line); color: var(--text);
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.sound-btn:active { transform: scale(.94); }

/* ============================================================
   PANEL DE LA CREADORA
   ============================================================ */
.admin { max-width: 1040px; margin: 0 auto; padding: 24px 16px 60px; }
.admin-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.admin-top h1 { font-size: 26px; }
.admin-top .eyebrow { color: var(--accent-2); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; }

.login-box {
  max-width: 360px; margin: 14vh auto 0; background: var(--panel); border: 1px solid var(--line);
  border-radius: 20px; padding: 28px; box-shadow: var(--shadow);
}
.login-box h1 { font-size: 26px; margin-bottom: 6px; }
.login-box p { margin: 0 0 18px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; text-align: left; }
.field label { font-size: 13px; color: var(--muted); }
.input {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; width: 100%;
}
.input:focus { border-color: rgba(232,69,124,.6); outline: none; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .num { font-size: 28px; font-weight: 700; font-family: "Playfair Display", serif; }
.stat .lbl { color: var(--muted); font-size: 13px; }

.tabs { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tab {
  background: none; border: 0; padding: 10px 14px; cursor: pointer; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600;
}
.tab.active { color: var(--text); border-bottom-color: var(--accent); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.card h3 { font-size: 18px; margin-bottom: 12px; }

.new-link { display: grid; grid-template-columns: 1fr 140px 1fr auto; gap: 10px; align-items: end; }
.new-link .field { margin: 0; }

.created-link {
  margin-top: 14px; background: var(--bg-2); border: 1px dashed rgba(245,215,161,.35);
  border-radius: 12px; padding: 12px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.created-link code { flex: 1; min-width: 0; overflow-wrap: anywhere; color: var(--accent-2); font-size: 13px; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip-btn {
  border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 6px 12px;
  cursor: pointer; color: var(--muted); font-size: 14px;
}
.chip-btn.active { background: var(--panel-2); color: var(--text); border-color: rgba(232,69,124,.5); }

.links-list { display: flex; flex-direction: column; gap: 10px; }
.link-row {
  display: grid; grid-template-columns: 1.3fr 1fr 1.3fr auto; gap: 12px; align-items: center;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
}
.link-row .who strong { display: block; }
.link-row .who small { color: var(--muted); }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.badge.pending { background: rgba(242,166,90,.15); color: var(--warn); }
.badge.used { background: rgba(78,203,143,.15); color: var(--ok); }
.result-cell .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.result-cell small { display: block; color: var(--muted); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }

.empty { text-align: center; color: var(--muted); padding: 30px 10px; }

.prizes-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.prizes-layout .card { margin-bottom: 0; }
.help { margin: -4px 0 10px; font-size: 14px; line-height: 1.5; }
.star-inline { color: #f2c94c; }

.prizes-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card-title-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.count-pill { font-size: 12px; color: var(--muted); background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.add-btn { width: 100%; margin-top: 6px; border-style: dashed; }

.stars-card { border-color: rgba(242,201,76,.35); background: linear-gradient(160deg, rgba(242,201,76,.08), var(--panel) 60%); }
.stars-card h3 small { font-family: "DM Sans", system-ui, sans-serif; font-size: 13px; color: #f2c94c; font-weight: 600; }
.star-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; align-items: center; margin-bottom: 10px; }
.star-badge {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 18px;
  background: var(--bg-2); color: var(--muted); border: 1px solid var(--line); transition: all .2s ease;
}
.star-row.on .star-badge { background: linear-gradient(135deg, #fbe39a, #c9932f); color: #3a2306; border-color: transparent; box-shadow: 0 0 14px rgba(242,201,76,.45); }
.star-row.on .input { border-color: rgba(242,201,76,.5); }
.star-row:not(.on) .input { opacity: .7; }

.switch { position: relative; display: inline-block; width: 50px; height: 30px; cursor: pointer; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch-ui { position: absolute; inset: 0; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); transition: background .2s ease; pointer-events: none; }
.switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--muted); transition: transform .2s ease, background .2s ease; }
.switch input:checked + .switch-ui { background: linear-gradient(135deg, #f2c94c, #c9932f); border-color: transparent; }
.switch input:checked + .switch-ui::after { transform: translateX(20px); background: #fff; }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--accent-2); outline-offset: 2px; }

.save-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px;
}
.save-bar span { font-size: 13px; }

/* Cada premio es una tarjeta: nombre/probabilidad arriba, mensaje abajo */
.prize-row {
  display: grid; gap: 10px; row-gap: 8px; align-items: center; margin-bottom: 10px;
  grid-template-columns: 44px minmax(0, 1fr) auto 56px 36px;
  grid-template-areas: "color label weight pct remove" ". msg msg msg .";
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px;
}
.pr-color { grid-area: color; }
.pr-label { grid-area: label; }
.pr-remove { grid-area: remove; }
.pr-pct { grid-area: pct; }
.pr-msg { grid-area: msg; display: flex; align-items: center; gap: 10px; }
.pr-msg span { font-size: 13px; color: var(--muted); white-space: nowrap; }
.pr-msg .input { padding-top: 9px; padding-bottom: 9px; }
.prize-row input[type="color"] { width: 44px; height: 40px; border: 0; background: none; padding: 0; cursor: pointer; }
.prize-row .pct { color: var(--muted); font-size: 14px; text-align: right; }
.prize-row.is-featured .pr-label { border-color: rgba(242,201,76,.55); }
.prize-row.is-featured .pct { color: #f2c94c; font-size: 12px; font-weight: 700; }
.prize-row input:disabled { opacity: .45; }
.pr-weight { grid-area: weight; display: flex; align-items: center; gap: 8px; }
.pr-weight span { font-size: 13px; color: var(--muted); }
.pr-weight .input { width: 84px; }
.star-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line);
  background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; line-height: 1;
  touch-action: manipulation;
}
.star-btn.on {
  background: linear-gradient(135deg, #fbe39a, #c9932f); color: #3a2306; border-color: transparent;
  box-shadow: 0 0 14px rgba(242,201,76,.45);
}
.icon-btn { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 22px; min-width: 36px; min-height: 36px; }
.icon-btn:hover { color: var(--danger); }
.prize-head { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.prize-head span:nth-child(5) { text-align: center; }
.prize-actions { display: flex; gap: 10px; justify-content: space-between; margin-top: 12px; flex-wrap: wrap; }

.preview-card { position: sticky; top: 16px; text-align: center; }
.preview-wrap { position: relative; width: min(100%, 270px); aspect-ratio: 1; margin: 14px auto 6px; }
.preview-wrap canvas { width: 100%; height: 100%; display: block; }
.pointer.small { top: -7px; border-left-width: 11px; border-right-width: 11px; border-top-width: 21px; }
.preview-msg { font-size: 13px; margin: 6px 0 0; }

/* ---------- Ganancias ---------- */
.stats { grid-template-columns: 1.3fr 1fr 1fr 1fr; }
.stat-money {
  text-align: left; cursor: pointer; font: inherit; color: inherit;
  background: linear-gradient(150deg, rgba(232,69,124,.22), var(--panel) 70%);
  border-color: rgba(232,69,124,.35);
}
.stat-money .num { color: #fff; }

.money-input { position: relative; }
.money-input span { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; pointer-events: none; }
.money-input .input { padding-left: 26px; font-variant-numeric: tabular-nums; }

.who-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.amount-pill {
  border: 1px solid rgba(78,203,143,.35); background: rgba(78,203,143,.12); color: var(--ok);
  border-radius: 999px; padding: 3px 10px; font-size: 13px; font-weight: 700; cursor: pointer;
  font-variant-numeric: tabular-nums; touch-action: manipulation;
}
.amount-pill span { opacity: .7; font-weight: 400; }
.amount-pill.empty { border-color: var(--line); background: transparent; color: var(--muted); font-weight: 600; }

.money-hero {
  text-align: center; padding: 26px 18px 22px; margin-bottom: 12px; border-radius: 20px;
  background: radial-gradient(400px 200px at 50% 0%, rgba(232,69,124,.35), transparent 70%), var(--panel);
  border: 1px solid rgba(232,69,124,.3);
}
.money-hero .eyebrow { color: var(--accent-2); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; }
.money-big {
  font-family: "Playfair Display", Georgia, serif; font-weight: 700; line-height: 1.1; margin: 8px 0 6px;
  font-size: clamp(40px, 13vw, 64px); font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.money-sub { color: var(--muted); font-size: 14px; }

.money-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.money-tiles .stat .num { font-size: 22px; font-variant-numeric: tabular-nums; margin: 2px 0; overflow-wrap: anywhere; }
.money-tiles .stat .sub { color: var(--muted); font-size: 12px; }

.chart-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.chart-head h3 { margin: 0; font-size: 17px; }
.segmented { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.segmented button {
  border: 0; background: none; color: var(--muted); border-radius: 999px; padding: 6px 12px; cursor: pointer;
  font-size: 13px; font-weight: 600; touch-action: manipulation;
}
.segmented button.active { background: var(--panel-2); color: var(--text); }

.chart { position: relative; padding-top: 20px; }
.chart-max {
  position: absolute; top: 0; left: 0; right: 0; font-size: 11px; color: var(--muted);
  border-bottom: 1px dashed rgba(255,255,255,.1); padding-bottom: 2px; height: 20px;
}
.chart-bars { display: flex; align-items: stretch; gap: 2px; height: 170px; border-bottom: 1px solid rgba(255,255,255,.18); }
.bar-col {
  flex: 1; min-width: 0; display: flex; align-items: flex-end; justify-content: center;
  background: none; border: 0; padding: 0; cursor: pointer; border-radius: 6px; touch-action: manipulation;
}
.bar-col:hover, .bar-col.active { background: rgba(255,255,255,.05); }
.bar-col:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.bar { display: block; width: min(70%, 28px); background: var(--accent); border-radius: 4px 4px 0 0; transition: height .35s ease; }
.bar.zero { height: 0 !important; }
.bar-col.active .bar { background: #ff6b9a; }
.chart-axis { display: flex; gap: 2px; margin-top: 6px; }
.chart-axis span { flex: 1; min-width: 0; text-align: center; font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.chart-axis span.current { color: var(--text); font-weight: 700; }
.chart-tip {
  position: absolute; top: -6px; transform: translateX(-50%); z-index: 5; pointer-events: none;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px;
  box-shadow: var(--shadow); text-align: center; white-space: nowrap;
}
.chart-tip b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; }
.chart-tip span { font-size: 12px; color: var(--muted); }

/* Filtros de periodo: todos visibles a la vez (se acomodan en varias filas) */
.filter-bar { margin-bottom: 12px; }
.chip-scroll { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-scroll .chip-btn { white-space: nowrap; padding: 8px 14px; min-height: 38px; touch-action: manipulation; }
#m-period-cut:not(.active) { border-color: rgba(232,69,124,.5); color: var(--text); }
.chip-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.custom-range { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.custom-range label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.custom-range .input { color-scheme: dark; min-height: 44px; }

.chart-empty { text-align: center; padding: 20px 0; margin: 0; font-size: 14px; }
.list-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.list-head h3 { margin: 0; }
.list-head .input { max-width: 220px; }

.cut-card { border-color: rgba(245,215,161,.25); }
.cut-btn { width: 100%; max-width: 320px; min-height: 48px; }
.cut-list { margin-top: 16px; }
.cut-title { font-size: 12px; text-transform: uppercase; letter-spacing: .15em; color: var(--muted); margin-bottom: 4px; }
.cut-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cut-row:last-child { border-bottom: 0; }
.cut-row strong { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
.cut-row small { color: var(--muted); font-size: 12px; }
.cut-none { font-size: 14px; margin: 0; }

/* Ajustes */
.icon-only { width: 38px; padding-left: 0; padding-right: 0; font-size: 17px; }
.settings-block { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.settings-block h4 { margin: 0 0 4px; font-size: 16px; }
.settings-block > p { margin: 0 0 12px; font-size: 14px; }
.settings-btn { width: 100%; max-width: 320px; min-height: 48px; }
.show-pw { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); margin: 0 0 14px; min-height: 32px; cursor: pointer; }
.show-pw input { width: 18px; height: 18px; accent-color: var(--accent); }
.advanced { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.advanced summary {
  cursor: pointer; color: var(--muted); font-size: 14px; padding: 8px 0; list-style: none;
  display: flex; align-items: center; gap: 8px; min-height: 44px;
}
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::before { content: "▸"; transition: transform .2s ease; }
.advanced[open] summary::before { transform: rotate(90deg); }
.danger-zone {
  margin-top: 8px; border: 1px solid rgba(255,93,108,.35); border-radius: 14px; padding: 16px;
  background: rgba(255,93,108,.06);
}
.danger-zone h4 { margin: 0 0 8px; color: var(--danger); font-size: 16px; }
.danger-zone p { margin: 0 0 8px; font-size: 14px; }
.danger-zone ul { margin: 0 0 10px; padding-left: 20px; font-size: 14px; line-height: 1.6; }
.btn-danger-solid { background: var(--danger); color: #fff; width: 100%; min-height: 48px; }
.btn-danger-solid:disabled { background: var(--panel-2); color: var(--muted); }

.pay-list { display: flex; flex-direction: column; }
.pay-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.pay-row:last-child { border-bottom: 0; }
.pay-who { min-width: 0; }
.pay-who strong { display: block; overflow-wrap: anywhere; }
.pay-who small { color: var(--muted); font-size: 12px; }
.pay-amount {
  border: 0; background: none; color: var(--ok); font-weight: 700; font-size: 16px; cursor: pointer;
  font-variant-numeric: tabular-nums; white-space: nowrap; padding: 6px 0 6px 8px; touch-action: manipulation;
}

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--panel-2); border: 1px solid var(--line); padding: 12px 18px; border-radius: 12px;
  box-shadow: var(--shadow); z-index: 100; animation: fade .2s ease; max-width: calc(100vw - 32px);
}
.toast.error { border-color: rgba(255,93,108,.5); }
.demo-banner {
  background: rgba(242,166,90,.12); border: 1px solid rgba(242,166,90,.3); color: var(--warn);
  font-size: 13px; padding: 8px 12px; border-radius: 10px; margin-bottom: 16px;
}

.demo-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; gap: 14px; justify-content: center; align-items: center; flex-wrap: wrap;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(35, 26, 40, .95); border-top: 1px solid rgba(242,166,90,.3);
  font-size: 14px;
}
.demo-bar span { color: var(--warn); font-weight: 700; }
.demo-bar a, .demo-bar button {
  color: var(--text); background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 7px 14px; text-decoration: none; cursor: pointer; font-weight: 600;
}
.player { padding-bottom: 90px; }

/* Pantallas bajas (móvil apaisado o teléfonos pequeños) */
@media (max-height: 680px) {
  .player h1 { font-size: 24px; }
  .player .eyebrow { font-size: 11px; }
  .wheel-wrap { margin: 14px auto; }
  .spin-btn { min-height: 52px; padding: 12px 36px; }
}

@media (max-width: 900px) {
  .prizes-layout { grid-template-columns: 1fr; }
  .preview-card { position: static; }
}

@media (max-width: 720px) {
  .admin { padding: max(16px, env(safe-area-inset-top)) 12px calc(60px + env(safe-area-inset-bottom)); }
  .admin-top h1 { font-size: 22px; }
  .card { padding: 14px; }
  .input { font-size: 16px; } /* evita que el iPhone haga zoom al escribir */
  .btn-small { padding: 9px 14px; }
  .new-link { grid-template-columns: 1fr; }
  .new-link .btn { width: 100%; min-height: 48px; }
  #search { max-width: none !important; }
  .link-row { grid-template-columns: 1fr auto; }
  .link-row .result-cell { grid-column: 1 / -1; }
  .link-row .row-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat-money { grid-column: 1 / -1; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
  .stat-money .num { font-size: 26px; order: 2; }
  .money-tiles { gap: 8px; }
  .money-tiles .stat { padding: 10px; }
  .money-tiles .stat .num { font-size: 18px; }
  .chart-bars { height: 150px; }
  .list-head .input { max-width: none; }
  .cut-btn { max-width: none; }
  .chip-scroll { gap: 6px; }
  .chip-scroll .chip-btn { padding: 7px 12px; font-size: 13px; }
  .chart-axis span { font-size: 9px; }
  .stat { padding: 10px 12px; }
  .stat .num { font-size: 22px; }
  .stat .lbl { font-size: 12px; }
  .tabs { overflow-x: auto; }
  .tab { white-space: nowrap; }

  /* Cada premio en una tarjeta de dos filas */
  .prize-row {
    grid-template-columns: 40px minmax(0, 1fr) auto 36px;
    grid-template-areas: "color label label remove" ". weight pct pct" "msg msg msg msg";
  }
  .pr-msg { flex-direction: column; align-items: stretch; gap: 4px; }
  .add-btn { min-height: 46px; }
  /* Botón de guardar siempre a mano en el teléfono */
  .save-bar {
    position: sticky; bottom: max(8px, env(safe-area-inset-bottom)); z-index: 30;
    box-shadow: 0 -8px 30px rgba(0,0,0,.45);
  }
  .save-bar span { display: none; }
  .save-bar .btn { width: 100%; min-height: 50px; }
}
