/* ============================================================
   STAR STABLE MODERNIZED — DESIGN SYSTEM
   Palette:
     --primary:   #7C4DFF  (violet — mystical/horse-game energy)
     --accent:    #E8B84B  (warm gold — star coins)
     --surface:   #16131F  (deep dark)
     --surface2:  #1E1A2E  (card bg)
     --surface3:  #2A2540  (elevated panel)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Cinzel:wght@700;900&display=swap');

/* BASE */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --primary: #7C4DFF;
  --primary-glow: rgba(124,77,255,0.35);
  --accent: #E8B84B;
  --accent-dim: rgba(232,184,75,0.12);
  --surface: #16131F;
  --surface2: #1E1A2E;
  --surface3: #2A2540;
  --border: rgba(124,77,255,0.22);
  --border-accent: rgba(232,184,75,0.3);
  --text: #F0EDF8;
  --muted: #9B95B8;
  --success: #3DD68C;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-md: 0 8px 32px rgba(0,0,0,0.45);
  --shadow-glow: 0 0 40px rgba(124,77,255,0.16);
}

html { scroll-behavior: smooth; }

body {
  background-color: var(--surface);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(124,77,255,0.11) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(232,184,75,0.05) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  margin: 0; padding: 0;
  min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }

/* HERO HEADER */
header {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(to bottom, rgba(22,19,31,0.5) 0%, rgba(22,19,31,0.85) 65%, var(--surface) 100%),
    url('../img/star-stable.jpg') center top / cover no-repeat;
  padding: 48px 0 40px;
  border-bottom: 1px solid var(--border);
}

header .top-logo {
  margin: 0 auto;
  max-width: 420px;
  width: 88%;
  filter: drop-shadow(0 4px 24px rgba(124,77,255,0.45));
}

/* LAYOUT */
.container { max-width: 960px !important; padding: 0 16px; }
section { margin: 28px auto; }

.inside-section {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

/* SECTION HEADINGS */
.section-heading {
  background: linear-gradient(135deg, var(--surface3) 0%, rgba(124,77,255,0.1) 100%);
  border-bottom: 1px solid var(--border);
  padding: 22px 28px 18px;
  text-align: left;
}

.section-heading h1,
.section-heading h2 {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: clamp(1.1rem, 4vw, 1.6rem);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 6px;
  padding: 0;
  text-shadow: 0 0 20px rgba(232,184,75,0.28);
}

.section-heading p {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0; padding: 0;
  line-height: 1.6;
}

/* SECTION CONTENT */
.section-content {
  padding: 28px;
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  position: relative;
}

/* FORMS */
.form-group { margin-bottom: 16px; }

label {
  display: block !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  color: var(--muted) !important;
  margin-bottom: 8px !important;
}

label i.fa { color: var(--primary); margin-right: 6px; font-size: 0.85em; }

.form-control {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  background: rgba(124,77,255,0.07);
  box-shadow: 0 0 0 3px rgba(124,77,255,0.16);
}

.form-control::placeholder { color: rgba(155,149,184,0.45); }

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239B95B8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

select.form-control option { background: var(--surface3); color: var(--text); }

.gen-select {
  background-position: 12px center !important;
  background-size: 20px 20px !important;
  padding-left: 44px !important;
  background-repeat: no-repeat !important;
}

input[type="checkbox"] {
  width: 20px; height: 20px;
  accent-color: var(--primary);
  cursor: pointer; margin-top: 4px;
}

/* BUTTONS */
.connect-button,
.gen-button {
  display: block;
  width: 100%;
  height: 52px;
  padding: 0 24px;
  background: var(--primary);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  outline: none;
  transition: background 0.18s, transform 0.12s, box-shadow 0.18s;
  box-shadow: 0 4px 16px rgba(124,77,255,0.35);
  position: relative;
}

.connect-button:hover, .gen-button:hover {
  background: #9366FF;
  box-shadow: 0 6px 24px rgba(124,77,255,0.5);
  transform: translateY(-1px);
}

.connect-button:active, .gen-button:active { transform: translateY(1px); }
.gen-button i.fa { margin-right: 8px; }

.how-button {
  display: block; width: 100%; height: 48px; padding: 0 24px;
  background: transparent; color: var(--accent);
  font-family: 'Inter', sans-serif; font-size: 0.9rem; font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase;
  border: 1px solid var(--border-accent); border-radius: var(--radius-sm);
  cursor: pointer; outline: none;
  transition: background 0.18s, border-color 0.18s;
}
.how-button:hover { background: var(--accent-dim); border-color: var(--accent); }

.connect-btn-area { margin-top: 8px; }

/* CONNECT AREA */
.account_connect_area { background: transparent !important; position: relative; }
.connected_msg { display: none; position: absolute; left:0; top:0; width:100%; height:100%; z-index:100; }
.connected_msg .overlay {
  position: absolute; background: rgba(22,19,31,0.82);
  border-radius: var(--radius-md); width:100%; height:100%;
  backdrop-filter: blur(4px);
}
.connected_msg .connect_message {
  position: absolute; background: var(--success); border-radius: var(--radius-sm);
  top:50%; left:50%; transform: translate(-50%,-50%);
  padding: 12px 24px; z-index:101; color:#fff;
  font-weight:600; font-size:0.9rem; white-space:nowrap;
  box-shadow: 0 4px 20px rgba(61,214,140,0.4);
}
.connected_msg .connect_message p { margin:0; padding:0; color:#fff; }

/* GENERATOR */
#gen_section .section-content {
  background: transparent !important;
  border: none !important; box-shadow: none !important; text-align: left;
}
#gen_section.inactive { opacity: 0.5; pointer-events: none; }

/* CONSOLE */
.gen-console-area { display: none; }

.loading-spinner {
  margin: 2em auto; font-size: 8px;
  width: 8em; height: 8em; border-radius: 50%;
  border: 0.75em solid rgba(255,255,255,0.1);
  border-left-color: var(--primary);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.gen-loading-msg { text-align:center; color:var(--muted); font-size:0.9rem; font-weight:500; }

.gen-dev-console {
  background: #0D0B14;
  border: 1px solid rgba(124,77,255,0.18);
  border-radius: var(--radius-sm);
  font-family: 'SF Mono','Fira Code','Source Code Pro',monospace;
  font-size: 0.77rem; line-height: 1.7;
  padding: 14px 16px; height: 280px; overflow: hidden;
  color: #C8C2E8; text-align: left; margin: 16px 0;
}
.dev-console-text { margin:0; padding:0; list-style:none; }
.console-green-text  { color: var(--success); }
.console-red-text    { color: #FF6B6B; }
.console-yellow-text { color: var(--accent); }

/* PROGRESS */
.progress {
  background: var(--surface3); border-radius: 100px; height: 8px;
  margin-top: 12px; overflow: hidden;
}
.progress-bar { background: var(--primary); border-radius: 100px; transition: width 0.5s; }
.progress-bar-success { background: var(--success) !important; }

/* LOADING MODAL */
#loading_modal {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 28px; text-align: center;
}
#loading_modal .loading_area p { color: var(--muted); font-size: 0.9rem; }
#loading_modal .loading_area strong { color: var(--text); }
#loading_modal .loader {
  margin: 0 auto 20px; font-size: 8px;
  width: 8em; height: 8em; border-radius: 50%;
  border: 0.75em solid rgba(255,255,255,0.1);
  border-left-color: var(--success);
  animation: spin 0.9s linear infinite;
}

/* GEN MODAL */
#gen_modal {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 28px; text-align: left;
}
#gen_modal .section-heading { border-radius: var(--radius-md) var(--radius-md) 0 0; margin: -28px -28px 24px; }
.generator_finished_area .section-content p { color: var(--muted); font-size: 0.9rem; }
.generator_finished_area img.alignnone {
  display: block; margin: 0 auto; max-width: 240px;
  border-radius: var(--radius-sm); transition: opacity 0.2s; cursor: pointer;
}
.generator_finished_area img.alignnone:hover { opacity: 0.85; }

.badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; background: var(--primary);
  color: #fff; border-radius: 50%; font-size: 0.72rem;
  font-weight: 700; margin-right: 8px; vertical-align: middle;
}

.activate_code {
  display: block; width: 100%; height: 52px;
  background: var(--primary); color: #fff;
  font-family: 'Inter', sans-serif; font-size: 1rem; font-weight: 700;
  letter-spacing: 0.07em; text-transform: uppercase;
  border: none; border-radius: var(--radius-sm);
  cursor: pointer; outline: none;
  transition: background 0.18s, transform 0.12s;
  margin-top: 12px; text-decoration: none; text-align: center;
  line-height: 52px; box-shadow: 0 4px 16px rgba(124,77,255,0.35);
}
.activate_code:hover { background: #9366FF; transform: translateY(-1px); }

.share_btn {
  display: block; width: 100%; height: 52px;
  background: #3B5998; color: #fff;
  font-family: 'Inter', sans-serif; font-size: 1rem; font-weight: 700;
  letter-spacing: 0.07em; text-transform: uppercase;
  border: none; border-radius: var(--radius-sm); cursor: pointer;
  outline: none; margin-top: 10px; text-decoration: none;
  text-align: center; line-height: 52px; transition: background 0.18s;
}
.share_btn:hover { background: #4468ad; }

/* TICKER FEED */
#textChanger {
  background: var(--surface2) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  color: var(--text) !important;
  text-shadow: none !important;
  background-image: none !important;
  padding: 16px 20px !important;
  margin: 8px auto !important;
  max-width: 640px !important;
  min-height: 72px !important; max-height: none !important;
  width: 90% !important;
  font-size: 0.88rem; line-height: 1.6;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
#textChanger b { color: var(--accent); }
#textChanger img { display: inline-block !important; vertical-align: middle; margin: 0 4px; }

table[border="0"] { width: 100%; max-width: 700px; margin: 0 auto !important; padding: 0 !important; }

/* MAGNIFIC */
.white-popup-block {
  background: var(--surface2) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  padding: 32px !important;
  max-width: 560px; margin: 20px auto; color: var(--text);
}
.mfp-bg { background: rgba(13,11,20,0.9) !important; }
.mfp-close { color: var(--muted) !important; font-size: 24px !important; }

/* SWEET ALERT */
.sweet-alert {
  background: var(--surface2) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
}
.sweet-alert h2 { color: var(--text) !important; font-family: 'Inter',sans-serif !important; }
.sweet-alert p { color: var(--muted) !important; }
.sweet-alert button {
  background: var(--primary) !important; border-radius: var(--radius-sm) !important;
  font-family: 'Inter',sans-serif !important; font-weight: 700 !important;
  letter-spacing: 0.05em !important; box-shadow: none !important; border: none !important;
}
.sweet-alert button:hover { background: #9366FF !important; }

/* FOOTER */
footer { border-top: 1px solid var(--border); margin: 40px auto 0; padding: 24px 0; }
footer p { color: var(--muted) !important; font-size: 0.82rem; margin: 0; text-align: center; }

/* RESPONSIVE */
@media (max-width: 767px) {
  body { text-align: left; }
  header { padding: 28px 0 20px; }
  header .top-logo { max-width: 260px; }
  .section-heading { padding: 16px 16px 12px; }
  .section-content { padding: 16px 14px; }
  .col-md-4, .col-md-6, .col-md-12 { width: 100%; float: none; padding: 0; }
  .form-group { margin-bottom: 12px; }
  .form-control { height: 50px; font-size: 1rem; }
  .connect-button, .gen-button { height: 52px; font-size: 1rem; }
  .col-md-offset-1 { margin-left: 0; }
  #textChanger { width: 94% !important; padding: 14px !important; }
  .gen-dev-console { height: 220px; font-size: 0.72rem; }
  section { margin: 14px auto; }
  .inside-section { border-radius: var(--radius-md); }
}
@media (max-width: 480px) {
  .container { padding: 0 10px; }
  .section-heading h1, .section-heading h2 { font-size: 1.05rem; }
}

/* ============================================================
   PATCH: FONT SIZES, SELECT ICONS, SUCCESS ANIMATION
   ============================================================ */

/* 1. BIGGER FONTS EVERYWHERE */
label {
  font-size: 0.95rem !important;
  letter-spacing: 0.04em !important;
}

.form-control {
  font-size: 1.05rem !important;
  height: 52px !important;
}

select.form-control {
  font-size: 1.05rem !important;
}

.section-heading h1,
.section-heading h2 {
  font-size: clamp(1.3rem, 4vw, 1.9rem) !important;
}

.section-heading p {
  font-size: 1rem !important;
}

.gen-loading-msg {
  font-size: 1.1rem !important;
  font-weight: 600 !important;
}

.gen-dev-console {
  font-size: 0.92rem !important;
  line-height: 1.8 !important;
  height: 320px !important;
}

/* Loading modal text */
#loading_modal .loading_area p {
  font-size: 1.05rem !important;
  color: var(--text) !important;
}

/* Connect button */
.connect-button,
.gen-button {
  font-size: 1.05rem !important;
  height: 56px !important;
}

/* Badge */
.badge {
  width: 26px !important; height: 26px !important;
  font-size: 0.85rem !important;
}

/* gen modal p */
.generator_finished_area .section-content p {
  font-size: 1rem !important;
}

/* 2. SELECT RESOURCE ICONS — bigger, vertically centered */
.gen-select {
  padding-left: 52px !important;
  background-size: 26px 26px !important;
  background-position: 12px 50% !important;
}

/* individual icon overrides with size tweak */
#gen_section .section-content .generator-section .gen-select-membership {
  background-image: url("../img/membership.png") !important;
}
#gen_section .section-content .generator-section .gen-select-starcoin {
  background-image: url("../img/starcoin.png") !important;
}
#gen_section .section-content .generator-section .gen-select-jorvik-coins {
  background-image: url("../img/jorvik-coins.png") !important;
}

/* 3. SWEET ALERT — fix broken success icon on dark bg */

/* The ::before/::after masks need to match modal bg, not white */
.sweet-alert .sa-icon.sa-success::before,
.sweet-alert .sa-icon.sa-success::after {
  background: var(--surface2) !important;
}

.sweet-alert .sa-icon.sa-success .sa-fix {
  background-color: var(--surface2) !important;
}

.sweet-alert .sa-icon.sa-success .sa-placeholder {
  border-color: rgba(61, 214, 140, 0.25) !important;
}

/* Replace the default pale green checkmark with our vivid green */
.sweet-alert .sa-icon.sa-success {
  border-color: var(--success) !important;
  border-width: 3px !important;
}

.sweet-alert .sa-icon.sa-success .sa-line {
  background-color: var(--success) !important;
  height: 6px !important;
  border-radius: 3px !important;
}

/* Add a glow ring behind the success icon */
.sweet-alert .sa-icon.sa-success::before {
  box-shadow: none !important;
}

/* Pulse glow animation on success icon */
@keyframes successPulse {
  0%   { box-shadow: 0 0 0 0 rgba(61,214,140,0.55); }
  60%  { box-shadow: 0 0 0 18px rgba(61,214,140,0); }
  100% { box-shadow: 0 0 0 0 rgba(61,214,140,0); }
}

.sweet-alert .sa-icon.sa-success {
  animation: successPulse 1.2s ease-out 0.4s 1 !important;
}

/* Sweet alert title & text bigger */
.sweet-alert h2 {
  font-size: 1.6rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em !important;
}

.sweet-alert p {
  font-size: 1rem !important;
  line-height: 1.55 !important;
}

.sweet-alert button {
  font-size: 1rem !important;
  height: 48px !important;
  padding: 0 32px !important;
  border-radius: var(--radius-sm) !important;
}

/* 4. MOBILE FONT PATCHES */
@media (max-width: 767px) {
  label { font-size: 0.9rem !important; }
  .form-control { font-size: 1rem !important; height: 50px !important; }
  .gen-dev-console { font-size: 0.85rem !important; height: 250px !important; }
  .gen-loading-msg { font-size: 1rem !important; }
  .section-heading p { font-size: 0.95rem !important; }
}

/* ============================================================
   PATCH 2: EVEN CONNECT FORM + BIGGER FONTS
   ============================================================ */

/* ── Global font size increase ── */
body { font-size: 17px !important; }

label {
  font-size: 1rem !important;
  letter-spacing: 0.03em !important;
  margin-bottom: 10px !important;
}

.form-control {
  font-size: 1.1rem !important;
  height: 54px !important;
}

select.form-control { font-size: 1.1rem !important; }

.section-heading h1,
.section-heading h2 {
  font-size: clamp(1.35rem, 4vw, 2rem) !important;
  margin-bottom: 10px !important;
}

.section-heading p { font-size: 1.05rem !important; line-height: 1.65 !important; }

.connect-button, .gen-button {
  font-size: 1.1rem !important;
  height: 58px !important;
  letter-spacing: 0.1em !important;
}

.gen-loading-msg { font-size: 1.15rem !important; }

.gen-dev-console {
  font-size: 0.95rem !important;
  line-height: 1.85 !important;
}

/* ── Connect fields: flex row, perfectly aligned ── */
.connect-fields-row {
  display: flex;
  gap: 20px;
  align-items: flex-end; /* bottom-aligns all fields so inputs are on same baseline */
  margin-bottom: 20px;
}

.connect-field {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.connect-field label {
  margin-bottom: 10px !important;
  white-space: nowrap;
}

/* The toggle column doesn't need to grow as wide */
.connect-field--toggle {
  flex: 0 0 180px;
}

/* ── Custom toggle switch ── */
.toggle-wrap {
  display: flex;
  align-items: center;
  height: 54px; /* match input height */
  gap: 12px;
}

/* Hide native checkbox */
.toggle-input {
  position: absolute !important;
  width: 1px !important; height: 1px !important;
  opacity: 0 !important; pointer-events: none !important;
  margin: 0 !important;
}

.toggle-label {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  cursor: pointer !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  color: var(--muted) !important;
  margin: 0 !important;
  user-select: none;
}

.toggle-track {
  display: inline-flex;
  align-items: center;
  width: 56px;
  height: 30px;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 100px;
  transition: background 0.25s, border-color 0.25s;
  position: relative;
  flex-shrink: 0;
}

.toggle-thumb {
  position: absolute;
  left: 4px;
  width: 22px; height: 22px;
  background: var(--muted);
  border-radius: 50%;
  transition: left 0.25s, background 0.25s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
}

/* Checked state */
.toggle-input:checked + .toggle-label .toggle-track {
  background: var(--primary);
  border-color: var(--primary);
}
.toggle-input:checked + .toggle-label .toggle-thumb {
  left: calc(100% - 26px);
  background: #fff;
}
.toggle-input:checked + .toggle-label .toggle-text {
  color: var(--primary) !important;
}
.toggle-input:checked + .toggle-label .toggle-text::before {
  content: 'ON';
}
/* Default OFF text hidden via ::before trick */
.toggle-text { color: var(--muted); transition: color 0.2s; }
.toggle-input:not(:checked) + .toggle-label .toggle-text { }
.toggle-input:not(:checked) + .toggle-label .toggle-text::before { content: 'OFF'; }
.toggle-text { font-size: 0 !important; } /* hide original text node */
.toggle-text::before { font-size: 1rem; }

/* ── Remove old bootstrap-switch styles from this area ── */
.bootstrap-switch-wrapper,
.bootstrap-switch { display: none !important; }

/* ── Mobile: stack fields ── */
@media (max-width: 767px) {
  .connect-fields-row {
    flex-direction: column;
    gap: 4px;
    align-items: stretch;
  }
  .connect-field--toggle { flex: unset; }
  .toggle-wrap { height: 52px; }
  body { font-size: 16px !important; }
  label { font-size: 0.95rem !important; }
  .form-control { height: 52px !important; font-size: 1rem !important; }
}
