/* ============================================================
   challenges.css -- toast notifications + callsign component
   Loaded on any page that participates in the challenge system.
   ============================================================ */

/* ---------- TOAST ---------- */
.sc-toast {
  position: fixed;
  right: -360px;
  width: 300px;
  background: #1b1f12;
  border: 2px solid #bdb076;
  border-left: 4px solid #e8d090;
  padding: 10px 14px;
  font-family: 'Arcade', monospace;
  color: #e8d090;
  z-index: 99998;
  box-shadow: -4px 4px 20px rgba(0, 0, 0, 0.75);
  transition: right 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  line-height: 1.5;
}

.sc-toast.sc-toast-in {
  right: 16px;
}

.sc-toast.sc-toast-out {
  right: -360px;
  transition: right 0.35s ease-in;
}

.sc-toast-header {
  font-size: 0.58rem;
  color: #bdb076;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.sc-toast-name {
  font-size: 0.82rem;
  color: #e8d090;
}

.sc-toast-reward {
  font-size: 0.65rem;
  color: #a09060;
  margin-top: 2px;
}

/* ---------- CALLSIGN COMPONENT ----------
   Used on the challenges page header and (eventually) game page footers.
   Usage: SiteChallenges.renderCallsign(someElement)
   ---------------------------------------- */
.sc-callsign {
  display: flex;
  align-items: stretch;
  height: 52px;
  gap: 0;
  overflow: hidden;
  max-width: 400px;
}

.sc-emblem {
  width: 52px;
  min-width: 52px;
  height: 52px;
  border: 2px solid #bdb076;
  border-right: none;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.sc-emblem.sc-emblem-empty {
  background: #1a1a14;
}

.sc-emblem-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sc-title {
  flex: 1;
  height: 52px;
  border: 2px solid #bdb076;
  background-color: #2a2f1f;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  padding: 0 14px;
  position: relative;
  overflow: hidden;
}

/* Darken the image so text remains readable */
.sc-title::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  pointer-events: none;
}

.sc-title.sc-title-empty {
  background-image: none !important;
  background-color: #1a1a14;
}

.sc-title-text {
  font-family: 'Arcade', monospace;
  font-size: 0.88rem;
  color: #e8d090;
  letter-spacing: 2px;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.95), 0 0 10px rgba(232, 208, 144, 0.35);
  position: relative;
  z-index: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sc-title-empty .sc-title-text {
  color: #555;
  letter-spacing: 1px;
}

/* ---------- CALLSIGN ANIMATIONS ---------- */

/* Rainbow: hue-cycles the whole title card (bg image + text). Applied to .sc-title. */
@keyframes sc-rainbow {
  0%   { filter: hue-rotate(0deg)   brightness(1.15); }
  100% { filter: hue-rotate(360deg) brightness(1.15); }
}

/* Shimmer: glowing text pulse. Applied to .sc-title-text. */
@keyframes sc-text-shimmer {
  0%, 100% {
    color: #e8d090;
    text-shadow: 0 1px 5px rgba(0,0,0,0.95), 0 0 8px rgba(232,208,144,0.25);
  }
  50% {
    color: #fff8e0;
    text-shadow: 0 1px 4px rgba(0,0,0,0.85), 0 0 18px rgba(255,248,220,0.85), 0 0 36px rgba(232,208,144,0.45);
  }
}

/* Pulse: text breathes in and out. Applied to .sc-title-text. */
@keyframes sc-text-pulse {
  0%, 100% { letter-spacing: 2px; opacity: 1; }
  50%       { letter-spacing: 4px; opacity: 0.88; }
}

/* Container-level rainbow (on .sc-title) */
.sc-fx-rainbow { animation: sc-rainbow 4s linear infinite; }

/* Text-level shimmer/pulse (on .sc-title-text) */
.sc-title-text.sc-fx-shimmer {
  animation: sc-text-shimmer 2.4s ease-in-out infinite;
}
.sc-title-text.sc-fx-pulse {
  display: inline-block;
  animation: sc-text-pulse 2.2s ease-in-out infinite;
}

/* Legacy container classes kept for any direct callers */
.sc-fx-shimmer { animation: sc-text-shimmer 2.4s ease-in-out infinite; }
.sc-fx-pulse   { display: inline-block; animation: sc-text-pulse 2.2s ease-in-out infinite; }
.sc-fx-glow    { filter: drop-shadow(0 0 5px #e8d090); }

/* ---------- FOOTER CALLSIGN (inline, above Prime Clock) ---------- */
#sc-footer-callsign {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 12px 12px;
  border-bottom: 1px solid rgba(189, 176, 118, 0.25);
  margin-bottom: 8px;
}

.sc-footer-link {
  display: block;
  text-decoration: none;
  opacity: 0.88;
  transition: opacity 0.2s, transform 0.15s;
}

.sc-footer-link:hover {
  opacity: 1;
  transform: translateY(-1px);
}

/* Fixed width gives the background image a real canvas to fill */
#sc-footer-callsign .sc-callsign {
  width: 440px;
  max-width: 90vw;
  height: 48px;
}

#sc-footer-callsign .sc-emblem {
  width: 48px;
  min-width: 48px;
  height: 48px;
}

#sc-footer-callsign .sc-title {
  height: 48px;
  overflow: hidden;
}

/* Show the full title text without truncation */
#sc-footer-callsign .sc-title-text {
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

.sc-footer-name {
  font-family: 'Arcade', monospace;
  font-size: 0.6rem;
  color: #a09060;
  letter-spacing: 2px;
  text-align: center;
}

/* ---------- EMBLEM FX (applied to .sc-emblem-img) ---------- */
.sc-emblem-img.sc-fx-glow    { filter: drop-shadow(0 0 8px #e8d090) brightness(1.1); }
.sc-emblem-img.sc-fx-shimmer { animation: sc-text-shimmer 2.4s ease-in-out infinite; }
.sc-emblem-img.sc-fx-rainbow { animation: sc-rainbow 4s linear infinite; }
