:root {
  --bg: #1a1024;
  --shell: #f2c94c;
  --shell-dark: #d4a017;
  --ink: #2a1a12;
  --cream: #fff8e8;
  --pink: #ff6b9d;
  --mint: #5ee0b0;
  --sky: #6ec8ff;
  --muted: #8a7060;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse 70% 50% at 20% 10%, rgba(255, 107, 157, 0.22), transparent 55%),
    radial-gradient(ellipse 60% 45% at 90% 80%, rgba(94, 224, 176, 0.18), transparent 50%),
    linear-gradient(165deg, #241433 0%, #1a1024 45%, #12101c 100%);
  color: var(--cream);
  font-family: "Nunito", system-ui, sans-serif;
  overflow-x: hidden;
}

#app {
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 14px 28px;
  gap: 14px;
}

.top {
  width: min(440px, 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.back {
  color: var(--mint);
  text-decoration: none;
  font-weight: 800;
  font-size: 0.85rem;
}

.brand {
  font-family: "Fredoka", sans-serif;
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  color: #ffe08a;
}

.mute {
  font: inherit;
  font-weight: 800;
  border: 1px solid rgba(255, 224, 138, 0.35);
  background: rgba(0, 0, 0, 0.25);
  color: var(--cream);
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.device {
  width: min(440px, 100%);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.device-shell {
  background: linear-gradient(160deg, #ffe08a, var(--shell) 40%, var(--shell-dark));
  border-radius: 36px;
  padding: 16px 16px 20px;
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.45),
    inset 0 2px 0 rgba(255, 255, 255, 0.45);
  color: var(--ink);
}

.device-label {
  text-align: center;
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  font-weight: 800;
  opacity: 0.55;
  margin-bottom: 8px;
}

#screen {
  display: block;
  width: 100%;
  height: auto;
  background: #c8f0d8;
  border-radius: 18px;
  border: 4px solid #2a1a12;
  image-rendering: pixelated;
  box-shadow: inset 0 0 0 3px #7ab892;
}

.status-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  margin-top: 12px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.72rem;
  font-weight: 800;
}

.hearts {
  display: flex;
  gap: 3px;
  letter-spacing: 0;
  font-size: 0.95rem;
  line-height: 1;
}

.banner {
  margin-top: 10px;
  text-align: center;
  font-family: "Fredoka", sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
}

.meta {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  opacity: 0.7;
  margin-top: 4px;
}

.actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.actions button,
.angel-panel button,
.create-actions button {
  font-family: inherit;
  font-weight: 800;
  border: none;
  border-radius: 14px;
  padding: 12px 10px;
  cursor: pointer;
  background: rgba(255, 248, 232, 0.12);
  color: var(--cream);
  border: 1px solid rgba(255, 248, 232, 0.18);
}

.actions button:hover,
.angel-panel button:hover {
  background: rgba(94, 224, 176, 0.22);
  border-color: var(--mint);
}

.actions button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.primary {
  background: linear-gradient(180deg, #ff8ab8, var(--pink)) !important;
  border: none !important;
  color: #fff !important;
  box-shadow: 0 8px 20px rgba(255, 107, 157, 0.35);
}

.ghost {
  background: transparent !important;
}

.angel-panel {
  text-align: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.angel-panel p {
  margin-bottom: 12px;
  line-height: 1.45;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 16px;
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(255, 107, 157, 0.25), transparent 60%),
    rgba(12, 8, 18, 0.92);
  overflow: auto;
}

.overlay.hidden { display: none; }

.panel.create {
  width: min(460px, 100%);
  background: linear-gradient(165deg, #2a1a38, #1c1228);
  border: 1px solid rgba(255, 224, 138, 0.25);
  border-radius: 24px;
  padding: 22px 18px 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #ffe08a;
  font-weight: 800;
}

h1 {
  font-family: "Fredoka", sans-serif;
  font-size: clamp(2rem, 8vw, 2.8rem);
  margin: 4px 0 8px;
  color: #fff;
}

.tag {
  color: rgba(255, 248, 232, 0.78);
  line-height: 1.45;
  margin-bottom: 12px;
}

.rules {
  list-style: none;
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
  font-size: 0.88rem;
  color: rgba(255, 248, 232, 0.85);
}

.rules li {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.field span {
  font-size: 0.8rem;
  font-weight: 800;
  color: #ffe08a;
}

.field input {
  font: inherit;
  font-weight: 700;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 224, 138, 0.3);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
}

.pick-title {
  font-weight: 800;
  margin-bottom: 8px;
  color: #ffe08a;
}

.animal-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.animal-card {
  appearance: none;
  border: 2px solid transparent;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 14px;
  padding: 8px 4px;
  cursor: pointer;
  color: #fff;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 800;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.animal-card .emoji {
  font-size: 1.55rem;
  line-height: 1;
}

.animal-card.active {
  border-color: var(--pink);
  background: rgba(255, 107, 157, 0.2);
  box-shadow: 0 0 0 2px rgba(255, 107, 157, 0.25);
}

.create-actions {
  display: grid;
  gap: 8px;
}

.create-actions button {
  padding: 14px;
  font-size: 1rem;
}

.resume-block {
  text-align: center;
  margin: 8px 0 6px;
  padding: 16px 12px 8px;
  border-radius: 18px;
  background: rgba(255, 107, 157, 0.12);
  border: 1px solid rgba(255, 107, 157, 0.35);
}

.resume-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 800;
  color: #ff8ab8;
  margin-bottom: 6px;
}

.resume-desc {
  font-family: "Fredoka", sans-serif;
  font-size: 1.15rem;
  margin-bottom: 14px;
  color: #fff;
}

.resume-btn {
  width: 100%;
  padding: 16px 14px !important;
  font-size: 1.15rem !important;
  margin-bottom: 10px;
}

.linkish {
  width: 100%;
  font-size: 0.85rem !important;
  opacity: 0.85;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.new-block.collapsed {
  display: none;
}

.back-line {
  text-align: center;
  margin-top: 14px;
}

.back-line a {
  color: var(--mint);
  font-weight: 800;
  text-decoration: none;
}

#toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 50;
  background: rgba(20, 12, 28, 0.92);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 224, 138, 0.35);
  font-weight: 800;
  max-width: 90vw;
}

#toast[hidden] { display: none; }

@media (max-width: 420px) {
  .animal-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
  }
  .animal-card {
    font-size: 0.58rem;
    padding: 6px 2px;
  }
}
