@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Nunito:wght@400;600;800;900&display=swap');

:root {
  --cream:        #FFF8DC;
  --cream-dark:   #F5E6C8;
  --brown-light:  #c8a97e;
  --brown:        #8B6343;
  --brown-dark:   #2c1810;

  --teal:         #4ECDC4;
  --teal-dark:    #2EAD9E;
  --pink:         #FF6B9D;
  --gold:         #FFD700;
  --gold-dark:    #FFA500;
  --purple:       #6C5CE7;
  --green-soft:   #A8E6CF;

  --stat-high:    linear-gradient(90deg, #56ab2f, #a8e063);
  --stat-mid:     linear-gradient(90deg, #f7971e, #ffd200);
  --stat-low:     linear-gradient(90deg, #cb2d3e, #ef473a);

  --panel-bg:     rgba(255, 248, 220, 0.90);
  --panel-border: var(--brown-light);
  --panel-shadow: 0 8px 32px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.6);
  --panel-radius: 20px;

  --pet-glow:     0 0 24px rgba(78, 205, 196, 0.5), 0 0 48px rgba(78, 205, 196, 0.2);

  --font-pixel:   'Press Start 2P', monospace;
  --font-body:    'Nunito', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  font-family: var(--font-body);
  color: var(--brown-dark);
  overflow-x: hidden;
  background: #87CEEB;
}

body.level-up-flash {
  animation: levelUpFlash 0.8s ease;
}

.particles-stack {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.particles-stack canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: opacity 2s ease;
}

#ad-top {
  position: relative;
  z-index: 20;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 90px;
  background: rgba(0,0,0,0.08);
}
@media (max-width: 767px) { #ad-top { height: 50px; } }

.game-wrapper {
  position: relative;
  z-index: 60;
  max-width: 520px;
  margin: 0 auto;
  padding: 12px 12px 80px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: calc(100vh - 90px);
}

.game-header {
  background: var(--panel-bg);
  border: 2px solid var(--panel-border);
  border-radius: var(--panel-radius);
  box-shadow: var(--panel-shadow);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  backdrop-filter: blur(8px);
}

.pet-name-display {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pixel-text { font-family: var(--font-pixel); }

.pet-name-display .pixel-text {
  font-size: 10px;
  color: var(--brown-dark);
  text-shadow: 2px 2px 0 var(--brown-light);
}

.level-badge {
  background: var(--gold);
  color: var(--brown-dark);
  font-family: var(--font-pixel);
  font-size: 7px;
  padding: 3px 6px;
  border-radius: 6px;
  border: 1.5px solid var(--gold-dark);
  box-shadow: 0 2px 0 rgba(0,0,0,0.2);
}

.xp-bar-wrapper,
.xp-track {
  flex: 1;
  position: relative;
  height: 16px;
  background: rgba(0,0,0,0.1);
  border-radius: 8px;
  overflow: hidden;
  border: 1.5px solid var(--brown-light);
}

.xp-bar-fill,
.xp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  border-radius: 8px;
  width: 0%;
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.xp-text,
.xp-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-family: var(--font-pixel);
  color: var(--brown-dark);
  text-shadow: 0 1px 0 rgba(255,255,255,0.8);
}

.btn-badges {
  font-size: 22px;
  background: none;
  border: none;
  cursor: pointer;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.btn-badges:hover { transform: scale(1.2) rotate(-10deg); }

.game-main {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.status-panel {
  background: var(--panel-bg);
  border: 2px solid var(--panel-border);
  border-radius: var(--panel-radius);
  box-shadow: var(--panel-shadow);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 110px;
  backdrop-filter: blur(8px);
}

.stat-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-icon { font-size: 14px; flex-shrink: 0; }

.stat-bar-track,
.stat-track {
  flex: 1;
  height: 8px;
  background: rgba(0,0,0,0.12);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.1);
}

.stat-bar-fill,
.stat-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease, background 0.5s ease;
  width: 80%;
  background: var(--stat-high);
}

.stat-bar-fill.mid,
.stat-fill.mid { background: var(--stat-mid); }
.stat-bar-fill.low,
.stat-fill.low {
  background: var(--stat-low);
  animation: criticalPulse 1s ease-in-out infinite;
}

.stat-value,
.stat-val {
  font-family: var(--font-pixel);
  font-size: 6px;
  color: var(--brown);
  min-width: 20px;
  text-align: right;
}

.stat-row.critical .stat-icon {
  animation: shake 0.4s ease-in-out infinite;
}

.pet-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.speech-bubble {
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid var(--brown-light);
  border-radius: 14px;
  padding: 8px 12px;
  font-family: var(--font-pixel);
  font-size: 7px;
  text-align: center;
  line-height: 1.6;
  max-width: 180px;
  position: relative;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  animation: floatBubble 3s ease-in-out infinite;
  color: var(--brown-dark);
}

.speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--brown-light);
}
.speech-bubble::before {
  content: '';
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(255, 255, 255, 0.95);
  z-index: 1;
}

.pet-container {
  position: relative;
  width: 220px;
  height: 220px;
}

#pet-canvas {
  width: 220px;
  height: 220px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(var(--pet-glow));
  animation: petFloat 2.5s ease-in-out infinite;
}

.effects-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}

.weather-badge {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--brown);
  background: rgba(255,255,255,0.7);
  border: 1.5px solid var(--brown-light);
  border-radius: 20px;
  padding: 4px 10px;
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  background: var(--panel-bg);
  border: 2px solid var(--panel-border);
  border-radius: var(--panel-radius);
  box-shadow: var(--panel-shadow);
  padding: 14px;
  backdrop-filter: blur(8px);
}

.action-btn {
  --cd: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 12px 8px;
  min-height: 48px;
  border: 2px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  background: var(--btn-color, #4ECDC4);
  background: linear-gradient(145deg, var(--btn-color, #4ECDC4), color-mix(in srgb, var(--btn-color, #4ECDC4) 70%, #000));
  color: white;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 11px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  box-shadow: 0 4px 0 rgba(0,0,0,0.2), 0 6px 12px rgba(0,0,0,0.1);
  transition: transform 0.1s, box-shadow 0.1s, opacity 0.2s;
  position: relative;
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.action-btn .btn-icon { font-size: 26px; line-height: 1; }
.action-btn .btn-label { font-size: 10px; font-weight: 900; letter-spacing: 0.3px; }

.action-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 rgba(0,0,0,0.2), 0 2px 4px rgba(0,0,0,0.1);
}

.action-btn.popping { animation: buttonPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }

.action-btn:disabled, .action-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

.action-btn .cooldown-ring {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.action-btn.cooling .cooldown-ring { opacity: 1; }
.action-btn .cooldown-conic {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: conic-gradient(from 0deg, rgba(0,0,0,0.45) calc(var(--cd, 0) * 360deg), transparent 0);
}
.action-btn .cooldown-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-pixel);
  font-size: 8px;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.9);
  z-index: 1;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.25s ease;
}

.modal-box {
  background: var(--cream);
  border: 3px solid var(--brown-light);
  border-radius: 24px;
  padding: 32px 28px;
  max-width: 320px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  animation: modalPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-box h2 {
  font-size: 12px;
  color: var(--brown-dark);
  text-shadow: 2px 2px 0 var(--brown-light);
}

.modal-levelup { border-color: var(--gold); position: relative; overflow: hidden; }
.levelup-glow {
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle, rgba(255,215,0,0.35) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.modal-levelup > *:not(.levelup-glow) { position: relative; z-index: 1; }

.new-level-display {
  font-family: var(--font-pixel);
  font-size: 32px;
  color: var(--gold-dark);
  text-shadow: 3px 3px 0 rgba(0,0,0,0.2);
}

.badges-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  max-height: 300px;
  overflow-y: auto;
}

.badge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px;
  border-radius: 10px;
  background: rgba(0,0,0,0.06);
  border: 1.5px solid rgba(0,0,0,0.08);
}
.badge-item.locked { opacity: 0.3; filter: grayscale(1); }
.badge-item .badge-icon { font-size: 24px; }
.badge-item .badge-label { font-size: 6px; font-family: var(--font-pixel); text-align: center; line-height: 1.4; }

.modal-ad #ad-rectangle {
  min-height: 250px;
  min-width: 300px;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.05);
  border-radius: 12px;
}

.ad-intro { font-size: 9px; line-height: 1.5; }

.btn-primary {
  background: linear-gradient(145deg, var(--teal), var(--teal-dark));
  color: white;
  border: none;
  border-radius: 12px;
  padding: 12px 24px;
  font-family: var(--font-body);
  font-weight: 900;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0,0,0,0.2);
  transition: transform 0.1s, box-shadow 0.1s;
}
.btn-primary:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,0.2); }

.btn-secondary {
  background: rgba(0,0,0,0.08);
  color: var(--brown);
  border: 1.5px solid var(--brown-light);
  border-radius: 10px;
  padding: 8px 18px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-secondary:hover { background: rgba(0,0,0,0.14); }
.btn-secondary:disabled { opacity: 0.6; cursor: not-allowed; }

.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--brown-dark);
  color: white;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
  padding: 10px 20px;
  border-radius: 20px;
  z-index: 100001;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  max-width: 280px;
  text-align: center;
}
.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#xp-floats {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99998;
}

.xp-float {
  position: absolute;
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--gold);
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
  animation: xpFloat 1.2s ease-out forwards;
  pointer-events: none;
}

.effect-emoji {
  position: absolute;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%);
  font-size: 28px;
  pointer-events: none;
  animation: heartFloat 1s ease-out forwards;
}

.effect-sparkle {
  position: absolute;
  width: 12px;
  height: 12px;
  pointer-events: none;
  animation: sparkle 0.9s ease-out forwards;
}

#ad-bottom {
  position: fixed;
  bottom: 0;
  left: 0; right: 0;
  height: 50px;
  z-index: 40;
  background: rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (min-width: 768px) { #ad-bottom { display: none; } }

.game-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: var(--brown);
  padding: 0 4px;
}

.age-display strong { color: var(--brown-dark); }

.recent-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.recent-badges span {
  font-size: 18px;
}

@keyframes petFloat {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33%       { transform: translateY(-8px) rotate(1deg); }
  66%       { transform: translateY(-4px) rotate(-1deg); }
}

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

@keyframes buttonPop {
  0%   { transform: scale(1); }
  35%  { transform: scale(0.88); }
  70%  { transform: scale(1.14); }
  100% { transform: scale(1); }
}

@keyframes criticalPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%       { transform: translateX(-2px) rotate(-5deg); }
  75%       { transform: translateX(2px) rotate(5deg); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes modalPop {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

@keyframes xpFloat {
  0%   { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-60px); opacity: 0; }
}

@keyframes sparkle {
  0%   { transform: scale(0) rotate(0deg); opacity: 1; }
  100% { transform: scale(1.8) rotate(180deg) translateY(-30px); opacity: 0; }
}

@keyframes heartFloat {
  0%   { transform: translateY(0) scale(0); opacity: 1; }
  50%  { opacity: 1; }
  100% { transform: translateY(-50px) scale(1.2); opacity: 0; }
}

@keyframes levelUpFlash {
  0%, 100% { background: transparent; }
  50%       { background: rgba(255, 215, 0, 0.25); }
}

.header-left { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.header-right { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.icon-btn {
  font-size: 22px;
  background: none;
  border: none;
  cursor: pointer;
  min-width: 48px;
  min-height: 48px;
  border-radius: 12px;
  line-height: 1;
}
.icon-btn:hover { background: rgba(0,0,0,0.07); }

.pet-container {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 0 auto;
}
.fx-canvas {
  position: absolute;
  left: 0;
  top: 0;
  width: 220px;
  height: 220px;
  pointer-events: none;
  z-index: 2;
  image-rendering: pixelated;
}
#pet-canvas {
  position: relative;
  z-index: 1;
  display: block;
  margin: 0 auto;
}

.thought--fade { opacity: 0.35; transition: opacity 0.16s ease; }

@keyframes petFlyUp {
  0% { transform: translateY(0) rotate(0); }
  35% { transform: translateY(-68px) rotate(14deg); }
  100% { transform: translateY(0) rotate(0); }
}
#pet-canvas.pet-fly {
  animation: petFlyUp 0.75s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#pet-canvas.shaking {
  animation: shake 0.45s ease-in-out infinite;
}

.modal-death-wrap {
  background: radial-gradient(ellipse at center, rgba(30,10,10,0.75) 0%, rgba(0,0,0,0.92) 100%);
}

.modal-setup { max-width: 360px; max-height: 90vh; overflow-y: auto; }
.setup-title { font-size: 10px; line-height: 1.5; margin: 8px 0; }
.setup-label {
  display: block;
  text-align: left;
  font-weight: 800;
  font-size: 12px;
  margin-top: 10px;
  width: 100%;
}
.setup-label input, #setup-name, #settings-name {
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 2px solid var(--brown-light);
  font-family: var(--font-body);
  font-size: 14px;
}
.type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}
.type-btn {
  min-height: 48px;
  padding: 10px;
  border-radius: 12px;
  border: 2px solid var(--brown-light);
  background: rgba(255,255,255,0.6);
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 11px;
}
.type-btn.active {
  border-color: var(--teal-dark);
  background: rgba(78, 205, 196, 0.25);
}
.color-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  width: 100%;
}
.color-dot {
  width: 40px;
  height: 40px;
  min-width: 48px;
  min-height: 48px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  padding: 0;
}
.color-dot.active { border-color: var(--brown-dark); }

.btn-start { width: 100%; margin-top: 12px; }

.levelup-emoji { font-size: 48px; }
.new-level-num {
  font-family: var(--font-pixel);
  font-size: 26px;
  color: var(--gold-dark);
}
.death-title { font-size: 10px; line-height: 1.4; }
.death-count-sub { font-size: 12px; opacity: 0.65; }

.btn-danger {
  background: linear-gradient(145deg, #e74c3c, #c0392b);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  font-weight: 800;
  cursor: pointer;
  width: 100%;
  font-family: var(--font-body);
}
.settings-actions-row {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
}
.settings-danger-zone {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(0,0,0,0.1);
}
.type-xp-hint { font-size: 9px; opacity: 0.65; font-weight: 600; }
.modal-scroll { max-height: 85vh; overflow-y: auto; align-items: stretch; }

.age-display { font-size: 12px; text-align: center; margin-top: 4px; color: var(--brown); }

button.bitcho-global-reset {
  margin: 0;
  font: inherit;
  appearance: none;
  cursor: pointer;
}
.bitcho-global-reset {
  position: fixed;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 99990;
  padding: 10px 16px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  color: var(--brown-dark);
  background: rgba(255, 248, 220, 0.95);
  border: 2px solid var(--brown-light);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  max-width: calc(100vw - 24px);
  text-align: center;
  pointer-events: auto;
}
.bitcho-global-reset:active {
  transform: translateX(-50%) scale(0.98);
}

@media (max-width: 767px) {
  .bitcho-global-reset {
    bottom: max(62px, calc(env(safe-area-inset-bottom, 0px) + 56px));
  }
}

.setup-reset-hint {
  margin: 10px 0 0;
  text-align: center;
  font-size: 11px;
  line-height: 1.4;
  font-weight: 600;
}
button.setup-reset-link {
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  appearance: none;
}
.setup-reset-link {
  color: var(--teal-dark);
  text-decoration: underline;
}
.setup-reset-link:active { opacity: 0.85; }

.bitcho-load-warning-reset {
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  appearance: none;
  color: var(--teal-dark);
  text-decoration: underline;
}

.bitcho-load-warning {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 100002;
  max-width: 520px;
  margin: 0 auto;
  padding: 14px 16px;
  background: #fff8dc;
  border: 2px solid var(--brown-light);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.25);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.45;
  color: var(--brown-dark);
}
.bitcho-load-warning p { margin: 0 0 8px; }
.bitcho-load-warning p:last-child { margin-bottom: 0; }
.bitcho-load-warning code { font-size: 11px; background: rgba(0,0,0,0.06); padding: 2px 6px; border-radius: 4px; }
.bitcho-load-warning a { color: var(--teal-dark); font-weight: 800; }
.bitcho-load-warning-actions { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.bitcho-load-warning-or { opacity: 0.75; font-size: 12px; }

@media (max-width: 400px) {
  .game-main { flex-direction: column; align-items: center; }
  .status-panel { flex-direction: row; flex-wrap: wrap; min-width: unset; width: 100%; padding: 10px; gap: 8px; }
  .stat-row { width: calc(50% - 4px); }
  .actions-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px; }
  #pet-canvas { width: 180px; height: 180px; }
  .pet-container { width: 180px; height: 180px; }
  .fx-canvas { width: 180px; height: 180px; }
}

@media (min-width: 481px) {
  .game-main { align-items: flex-start; }
}

@media (min-width: 769px) {
  .game-wrapper { max-width: 720px; }
}
