:root {
  --bg: #090909;
  --bg-soft: #131313;
  --panel: rgba(17, 17, 17, 0.82);
  --line: rgba(255, 255, 255, 0.1);
  --text: #f6f2e8;
  --muted: rgba(246, 242, 232, 0.66);
  --danger: #ff5f1f;
  --danger-2: #ffb323;
  --accent: #8ee25a;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top, rgba(255, 179, 35, 0.18), transparent 28%),
    radial-gradient(circle at 80% 20%, rgba(255, 95, 31, 0.12), transparent 24%),
    linear-gradient(180deg, #121212 0%, #070707 100%);
  color: var(--text);
  font-family: "Noto Sans KR", sans-serif;
}

body {
  position: relative;
  overflow-x: hidden;
}

.noise {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.016) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.014) 1px, transparent 1px);
  background-size: 3px 3px, 3px 3px;
  pointer-events: none;
  opacity: 0.18;
  mix-blend-mode: soft-light;
}

.page-shell {
  position: relative;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 44px 0 60px;
}

.hero {
  margin-bottom: 28px;
  animation: rise-in 700ms ease-out both;
}

.eyebrow,
.panel-kicker,
.result-label,
.field-label,
.meta-key,
.spin-state,
.control-head {
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--danger-2);
  font-size: 12px;
  font-weight: 700;
}

.hero h1 {
  margin: 0;
  font-family: "Oswald", sans-serif;
  font-size: clamp(3rem, 7vw, 6rem);
  line-height: 0.92;
  text-transform: uppercase;
}

.hero-copy {
  width: min(720px, 100%);
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.layout {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 22px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.control-panel {
  padding: 24px;
  animation: rise-in 900ms ease-out both;
}

.control-head {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--danger-2), var(--danger));
  box-shadow: 0 0 18px rgba(255, 95, 31, 0.75);
}

.field {
  display: block;
  margin-top: 28px;
}

.field-label {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.distance-input-wrap {
  position: relative;
}

.distance-input-wrap input {
  width: 100%;
  padding: 22px 88px 22px 22px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: "Oswald", sans-serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  outline: none;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.distance-input-wrap input:focus {
  border-color: rgba(255, 179, 35, 0.7);
  box-shadow: 0 0 0 6px rgba(255, 179, 35, 0.12);
  transform: translateY(-1px);
}

.unit {
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-family: "Oswald", sans-serif;
  font-size: 28px;
}

.preset-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.chip {
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.chip:hover,
.chip.is-active {
  border-color: rgba(255, 179, 35, 0.65);
  background: rgba(255, 179, 35, 0.14);
  transform: translateY(-1px);
}

.go-button {
  width: 100%;
  margin-top: 30px;
  padding: 18px 22px;
  border: 0;
  border-radius: 22px;
  background:
    linear-gradient(135deg, #ffdd57 0%, #ff8b2b 42%, #ff3d00 100%);
  color: #120d08;
  font-family: "Oswald", sans-serif;
  font-size: 34px;
  cursor: pointer;
  box-shadow:
    0 22px 40px rgba(255, 95, 31, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}

.go-button:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow:
    0 28px 48px rgba(255, 95, 31, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.go-button:active {
  transform: translateY(1px) scale(0.995);
}

.go-button small {
  display: block;
  margin-top: 4px;
  font-family: "Noto Sans KR", sans-serif;
  font-size: 12px;
  letter-spacing: 0.1em;
}

.go-button[disabled] {
  filter: grayscale(0.2);
  cursor: wait;
  opacity: 0.8;
}

.helper-text {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.result-panel {
  padding: 24px;
  min-height: 560px;
  position: relative;
  overflow: hidden;
  animation: rise-in 1100ms ease-out both;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.panel-kicker,
.spin-state {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.spin-state.is-live {
  color: var(--danger-2);
}

.slot-stage {
  position: relative;
  min-height: 280px;
  display: grid;
  place-items: center;
  margin-top: 22px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 26px;
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 95, 31, 0.18), transparent 35%),
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
  overflow: hidden;
}

.slot-flare {
  position: absolute;
  inset: -80px;
  background:
    conic-gradient(from 180deg, transparent 0deg, rgba(255, 179, 35, 0.18) 42deg, transparent 70deg, rgba(255, 95, 31, 0.18) 160deg, transparent 220deg, rgba(142, 226, 90, 0.14) 320deg, transparent 360deg);
  opacity: 0.42;
  animation: spin 16s linear infinite;
}

.slot-grid {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, transparent, black 18%, black 82%, transparent);
  opacity: 0.16;
}

.slot-text {
  position: relative;
  z-index: 1;
  padding: 0 20px;
  text-align: center;
  font-family: "Oswald", sans-serif;
  font-size: clamp(2.4rem, 6vw, 5.5rem);
  line-height: 0.95;
  text-transform: uppercase;
  text-shadow:
    0 0 18px rgba(255, 95, 31, 0.32),
    0 0 42px rgba(255, 179, 35, 0.18);
}

.slot-text.is-spinning {
  animation: pulse 480ms ease-in-out infinite alternate;
}

.result-card {
  margin-top: 22px;
  padding: 20px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(142, 226, 90, 0.08), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(142, 226, 90, 0.18);
  transform-origin: top;
  animation: reveal 400ms ease both;
}

.result-card.is-hidden {
  display: none;
}

.result-main h2 {
  margin: 10px 0 0;
  font-family: "Oswald", sans-serif;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 0.95;
  text-transform: uppercase;
}

.result-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.meta-item {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.meta-key {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.meta-item strong {
  display: block;
  margin-top: 6px;
  font-size: 15px;
  line-height: 1.5;
  word-break: break-word;
}

.result-actions {
  margin-top: 18px;
}

.map-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  background: #f6f2e8;
  color: #111;
  text-decoration: none;
  font-weight: 800;
}

.map-link:hover {
  background: #fff;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  from { transform: scale(1); opacity: 0.82; }
  to { transform: scale(1.02); opacity: 1; }
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .result-panel {
    min-height: 0;
  }

  .result-meta {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 18px, 1180px);
    padding-top: 18px;
    padding-bottom: 36px;
  }

  .control-panel,
  .result-panel {
    padding: 18px;
    border-radius: 22px;
  }

  .slot-stage {
    min-height: 220px;
  }
}
