/* =======================================================
   WTFIT - styles
   White, clean, Google-flavoured. The big red button is the moment.
   ======================================================= */

:root {
  /* Slightly-off Google palette — nod without copy */
  --g-blue:  #3b78e7;
  --g-red:   #d93b30;
  --g-amber: #f4b73d;
  --g-green: #1ea96c;

  --bg: #ffffff;
  --ink: #202124;          /* near-black, easier on eyes than pure black */
  --ink-soft: #5f6368;
  --rule: #e8eaed;
  --rule-strong: #dadce0;
  --accent: #d93b30;       /* the big red button — same hue as the T in the logo */

  --shadow-soft: 0 1px 2px rgba(60,64,67,0.10), 0 2px 6px rgba(60,64,67,0.10);
  --shadow-button: 0 1px 3px rgba(60,64,67,0.20), 0 4px 12px rgba(60,64,67,0.18);
  --radius: 14px;

  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ----- Screens ----- */
.screen {
  display: none;
  padding: 14px 20px 28px;
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
}
.screen.active { display: block; }

/* ----- Brand ----- */
.brand {
  text-align: center;
  margin: 14px 0 18px;
}
.logo {
  font-family: var(--font-body);
  font-size: 72px;
  font-weight: 700;
  letter-spacing: -0.04em;
  margin: 0;
  line-height: 1;
  user-select: none;
}
.logo-letter {
  display: inline-block;
}
.tagline {
  color: var(--ink);
  margin-top: 10px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ----- Upload ----- */
.upload-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 380px;
  margin: 8px auto 0;
}
.upload-tile {
  background: #ffffff;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-soft);
  transition: border-color 0.2s;
}
.upload-tile.has-image {
  border-color: var(--g-green);
}

.upload-preview {
  position: relative;
  height: 110px;
  background: #f8f9fa;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: height 0.25s ease;
}
.upload-tile.has-image .upload-preview {
  height: 160px;
}
/* Empty-state placeholder: a soft camera-style icon drawn in CSS so we don't
   need an SVG asset. Hidden once an image is uploaded. */
.upload-preview::before {
  content: "";
  width: 56px;
  height: 44px;
  border: 2px solid var(--rule-strong);
  border-radius: 6px;
  position: relative;
  background:
    radial-gradient(circle at 50% 60%, var(--rule-strong) 0 9px, transparent 10px) no-repeat;
}
.upload-tile.has-image .upload-preview::before { display: none; }

.upload-actions {
  display: flex;
  flex-direction: row;
  gap: 8px;
  padding: 12px;
}
.upload-btn {
  flex: 1;
  text-align: center;
  padding: 12px 8px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.08s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  display: block;
  font-family: var(--font-body);
}
.upload-btn:active { transform: scale(0.98); }
.upload-btn.primary {
  background: var(--g-blue);
  color: #ffffff;
}
.upload-btn.primary:hover { background: #2f68d6; }
.upload-btn.secondary {
  background: #ffffff;
  color: var(--g-blue);
  border: 1px solid var(--rule-strong);
}
.upload-btn.secondary:hover { background: #f8f9fa; }

/* ----- The big red emergency button -----
   Circular, bright red, slight gloss, dark bezel ring around it so it reads
   as a physical "smash this" button. Always visible (red even when disabled,
   just dimmed) so it's the focal point of the page.
     - Disabled: 55% opacity, no outer red glow.
     - Enabled:  full saturation, red halo, click-ready.
     - Active:   depresses slightly via transform + deeper inner shadow. */
.judge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 4px 0 0;
}
.judge-btn-circle {
  appearance: none;
  border: 0;
  border-radius: 50%;
  width: 200px;
  height: 200px;
  /* Glossy dome — brighter, redder red. Top-left highlight, bottom shadow. */
  background: radial-gradient(circle at 35% 28%, #ff5c5c 0%, #f50808 50%, #b80000 100%);
  color: #000000;
  font-family: var(--font-body);
  font-weight: 900;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: not-allowed;
  opacity: 0.55;
  transition: opacity 0.25s ease, transform 0.08s ease, box-shadow 0.25s ease;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: -0.01em;
  padding: 18px 16px 14px;
  /* Layered shadows: thinner bezel ring + drop + inner highlight + inner shadow */
  box-shadow:
    0 0 0 5px #2a0000,
    0 8px 16px rgba(0,0,0,0.18),
    inset 0 -10px 16px rgba(0,0,0,0.30),
    inset 0 8px 14px rgba(255,255,255,0.20);
}
.judge-btn-circle:not(:disabled) {
  opacity: 1;
  cursor: pointer;
  box-shadow:
    0 0 0 5px #2a0000,
    0 12px 32px rgba(245, 8, 8, 0.50),
    0 8px 16px rgba(0,0,0,0.22),
    inset 0 -10px 16px rgba(0,0,0,0.30),
    inset 0 8px 14px rgba(255,255,255,0.24);
}
.judge-btn-circle:active:not(:disabled) {
  transform: scale(0.97) translateY(2px);
  box-shadow:
    0 0 0 5px #2a0000,
    0 4px 10px rgba(245, 8, 8, 0.35),
    0 4px 10px rgba(0,0,0,0.20),
    inset 0 6px 16px rgba(0,0,0,0.45),
    inset 0 -2px 6px rgba(255,255,255,0.08);
}
/* Stacked words inside the button: What / the / fuck / ?
   All equal-sized, black, heavy weight — reads like a stencilled warning. */
.jb-line {
  display: block;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.jb-q {
  display: block;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.1;
  margin-top: 2px;
}
.judge-hint {
  margin: 0;
  font-size: 13px;
  font-style: italic;
  color: var(--ink-soft);
  text-align: center;
  transition: opacity 0.25s ease;
}
/* Hint disappears once the button is armed. :has() lets us do this without JS. */
.judge-wrap:has(.judge-btn-circle:not(:disabled)) .judge-hint {
  opacity: 0;
}

.fineprint {
  font-size: 11px;
  color: var(--ink-soft);
  text-align: center;
  margin-top: 14px;
}

/* ----- Loading ----- */
.loading-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  text-align: center;
  gap: 24px;
}
.loading-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--rule);
  border-top-color: var(--g-blue);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text {
  font-size: 16px;
  color: var(--ink-soft);
}

/* ----- Result ----- */
.result-photo-wrap {
  display: flex;
  justify-content: center;
  margin: 0 0 28px;
}
.result-photo {
  max-width: 100%;
  width: 320px;
  height: auto;
  max-height: 360px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow-soft);
}

.verdict-line {
  font-family: var(--font-body);
  font-size: 28px;
  line-height: 1.3;
  font-weight: 600;
  text-align: center;
  margin: 0 0 24px;
  padding: 0 4px;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
}

/* ----- Generic CTA (used on result and error screens) ----- */
.cta {
  appearance: none;
  border: 0;
  background: var(--g-blue);
  color: #ffffff;
  padding: 14px 20px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.08s ease;
  display: inline-block;
  width: 100%;
  -webkit-tap-highlight-color: transparent;
}
.cta:active { transform: scale(0.99); }
.cta.primary { background: var(--g-blue); color: #ffffff; }
.cta.primary:hover { background: #2f68d6; }

/* ----- Error ----- */
h2 {
  font-size: 22px;
  font-weight: 600;
  margin: 40px 0 16px;
  text-align: center;
}
.error-text {
  text-align: center;
  margin: 0 auto 24px;
  max-width: 400px;
  color: var(--ink-soft);
}

/* ----- Tablet up ----- */
@media (min-width: 600px) {
  .logo { font-size: 96px; }
  .tagline { font-size: 28px; }
  .verdict-line { font-size: 32px; }
  .judge-btn-circle { width: 240px; height: 240px; }
  .jb-line, .jb-q { font-size: 28px; }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .loading-spinner { animation-duration: 1.4s; }
  .upload-preview { transition: none; }
}
