:root {
  --bg-1: #0f172a;
  --bg-2: #1e293b;
  --card: rgba(10, 14, 30, 0.88);
  --line: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --ok: #22c55e;
  --error: #f97316;
  --accent: #f59e0b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 20%, #1d4ed8 0%, transparent 35%),
    radial-gradient(circle at 80% 0%, #b91c1c 0%, transparent 30%),
    linear-gradient(130deg, var(--bg-1), var(--bg-2));
}

.page {
  width: min(960px, 96vw);
  margin: 30px auto;
  display: grid;
  gap: 16px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  padding: 20px;
  backdrop-filter: blur(8px);
}

h1,
h2,
h3 {
  margin-top: 0;
}

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

.input-group {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.row {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
}

label {
  color: #cbd5e1;
  font-size: 14px;
}

input,
textarea {
  width: 100%;
  border: 1px solid #475569;
  border-radius: 8px;
  background: #0b1121;
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
}

textarea {
  resize: vertical;
}

button {
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #1f2937;
  font-weight: 700;
  padding: 10px 14px;
  cursor: pointer;
}

button.ghost {
  background: #1f2937;
  color: var(--text);
  border: 1px solid #334155;
}

button:hover {
  filter: brightness(1.1);
}

.hidden {
  display: none;
}

.status {
  min-height: 20px;
  color: var(--muted);
  margin: 8px 0 0;
}

.status.error {
  color: var(--error);
}

.status.ok {
  color: var(--ok);
}

.app-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.result pre {
  border: 1px solid #334155;
  border-radius: 10px;
  background: #020617;
  color: #cbd5e1;
  padding: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.mascot-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 16px;
  animation: float 2.5s ease-in-out infinite;
}

.mascot-face {
  width: 84px;
  height: 84px;
  background: #0b0f1d;
  border: 3px solid #f8fafc;
  position: relative;
  border-radius: 10px;
  box-shadow: 0 0 0 4px #7f1d1d;
}

.ear {
  position: absolute;
  width: 20px;
  height: 20px;
  background: #0b0f1d;
  border: 3px solid #f8fafc;
  top: -14px;
}

.ear-l {
  left: 6px;
  transform: rotate(-20deg);
}

.ear-r {
  right: 6px;
  transform: rotate(20deg);
}

.eye {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 2px;
  background: #facc15;
  top: 28px;
}

.eye-l {
  left: 16px;
}

.eye-r {
  right: 16px;
}

.nose {
  width: 10px;
  height: 8px;
  background: #fb7185;
  position: absolute;
  left: calc(50% - 5px);
  top: 48px;
}

.mouth {
  width: 26px;
  height: 6px;
  border-bottom: 3px solid #f8fafc;
  position: absolute;
  left: calc(50% - 13px);
  top: 58px;
}

.mascot-wrap.success .eye-r {
  height: 3px;
  top: 34px;
}

.mascot-wrap.success {
  animation: jump 0.6s ease;
}

.mascot-wrap.error {
  animation: shake 0.5s ease;
}

.mascot-wrap.copy {
  animation: pulse 0.5s ease;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

@keyframes jump {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-6px);
  }
  75% {
    transform: translateX(6px);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

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