/* Spillegrense-oppsett ved innlogging (Tobias-vedtak fre 16.10.2026).
 *
 * Gjenskaper den godkjente mockupen (claude.ai/artifact/5e1ozRqhXNRPm6f6SoMe8T):
 * samme palett som spillepause-popupen og «Ditt spillregnskap» (gradient
 * #571a26→#43121c→#380e17, gull #e8c98a, tekst #fdf6ec), to bokser med store
 * − / + (52 px) og ett gullfarget «Lagre grensene». Tekst ≥ 15 px, trykkflater
 * ≥ 44 px (mange spillere er 50+). `sgo-`-prefiks mot kollisjon. Eksternt fil
 * pga. CSP. z-index 10750: over «Ditt spillregnskap» (10700), under Min konto
 * (10800). Ingen backdrop-filter over Pixi-canvas.
 */

/* ── Tema på terminalen (BIN-4228) ────────────────────────────────────────
 * Som spillregnskap-innslaget: handoffens farger er reserven, temaet vinner
 * bare bak `mk-themed` (hallterminaler). Rødt i feilmeldingen følger ikke temaet. */
:root {
  --sgo-bg: linear-gradient(180deg, #571a26 0%, #43121c 60%, #380e17 100%);
  --sgo-ink: #fdf6ec;
  --sgo-accent: #e8c98a;
  --sgo-on-accent: #43121c;
}
html.mk-themed {
  --sgo-bg: var(--th-screen-bg, linear-gradient(180deg, #571a26 0%, #43121c 60%, #380e17 100%));
  --sgo-ink: var(--th-text, #fdf6ec);
  --sgo-accent: var(--th-accent, #e8c98a);
  --sgo-on-accent: var(--th-on-accent, #43121c);
}

.sgo-root {
  position: fixed;
  inset: 0;
  z-index: 10750;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  color: var(--sgo-ink);
}

.sgo-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(23, 9, 12, 0.9);
}

.sgo-modal {
  position: relative;
  z-index: 1;
  width: 620px;
  max-width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  box-sizing: border-box;
  padding: 36px 40px 28px;
  background: var(--sgo-bg);
  border: 1px solid rgba(232, 201, 138, 0.35);
  border-radius: 24px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
  text-align: center;
}

.sgo-title {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.15;
}

.sgo-lead {
  margin: 10px auto 0;
  max-width: 470px;
  font-size: 18px;
  line-height: 1.5;
  color: rgba(253, 246, 236, 0.85);
}

.sgo-limits {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 24px;
  text-align: left;
}

.sgo-limit {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 12px 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  border-radius: 16px;
  transition: border-color 0.15s, background-color 0.15s;
}

.sgo-limit.is-changed {
  border-color: var(--sgo-accent);
  background: rgba(232, 201, 138, 0.08);
}

.sgo-limit-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.sgo-label {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(253, 246, 236, 0.7);
}

.sgo-tag {
  font-size: 13px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(253, 246, 236, 0.85);
}

.sgo-limit.is-changed .sgo-tag {
  background: var(--sgo-accent);
  color: var(--sgo-on-accent);
}

.sgo-stepper {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 52px;
  align-items: center;
  gap: 6px;
}

.sgo-step {
  width: 52px;
  height: 52px;
  padding: 0 0 3px;
  border-radius: 50%;
  border: 2px solid rgba(232, 201, 138, 0.7);
  background: transparent;
  color: var(--sgo-accent);
  font: 700 28px/1 "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s;
}

.sgo-step:hover:not(:disabled) {
  background: rgba(232, 201, 138, 0.14);
}

.sgo-step:disabled {
  border-color: rgba(255, 255, 255, 0.16);
  color: rgba(253, 246, 236, 0.28);
  cursor: default;
}

.sgo-value {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  cursor: text;
}

.sgo-value input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  max-width: 130px;
  padding: 2px 0;
  border: 0;
  border-bottom: 2px dashed rgba(232, 201, 138, 0.35);
  border-radius: 0;
  background: transparent;
  color: var(--sgo-ink);
  font: 800 30px/1.1 "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.sgo-value input:focus {
  outline: none;
  border-bottom: 2px solid var(--sgo-accent);
}

.sgo-value span {
  font-size: 17px;
  font-weight: 700;
  color: rgba(253, 246, 236, 0.75);
}

.sgo-foot {
  min-height: 20px;
  font-size: 15px;
  text-align: center;
  color: rgba(253, 246, 236, 0.65);
}

.sgo-foot.is-note {
  font-weight: 700;
  color: var(--sgo-accent);
}

.sgo-error {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 157, 143, 0.5);
  background: rgba(255, 120, 105, 0.14);
  color: #ffc4ba;
  font-size: 16px;
}

.sgo-cta {
  display: block;
  width: 100%;
  min-height: 56px;
  margin-top: 20px;
  padding: 16px;
  border: 0;
  border-radius: 999px;
  background: var(--sgo-accent);
  color: var(--sgo-on-accent);
  font: 800 20px/1.2 "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  cursor: pointer;
}

.sgo-cta:disabled {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(253, 246, 236, 0.45);
  cursor: default;
}

.sgo-reset {
  display: block;
  min-height: 44px;
  margin: 8px auto 0;
  padding: 8px 12px;
  border: 0;
  background: none;
  color: var(--sgo-accent);
  font: 700 16px "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.sgo-reset[hidden],
.sgo-error[hidden] {
  display: none;
}

.sgo-cta:focus-visible,
.sgo-step:focus-visible,
.sgo-reset:focus-visible {
  outline: 3px solid var(--sgo-ink);
  outline-offset: 3px;
}

.sgo-helper {
  margin: 10px 0 0;
  font-size: 15px;
  color: rgba(253, 246, 236, 0.65);
}

/* ── Bekreftelsen ──────────────────────────────────────────────────────── */

.sgo-done-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  border: 2px solid #8fd3a0;
  border-radius: 18px;
  position: relative;
}

.sgo-done-icon::after {
  content: "";
  position: absolute;
  left: 22px;
  top: 14px;
  width: 14px;
  height: 26px;
  border: solid #8fd3a0;
  border-width: 0 4px 4px 0;
  transform: rotate(45deg);
}

.sgo-summary {
  max-width: 400px;
  margin: 22px auto 0;
  padding: 6px 18px;
  border: 1px solid rgba(232, 201, 138, 0.4);
  border-radius: 14px;
  background: rgba(232, 201, 138, 0.08);
  text-align: left;
}

.sgo-summary div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 0;
  font-size: 17px;
}

.sgo-summary div + div {
  border-top: 1px solid rgba(232, 201, 138, 0.2);
}

.sgo-summary dt {
  margin: 0;
}

.sgo-summary dd {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  color: var(--sgo-accent);
  font-variant-numeric: tabular-nums;
}

.sgo-done-text {
  margin-top: 18px;
  font-size: 16px;
}

@media (max-width: 600px) {
  .sgo-root {
    padding: 16px 12px;
  }
  .sgo-modal {
    padding: 26px 18px 20px;
    border-radius: 22px;
  }
  .sgo-title {
    font-size: 25px;
  }
  .sgo-lead {
    font-size: 17px;
  }
  .sgo-limits {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 18px;
  }
  .sgo-cta {
    margin-top: 16px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .sgo-modal {
    animation: sgo-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  @keyframes sgo-in {
    from { opacity: 0; transform: translateY(14px) scale(0.98); }
    to { opacity: 1; transform: none; }
  }
}
