:root {
  --primary: #19c8b9;
  --primary-dark: #11a89b;
  --mint-bg: #e6f9f6;
  --text: #794f27;
  --body: #725d42;
  --muted: #9f927d;
  --border: #c4b89e;
  --border-soft: #e8dcc8;
  --paper: #f8f8f0;
  --panel: #f7f3df;
  --panel-light: #faf8f2;
  --yellow: #f7cd67;
  --yellow-bg: #fff0c7;
  --green: #8ac68a;
  --green-bg: #e7f6e7;
  --pink: #f8a6b2;
  --pink-bg: #fde4e8;
  --blue: #889df0;
  --blue-bg: #e8ecff;
  --red: #fc736d;
  --red-bg: #ffe4e4;
  --shadow: rgba(61, 52, 40, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--body);
  background:
    radial-gradient(circle at 20% 10%, rgba(25, 200, 185, 0.16) 0 16px, transparent 17px),
    radial-gradient(circle at 80% 30%, rgba(247, 205, 103, 0.18) 0 20px, transparent 21px),
    linear-gradient(180deg, #edf8f3, #f8f8f0);
  font-family: Nunito, "Noto Sans SC", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.phone-shell {
  width: min(100vw, 430px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--paper);
  box-shadow: 0 18px 60px rgba(61, 52, 40, 0.18);
}

.app-root {
  min-height: 100vh;
  background: var(--paper);
}

.status-bar {
  height: 48px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text);
  background: #f8f4e8;
  font-weight: 900;
}

.status-bar span:last-child {
  color: var(--muted);
  font-size: 12px;
}

.screen {
  min-height: calc(100vh - 48px);
  padding: 0 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.scroll-screen {
  overflow-y: auto;
  padding-bottom: 96px;
}

.ribbon {
  position: relative;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 22px;
  font-weight: 900;
}

.ribbon::before {
  content: "";
  position: absolute;
  inset: 12px 36px 8px;
  background: var(--primary);
  border-radius: 8px;
  box-shadow: 0 5px 0 #11a89b;
}

.ribbon::after {
  content: "";
  position: absolute;
  inset: 18px 18px 14px;
  background:
    linear-gradient(135deg, transparent 0 18px, #11a89b 19px),
    linear-gradient(225deg, transparent 0 18px, #11a89b 19px);
  background-position: left center, right center;
  background-size: 50% 100%;
  background-repeat: no-repeat;
  z-index: 0;
}

.ribbon span {
  position: relative;
  z-index: 1;
  line-height: 1;
}

.lead {
  margin: 0;
  color: var(--body);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
}

.panel {
  border: 2px solid var(--border);
  border-radius: 20px;
  background: var(--panel);
  padding: 14px;
}

.panel.yellow {
  border-color: var(--yellow);
  background: var(--yellow-bg);
}

.panel.green {
  border-color: var(--green);
  background: var(--green-bg);
}

.panel.pink {
  border-color: var(--pink);
  background: var(--pink-bg);
}

.panel.blue {
  border-color: var(--blue);
  background: var(--blue-bg);
}

.stage {
  min-height: 240px;
  border: 2px solid var(--border);
  border-radius: 24px;
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.88) 0 18px, transparent 19px),
    radial-gradient(circle at 78% 22%, rgba(255, 255, 255, 0.72) 0 14px, transparent 15px),
    linear-gradient(180deg, #e6f9f6 0%, #f7f3df 72%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  overflow: hidden;
  position: relative;
}

.stage::after {
  content: "";
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -28px;
  height: 96px;
  border-radius: 50%;
  background: #cce8ba;
}

.pet-figure {
  position: relative;
  z-index: 1;
  width: 142px;
  height: 142px;
  display: grid;
  place-items: center;
  font-size: 86px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.58);
  border: 2px solid rgba(196, 184, 158, 0.75);
  box-shadow: 0 10px 24px rgba(61, 52, 40, 0.12);
  animation: floaty 2.6s ease-in-out infinite;
}

.pet-nameplate {
  position: relative;
  z-index: 1;
  padding: 7px 13px;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: rgba(247, 243, 223, 0.9);
  color: var(--text);
  font-weight: 900;
}

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

.button {
  width: 100%;
  min-height: 46px;
  border: 2px solid #f8f8f0;
  border-radius: 999px;
  color: var(--text);
  background: #f8f8f0;
  box-shadow: 0 5px 0 #bdaea0;
  font-weight: 900;
  transition: transform 0.15s, box-shadow 0.15s;
}

.button:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #bdaea0;
}

.button.secondary {
  color: var(--body);
  background: var(--panel);
  border-color: var(--border);
  box-shadow: 0 2px 4px rgba(61, 52, 40, 0.08);
}

.button.danger {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
  box-shadow: 0 5px 0 #c94444;
}

.button.small {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
  box-shadow: 0 3px 0 #bdaea0;
}

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

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

.input {
  width: 100%;
  height: 48px;
  padding: 0 18px;
  border: 3px solid var(--border);
  border-radius: 999px;
  color: var(--body);
  background: var(--panel);
  outline: none;
  box-shadow: 0 3px 0 #d4c9b4;
  font-weight: 700;
}

.input:focus {
  border-color: #ffcc00;
  box-shadow: 0 3px 0 #e0b800, 0 0 0 3px rgba(255, 204, 0, 0.15);
}

.grid {
  display: grid;
  gap: 10px;
}

.pet-grid {
  grid-template-columns: repeat(2, 1fr);
}

.item-card {
  border: 2px solid var(--border-soft);
  border-radius: 18px;
  background: var(--panel);
  padding: 12px;
  color: var(--body);
  text-align: left;
}

.item-card.selected {
  border-color: var(--primary);
  background: var(--mint-bg);
}

.item-card.disabled {
  opacity: 0.55;
}

.item-title {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
}

.item-meta {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.pet-card-face {
  font-size: 44px;
  line-height: 1;
  margin-bottom: 8px;
}

.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  padding: 6px 11px;
  border: 2px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  background: var(--mint-bg);
  font-size: 12px;
  font-weight: 900;
}

.dialogue {
  position: relative;
  border: 2px solid var(--border-soft);
  border-radius: 20px;
  background: var(--panel);
  padding: 13px 14px;
  color: var(--body);
  font-weight: 700;
  line-height: 1.45;
}

.status-list {
  display: grid;
  gap: 9px;
}

.status-row {
  display: grid;
  grid-template-columns: 58px 1fr 42px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 900;
}

.bar {
  height: 12px;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: #fff8df;
  overflow: hidden;
}

.bar > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--green));
}

.actions {
  position: sticky;
  bottom: 12px;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  padding: 8px 10px;
  border: 2px solid var(--border);
  border-radius: 30px;
  background: rgba(247, 243, 223, 0.96);
  box-shadow: 0 8px 24px rgba(61, 52, 40, 0.15);
  backdrop-filter: blur(6px);
}

.action-btn {
  min-height: 58px;
  border: 0;
  border-radius: 20px;
  color: var(--text);
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 900;
}

.action-btn.active,
.action-btn:active {
  background: var(--mint-bg);
}

.action-icon {
  font-size: 22px;
  line-height: 1;
}

.tabs {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.tab {
  flex: 0 0 auto;
  min-height: 34px;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--body);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 900;
}

.tab.active {
  border-color: var(--primary);
  background: var(--mint-bg);
  color: var(--text);
}

.question {
  font-size: 18px;
  line-height: 1.45;
  color: var(--text);
  font-weight: 900;
}

.option {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: 18px;
  background: var(--panel);
  color: var(--body);
  padding: 13px;
  text-align: left;
  font-weight: 800;
}

.option.correct {
  border-color: var(--green);
  background: var(--green-bg);
}

.option.wrong {
  border-color: var(--red);
  background: var(--red-bg);
}

.empty {
  padding: 22px 10px;
  text-align: center;
  color: var(--muted);
  font-weight: 800;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 20;
  max-width: min(340px, calc(100vw - 40px));
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  pointer-events: none;
  padding: 10px 14px;
  border-radius: 999px;
  color: #fff;
  background: rgba(121, 79, 39, 0.92);
  font-weight: 800;
  transition: all 0.2s;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.loading {
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: var(--text);
  font-weight: 900;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(61, 52, 40, 0.28);
}

.modal {
  width: min(360px, 100%);
  border: 2px solid var(--border);
  border-radius: 24px;
  background: var(--paper);
  padding: 16px;
  box-shadow: 0 18px 48px rgba(61, 52, 40, 0.22);
}

.modal h3 {
  margin: 0 0 12px;
  color: var(--text);
}

.hidden {
  display: none !important;
}
