  /* =========================================================
   Kingdom Connects — buttons.css
   Plasticky buttons + Web 4.0 sheen + responsive layout
   ========================================================= */

/* ---------- Base CTA appearance ---------- */
.action-button, .btn {
  --btn-fg: var(--button-fg);
  --btn-bg-fallback: #f59e0b;
  color: var(--btn-fg);
  display: inline-block;
  font-weight: 800;
  text-align: center;
  border: 0;
  border-radius: 16px;
  padding: 16px 28px;
  font-size: clamp(16px, 1.05rem, 20px);
  cursor: pointer;
  position: relative;
  isolation: isolate;
  text-decoration: none;

  background:
    linear-gradient(180deg, rgba(255,255,255,.35), rgba(255,255,255,0) 45%),
    var(--button-bg, var(--btn-bg-fallback));

  box-shadow:
    0 12px 24px rgba(0,0,0,.35),
    inset 0 -2px 0 rgba(0,0,0,.25),
    inset 0 1px 0 rgba(255,255,255,.45);

  transition: transform .12s ease, filter .15s ease, box-shadow .15s ease;
}

/* Gloss bar */
.action-button::before, .btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg,
    rgba(255,255,255,.65) 0%,
    rgba(255,255,255,.35) 14%,
    rgba(255,255,255,0) 40%);
  mix-blend-mode: screen;
  opacity: .9;
}

/* Sheen swipe */
.action-button::after, .btn::after {
  content: "";
  position: absolute;
  top: -100%;
  left: -30%;
  width: 60%;
  height: 300%;
  transform: rotate(25deg);
  pointer-events: none;
  border-radius: 24px;
  opacity: 0;
  background: linear-gradient(90deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,.45) 45%,
    rgba(255,255,255,.85) 50%,
    rgba(255,255,255,.45) 55%,
    rgba(255,255,255,0) 100%);
  filter: blur(0.5px);
}

/* Hover */
.action-button:hover, .btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.03) saturate(1.02);
  box-shadow:
    0 16px 28px rgba(0,0,0,.4),
    inset 0 -2px 0 rgba(0,0,0,.28),
    inset 0 1px 0 rgba(255,255,255,.55);
}

/* Pressed */
.action-button:active, .btn:active,
.action-button.is-pressed, .btn.is-pressed {
  transform: translateY(2px);
  filter: brightness(.98);
  box-shadow:
    0 6px 14px rgba(0,0,0,.35),
    inset 0 -1px 0 rgba(0,0,0,.35),
    inset 0 3px 8px rgba(0,0,0,.25),
    inset 0 0 0 1px rgba(255,255,255,.18);
}

/* Sheen animation */
.action-button.clicked::after, .btn.clicked::after {
  animation: kc-sheen .6s ease forwards;
  opacity: 1;
}
@keyframes kc-sheen {
  0%   { transform: translateX(0) rotate(25deg); opacity: 0; }
  10%  { opacity: .6; }
  50%  { transform: translateX(240%) rotate(25deg); opacity: .9; }
  100% { transform: translateX(360%) rotate(25deg); opacity: 0; }
}

/* Light theme tweak */
html[data-theme="light"] .action-button, 
html[data-theme="light"] .btn {
  box-shadow:
    0 12px 22px rgba(0,0,0,.18),
    inset 0 -2px 0 rgba(0,0,0,.10),
    inset 0 1px 0 rgba(255,255,255,.75);
}

/* ---------- Button Section Layout ---------- */
.button-section {
  display: grid;
  gap: 18px;
  max-width: 720px;
  margin: 0 auto;
}

.button-section .action-button {
  width: 100%;
  min-height: 58px;
}

/* Mobile full width */
@media (max-width: 720px) {
  .button-section {
    width: 100%;
    max-width: 100%;
    padding: 0;
    gap: 16px;
  }
  
  .button-section .action-button,
  .button-section .btn {
    max-width: 100%;
  }
}
/* CTA blocks: make each button full-width with a solid tap target */
.cta-block .action-button {
  width: 100%;
  min-height: 58px;
}

/* Mobile: All standalone CTA buttons should be full-width for better UX */
@media (max-width: 720px) {
  .action-button, .btn {
    width: 100%;
    max-width: 100%;
    display: block;
  }

  /* Exception: buttons in flex containers (like header actions) */
  .header-actions .action-button,
  .header-actions .btn {
    width: auto;
    display: inline-block;
  }
  
  /* Factoid action buttons: full-width on mobile */
  .factoid-actions .button-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }
  
  .factoid-actions .action-button,
  .factoid-actions .btn {
    width: 100%;
  }
}

/* Extra-small mobile: Reduce button padding to prevent overflow */
@media (max-width: 480px) {
  .action-button, .btn {
    padding: 14px 20px;
    font-size: clamp(14px, 1rem, 18px);
  }
}

/* =========================================================
   GOLD BUTTON VARIANT (works in dark & light themes)
   - Use on: <a class="action-button btn-gold">…</a>
             <button class="btn btn-gold">…</button>
   - Honors your existing sheen/pressed effects (.clicked/.is-pressed)
   ========================================================= */

/* Palette (shared) */
:root{
  --gold-hi:  #FFF4B0;   /* highlight */
  --gold:     #FFD700;   /* classic gold */
  --gold-mid: #DAA520;   /* depth */
  --gold-deep:#B8860B;   /* antique edge */
  --ring-fallback: 0 0 0 3px rgba(59,130,246,.45);
}

/* Text color over gold, by theme */
html[data-theme="dark"]  { --gold-fg: #0b1220; }  /* dark ink on bright gold */
html[data-theme="light"] { --gold-fg: #0b1220; }

/* Base state */
.action-button.btn-gold,
.btn.btn-gold {
  color: var(--gold-fg);
  /* drive your existing button system with these tokens */
  --button-bg: linear-gradient(180deg, var(--gold) 0%, var(--gold-mid) 100%);
  --button-bg-hover: linear-gradient(180deg, var(--gold-hi) 0%, var(--gold) 100%);

  /* immediate background so it also works if your base ignores --button-bg */
  background: var(--button-bg);
  /* slightly crisper inner rim for metallic feel */
  box-shadow:
    0 12px 24px rgba(0,0,0,.35),
    inset 0 -2px 0 rgba(0,0,0,.22),
    inset 0 1px 0 rgba(255,255,255,.55);
}

/* Hover */
.action-button.btn-gold:hover,
.btn.btn-gold:hover {
  background: var(--button-bg-hover);
  filter: brightness(1.04) saturate(1.03);
  transform: translateY(-2px);
  box-shadow:
    0 16px 28px rgba(0,0,0,.40),
    inset 0 -2px 0 rgba(0,0,0,.25),
    inset 0 1px 0 rgba(255,255,255,.65);
}

/* Active / pressed (works alongside your .is-pressed) */
.action-button.btn-gold:active,
.btn.btn-gold:active,
.action-button.btn-gold.is-pressed,
.btn.btn-gold.is-pressed {
  background: linear-gradient(180deg, var(--gold-mid) 0%, var(--gold-deep) 100%);
  transform: translateY(2px);
  filter: brightness(.98);
  box-shadow:
    0 6px 14px rgba(0,0,0,.35),
    inset 0 -1px 0 rgba(0,0,0,.35),
    inset 0 3px 8px rgba(0,0,0,.25),
    inset 0 0 0 1px rgba(255,255,255,.18);
}

/* Focus (keyboard) */
.action-button.btn-gold:focus-visible,
.btn.btn-gold:focus-visible {
  outline: none;
  box-shadow: var(--ring, var(--ring-fallback));
}

/* Disabled */
.action-button.btn-gold[disabled],
.btn.btn-gold[disabled],
.action-button.btn-gold.is-disabled,
.btn.btn-gold.is-disabled {
  opacity: .55;
  cursor: not-allowed;
  filter: grayscale(.1) saturate(.9);
  transform: none;
  box-shadow:
    0 8px 16px rgba(0,0,0,.25),
    inset 0 -1px 0 rgba(0,0,0,.18),
    inset 0 1px 0 rgba(255,255,255,.40);
}
.admin-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: 1rem;
}

/* Secondary button variants */
.btn-secondary {
  --button-bg: linear-gradient(180deg, #6b7280 0%, #4b5563 100%);
  --button-bg-hover: linear-gradient(180deg, #9ca3af 0%, #6b7280 100%);
  background: var(--button-bg);
  color: #ffffff;
}

.btn-secondary:hover {
  background: var(--button-bg-hover);
}

.btn-danger {
  --button-bg: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
  --button-bg-hover: linear-gradient(180deg, #f87171 0%, #ef4444 100%);
  background: var(--button-bg);
  color: #ffffff;
}

.btn-danger:hover {
  background: var(--button-bg-hover);
}

.btn-success {
  --button-bg: linear-gradient(180deg, #10b981 0%, #059669 100%);
  --button-bg-hover: linear-gradient(180deg, #34d399 0%, #10b981 100%);
  background: var(--button-bg);
  color: #ffffff;
}

.btn-success:hover {
  background: var(--button-bg-hover);
}

.btn-warning {
  --button-bg: linear-gradient(180deg, #f4a261 0%, #e76f51 100%);
  --button-bg-hover: linear-gradient(180deg, #f8b88b 0%, #f4a261 100%);
  background: var(--button-bg);
  color: #ffffff;
}

.btn-warning:hover {
  background: var(--button-bg-hover);
}

/* Button row layout */
.button-row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

@media (min-width: 720px) {
  .button-row {
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .button-row > * {
    flex: 1;
    min-width: 200px;
    max-width: 100%;
  }
}

/* Mobile: Ensure button-row children don't overflow */
@media (max-width: 720px) {
  .button-row > * {
    max-width: 100%;
    width: 100%;
  }
}

/* ---------- User Status Badge & Login Button ---------- */
.user-status {
  display: flex;
  align-items: center;
}

.logged-in-badge {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  background: rgba(255, 215, 0, 0.08);
  border-radius: 10px;
  border: 1px solid rgba(255, 215, 0, 0.3);
  white-space: nowrap;
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.login-btn {
  appearance: none;
  border: 0;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--dark-blue);
  background: var(--gold);
  border-radius: 10px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 
    0 2px 8px rgba(255, 215, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.login-btn:hover {
  background: var(--gold-bright);
  transform: translateY(-1px) scale(1.05);
  box-shadow: 
    0 4px 12px rgba(255, 215, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

/* Hide on mobile and tablet to prevent overflow */
@media (max-width: 979px) {
  .user-status {
    display: none;
  }
}

/* Small inline text button */
.btn-text-small {
  appearance: none;
  background: none;
  border: none;
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  margin-left: 0.5rem;
  transition: color 0.2s ease;
}

.btn-text-small:hover {
  color: var(--gold-bright);
  text-decoration: none;
}

.btn-text-small:active {
  color: var(--gold-mid);
}

