/* ============================================================
   swipe-writing.css — hudsoncw.com / Kafkeclitus
   Silkscreen  → YAY / NAY / LATER reactions only
   Pixelify Sans → all other UI chrome + titles
   DotGothic16   → card body + info text (anything read in quantity)
   ============================================================ */

#sw-app {
  --sw-cream:  #f5f0e8;
  --sw-dim:    rgba(245, 240, 232, 0.42);
  --sw-border: rgba(245, 240, 232, 0.14);
  --sw-gold:   #f0c040;
  --sw-red:    #e03030;
  --sw-green:  #38d050;
  --sw-panel:  rgba(6, 8, 22, 0.72);
}

body.page-template-page-swipe-writing {
  background: #050912 !important;
}

/* WP nav / header sits above everything */
body.page-template-page-swipe-writing #masthead,
body.page-template-page-swipe-writing .site-header,
body.page-template-page-swipe-writing nav.navbar,
body.page-template-page-swipe-writing .navbar {
  position: relative !important;
  z-index: 200 !important;
}

#sw-app * { box-sizing: border-box; }
#sw-app p, #sw-app h3 { margin: 0; }

/* ── Wrap ── */
#sw-app .sw-wrap {
  min-height: 100vh;
  background: transparent;
  font-family: "Pixelify Sans", monospace !important;
  position: relative;
  z-index: 1;
}

#sw-app .sw-inner {
  max-width: 440px;
  margin: 0 auto;
  padding: 0 22px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Toast — Silkscreen (it's a reaction word) ── */
#sw-app .sw-toast {
  display: none;
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 2px;
  padding: 5px 16px;
  font-family: "Silkscreen", monospace !important;
  font-size: 11px;
  letter-spacing: 1px;
  z-index: 9999;
  pointer-events: none;
  border: 2px solid transparent;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.6);
  animation: sw-pop .18s cubic-bezier(.22,1,.36,1);
  white-space: nowrap;
}

/* ── Header ── */
#sw-app .sw-header {
  padding-top: clamp(28px, 5vh, 52px);
  padding-bottom: 4px;
  position: relative;
  z-index: 2;
}

#sw-app .sw-title-block { margin-bottom: 20px; }

#sw-app .sw-title-light {
  font-family: "Pixelify Sans", monospace !important;
  font-size: clamp(22px, 5.5vw, 32px);
  font-weight: 400;
  color: var(--sw-dim);
  letter-spacing: 0.5px;
  line-height: 1.1;
}

#sw-app .sw-title-bold {
  font-family: "Pixelify Sans", monospace !important;
  font-size: clamp(26px, 6.5vw, 38px);
  font-weight: 700;
  color: var(--sw-cream);
  letter-spacing: 0.5px;
  line-height: 1.1;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.55);
}

/* ── Controls ── */
#sw-app .sw-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

#sw-app .sw-btn {
  border: 2px solid var(--sw-border);
  cursor: pointer;
  font-family: "Pixelify Sans", monospace !important;
  border-radius: 2px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1;
  transition: box-shadow .1s, transform .1s;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.55);
}
#sw-app .sw-btn:active {
  box-shadow: 1px 1px 0 rgba(0,0,0,0.55);
  transform: translate(2px, 2px);
}

#sw-app .sw-btn-play {
  background: rgba(6,8,22,0.8);
  color: var(--sw-gold);
  border-color: var(--sw-gold);
  box-shadow: 3px 3px 0 rgba(0,0,0,0.65);
}

#sw-app .sw-btn-info {
  background: rgba(6,8,22,0.7);
  color: var(--sw-dim);
  border-color: var(--sw-border);
  padding: 7px 11px;
}
#sw-app .sw-btn-info.active {
  color: var(--sw-gold);
  border-color: var(--sw-gold);
  background: rgba(240,192,64,0.08);
}

#sw-app .sw-btn-rum {
  margin-left: auto;
  background: rgba(6,8,22,0.7);
  color: var(--sw-dim);
  border-color: var(--sw-border);
}
#sw-app .sw-btn-rum.active {
  background: rgba(240,192,64,0.1);
  color: var(--sw-gold);
  border-color: var(--sw-gold);
}

/* ── Info panel ── */
#sw-app .sw-info-panel {
  margin: 14px 0 6px;
  background: var(--sw-panel);
  border: 2px solid var(--sw-border);
  border-radius: 2px;
  padding: 16px 18px;
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.05),
    4px 4px 0 rgba(0,0,0,0.5);
}

#sw-app .sw-info-row {
  margin-bottom: 14px;
}
#sw-app .sw-info-row:last-child { margin-bottom: 0; }

#sw-app .sw-info-label {
  font-family: "Pixelify Sans", monospace !important;
  font-size: 11px;
  font-weight: 700;
  color: var(--sw-gold);
  letter-spacing: 0.5px;
  margin-bottom: 5px;
  line-height: 1;
}

#sw-app .sw-info-text {
  font-family: "DotGothic16", monospace !important;
  font-size: 16px;
  color: rgba(245,240,232,0.62);
  line-height: 1.5;
  letter-spacing: 0.2px;
}

/* ── Body ── */
#sw-app .sw-body {
  flex: 1;
  padding-bottom: 40px;
  position: relative;
  z-index: 1;
}

/* ── Idle ── */
#sw-app .sw-idle { padding-top: 24px; }

#sw-app .sw-stack-preview {
  position: relative;
  height: clamp(360px, 58vh, 510px);
}

#sw-app .sw-sp-layer {
  position: absolute;
  inset: 0;
  border-radius: 4px;
  transform-origin: 50% 110%;
  border: 2px solid rgba(245,240,232,0.08);
}

#sw-app .sw-idle-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 14px;
}

#sw-app .sw-idle-icon {
  font-family: "Pixelify Sans", monospace !important;
  font-size: 22px;
  font-weight: 700;
  color: rgba(245,240,232,0.16);
  line-height: 1;
}

#sw-app .sw-idle-msg {
  font-family: "Pixelify Sans", monospace !important;
  font-size: 20px;
  font-weight: 400;
  color: rgba(245,240,232,0.35);
  text-align: center;
  line-height: 1.4;
  letter-spacing: 0.3px;
}

#sw-app .sw-idle-hint {
  font-family: "Pixelify Sans", monospace !important;
  font-size: 10px;
  font-weight: 400;
  color: rgba(245,240,232,0.18);
  text-align: center;
  line-height: 1.8;
  letter-spacing: 0.3px;
}

/* ── Done ── */
#sw-app .sw-done { padding-top: 32px; }

#sw-app .sw-done-card {
  background: var(--sw-panel);
  border: 2px solid var(--sw-border);
  border-radius: 4px;
  padding: 32px 24px;
  text-align: center;
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.06),
    inset -1px -1px 0 rgba(0,0,0,0.3),
    5px 5px 0 rgba(0,0,0,0.55);
}

#sw-app .sw-done-title {
  font-family: "Pixelify Sans", monospace !important;
  font-size: 32px;
  font-weight: 700;
  color: var(--sw-cream);
  margin-bottom: 10px;
  letter-spacing: 0.5px;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.45);
}

#sw-app .sw-done-stats {
  font-family: "Pixelify Sans", monospace !important;
  font-size: 12px;
  color: var(--sw-dim);
  margin-bottom: 28px;
  line-height: 1.7;
  letter-spacing: 0.3px;
}

#sw-app .sw-done-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
}

#sw-app .sw-btn-solid {
  background: rgba(6,8,22,0.85);
  color: var(--sw-gold);
  border-color: var(--sw-gold);
  box-shadow: 3px 3px 0 rgba(0,0,0,0.6);
  padding: 9px 18px;
}

#sw-app .sw-btn-ghost {
  background: transparent;
  color: var(--sw-dim);
  border-color: var(--sw-border);
  padding: 9px 16px;
}

/* ── Card stack ── */
#sw-app .sw-cards-section { padding-top: 18px; }

#sw-app .sw-cards-meta {
  font-family: "Pixelify Sans", monospace !important;
  font-size: 10px;
  font-weight: 400;
  color: rgba(245,240,232,0.25);
  margin-bottom: 12px;
  letter-spacing: 0.3px;
  line-height: 1.5;
}

#sw-app .sw-card-stack {
  position: relative;
  height: clamp(400px, 63vh, 560px);
}

/* ── Card ── */
#sw-app .sw-card {
  position: absolute;
  inset: 0;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform-origin: 50% 110%;
  transition: transform .42s cubic-bezier(.22,1,.36,1);
  user-select: none;
  -webkit-user-select: none;
  border: 2px solid rgba(245,240,232,0.12);
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.09),
    inset -1px -1px 0 rgba(0,0,0,0.35),
    5px 5px 0 rgba(0,0,0,0.6),
    8px 8px 0 rgba(0,0,0,0.16);
}

#sw-app .sw-card-top { cursor: grab; }
#sw-app .sw-card-top:active { cursor: grabbing; }

#sw-app .sw-card-sheen {
  position: absolute;
  inset: 0;
  border-radius: 4px;
  background: linear-gradient(
    150deg,
    rgba(255,255,255,0.06) 0%,
    rgba(255,255,255,0) 45%
  );
  pointer-events: none;
  z-index: 1;
}

/* Card header */
#sw-app .sw-card-hdr {
  padding: 20px 22px 10px;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

#sw-app .sw-card-byline {
  font-family: "Pixelify Sans", monospace !important;
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(245,240,232,0.28);
  margin-bottom: 7px;
  line-height: 1;
}

#sw-app .sw-card-title {
  font-family: "Pixelify Sans", monospace !important;
  font-size: clamp(18px, 4.5vw, 24px);
  font-weight: 700;
  color: var(--sw-cream);
  line-height: 1.15;
  letter-spacing: 0.3px;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.4);
}

#sw-app .sw-card-rule {
  height: 1px;
  background: rgba(245,240,232,0.09);
  margin: 0 22px;
  flex-shrink: 0;
  z-index: 2;
}

/* Scroll body — DotGothic16 for reading comfort */
#sw-app .sw-card-scroll {
  flex: 1;
  padding: 14px 22px 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 2;
}
#sw-app .sw-card-scroll::-webkit-scrollbar { width: 3px; }
#sw-app .sw-card-scroll::-webkit-scrollbar-thumb {
  background: rgba(245,240,232,0.1);
}

#sw-app .sw-card-scroll p {
  font-family: "DotGothic16", monospace !important;
  font-size: clamp(17px, 3.8vw, 19px);
  line-height: 1.7;
  color: rgba(245,240,232,0.82);
  letter-spacing: 0.2px;
}

/* Footer */
#sw-app .sw-card-foot {
  padding: 0 22px 14px;
  flex-shrink: 0;
  z-index: 2;
}

#sw-app .sw-scroll-lock {
  display: flex;
  align-items: center;
  gap: 10px;
}

#sw-app .sw-prog-track {
  flex: 1;
  height: 4px;
  background: rgba(245,240,232,0.06);
  overflow: hidden;
  border: 1px solid rgba(245,240,232,0.08);
}

#sw-app .sw-prog-fill {
  height: 100%;
  width: 0%;
  background: var(--sw-gold);
  transition: width .15s;
  box-shadow: 0 0 5px rgba(240,192,64,0.45);
}

#sw-app .sw-scroll-lbl {
  font-family: "Pixelify Sans", monospace !important;
  font-size: 9px;
  font-weight: 400;
  color: rgba(245,240,232,0.22);
  letter-spacing: 0.3px;
  white-space: nowrap;
  line-height: 1;
}

/* Swipe hints — Silkscreen for the reaction words */
#sw-app .sw-swipe-hints {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#sw-app .sw-h-nay {
  font-family: "Silkscreen", monospace !important;
  font-size: 8px;
  color: rgba(224,48,48,0.55);
  letter-spacing: 0.5px;
  line-height: 1;
}
#sw-app .sw-h-later {
  font-family: "Silkscreen", monospace !important;
  font-size: 8px;
  color: rgba(245,240,232,0.22);
  letter-spacing: 0.5px;
  line-height: 1;
}
#sw-app .sw-h-yay {
  font-family: "Silkscreen", monospace !important;
  font-size: 8px;
  color: rgba(56,208,80,0.55);
  letter-spacing: 0.5px;
  line-height: 1;
}

/* Swipe overlays — Silkscreen */
#sw-app .sw-ov {
  position: absolute;
  border-radius: 2px;
  padding: 4px 12px;
  font-family: "Silkscreen", monospace !important;
  font-size: 11px;
  letter-spacing: 1.5px;
  pointer-events: none;
  opacity: 0;
  z-index: 5;
  top: 20px;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.5);
}

#sw-app .sw-ov-yay {
  right: 20px;
  background: rgba(56,208,80,0.15);
  border: 2px solid rgba(56,208,80,0.7);
  color: #38d050;
  transform: rotate(-6deg);
}

#sw-app .sw-ov-nay {
  left: 20px;
  background: rgba(224,48,48,0.12);
  border: 2px solid rgba(224,48,48,0.65);
  color: #e03030;
  transform: rotate(6deg);
}

#sw-app .sw-ov-later {
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  background: rgba(245,240,232,0.06);
  border: 2px solid rgba(245,240,232,0.26);
  color: rgba(245,240,232,0.5);
  padding: 4px 16px;
}

/* ── Chart / Scores ── */
#sw-app .sw-chart-wrap { padding-top: 26px; }

#sw-app .sw-chart-card {
  background: var(--sw-panel);
  border: 2px solid var(--sw-border);
  border-radius: 4px;
  padding: 20px 18px;
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.05),
    inset -1px -1px 0 rgba(0,0,0,0.28),
    5px 5px 0 rgba(0,0,0,0.55);
}

#sw-app .sw-chart-hdr {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}

#sw-app .sw-chart-title {
  font-family: "Pixelify Sans", monospace !important;
  font-size: 24px;
  font-weight: 700;
  color: var(--sw-cream);
  margin: 0;
  letter-spacing: 0.5px;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.4);
}

#sw-app .sw-btn-reset {
  background: none;
  border: none;
  font-family: "Pixelify Sans", monospace !important;
  font-size: 10px;
  font-weight: 400;
  color: rgba(245,240,232,0.2);
  cursor: pointer;
  padding: 0;
  letter-spacing: 0.3px;
}

#sw-app .sw-chart-meta {
  font-family: "Pixelify Sans", monospace !important;
  font-size: 10px;
  font-weight: 400;
  color: rgba(245,240,232,0.25);
  margin-bottom: 18px;
  line-height: 1.7;
  letter-spacing: 0.3px;
}

#sw-app .sw-bars {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 8px;
}

#sw-app .sw-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

#sw-app .sw-bar-label {
  font-family: "DotGothic16", monospace !important;
  font-size: 13px;
  color: rgba(245,240,232,0.45);
  width: 130px;
  flex-shrink: 0;
  line-height: 1.2;
}

#sw-app .sw-bar-track {
  flex: 1;
  height: 10px;
  background: rgba(245,240,232,0.04);
  overflow: hidden;
  min-width: 60px;
  border: 1px solid rgba(245,240,232,0.07);
}

#sw-app .sw-bar-fill {
  height: 100%;
  transition: width .4s cubic-bezier(.22,1,.36,1);
  min-width: 3px;
}

#sw-app .sw-bar-val {
  font-family: "Pixelify Sans", monospace !important;
  font-size: 10px;
  font-weight: 700;
  min-width: 36px;
  text-align: right;
  line-height: 1;
}

#sw-app .sw-bar-legend {
  font-family: "Pixelify Sans", monospace !important;
  font-size: 9px;
  font-weight: 400;
  color: rgba(245,240,232,0.16);
  text-align: center;
  margin-top: 8px;
  letter-spacing: 0.3px;
  line-height: 1.7;
}

#sw-app .sw-tbl {
  margin-top: 18px;
  border-top: 1px solid rgba(245,240,232,0.07);
  padding-top: 14px;
}

#sw-app .sw-tbl-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(245,240,232,0.04);
}
#sw-app .sw-tbl-row:last-child { border-bottom: none; }

#sw-app .sw-tbl-rank {
  font-family: "Pixelify Sans", monospace !important;
  font-size: 10px;
  font-weight: 400;
  color: rgba(245,240,232,0.2);
  min-width: 22px;
  line-height: 1;
}

#sw-app .sw-tbl-dot {
  width: 9px;
  height: 9px;
  border-radius: 1px;
  flex-shrink: 0;
  border: 1px solid rgba(245,240,232,0.1);
}

#sw-app .sw-tbl-name {
  font-family: "DotGothic16", monospace !important;
  font-size: 14px;
  color: rgba(245,240,232,0.65);
  flex: 1;
  line-height: 1.2;
}

#sw-app .sw-tbl-score {
  font-family: "Pixelify Sans", monospace !important;
  font-size: 11px;
  font-weight: 700;
  min-width: 38px;
  text-align: right;
  line-height: 1;
}

#sw-app .sw-tbl-time {
  font-family: "Pixelify Sans", monospace !important;
  font-size: 9px;
  font-weight: 400;
  color: rgba(245,240,232,0.16);
  min-width: 28px;
  text-align: right;
  line-height: 1;
}

#sw-app .sw-chart-empty {
  text-align: center;
  padding: 32px 0;
  font-family: "Pixelify Sans", monospace !important;
  font-size: 11px;
  font-weight: 400;
  color: rgba(245,240,232,0.2);
  line-height: 1.8;
  letter-spacing: 0.3px;
}

#sw-app .sw-chart-note {
  font-family: "Pixelify Sans", monospace !important;
  font-size: 9px;
  font-weight: 400;
  color: rgba(245,240,232,0.14);
  text-align: center;
  margin-top: 12px;
  line-height: 1.8;
  letter-spacing: 0.3px;
}

/* ── Keyframes ── */
@keyframes sw-fu {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

@keyframes sw-pop {
  from { opacity: 0; transform: translateX(-50%) scale(.88); }
  to   { opacity: 1; transform: translateX(-50%) scale(1); }
}

#sw-app .sw-fu {
  animation: sw-fu .3s cubic-bezier(.22,1,.36,1);
}