/* ── Grass Card ───────────────────────────────────────────────────────────── */

.grass-card {
  position: relative;
  min-height: min(calc(100vh - 160px), 700px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255,255,255,.1), rgba(255,255,255,.03)),
    rgba(255,255,255,.05);
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(22px);
}

/* Sky */
.sky {
  position: absolute;
  inset: 0 0 35%;
  background:
    radial-gradient(circle at 72% 22%, rgba(246,229,141,.95) 0 42px, transparent 44px),
    radial-gradient(circle at 16% 26%, rgba(143,216,255,.18), transparent 10rem),
    linear-gradient(180deg, rgba(130,220,255,.32), rgba(130,220,255,.04));
  opacity: .9;
}

/* Clouds */
.cloud {
  position: absolute;
  width: 130px;
  height: 40px;
  border-radius: 999px;
  background: rgba(255,255,255,.22);
  filter: blur(.3px);
  animation: drift 28s linear infinite;
}

.cloud::before,
.cloud::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: inherit;
}

.cloud::before { width: 52px; height: 52px; left: 18px; bottom: 9px; }
.cloud::after { width: 68px; height: 68px; right: 12px; bottom: 3px; }

.cloud-one { top: 76px; left: -150px; opacity: .35; }
.cloud-two { top: 148px; left: -280px; opacity: .22; animation-duration: 38s; animation-delay: -12s; transform: scale(.76); }

@keyframes drift {
  from { translate: 0 0; }
  to { translate: 820px 0; }
}

/* Field */
.field {
  position: absolute;
  inset: 42% 0 0;
  background:
    radial-gradient(ellipse at center top, rgba(108,240,143,.35), transparent 48%),
    linear-gradient(180deg, var(--green-3), #061c0d);
  overflow: hidden;
}

/* Grass blades */
.blade {
  position: absolute;
  bottom: -8px;
  width: 5px;
  height: var(--h);
  left: var(--x);
  background: linear-gradient(180deg, #9affae, #1d9b4e 68%, #0c4725);
  border-radius: 99px 99px 0 0;
  transform-origin: bottom center;
  transform: rotate(var(--r));
  animation: sway var(--d) ease-in-out infinite alternate;
  opacity: var(--o);
  filter: drop-shadow(0 6px 6px rgba(0,0,0,.15));
}

@keyframes sway {
  from { transform: rotate(calc(var(--r) - 5deg)); }
  to { transform: rotate(calc(var(--r) + 7deg)); }
}

/* Touch zone */
.touch-zone {
  position: absolute;
  left: 50%;
  bottom: 100px;
  transform: translateX(-50%);
  width: min(310px, 74%);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, rgba(108,240,143,.2), transparent 64%);
  border: 1px dashed rgba(255,255,255,.24);
  cursor: pointer;
  user-select: none;
  transition: background .2s ease;
}

.touch-zone:hover {
  background: radial-gradient(circle, rgba(108,240,143,.32), transparent 64%);
}

.touch-zone:focus-visible {
  outline: 3px solid rgba(108,240,143,.5);
  outline-offset: 4px;
}

/* Touch counter (inside touch zone, below hand) */
.touch-hint {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,.7);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: 0 2px 8px rgba(0,0,0,.4);
}

/* Hand emoji */
.touch-hand {
  width: 128px;
  height: 128px;
  display: grid;
  place-items: center;
  border-radius: 42px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  font-size: 72px;
  box-shadow: 0 18px 64px rgba(0,0,0,.24), 0 0 0 8px rgba(108,240,143,.04);
  transition: transform .22s cubic-bezier(.34,1.56,.64,1);
  line-height: 1;
}

.touch-zone:hover .touch-hand {
  transform: scale(1.06) rotate(-3deg);
}

.hand-tap {
  transform: scale(.86) translateY(16px) rotate(5deg) !important;
}

/* Grass float number — big, bold, game-like */
.grass-float {
  position: absolute;
  color: #6cf08f;
  font-size: 34px;
  font-weight: 900;
  pointer-events: none;
  letter-spacing: -.03em;
  text-shadow: 0 2px 0 rgba(0,0,0,.5), 0 0 20px rgba(108,240,143,.6);
  animation: floatUp .65s cubic-bezier(.22,1,.36,1) forwards;
  z-index: 10;
  line-height: 1;
  bottom: 30%;
}

@keyframes floatUp {
  from { opacity: 1; transform: translateY(0) scale(1.2); }
  60% { opacity: 1; transform: translateY(-22px) scale(1); }
  to { opacity: 0; transform: translateY(-40px) scale(.85); }
}

/* Notification blocker — placed at top to be far from touch zone */
.notification-blocker {
  position: absolute;
  inset: 0;
  background: rgba(7,20,13,.8);
  backdrop-filter: blur(10px);
  z-index: 50;
  display: flex;
  align-items: flex-start;   /* top alignment — away from grass tap area */
  justify-content: flex-end; /* right side */
  border-radius: inherit;
  padding: 20px 20px 0;
}

.blocker-inner {
  background: rgba(13,35,21,.95);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  max-width: 260px;
  text-align: left;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
}

.blocker-source {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--soft);
  margin-bottom: 6px;
}

.blocker-message {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--text);
  line-height: 1.4;
}

.btn-dismiss {
  background: linear-gradient(135deg, var(--green), var(--green-2));
  color: #04180a;
  font-weight: 700;
  padding: 0 18px;
  min-height: 38px;
  border-radius: 999px;
  cursor: pointer;
  border: none;
  font-size: 13px;
  transition: transform .15s ease;
  display: inline-flex;
  align-items: center;
  /* Slightly delayed appearance to prevent instant-click */
  animation: delayReveal .4s 0.6s both;
}

@keyframes delayReveal {
  from { opacity: 0; transform: scale(.9); }
  to { opacity: 1; transform: scale(1); }
}

.btn-dismiss:hover { transform: scale(1.04); }

/* Diagnosis area */
.diagnosis-area {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  padding: 14px 18px;
  background: rgba(0,0,0,.3);
  border: 1px solid rgba(255,255,255,.11);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(16px);
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  animation: slideUp .3s ease;
}

.diagnosis-label {
  font-weight: 700;
  color: var(--text);
  margin-right: 4px;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Inline status strip ─────────────────────────────────────────────────── */

.status-strip {
  position: absolute;
  left: 14px;
  right: 14px;
  top: 14px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  z-index: 5;
}

.status-chip {
  padding: 10px 12px;
  background: rgba(0,0,0,.28);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(14px);
}

.status-chip-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--soft);
  margin-bottom: 4px;
}

.status-chip-value {
  display: block;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--text);
  margin-bottom: 5px;
}

.status-chip-value.danger { color: var(--danger); }
.status-chip-value.good-val { color: var(--green); }

.status-chip-bar {
  height: 4px;
  background: rgba(255,255,255,.1);
  border-radius: 2px;
  overflow: hidden;
}

.status-chip-fill {
  height: 100%;
  border-radius: 2px;
  transition: width .4s ease;
}

.status-chip-fill.good { background: linear-gradient(90deg, var(--green-2), var(--green)); }
.status-chip-fill.bad { background: linear-gradient(90deg, var(--danger), var(--orange)); }

/* ── Wellness area ───────────────────────────────────────────────────────── */

.wellness-area {
  padding: 14px 16px;
  background: rgba(108,240,143,.06);
  border: 1px solid rgba(108,240,143,.15);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 12px;
}

.wellness-text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  flex: 1;
  font-style: italic;
}

/* Breathing circle */
.breath-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(108,240,143,.5), transparent);
  border: 1px solid rgba(108,240,143,.35);
  animation: breathe 4.5s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes breathe {
  0%, 100% { transform: scale(.65); opacity: .4; }
  50% { transform: scale(1); opacity: 1; }
}

/* ── Certificate unlock banner ───────────────────────────────────────────── */

.cert-unlock-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(108,240,143,.1), rgba(246,229,141,.07));
  border: 1px solid rgba(108,240,143,.3);
  border-radius: var(--radius-sm);
  animation: certPop .4s cubic-bezier(.34,1.56,.64,1);
}

@keyframes certPop {
  from { opacity: 0; transform: scale(.95) translateY(4px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.cert-banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cert-banner-level {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--green);
}

.cert-banner-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

/* ── Metrics panel ──────────────────────────────────────────────────────── */

.metrics-list {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.metric-item {
  padding: 10px 12px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
}

.metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.metric-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  cursor: help;
}

.metric-value {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.metric-value.good { color: var(--green); }
.metric-value.bad { color: var(--danger); }

.metric-bar {
  height: 5px;
  background: rgba(255,255,255,.08);
  border-radius: 3px;
  overflow: hidden;
}

.metric-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .4s ease;
}

.fill-good {
  background: linear-gradient(90deg, var(--green-2), var(--green));
}

.fill-bad {
  background: linear-gradient(90deg, var(--danger), var(--orange));
}

/* ── Notifications ───────────────────────────────────────────────────────── */

.notif-toast {
  background: rgba(10,28,18,.95);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: translateX(24px);
  transition: opacity .22s ease, transform .22s ease;
  min-width: 240px;
}

.notif-toast.notif-enter {
  opacity: 1;
  transform: translateX(0);
}

.notif-toast.notif-exit {
  opacity: 0;
  transform: translateX(24px);
}

.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.notif-source {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--soft);
}

.notif-close {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  color: var(--soft);
  font-size: 15px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .15s ease;
  flex-shrink: 0;
  border: none;
}

.notif-close:hover {
  background: rgba(255,255,255,.18);
  color: var(--text);
}

.notif-message {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

/* ── Achievement toasts ─────────────────────────────────────────────────── */

.ach-toast {
  background: rgba(108,240,143,.1);
  border: 1px solid rgba(108,240,143,.3);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity .3s ease, transform .3s ease;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ach-toast.ach-show {
  opacity: 1;
  transform: translateX(0);
}

.ach-toast.ach-hide {
  opacity: 0;
  transform: translateX(-20px);
}

.ach-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--green);
}

.ach-toast strong {
  font-size: 13px;
  color: var(--text);
  display: block;
}

.ach-desc {
  font-size: 12px;
  color: var(--soft);
  display: block;
}

/* ── Actions panel ──────────────────────────────────────────────────────── */

.actions-list {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 10px 14px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  cursor: pointer;
  text-align: left;
  transition: background .18s ease, border-color .18s ease;
  min-height: 52px;
  width: 100%;
}

.action-btn:hover:not(.disabled) {
  background: rgba(108,240,143,.08);
  border-color: rgba(108,240,143,.25);
}

.action-btn.disabled {
  opacity: .5;
  cursor: not-allowed;
}

.action-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.action-sub {
  font-size: 12px;
  color: var(--soft);
}

/* Bad action section */
.section-bad-actions {
  padding: 12px;
}

.section-bad-actions .section-title {
  color: var(--danger);
}

.bad-action-card {
  padding: 14px;
  background: rgba(255, 156, 156, .06);
  border: 1px solid rgba(255, 156, 156, .2);
  border-radius: var(--radius-xs);
  transition: box-shadow .2s ease;
}

/* Escalating urgency shaking */
.bad-action-shake {
  animation: urgentShake 0.5s ease-in-out infinite;
  border-color: rgba(255, 156, 156, .5) !important;
  box-shadow: 0 0 12px rgba(255, 100, 100, .25);
}

.bad-action-shake-hard {
  animation: urgentShakeHard 0.25s ease-in-out infinite;
  border-color: rgba(255, 80, 80, .8) !important;
  background: rgba(255, 80, 80, .1) !important;
  box-shadow: 0 0 20px rgba(255, 80, 80, .4);
}

@keyframes urgentShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-3px) rotate(-.5deg); }
  40% { transform: translateX(3px) rotate(.5deg); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}

@keyframes urgentShakeHard {
  0%, 100% { transform: translateX(0) rotate(0); }
  15% { transform: translateX(-5px) rotate(-1deg); }
  30% { transform: translateX(5px) rotate(1deg); }
  45% { transform: translateX(-4px) rotate(-.5deg); }
  60% { transform: translateX(4px) rotate(.5deg); }
  75% { transform: translateX(-3px); }
}

.bad-action-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.bad-action-desc {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}

.bad-action-buttons {
  display: flex;
  gap: 8px;
}

.btn-bad {
  flex: 1;
  min-height: 36px;
  background: rgba(255,156,156,.15);
  border: 1px solid rgba(255,156,156,.3);
  color: var(--danger);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s ease;
}

.btn-bad:hover { background: rgba(255,156,156,.28); }

.btn-resist {
  flex: 1;
  min-height: 36px;
  background: rgba(108,240,143,.08);
  border: 1px solid rgba(108,240,143,.2);
  color: var(--green);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s ease;
}

.btn-resist:hover { background: rgba(108,240,143,.18); }

/* Section title */
.section-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--soft);
  padding: 14px 14px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.section-title.bad { color: var(--danger); }

.grass-currency {
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 0;
  text-transform: none;
}

/* ── Upgrades ────────────────────────────────────────────────────────────── */

.upgrades-list {
  padding: 8px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.upgrade-item {
  padding: 12px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  transition: background .18s ease, border-color .18s ease;
}

.upgrade-item:not(.locked):not(.purchased):hover {
  background: rgba(108,240,143,.07);
  border-color: rgba(108,240,143,.22);
  cursor: pointer;
}

.upgrade-item.locked { opacity: .55; }

.upgrade-item.purchased {
  background: rgba(108,240,143,.06);
  border-color: rgba(108,240,143,.2);
}

.upgrade-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.upgrade-emoji { font-size: 16px; }

.upgrade-name {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.upgrade-cost {
  font-size: 12px;
  font-weight: 700;
  color: var(--soft);
}

.upgrade-cost.can-afford { color: var(--green); }

.upgrade-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  background: rgba(108,240,143,.15);
  color: var(--green);
  padding: 2px 7px;
  border-radius: 999px;
}

.upgrade-desc {
  font-size: 12px;
  color: var(--soft);
  line-height: 1.4;
}

.upgrade-divider {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dim);
  padding: 6px 0 2px;
  border-top: 1px solid var(--line);
  margin-top: 4px;
}

/* ── Highscores ─────────────────────────────────────────────────────────── */

.hs-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.hs-row:last-child { border-bottom: none; }

.hs-row span { color: var(--muted); }
.hs-row strong { color: var(--text); font-weight: 700; }

/* ── Sound dialog ──────────────────────────────────────────────────────── */

.panel-sound h3 {
  font-size: 20px;
  letter-spacing: -.03em;
  margin-bottom: 6px;
}

.sound-subtitle {
  font-size: 14px;
  color: var(--soft);
  margin-bottom: 24px;
}

.sound-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
