* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  background: radial-gradient(circle at top, #2b2b52, #050510);
  color: #f5f5f5;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app {
  background: rgba(10, 10, 25, 0.9);
  border-radius: 16px;
  padding: 24px;
  width: 380px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

h1 {
  text-align: center;
  margin-bottom: 16px;
  letter-spacing: 0.08em;
  font-size: 1.4rem;
}

.pet-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.pet-visual {
  text-align: center;
  padding: 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1b1b3a, #26264d);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

#pet-emoji {
  font-size: 3rem;
  margin-bottom: 8px;
}

#pet-stage,
#pet-mood {
  font-size: 0.9rem;
  opacity: 0.9;
}

.pet-stats {
  background: rgba(15, 15, 35, 0.9);
  border-radius: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.stat {
  display: grid;
  grid-template-columns: 70px 1fr 40px;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 0.8rem;
}

.stat:last-child {
  margin-bottom: 0;
}

.label {
  opacity: 0.8;
}

.bar {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
  height: 8px;
}

.fill {
  height: 100%;
  width: 50%;
  background: linear-gradient(90deg, #4ade80, #22c55e);
  transition: width 0.2s ease, background 0.2s ease;
}

.value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  opacity: 0.9;
}

.controls {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

button {
  border: none;
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 0.85rem;
  cursor: pointer;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #f9fafb;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.4);
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.08s ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.5);
}

button:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

/* --- META PANEL --- */

.meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 0.8rem;
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lifespan-row {
  flex-direction: column;
  align-items: flex-start;
}

.lifespan-row label {
  margin-bottom: 4px;
}

input,
select {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 4px 8px;
  background: rgba(5, 5, 20, 0.9);
  color: #f9fafb;
  font-size: 0.8rem;
}

input:focus,
select:focus {
  outline: none;
  border-color: #6366f1;
}

#history-log {
  margin-top: 1rem;
  max-height: 120px;
  overflow-y: auto;
  font-size: 0.8rem;
  opacity: 0.8;
}

.log {
  background: rgba(5, 5, 20, 0.9);
  border-radius: 12px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  max-height: 140px;
  overflow-y: auto;
  font-size: 0.75rem;
}

.log h2 {
  font-size: 0.85rem;
  margin-bottom: 6px;
  opacity: 0.9;
}

#log-output {
  display: flex;
  flex-direction: column-reverse;
  gap: 2px;
}

.log-line {
  opacity: 0.8;
}

/* --- Birth Certificate Modal --- */

.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.modal-content {
  background: #fffdf5;
  padding: 25px 30px;
  border-radius: 12px;
  width: 320px;
  text-align: center;
  font-family: "Georgia", serif;
  box-shadow: 0 0 20px rgba(0,0,0,0.25);
  border: 4px double #c9a86a;
  outline: 6px solid #f3e3b0;
  position: relative;
}

.modal-content::before {
  content: "✦";
  font-size: 28px;
  color: #c9a86a;
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  background: #fffdf5;
  padding: 0 10px;
}

.modal-content h2 {
  margin-top: 0;
  font-size: 22px;
  color: #5a4632;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.modal-content p {
  margin: 4px 0 15px;
  font-size: 14px;
  color: #7a6a55;
  font-style: italic;
}

.modal-content input {
  width: 90%;
  padding: 8px;
  margin-top: 6px;
  border: 1px solid #c9a86a;
  border-radius: 6px;
  background: #fffaf0;
  font-family: inherit;
}

.modal-actions {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
}

.modal-actions button {
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
}

#rename-save {
  background: #c9a86a;
  color: white;
}

#rename-cancel {
  background: #e0d4b8;
  color: #5a4632;
}

/* --- Heaven Scene --- */

.heaven-content {
  background: #eef7ff;
  border: 3px solid #bcdcff;
  border-radius: 12px;
  width: 320px;
  text-align: center;
}

#heaven-pets {
  margin-top: 15px;
  max-height: 300px;
  overflow-y: auto;
}

.heaven-pet {
  background: white;
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 10px;
  box-shadow: 0 0 6px rgba(0,0,0,0.1);
}

.heaven-emoji {
  font-size: 32px;
}

.heaven-name {
  font-weight: bold;
  margin-top: 5px;
}

.heaven-life {
  font-size: 12px;
  color: #666;
}

/* --- Exercise Panel --- */

/* --- EXERCISE PANEL: NEON GLASS STYLE --- */

.exercise-status-panel {
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
  border: 1px solid rgba(0,255,180,0.25);
  box-shadow: 0 0 12px rgba(0,255,180,0.25);
}

.exercise-status-panel h3,
.exercise-status-panel label,
.exercise-status-panel span {
  color: #eafffa;
  text-shadow: 0 0 4px rgba(0,255,200,0.4);
}

.status-row {
  display: flex;
  justify-content: space-between;
  margin: 8px 0;
  font-weight: bold;
  color: #d9fff7;
}

.status {
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  color: #000;
  font-weight: bold;
}

.status.on {
  background: #00ffcc;
  box-shadow: 0 0 6px #00ffcc;
}

.status.off {
  background: #ff4d4d;
  box-shadow: 0 0 6px #ff4d4d;
}

.exercise-master {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  color: #eafffa;
}

.exercise-controls button {
  margin: 4px 0;
  background: linear-gradient(135deg, #00ffcc, #00bfa5);
  box-shadow: 0 0 10px rgba(0,255,200,0.4);
  color: #00332c;
  font-weight: bold;
}

.exercise-controls button:hover {
  filter: brightness(1.15);
  box-shadow: 0 0 14px rgba(0,255,200,0.6);
}




.exercise-session-ui {
  margin: 10px 0;
}

.session-timer {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-weight: bold;
}

.session-progress-bar {
  width: 100%;
  height: 10px;
  background: rgba(255,255,255,0.3);
  border-radius: 6px;
  overflow: hidden;
}

#exercise-progress-fill {
  height: 100%;
  width: 0%;
  background: #22c55e;
  transition: width 0.3s ease;
}

/* --- NEON CYBER RINGS --- */

.activity-rings {
  display: flex;
  justify-content: space-around;
  margin: 14px 0;
  padding: 6px 0;
}

.ring {
  text-align: center;
  filter: drop-shadow(0 0 6px rgba(0,255,180,0.4));
}

.ring-bg {
  fill: none;
  stroke: rgba(0, 255, 180, 0.15);
  stroke-width: 10;
  stroke-dasharray: 188;
  stroke-dashoffset: 0;
  filter: drop-shadow(0 0 4px rgba(0,255,180,0.25));
}

.ring-fill {
  fill: none;
  stroke: #00ffcc;
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 188;
  stroke-dashoffset: 188;
  transition: stroke-dashoffset 0.4s ease, stroke 0.3s ease;
  filter: drop-shadow(0 0 8px #00ffcc) drop-shadow(0 0 14px rgba(0,255,200,0.6));
}

.ring span {
  display: block;
  margin-top: 6px;
  font-size: 0.75rem;
  opacity: 0.85;
  letter-spacing: 0.03em;
}

/* Daily Goals */
.daily-goals ul {
  list-style: none;
  padding: 0;
}

.daily-goals li {
  margin: 4px 0;
  display: flex;
  justify-content: space-between;
}
.help-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  color: white;
  font-weight: bold;
  cursor: pointer;
  margin-left: 8px;
}

/* --- EXERCISE MODAL: NEON GLASS STYLE --- */

#exercise-modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

#exercise-modal .modal-content {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  border-radius: 14px;
  padding: 20px;
  width: 340px;
  border: 1px solid rgba(0,255,180,0.25);
  box-shadow: 0 0 18px rgba(0,255,180,0.35);
  color: #eafffa;
  text-shadow: 0 0 4px rgba(0,255,200,0.4);
  position: relative;
}

/* Header */
#exercise-modal h2 {
  margin-bottom: 12px;
  font-size: 1.2rem;
  letter-spacing: 0.05em;
  color: #aaffee;
  text-shadow: 0 0 6px rgba(0,255,200,0.6);
  text-align: center;
}

/* Close button */
#exercise-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  color: #eafffa;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 0 6px rgba(0,255,200,0.4);
}

#exercise-close:hover {
  filter: brightness(1.2);
}

/* Section dividers */
.exercise-section-title {
  margin: 14px 0 6px;
  font-size: 0.85rem;
  opacity: 0.9;
  letter-spacing: 0.04em;
  color: #aaffee;
  text-shadow: 0 0 4px rgba(0,255,200,0.4);
  border-bottom: 1px solid rgba(0,255,180,0.2);
  padding-bottom: 4px;
}

/* Buttons inside modal */
#exercise-modal button {
  background: linear-gradient(135deg, #00ffcc, #00bfa5);
  color: #00332c;
  font-weight: bold;
  border-radius: 999px;
  padding: 8px 12px;
  margin: 4px 0;
  border: none;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0,255,200,0.4);
  transition: 0.15s ease;
}

#exercise-modal button:hover {
  filter: brightness(1.15);
  box-shadow: 0 0 14px rgba(0,255,200,0.6);
}

#exercise-modal button:active {
  transform: scale(0.97);
}

/* Status labels inside modal */
#exercise-modal .status {
  text-shadow: none;
  color: #000;
  font-weight: bold;
}

/* --- HELP MODAL: NEON GLASS STYLE --- */

#exercise-help-modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

#exercise-help-modal .modal-content {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  border-radius: 14px;
  padding: 22px;
  width: 320px;
  border: 1px solid rgba(0,255,180,0.25);
  box-shadow: 0 0 18px rgba(0,255,180,0.35);
  color: #eafffa;
  text-shadow: 0 0 4px rgba(0,255,200,0.4);
  position: relative;
}

/* Title */
#exercise-help-modal h2 {
  margin-bottom: 12px;
  font-size: 1.2rem;
  letter-spacing: 0.05em;
  color: #aaffee;
  text-shadow: 0 0 6px rgba(0,255,200,0.6);
  text-align: center;
}

/* Paragraphs */
#exercise-help-modal p {
  margin: 8px 0;
  font-size: 0.85rem;
  line-height: 1.35;
  opacity: 0.95;
}

/* Close button */
#exercise-help-close {
  margin-top: 14px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #00ffcc, #00bfa5);
  color: #00332c;
  font-weight: bold;
  box-shadow: 0 0 10px rgba(0,255,200,0.4);
  transition: 0.15s ease;
}

#exercise-help-close:hover {
  filter: brightness(1.15);
  box-shadow: 0 0 14px rgba(0,255,200,0.6);
}

#exercise-help-close:active {
  transform: scale(0.97);
}

/* Help modal section styling */
#exercise-help-modal .help-section {
  margin: 12px 0;
  padding: 10px 12px;
  border-left: 2px solid rgba(0,255,180,0.35);
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
}

#exercise-help-modal h3 {
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: #aaffee;
  text-shadow: 0 0 4px rgba(0,255,200,0.5);
  letter-spacing: 0.03em;
}

#exercise-help-modal p {
  margin: 4px 0;
  font-size: 0.8rem;
  opacity: 0.95;
  line-height: 1.35;
}
/* ---------------------------------------------------------
   MOBILE RESPONSIVENESS (PHASE C)
   --------------------------------------------------------- */

@media (max-width: 480px) {

  /* App container */
  .app {
    width: 92%;
    padding: 16px;
    border-radius: 14px;
  }

  h1 {
    font-size: 1.2rem;
  }

  /* Pet visual */
  #pet-emoji {
    font-size: 2.4rem;
  }

  /* Stats bars */
  .stat {
    grid-template-columns: 60px 1fr 34px;
    font-size: 0.75rem;
  }

  .bar {
    height: 6px;
  }

  /* Controls grid */
  .controls {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  button {
    font-size: 0.8rem;
    padding: 7px 9px;
  }

  /* Exercise modal */
  #exercise-modal .modal-content {
    width: 90%;
    padding: 16px;
  }

  /* Help modal */
  #exercise-help-modal .modal-content {
    width: 90%;
    padding: 16px;
  }

  /* Heaven modal */
  .heaven-content {
    width: 90%;
  }

  #heaven-pets {
    max-height: 240px;
  }

  /* Rename modal */
  #rename-modal .modal-content {
    width: 90%;
  }

  /* Activity rings */
  .activity-rings {
    gap: 10px;
  }

  .ring svg {
    width: 60px;
    height: 60px;
  }

  .ring-bg,
  .ring-fill {
    stroke-width: 8;
  }

  .ring span {
    font-size: 0.7rem;
  }

  /* Exercise panel */
  .exercise-status-panel {
    padding: 10px;
  }

  .status-row {
    font-size: 0.75rem;
  }

  /* Session progress bar */
  .session-progress-bar {
    height: 8px;
  }

  #exercise-progress-fill {
    transition: width 0.25s ease;
  }
}
/* --- BETA BADGE (NEON CYBER STYLE) --- */

.beta-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  font-weight: bold;
  color: #00ffcc;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(0,255,180,0.35);
  border-radius: 6px;
  box-shadow: 0 0 10px rgba(0,255,200,0.4);
  backdrop-filter: blur(6px);
  text-shadow: 0 0 4px rgba(0,255,200,0.6);
  z-index: 50;
}

/* Ensure .app can position children absolutely */
.app {
  position: relative;
}
