/* Base layout */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: linear-gradient(135deg, #1a0f2e 0%, #2d1b4e 50%, #1a0f2e 100%);
  color: #f5e6ff;
}

body {
  min-height: 100vh;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1rem 1rem 1.5rem;
}

/* Header */

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.title-block h1 {
  margin: 0;
  font-size: 1.5rem;
  color: #ffd6f0;
}

.subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  color: #e9b5ff;
}

/* Parent toggle: small, slightly hidden */

.parent-toggle {
  border: none;
  background: transparent;
  color: #e9b5ff;
  font-size: 0.9rem;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  opacity: 0.7;
  transition: opacity 0.15s ease, background-color 0.15s ease,
    color 0.15s ease;
}

.parent-toggle:hover,
.parent-toggle:focus-visible {
  opacity: 1;
  cursor: pointer;
  background: rgba(255, 182, 224, 0.2);
  color: #ffd6f0;
  outline: none;
}

/* Cards */

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card {
  background: rgba(45, 27, 78, 0.75);
  border-radius: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(255, 182, 224, 0.3);
  box-shadow: 0 10px 25px rgba(138, 43, 226, 0.3);
}

.section-title {
  margin: 0 0 0.6rem;
  font-size: 1rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #e9b5ff;
}

/* Current status */

.status-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.6rem;
  padding: 1.2rem 0.8rem;
  border-radius: 1.2rem;
  background: radial-gradient(circle at center, rgba(255, 182, 224, 0.15), rgba(138, 43, 226, 0.2));
  border: 2px solid rgba(255, 182, 224, 0.4);
}

.status-display--unknown {
  border: 2px dashed rgba(255, 182, 224, 0.5);
}

.status-emoji {
  font-size: 5rem;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(255, 182, 224, 0.4));
}

.status-text-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.status-label-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-label {
  font-size: 1.3rem;
  font-weight: 600;
  color: #ffd6f0;
}

.trend-indicator {
  font-size: 1.5rem;
  line-height: 1;
}

.status-meta {
  font-size: 0.85rem;
  color: #e9b5ff;
}

/* Counters row */

.counters-row {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Streak display */

.streak-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1rem;
  color: #ffd6f0;
  background: rgba(255, 182, 224, 0.15);
  border: 1px solid rgba(255, 182, 224, 0.3);
  border-radius: 0.75rem;
  padding: 0.5rem 0.75rem;
}

.streak-emoji {
  font-size: 1.2rem;
}

.streak-text {
  font-weight: 600;
}

/* Reward counter display */

.reward-counter-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1rem;
  color: #ffd6f0;
  background: rgba(255, 182, 224, 0.15);
  border: 1px solid rgba(255, 182, 224, 0.3);
  border-radius: 0.75rem;
  padding: 0.5rem 0.75rem;
}

.reward-counter-display.reward-counter-today {
  background: rgba(255, 182, 224, 0.3);
  border-color: rgba(255, 182, 224, 0.5);
  box-shadow: 0 4px 12px rgba(255, 182, 224, 0.4);
}

.reward-counter-emoji {
  font-size: 1.2rem;
}

.reward-counter-text {
  font-weight: 600;
}

/* Reward gate */

.reward-gate {
  margin-top: 0.75rem;
}

.reward-gate-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.reward-gate-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.6rem 0.75rem;
  border-radius: 0.75rem;
  transition: all 0.2s ease;
}

.reward-gate-item.reward-locked {
  background: rgba(45, 27, 78, 0.6);
  border: 1px solid rgba(255, 182, 224, 0.2);
  color: #9ca3af;
}

.reward-gate-item.reward-unlocked {
  background: rgba(255, 182, 224, 0.2);
  border: 1px solid rgba(255, 182, 224, 0.4);
  color: #ffd6f0;
}

.reward-gate-status {
  font-size: 0.85rem;
  font-weight: 600;
}

.reward-gate-item.reward-locked .reward-gate-status {
  color: #9ca3af;
}

.reward-gate-item.reward-unlocked .reward-gate-status {
  color: #ffd6f0;
}

.reward-gate-text-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.reward-gate-emoji {
  font-size: 1.2rem;
  line-height: 1;
}

.reward-gate-text {
  font-size: 0.9rem;
  word-wrap: break-word;
  flex: 1;
}

.reward-gate-item.reward-locked .reward-gate-text {
  color: #9ca3af;
  opacity: 0.7;
}

.reward-gate-item.reward-unlocked .reward-gate-text {
  color: #f5e6ff;
}

/* Bear message */

.bear-message {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: #ffd6f0;
  background: rgba(255, 182, 224, 0.15);
  border: 1px solid rgba(255, 182, 224, 0.3);
  border-radius: 0.75rem;
  padding: 0.6rem 0.75rem;
  text-align: center;
  font-style: italic;
}

/* Last inspection card */

.last-inspection {
  margin-top: 0.75rem;
}

.last-inspection-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.6rem;
  padding: 0.8rem;
}

.last-inspection-emoji {
  font-size: 3.5rem;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(255, 182, 224, 0.4));
}

.last-inspection-label {
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffd6f0;
}

.last-inspection-time {
  font-size: 0.9rem;
  color: #e9b5ff;
}

.last-inspection-note {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #e9b5ff;
  font-style: italic;
  padding: 0.4rem 0.6rem;
  background: rgba(45, 27, 78, 0.4);
  border-radius: 0.6rem;
  max-width: 100%;
  word-wrap: break-word;
  text-align: center;
}


/* History */

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 240px;
  overflow-y: auto;
}

.history-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.3rem;
  font-size: 0.9rem;
  padding: 0.6rem 0.45rem;
  border-radius: 0.9rem;
  background: rgba(45, 27, 78, 0.6);
  border: 1px solid rgba(255, 182, 224, 0.2);
}

.history-emoji {
  font-size: 2rem;
  line-height: 1;
}

.history-label {
  font-weight: 500;
}

.history-note {
  font-size: 0.8rem;
  color: #e9b5ff;
  font-style: italic;
  margin-top: 0.2rem;
  padding: 0.25rem 0.5rem;
  background: rgba(45, 27, 78, 0.4);
  border-radius: 0.5rem;
  max-width: 100%;
  word-wrap: break-word;
}

.history-time {
  font-size: 0.75rem;
  color: #e9b5ff;
}

.history-empty {
  font-size: 0.9rem;
  color: #e9b5ff;
}

/* Parent panel */

.parent-panel {
  margin-top: 0.4rem;
}

.parent-note {
  margin: 0 0 0.6rem;
  font-size: 0.9rem;
  color: #f5e6ff;
}

.status-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.status-btn {
  border: 1px solid rgba(255, 182, 224, 0.4);
  border-radius: 0.9rem;
  background: rgba(45, 27, 78, 0.7);
  padding: 0.6rem 0.2rem;
  color: #f5e6ff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease,
    transform 0.08s ease, box-shadow 0.15s ease;
}

.status-btn-emoji {
  font-size: 2rem;
  line-height: 1;
}

.status-btn-label {
  font-size: 0.75rem;
}

.status-btn:hover {
  border-color: #ffd6f0;
  background: rgba(255, 182, 224, 0.25);
  box-shadow: 0 8px 18px rgba(255, 182, 224, 0.3);
}

.status-btn:active {
  transform: scale(0.97);
}

.status-btn.selected {
  border-color: #ffd6f0;
  background: radial-gradient(circle at center, rgba(255, 182, 224, 0.4), rgba(138, 43, 226, 0.5));
  box-shadow: 0 10px 22px rgba(255, 182, 224, 0.5);
}

/* Actions */

.primary-action {
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  background: linear-gradient(135deg, #ff6ec7, #c445ff);
  color: #1a0f2e;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(255, 110, 199, 0.4);
  transition: opacity 0.15s ease, transform 0.08s ease,
    box-shadow 0.15s ease, filter 0.15s ease;
}

.primary-action:disabled {
  opacity: 0.45;
  cursor: default;
  box-shadow: none;
}

.primary-action:not(:disabled):hover {
  filter: brightness(1.05);
}

.primary-action:not(:disabled):active {
  transform: scale(0.97);
  box-shadow: 0 4px 12px rgba(255, 110, 199, 0.4);
}

.secondary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
  margin-top: 0.6rem;
}

.secondary-action {
  flex: 1 1 48%;
  border-radius: 999px;
  border: 1px solid rgba(255, 182, 224, 0.4);
  background: rgba(45, 27, 78, 0.7);
  color: #f5e6ff;
  font-size: 0.85rem;
  padding: 0.5rem 0.3rem;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease,
    transform 0.08s ease;
}

.secondary-action:hover {
  background: rgba(255, 182, 224, 0.25);
  border-color: #ffd6f0;
}

.secondary-action:active {
  transform: scale(0.97);
}

.secondary-action.danger {
  border-color: rgba(255, 110, 150, 0.7);
  color: #ffd6f0;
}

.secondary-action.danger:hover {
  background: rgba(255, 110, 150, 0.25);
}

/* Divider and warning */

.divider {
  margin-top: 0.8rem;
  border-top: 1px dashed rgba(255, 182, 224, 0.4);
}

.parent-warning {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  color: #e9b5ff;
}

/* Inspection note input */

.inspection-note-section {
  margin-bottom: 0.75rem;
}

.note-label {
  display: block;
  font-size: 0.85rem;
  color: #e9b5ff;
  margin-bottom: 0.4rem;
}

.note-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(255, 182, 224, 0.4);
  border-radius: 0.75rem;
  background: rgba(45, 27, 78, 0.7);
  color: #f5e6ff;
  font-size: 0.9rem;
  font-family: inherit;
}

.note-input:focus {
  outline: none;
  border-color: #ffd6f0;
  background: rgba(45, 27, 78, 0.9);
}

.note-char-count {
  text-align: right;
  font-size: 0.75rem;
  color: #e9b5ff;
  margin-top: 0.25rem;
}

/* Rewards info */

.rewards-info {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed rgba(255, 182, 224, 0.4);
}

.rewards-title {
  font-size: 0.9rem;
  color: #e9b5ff;
  margin: 0 0 0.6rem;
  font-weight: 600;
}

.rewards-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.reward-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: #e9b5ff;
  padding: 0.5rem 0.6rem;
  background: rgba(45, 27, 78, 0.5);
  border-radius: 0.6rem;
  border: 1px solid rgba(255, 182, 224, 0.2);
}

.reward-item.reward-unlocked-item {
  color: #ffd6f0;
  background: rgba(255, 182, 224, 0.15);
  border: 1px solid rgba(255, 182, 224, 0.4);
}

.reward-status-emoji {
  font-size: 1.4rem;
  line-height: 1;
}

.reward-status-details {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
}

.reward-status-name {
  font-weight: 600;
}

.reward-status-desc {
  font-size: 0.75rem;
  color: #e9b5ff;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.reward-item.reward-unlocked-item .reward-status-desc {
  color: #ffd6f0;
}

.reward-unlock-emoji {
  font-size: 0.9rem;
}

.reward-text {
  flex: 1;
  word-wrap: break-word;
}

.rewards-note {
  margin: 0.6rem 0 0;
  font-size: 0.8rem;
  color: #e9b5ff;
  font-style: italic;
  text-align: center;
}

/* Reward definition section */

.reward-definition-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed rgba(255, 182, 224, 0.4);
}

.reward-input-group {
  margin-bottom: 0.75rem;
}

.reward-input-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #e9b5ff;
  margin-bottom: 0.4rem;
}

.reward-input-emoji {
  font-size: 1.2rem;
}

.reward-input-name {
  font-weight: 500;
}

.reward-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(255, 182, 224, 0.4);
  border-radius: 0.75rem;
  background: rgba(45, 27, 78, 0.7);
  color: #f5e6ff;
  font-size: 0.9rem;
  font-family: inherit;
}

.reward-input:focus {
  outline: none;
  border-color: #ffd6f0;
  background: rgba(45, 27, 78, 0.9);
}

/* Visitors log section */

.visitors-log-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed rgba(255, 182, 224, 0.4);
}

.visitors-log {
  max-height: 300px;
  overflow-y: auto;
  background: rgba(45, 27, 78, 0.5);
  border: 1px solid rgba(255, 182, 224, 0.2);
  border-radius: 0.75rem;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.visitor-entry {
  padding: 0.5rem 0.6rem;
  background: rgba(45, 27, 78, 0.6);
  border: 1px solid rgba(255, 182, 224, 0.15);
  border-radius: 0.6rem;
  font-size: 0.8rem;
}

.visitor-time {
  font-weight: 600;
  color: #ffd6f0;
  margin-bottom: 0.3rem;
  font-size: 0.85rem;
}

.visitor-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.visitor-ip {
  color: #e9b5ff;
  font-size: 0.75rem;
}

.visitor-device {
  color: #f5e6ff;
  font-size: 0.8rem;
  font-weight: 500;
}

.visitor-ua {
  color: #9ca3af;
  font-size: 0.7rem;
  font-style: italic;
  margin-top: 0.2rem;
}

.visitors-log-loading,
.visitors-log-empty,
.visitors-log-error {
  padding: 1rem;
  text-align: center;
  color: #e9b5ff;
  font-size: 0.85rem;
}

.visitors-log-error {
  color: #ff6ec7;
}

/* Footer */

.app-footer {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.8rem;
  color: #e9b5ff;
}

/* Desktop tweaks */

@media (min-width: 640px) {
  .app {
    padding: 1.5rem 1.25rem 2rem;
  }

  .title-block h1 {
    font-size: 1.7rem;
  }
}


