/* PromptHQ.AI — minimal slot */

@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap");

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100vh; }

:root {
  --bg: #FAFAF7;
  --ink: #14130F;
  --muted: #8A8881;
  --rule: #E6E4DD;
  --accent: #D9533C;
  --good: #2F7A55;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

body {
  font-family: var(--mono);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-size: 13px;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

/* ---- TOP ---- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 32px;
}
.brand {
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.01em;
}
.brand-dot { color: var(--accent); }
.brand-sub {
  margin-left: 8px;
  color: var(--muted);
  font-weight: 400;
}
.pulls {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.pulls-num {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-left: 6px;
}

/* ---- STAGE ---- */
.stage {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 56px;
  padding: 24px 56px 64px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  align-items: start;
}

@media (max-width: 880px) {
  .stage { grid-template-columns: 1fr; padding: 16px 24px 48px; gap: 32px; }
}

/* ---- WINNER ---- */
.winner-wrap {
  display: flex;
  flex-direction: column;
  gap: 80px;
  align-items: center;
  text-align: center;
}

.winner {
  position: relative;
  min-height: 360px;
  padding: 32px 0 16px;
  max-width: 720px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.winner-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 24px;
  min-height: 14px;
}
.winner-meta-secret {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
}
.winner-meta-secret.is-good { color: var(--good); }
.dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.winner-anim {
  transition: opacity 0.25s, transform 0.25s, filter 0.25s;
}
.winner-anim.is-spinning {
  opacity: 0;
  transform: translateY(-12px);
  filter: blur(4px);
}

.winner-name {
  margin: 0 0 24px;
  font-family: var(--mono);
  font-weight: 600;
  font-size: clamp(48px, 7vw, 80px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  color: var(--ink);
  text-wrap: balance;
}

.winner-tag {
  margin: 0 auto 22px;
  font-size: 16px;
  line-height: 1.5;
  font-weight: 500;
  color: var(--ink);
  max-width: 56ch;
  text-wrap: pretty;
}

.winner-desc {
  margin: 0 auto 28px;
  font-size: 13px;
  line-height: 1.7;
  color: color-mix(in oklab, var(--ink) 70%, transparent);
  max-width: 60ch;
  text-wrap: pretty;
}

.winner-stamp {
  margin: 14px auto 0;
  font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.7;
  min-height: 14px;
}
.winner-stamp:empty {
  margin: 0;
  min-height: 0;
}

.winner-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 11px;
  color: var(--muted);
}
.winner-foot-label {
  letter-spacing: 0.02em;
}
.meter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.meter-bar {
  display: grid;
  grid-template-columns: repeat(10, 8px);
  gap: 2px;
}
.mseg {
  height: 10px;
  background: var(--rule);
}
.mseg.is-on { background: var(--ink); }
.mseg.is-hot { background: var(--accent); }
.meter-num {
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
}

/* ---- OTHER 4 ---- */
.others {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--rule);
  width: 100%;
  max-width: 880px;
  opacity: 0.55;
  transition: opacity 0.2s;
}
.others:hover { opacity: 1; }
.others.is-spinning {
  opacity: 0;
  transition: opacity 0.25s;
}
.other {
  padding: 18px 16px 18px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-right: 1px solid var(--rule);
  min-width: 0;
}
.other:last-child { border-right: none; padding-right: 0; }
.other:not(:first-child) { padding-left: 16px; }

.other-num {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 4px;
}
.other-name {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 13px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 6px;
}
.other-tag {
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
  text-wrap: pretty;
}

@media (max-width: 720px) {
  .others { grid-template-columns: repeat(2, 1fr); }
  .other:nth-child(2) { border-right: none; }
  .other { border-bottom: 1px solid var(--rule); padding-bottom: 14px; padding-top: 14px; }
  .other:nth-last-child(-n+2) { border-bottom: none; }
}

/* ---- HANDLE ---- */
.handle-rig {
  position: relative;
  width: 80px;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  user-select: none;
  padding-top: 0;
}
.handle-mount {
  width: 10px;
  height: 56px;
  background: var(--ink);
}
.handle-track {
  position: absolute;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 220px;
  background: var(--rule);
  z-index: 1;
}
.handle {
  position: absolute;
  top: 50px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: grab;
  z-index: 3;
  touch-action: none;
}
.handle.is-dragging { cursor: grabbing; }
.handle.is-locked { cursor: not-allowed; opacity: 0.6; }
.handle-arm {
  width: 3px;
  height: 150px;
  background: var(--ink);
}
.handle-knob {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: -2px;
}
.handle-hint {
  position: absolute;
  top: 56px;
  left: -8px;
  transform: translateX(-100%);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}
.handle-hint kbd {
  font-family: var(--mono);
  font-size: 10px;
  padding: 1px 6px;
  border: 1px solid var(--ink);
  border-radius: 3px;
  background: transparent;
  letter-spacing: 0;
}

@media (max-width: 880px) {
  .handle-rig { display: none; }
}

/* ---- PULL TO REFRESH (mobile) ---- */
.pull-refresh { display: none; }
.mobile-hint { display: none; }

@media (max-width: 880px) {
  .pull-refresh {
    display: flex;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 0;
    align-items: flex-end;
    justify-content: center;
    overflow: hidden;
    pointer-events: none;
    z-index: 10;
  }
  .pull-refresh-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 0 12px;
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .pull-refresh-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--rule);
    transition: background 0.15s, transform 0.15s;
  }
  .pull-refresh.is-armed .pull-refresh-dot {
    background: var(--accent);
    transform: scale(1.4);
  }
  .pull-refresh.is-armed .pull-refresh-label::after {
    content: " — release";
    color: var(--accent);
  }

  .mobile-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 24px 0 8px;
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
    pointer-events: none;
  }
}

/* ---- ERROR ---- */
.error {
  max-width: 560px;
  margin: 24px auto 0;
  padding: 18px 22px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}
.error-title {
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}
.error-msg {
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0;
}
