/*
 * static/css/solve-ux.css — styling for the flag-submit result line and
 * the achievement toast stack.
 *
 * Colors lean on the existing dark palette. Tweak the variables at the
 * top of each section to retheme without touching individual selectors.
 */

/* ── Inline flag result ────────────────────────────────────────────────── */

.flag-result {
  display: inline-block;
  margin-left: 0.75rem;
  font-size: 0.95rem;
  line-height: 1.3;
  vertical-align: middle;
  min-height: 1.2em;
}
.flag-result--pending { color: #aaa; font-style: italic; }
.flag-result--info    { color: #9cf; }
.flag-result--warn    { color: #fc0; }
.flag-result--win     { color: #0c0; }
.flag-result--fail    { color: #f66; }
.flag-result--error   { color: #f88; }

.flag-result-firstblood {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0 0.4rem;
  background: #800;
  color: #fff;
  border-radius: 0.25rem;
  font-size: 0.85em;
  letter-spacing: 0.05em;
  font-weight: bold;
}

/* ── Toast container + stack ───────────────────────────────────────────── */

.poctf-toast-container {
  position: fixed;
  bottom: 1rem;
  right:  1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 9999;
  max-width: min(380px, 92vw);
  pointer-events: none; /* container ignores clicks; children re-enable */
}

.poctf-toast {
  pointer-events: auto;
  background: #1b1b1f;
  color: #eaeaea;
  border: 1px solid #444;
  border-radius: 0.4rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  font-size: 0.93rem;
  line-height: 1.35;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.poctf-toast--in {
  opacity: 1;
  transform: translateY(0);
}
.poctf-toast--dismissing {
  opacity: 0;
  transform: translateY(6px);
}

/* Plain toast kinds */
.poctf-toast--info  { border-color: #2a8; }
.poctf-toast--warn  { border-color: #c80; }
.poctf-toast--error { border-color: #c33; }

/* Achievement toast — richer card */
.poctf-toast--achievement {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 0.7rem;
  align-items: start;
  border-color: #a90;
  background: linear-gradient(180deg, #1b1b1f 0%, #1a1610 100%);
}

.poctf-toast-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 0.3rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid #555;
}
.poctf-toast-icon img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.poctf-toast-body { min-width: 0; }

.poctf-toast-eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #d9a200;
  margin-bottom: 0.1rem;
}
.poctf-toast-title {
  font-weight: bold;
  font-size: 1rem;
  margin-bottom: 0.15rem;
}
.poctf-toast-desc {
  opacity: 0.85;
  font-size: 0.88rem;
  margin-bottom: 0.2rem;
}
.poctf-toast-footer {
  font-size: 0.75rem;
  opacity: 0.7;
  margin-top: 0.2rem;
}

/* ── Post-solve rating toast ──────────────────────────────────────────── */

.poctf-toast--rating {
  border-color: #6a8;
  background: linear-gradient(180deg, #1b1b1f 0%, #161a17 100%);
  cursor: default;             /* override the default clickable cursor */
}
.poctf-toast--rating .poctf-toast-eyebrow { color: #7dd0a5; }

.poctf-rating-stars {
  display: flex;
  gap: 0.15rem;
  margin: 0.5rem 0 0.25rem 0;
}
.poctf-rating-star {
  background: transparent;
  border: 0;
  color: #555;
  font-size: 1.6rem;
  line-height: 1;
  padding: 0 0.15rem;
  cursor: pointer;
  transition: color 0.12s ease, transform 0.12s ease;
}
.poctf-rating-star:hover,
.poctf-rating-star:focus-visible {
  color: #ffcb47;
  transform: translateY(-1px);
  outline: none;
}
.poctf-rating-star.is-active {
  color: #ffcb47;
}
.poctf-rating-skip {
  color: #aaa;
  text-decoration: underline;
  font-size: 0.78rem;
}
.poctf-rating-skip:hover { color: #ddd; }

/* ── Scoreboard speculative range bar ─────────────────────────────────── */
/* Solid bar = finalized points.                                          */
/* Dotted extension = guaranteed minimum from pending solves (×p_min).    */
/* Candle / bracket = remaining upside to maximum (×p_max).               */

.sb-range-cell {
  vertical-align: middle;
}

.sb-range {
  position: relative;
  height: 14px;
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: visible;   /* candle endpoint may stick over the right edge */
}

.sb-range-solid {
  position: absolute;
  top: 0;
  bottom: 0;
  background: #5db075;
  border-radius: 2px 0 0 2px;
}

.sb-range-dotted {
  position: absolute;
  top: 1px;
  bottom: 1px;
  background-image: repeating-linear-gradient(
    90deg,
    #5db075 0 3px,
    transparent 3px 6px
  );
  opacity: 0.85;
}

.sb-range-candle {
  position: absolute;
  top: 4px;
  bottom: 4px;
  border-top:    1px solid rgba(217, 162, 0, 0.85);
  border-right:  1px solid rgba(217, 162, 0, 0.85);
  border-bottom: 1px solid rgba(217, 162, 0, 0.85);
  /* No left border — it visually attaches to the dotted segment. */
  background: rgba(217, 162, 0, 0.10);
}

.sb-pending {
  color: #d9a200;
  font-weight: bold;
}
