/* Dashboard-only styles (merchant, agent and admin panels): translation editors, the page builder, the game editor,
   the jackpot page and the sign-in screens. Kept out of app.css so the player site and the landing page don't load them.
   Linked right after app.css, so the order of the rules is unchanged. */
/* Translation editor */
.tr-en { max-width: 46ch; white-space: pre-wrap; }
.tr-base { max-width: 40ch; color: var(--muted); white-space: pre-wrap; }
.tr-input { width: 100%; min-width: 260px; resize: vertical; font: inherit; }
.tr-state { display: block; font-size: 0.78rem; min-height: 1em; }

/* Per-item translations (game / category / brand / role names) */
.item-i18n { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; margin: 4px 0 14px; }
.item-i18n summary { cursor: pointer; font-weight: 700; }
.item-i18n-grid { display: grid; gap: 6px 10px; align-items: center; margin-top: 6px; }
.item-i18n-grid input { width: 100%; }
.item-i18n-lang { font-size: 0.9rem; }
@media (max-width: 640px) { .item-i18n-grid { grid-template-columns: 1fr !important; } }

/* ---------- admin: landing page builder ---------- */
.lp-list { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 8px; }
.lp-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.lp-row.static { padding: 0; border: 0; background: none; }
.lp-row.off { opacity: 0.6; }
.lp-row.dragging { opacity: 0.4; }
.lp-row.drop-before { box-shadow: 0 -3px 0 var(--brand); }
.lp-row.drop-after { box-shadow: 0 3px 0 var(--brand); }
.lp-grip { cursor: grab; color: var(--muted); font-weight: 900; letter-spacing: -2px; user-select: none; }
.lp-icon { font-size: 1.4rem; width: 32px; text-align: center; flex: 0 0 auto; }
.lp-main { flex: 1; min-width: 0; }
.lp-main > .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; max-width: 100%; vertical-align: bottom; }
.lp-meta { font-size: 0.82rem; color: var(--muted); margin-top: 2px; }
.lp-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.lp-on { margin: 0 6px 0 0; font-size: 0.85rem; }
.lp-tr { color: var(--muted); }
.lp-tr.ok { color: var(--ok, #22c55e); }
.lp-page-card { padding: 12px 14px; }
.lp-types { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.lp-type { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2, var(--surface)); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.lp-type:hover { border-color: var(--brand); }
.lp-type .muted { font-size: 0.85rem; }
dialog.modal.lp-modal { width: min(1000px, calc(100vw - 32px)); }
dialog.modal.lp-modal .modal-body { max-height: 72vh; min-height: min(56vh, 520px); } /* (about the same size on every tab) */
.lp-tabs { margin: 0; padding: 0 20px; }
/* the editor's tabs: a count of changed settings, or "!" for a mistake (the words are for screen readers) */
.lp-tabs button { position: relative; display: inline-flex; align-items: center; gap: 6px; }
.lp-tab-mark { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: color-mix(in srgb, var(--brand) 16%, transparent); color: var(--brand); font-size: 0.7rem; font-weight: 800; }
.lp-tab-mark[hidden] { display: none; }
.lp-tab-mark.bad { background: var(--bad); color: #fff; }
.lp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.lp-group + .lp-group, .field + .lp-group, .lp-cond + .lp-group, .lp-listfield + .lp-group { margin-top: 18px; }
.lp-group-head { margin: 0 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--border); font-size: 0.95rem; }
.lp-group-head .muted { font-weight: 400; font-size: 0.85rem; }
.lp-tab-intro { margin: 0 0 12px; font-size: 0.88rem; }
.lp-check-field { margin-bottom: 14px; }
.lp-check-field .check { margin-bottom: 3px; }
.lp-check-field .hint { display: block; padding-left: 26px; font-size: 0.8rem; color: var(--muted); }
.lp-editor [aria-invalid="true"] { border-color: var(--bad); box-shadow: 0 0 0 2px color-mix(in srgb, var(--bad) 25%, transparent); }
.lp-tokens code, .lp-secbits code { font-size: 0.8rem; }
.lp-secbits { margin-bottom: 4px; }
.lp-listfield { margin: 6px 0 16px; padding: 12px; border-radius: 12px; border: 1px dashed var(--border); }
.lp-listhead { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.lp-item { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; background: var(--surface); }
.lp-item > summary { display: flex; align-items: center; gap: 6px; padding: 8px 10px; cursor: pointer; list-style: none; }
.lp-item > summary::-webkit-details-marker { display: none; }
.lp-item[open] > summary { border-bottom: 1px solid var(--border); }
.lp-item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.lp-num { display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 99px; background: var(--surface-2, var(--border)); font-size: 0.75rem; font-weight: 800; }
.lp-item-body { padding: 12px; }
.btn.xs { padding: 2px 7px; font-size: 0.78rem; }
.lp-none { margin: 0; }
.lp-image { display: flex; gap: 12px; align-items: flex-start; }
.lp-image img, .lp-noimg { width: 120px; height: 68px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); background: #000; flex: 0 0 auto; }
.lp-noimg { display: grid; place-items: center; font-size: 0.8rem; color: var(--muted); background: var(--surface-2, transparent); }
.lp-image-ctl { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.lp-icon-field input { max-width: 120px; }
.lp-trbar { gap: 12px; margin-bottom: 6px; }
.lp-trbar select { width: auto; max-width: 100%; }
.lp-trlist { display: flex; flex-direction: column; gap: 10px; }
.lp-tr-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.lp-tr-en { display: flex; flex-direction: column; gap: 2px; }
.lp-tr-label { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.lp-tr-text { white-space: pre-wrap; }
dialog.modal.lp-preview-modal { width: calc(100vw - 32px); max-width: 1400px; }
.lp-preview { display: block; width: 100%; height: 78vh; border: 0; background: #000; border-radius: 0 0 16px 16px; }
@media (max-width: 700px) {
  .lp-row { flex-wrap: wrap; }
  .lp-actions { width: 100%; justify-content: flex-start; }
  .lp-tr-row { grid-template-columns: 1fr; }
  .lp-image { flex-direction: column; }
}
.lp-colours { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.lp-color { display: flex; gap: 8px; align-items: center; }
.lp-color input[type=color] { width: 44px; height: 38px; padding: 2px; flex: 0 0 auto; cursor: pointer; border-radius: 8px; }
.lp-color input[type=color].unset { opacity: 0.35; }
.lp-color input[data-p] { font-family: ui-monospace, monospace; min-width: 0; }
.lp-presets { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 12px; }
.lp-preset { display: inline-flex; align-items: center; gap: 6px; }
.lp-swatch { width: 14px; height: 14px; border-radius: 50%; background: var(--sw); box-shadow: 0 0 0 3px var(--sb), 0 0 0 4px var(--border); }

/* ---------- merchant: jackpot ---------- */
.jp-live { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; background: linear-gradient(120deg, color-mix(in srgb, #f5b301 18%, var(--surface)), var(--surface) 60%); }
.jp-live-main { flex: 1 1 320px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.jp-pool .jp-live { margin: -4px 0 14px; padding: 14px; border-radius: 12px; }
.jp-live-name { font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
.jp-warn { color: #e0a100; font-size: 0.85rem; }
.jp-live-amount { font-size: clamp(2rem, 5vw, 3rem); font-weight: 900; font-variant-numeric: tabular-nums; color: #f5b301; }
.jp-live-stats { flex: 1 1 320px; display: grid; gap: 10px; }
.jp-live-stats > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.banner-prev { display: grid; place-items: center; height: 90px; margin-bottom: 8px; border-radius: 10px; border: 1px dashed var(--border); background: center / cover no-repeat var(--surface-2); }

/* game editor: layout artwork */
.deco-slots { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.deco-slot { display: flex; gap: 12px; padding: 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); }
.deco-prev { width: 96px; height: 96px; flex: none; display: grid; place-items: center; border-radius: 10px; background: repeating-conic-gradient(rgba(127, 127, 127, 0.18) 0 25%, transparent 0 50%) 0 0 / 16px 16px; overflow: hidden; font-size: 0.75rem; }
.deco-prev { position: relative; }
.deco-prev img { width: 100%; height: 100%; object-fit: contain; }
.deco-slot.off .deco-prev { opacity: 0.35; filter: grayscale(1); }
.deco-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.deco-head .piece-on { margin: 0; font-size: 0.85rem; }
.screen-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(400px, 44%); gap: 16px; align-items: start; }
.screen-layout .deco-slots { grid-template-columns: 1fr; }
.screen-preview { position: sticky; top: 72px; padding: 12px; }
@media (max-width: 1180px) { .screen-layout { grid-template-columns: 1fr; } .screen-preview { position: static; } .preview-slot { order: -1; } .screen-layout .deco-slots { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); } }
.preview-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.preview-stage { position: relative; overflow: hidden; border-radius: 10px; background: #000; }
.preview-stage.phone { display: flex; justify-content: center; background: repeating-conic-gradient(rgba(127, 127, 127, 0.12) 0 25%, transparent 0 50%) 0 0 / 16px 16px; }
.preview-stage iframe { display: block; border: 0; transform-origin: 0 0; }
.preview-stage.phone iframe { transform-origin: 50% 0; flex: none; border-radius: 18px; }
.preview-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
details.screen-group { margin: 10px 0; border: 1px solid var(--border); border-radius: 12px; padding: 0 12px; }
details.screen-group > summary { cursor: pointer; padding: 12px 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; font-weight: 700; }
details.screen-group > summary .muted { font-weight: 400; font-size: 0.8rem; flex-basis: 100%; }
details.screen-group[open] > summary { border-bottom: 1px solid var(--border); margin-bottom: 12px; }
details.screen-group .deco-slots { padding-bottom: 12px; }
.adjust { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 12px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); align-items: end; }
.adjust label { display: flex; flex-direction: column; gap: 4px; font-size: 0.78rem; font-weight: 600; }
.adjust label output { font-weight: 400; color: var(--muted); }
.adjust input[type=range] { width: 100%; padding: 0; }
.adjust .btn { justify-self: start; }
.style-picks { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.style-pick { width: 44px; height: 44px; padding: 3px; border-radius: 8px; border: 2px solid var(--border); background: repeating-conic-gradient(rgba(127, 127, 127, 0.18) 0 25%, transparent 0 50%) 0 0 / 10px 10px; cursor: pointer; }
.style-pick img { width: 100%; height: 100%; object-fit: contain; display: block; }
.style-pick.on { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 30%, transparent); }
.wide .deco-prev img, .wide .style-pick img { width: 100%; height: 60%; object-fit: fill; }
.style-pick:disabled { cursor: default; }
.deco-tag { position: absolute; left: 4px; bottom: 4px; padding: 1px 6px; border-radius: 6px; font-size: 0.65rem; font-weight: 700; background: rgba(0, 0, 0, 0.65); color: #fff; }
.deco-info { min-width: 0; }
.deco-info p { margin: 4px 0 8px; font-size: 0.82rem; }

/* game editor: win messages */
.msg-style-grid { border-top: 0; margin-top: 0; padding-top: 4px; padding-bottom: 12px; }
.msg-colour { display: flex; align-items: center; gap: 8px; }
.msg-colour input[type=color] { width: 44px; height: 32px; padding: 2px; }
.msg-colour .check { margin: 0; font-weight: 500; font-size: 0.78rem; }
.msg-fields { border-top: 0; padding-top: 0; }
.msg-prev { background: #111; }
.msg-sample { padding: 4px; font-weight: 900; font-size: 0.78rem; line-height: 1.1; text-align: center; color: #ffd23f; word-break: break-word; }
.preview-slot { min-width: 0; align-self: stretch; } /* full column height, so the preview inside can stay in view */
.tb-fields { border-top: 0; padding-top: 0; }
.adjust .tb-check { flex-direction: row; align-items: center; margin: 0; align-self: end; padding-bottom: 8px; font-size: 0.85rem; }

/* platform logo on the admin / merchant sign-in screens */
.login-logo { display: block; width: 200px; max-width: 70%; height: auto; margin: 0 auto 14px; filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.35)); }

/* Admin and merchant sign-in screens in the platform's own colours — black and gold, like the logo and the landing
   page — whatever the dashboard's accent colour or light / dark mode. */
#login.login-screen {
  color-scheme: dark;
  --brand: #d4af37; --bg: #0a0907; --surface: #15120c; --surface-2: #1d1911; --border: rgba(212, 175, 55, 0.28); --text: #f3ead2; --muted: #a89f86;
  background: radial-gradient(900px 520px at 85% -120px, rgba(212, 175, 55, 0.22), transparent),
    radial-gradient(700px 420px at -5% 25%, rgba(156, 116, 25, 0.16), transparent), #0a0907;
  color: var(--text);
}
#login .login-card { background: rgba(21, 18, 12, 0.92); border-color: rgba(212, 175, 55, 0.35); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65), 0 0 40px rgba(212, 175, 55, 0.08); color: var(--text); }
#login .login-card h1 { color: #f6dc83; }
#login input, #login select, #login textarea { background: #0f0d09; color: var(--text); border-color: rgba(212, 175, 55, 0.25); }
#login input:focus, #login select:focus, #login textarea:focus { border-color: #d4af37; outline: none; box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.22); }
#login .btn.primary { background: linear-gradient(135deg, #f6dc83, #d4af37 55%, #9c7419); color: #0a0907; border: 0; font-weight: 800; }
#login .btn.primary:hover { filter: brightness(1.08); }
#login .tabs { border-color: rgba(212, 175, 55, 0.2); }
#login .tabs .active { color: #f6dc83; border-bottom-color: #d4af37; }
#login a { color: #e8c55a; }
#login a:hover { color: #f6dc83; }
