:root {
  color-scheme: light;
  --bg: #f7f9fc;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #667085;
  --line: #d9e2ec;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #dc2626;
  --success: #047857;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 32rem),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
}

button,
input {
  font: inherit;
}

.center-layout {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 40px 20px;
}

.app-layout {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 44px 20px;
}

.panel {
  width: min(480px, 100%);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 24px 70px rgba(31, 41, 55, 0.12);
}

.panel-small {
  width: min(560px, 100%);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.18;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: 0;
}

.lead {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.form {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

.field {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.field input {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #ffffff;
  outline: none;
}

.field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #ffffff;
  background: var(--primary);
  font-weight: 800;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.button.secondary {
  border-color: var(--line);
  color: var(--text);
  background: #ffffff;
}

.button.secondary:hover {
  background: #f8fafc;
}

.message {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.message.error {
  color: var(--danger);
}

.message.success {
  color: var(--success);
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 0;
}

.content-band {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 12px;
}

.metric {
  min-height: 120px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.metric span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 20px;
}

.omikuji-panel {
  display: grid;
  gap: 18px;
  margin-top: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.omikuji-panel .button {
  justify-self: start;
}

.omikuji-result {
  min-height: 84px;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #f8fafc;
  font-size: 16px;
  line-height: 1.8;
  white-space: pre-wrap;
}

.omikuji-result.error {
  border-color: rgba(220, 38, 38, 0.28);
  color: var(--danger);
  background: #fef2f2;
}

.omikuji-result.success {
  border-color: rgba(4, 120, 87, 0.24);
  color: var(--text);
  background: #f0fdf4;
}

@media (max-width: 720px) {
  .panel {
    padding: 26px;
  }

  h1 {
    font-size: 28px;
  }

  .topbar {
    flex-direction: column;
  }

  .content-band {
    grid-template-columns: 1fr;
  }
}
