:root {
  --bg: #10131a;
  --panel: #1a1f2b;
  --panel-border: #2a3040;
  --text: #eef1f6;
  --text-muted: #97a1b3;
  --accent: #ff7a4d;
  --accent-hover: #ff9068;
  --accent-text: #1a0e08;
  --radius: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

/* Author `display` rules (e.g. .reel { display: flex }) otherwise beat the
   UA stylesheet's [hidden] { display: none }, since author-origin rules
   always win over UA-origin rules at equal specificity. Force it back. */
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #1c2231 0%, var(--bg) 60%);
  color: var(--text);
  display: flex;
  justify-content: center;
  padding: 32px 16px 64px;
}

.page {
  width: 100%;
  max-width: 640px;
}

.page__header {
  text-align: center;
  margin-bottom: 28px;
}

.page__header h1 {
  font-size: 1.8rem;
  margin: 0 0 6px;
}

.subtitle {
  color: var(--text-muted);
  margin: 0;
}

.filters {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}

.filters__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.field select {
  background: #10131a;
  color: var(--text);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 0.95rem;
}

.field--checkbox {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.field--checkbox input {
  width: 18px;
  height: 18px;
}

.spin-btn {
  width: 100%;
  background: var(--accent);
  color: var(--accent-text);
  border: none;
  border-radius: 10px;
  padding: 14px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}

.spin-btn:hover { background: var(--accent-hover); }
.spin-btn:active { transform: scale(0.98); }
.spin-btn:disabled { opacity: 0.6; cursor: wait; }

.spin-btn--secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  margin-top: 16px;
}
.spin-btn--secondary:hover { background: rgba(255, 122, 77, 0.1); }

.result-wrap { text-align: center; }

.reel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 32px 20px;
  margin-bottom: 20px;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reel__text {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-muted);
}

.reel--spinning .reel__text {
  animation: reel-flicker 0.12s linear infinite;
}

@keyframes reel-flicker {
  0%   { opacity: 0.4; transform: translateY(-2px); }
  50%  { opacity: 1;   transform: translateY(2px); }
  100% { opacity: 0.4; transform: translateY(-2px); }
}

.result {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: left;
  animation: reveal 0.35s ease;
}

@keyframes reveal {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.result h2 {
  margin: 0 0 8px;
  font-size: 1.4rem;
}

.result__description {
  color: var(--text-muted);
  margin: 0 0 16px;
  line-height: 1.5;
}

.result__meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 12px;
  margin: 0 0 12px;
}

.result__meta dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.result__meta dd {
  margin: 0;
  font-weight: 600;
}

.result__suburb {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 4px;
}

.result__link {
  display: inline-block;
  margin-top: 10px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.result__link:hover { text-decoration: underline; }

.result-error {
  background: var(--panel);
  border: 1px solid #5a2f2f;
  color: #ff9d9d;
  border-radius: var(--radius);
  padding: 18px;
}

.page__footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 40px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f5f8;
    --panel: #ffffff;
    --panel-border: #e2e5ec;
    --text: #1a1f2b;
    --text-muted: #5c6478;
    --accent-text: #1a0e08;
  }
}
