/* Solana Pet - Game Boy Color Palette */
:root {
  --gb-darkest: #071820;
  --gb-dark: #2F6B51;
  --gb-light: #88C17A;
  --gb-lightest: #DEF7CF;
}

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

/* Load pixel font */
@import url('https://fonts.googleapis.com/css2?family=DotGothic16&display=swap');

body {
  font-family: 'DotGothic16', monospace;
  background-color: var(--gb-lightest);
  color: var(--gb-darkest);
  min-height: 100vh;
}

/* Main wrapper - full width */
.main-wrapper {
  max-width: 1800px;
  margin: 0 auto;
  padding: 20px;
}

/* Dex + Professor Combined Panel */
.dex-professor-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-self: stretch;
}

/* Professor Section */
.professor-section {
  background: var(--gb-darkest);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.professor-sprite {
  width: 216px;
  height: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(3px 3px 0 var(--gb-dark));
}

.professor-speech {
  background: var(--gb-lightest);
  border: 3px solid var(--gb-darkest);
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 12px;
  position: relative;
  width: 100%;
  font-size: 14px;
  color: var(--gb-darkest);
  text-align: center;
  line-height: 1.5;
  box-shadow: 3px 3px 0 var(--gb-dark);
}

.professor-speech::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 10px solid var(--gb-darkest);
}

.professor-speech::before {
  content: '';
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid var(--gb-lightest);
  z-index: 1;
}

/* Pokedex Section */
.pokedex-section {
  background: var(--gb-darkest);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
  min-height: 0;
  padding: 4px;
}

/* Header */
.header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 20px;
  gap: 20px;
}

.header-left {
  text-align: left;
}

.header h1 {
  font-size: 36px;
  color: var(--gb-darkest);
  margin-bottom: 8px;
}

.header .subtitle {
  font-size: 16px;
  color: var(--gb-darkest);
  font-weight: bold;
  margin-bottom: 6px;
}

.header .tagline {
  font-size: 13px;
  color: var(--gb-dark);
  max-width: 500px;
  line-height: 1.5;
}

/* Connection indicator */
.connection-status {
  position: fixed;
  top: 15px;
  right: 15px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ff0000;
  box-shadow: 0 0 8px #ff0000;
  z-index: 100;
}

.connection-status.connected {
  background: #00ff00;
  box-shadow: 0 0 8px #00ff00;
}

/* Game container - four column layout */
/* Order: Dex+Prof | Pet | Chat | Wallet/Activity */
.game-container {
  display: grid;
  grid-template-columns: 1.2fr 2.5fr 1.5fr 1.2fr;
  gap: 15px;
  align-items: stretch;
  min-height: 70vh;
}

/* Pet Display Panel - THE MAIN STAGE */
.pet-panel {
  background: var(--gb-darkest);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
  justify-self: stretch;
  align-self: stretch;
  width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* Evolution bar inside pet panel */
.pet-panel .evolution-bar {
  background: var(--gb-dark);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.pet-panel .evolution-bar .evo-label span:first-child {
  color: var(--gb-lightest);
  font-size: 16px;
}

.pet-panel .evolution-bar .evo-next {
  color: var(--gb-light);
}

.pet-panel .evolution-bar .evo-progress {
  background: var(--gb-darkest);
}

.pet-panel .evolution-bar .evo-xp {
  color: var(--gb-lightest);
}

/* Pet Slot Tabs */
.pet-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.pet-tab {
  flex: 1;
  background: var(--gb-dark);
  border: none;
  padding: 10px 8px;
  font-family: inherit;
  font-size: 12px;
  color: var(--gb-light);
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  transition: all 0.15s;
  opacity: 0.7;
}

.pet-tab:hover {
  background: var(--gb-light);
  color: var(--gb-darkest);
  opacity: 1;
}

.pet-tab.active {
  background: var(--gb-lightest);
  color: var(--gb-darkest);
  opacity: 1;
}

/* Pet Slots */
.pet-slot {
  display: none;
  width: 100%;
}

.pet-slot.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  flex: 1;
  min-height: 0;
}

/* Empty Slot Styling */
.empty-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  background: var(--gb-dark);
  border-radius: 10px;
  width: 100%;
  max-width: 400px;
  aspect-ratio: 1;
}

.empty-machine-container {
  width: 60%;
  max-width: 200px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  opacity: 0.5;
}

.empty-machine {
  max-width: 100%;
  max-height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  animation: machine-flicker 3s ease-in-out infinite;
}

@keyframes machine-flicker {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.6; }
}

.buy-egg-prompt {
  text-align: center;
}

.buy-egg-prompt p {
  color: var(--gb-light);
  font-size: 14px;
  margin-bottom: 15px;
  opacity: 0.8;
}

.buy-egg-btn {
  background: var(--gb-light);
  color: var(--gb-darkest);
  border: none;
  padding: 14px 24px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
  box-shadow: 0 4px 0 var(--gb-dark);
}

.buy-egg-btn:hover {
  background: var(--gb-lightest);
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--gb-dark);
}

.buy-egg-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--gb-dark);
}

.egg-price {
  font-size: 11px;
  font-weight: normal;
  opacity: 0.8;
}

/* Battle Slot Styling */
.battle-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  background: var(--gb-dark);
  border-radius: 10px;
  width: 100%;
  max-width: 400px;
  aspect-ratio: 1;
}

.battle-video-container {
  width: 80%;
  max-width: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  border-radius: 8px;
  overflow: hidden;
}

.battle-video {
  width: 100%;
  height: auto;
  image-rendering: pixelated;
}

.battle-coming-soon {
  text-align: center;
}

.battle-coming-soon p {
  color: var(--gb-lightest);
  font-size: 18px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 2px;
  animation: pulse-text 2s ease-in-out infinite;
}

@keyframes pulse-text {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* Screen wrapper with tabs */
.screen-wrapper {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 15px;
  flex: 1 1 auto;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 0;
}

/* Action Tabs - vertical column beside the pet stage on desktop */
.action-tabs {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  width: auto;
}

.tab-btn {
  background: var(--gb-dark);
  border: none;
  border-radius: 8px;
  padding: 14px 18px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 70px;
}

.tab-btn:hover {
  background: var(--gb-light);
  transform: translateY(-2px);
}

.tab-btn:active {
  transform: translateY(1px);
  background: var(--gb-lightest);
}

.tab-icon {
  width: 24px;
  height: 24px;
  color: var(--gb-lightest);
}

.tab-btn:hover .tab-icon {
  color: var(--gb-darkest);
}

.tab-label {
  font-family: 'DotGothic16', monospace;
  font-size: 11px;
  color: var(--gb-lightest);
}

.tab-btn:hover .tab-label {
  color: var(--gb-darkest);
}

/* Level & Stage Display */
.level-stage-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
}

.level-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: 'DotGothic16', monospace;
}

.level-label {
  font-size: 24px;
  color: var(--gb-light);
  text-shadow: 2px 2px 0 var(--gb-darkest);
  line-height: 1;
}

.level-value {
  font-size: 48px;
  color: var(--gb-light);
  text-shadow: 3px 3px 0 var(--gb-darkest);
  line-height: 1;
  font-weight: bold;
}

.stage-indicator {
  font-family: 'DotGothic16', monospace;
  font-size: 20px;
  color: var(--gb-light);
  text-shadow: 2px 2px 0 var(--gb-darkest);
  text-transform: lowercase;
  padding: 6px 12px;
  background: rgba(47, 107, 81, 0.3);
  border-radius: 6px;
  border: 2px solid var(--gb-dark);
}

/* Empty/Disabled states */
.level-indicator.empty .level-value,
.level-indicator.empty .level-label {
  opacity: 0.4;
}

.stage-indicator.empty {
  opacity: 0.4;
  font-style: italic;
}

.stage-indicator.battle {
  background: rgba(139, 0, 0, 0.3);
  border-color: #8B0000;
  color: #ff6b6b;
}

/* Disabled action buttons */
.tab-btn.disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.tab-btn.disabled:hover {
  background: var(--gb-dark);
  transform: none;
}

/* Inline Buy Egg Button */
.buy-egg-btn-inline {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: var(--gb-light);
  color: var(--gb-darkest);
  border: none;
  padding: 10px 14px;
  border-radius: 8px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 4px 0 var(--gb-dark);
}

.buy-egg-btn-inline:hover {
  background: var(--gb-lightest);
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--gb-dark);
}

.buy-egg-btn-inline:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--gb-dark);
}

.buy-egg-btn-inline .buy-label {
  font-size: 14px;
  font-weight: bold;
}

.buy-egg-btn-inline .egg-price {
  font-size: 10px;
  opacity: 0.8;
}

/* Empty screen styling */
.screen.empty-screen {
  background: linear-gradient(180deg, #a8c8a0 0%, #889880 100%);
  opacity: 0.7;
}

.screen.empty-screen .machine-sprite.empty-machine {
  opacity: 0.5;
  filter: grayscale(30%);
}

/* Empty stats styling */
.stats.empty-stats .stat-bar {
  background: var(--gb-dark);
}

/* Battle screen styling */
.screen.battle-screen {
  background: linear-gradient(180deg, #2a1a1a 0%, #1a0a0a 100%);
  border-color: #8B0000;
}

.battle-container {
  position: relative;
}

.battle-container .battle-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  opacity: 0.6;
}

.battle-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 8px;
}

.battle-overlay p {
  font-size: 24px;
  color: #ff6b6b;
  text-shadow: 2px 2px 0 #000;
  letter-spacing: 4px;
  animation: pulse-text 2s ease-in-out infinite;
}

/* Battle stats styling */
.stats.battle-stats .stat-fill {
  background: linear-gradient(90deg, #8B0000, #ff6b6b);
}

/* Locked stage indicator */
.stage-indicator.locked {
  opacity: 0.5;
  font-style: italic;
  background: rgba(0, 0, 0, 0.3);
  border-color: var(--gb-dark);
}

/* Locked screen styling */
.screen.locked-screen {
  background: linear-gradient(180deg, #505050 0%, #303030 100%);
  opacity: 0.6;
}

.locked-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--gb-light);
  text-align: center;
  gap: 15px;
}

.lock-icon-large {
  font-size: 80px;
  color: var(--gb-dark);
  text-shadow: 3px 3px 0 rgba(0,0,0,0.3);
  animation: pulse-lock 2s ease-in-out infinite;
}

@keyframes pulse-lock {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.05); }
}

.locked-overlay p {
  font-size: 16px;
  color: var(--gb-light);
  opacity: 0.7;
}

/* Buy Incubator Button */
.buy-incubator-btn {
  background: linear-gradient(180deg, var(--gb-light) 0%, var(--gb-dark) 100%);
  border: 2px solid var(--gb-lightest);
}

.buy-incubator-btn:hover {
  background: linear-gradient(180deg, var(--gb-lightest) 0%, var(--gb-light) 100%);
}

/* Simple Battle Slot (Tab 4) */
.battle-slot-simple {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  margin: 0 auto;
}

.battle-video-full {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.8;
}

.battle-soon-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.6) 100%);
}

.soon-text {
  font-family: 'DotGothic16', monospace;
  font-size: 48px;
  color: var(--gb-lightest);
  text-shadow:
    3px 3px 0 var(--gb-darkest),
    0 0 20px rgba(136, 193, 122, 0.5);
  animation: soon-pulse 3s ease-in-out infinite;
}

@keyframes soon-pulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.02); }
}

/* Main screen - The Square Stage (HERO ELEMENT) */
.screen {
  background: linear-gradient(180deg, var(--gb-lightest) 0%, #c8e8b8 100%);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
  image-rendering: pixelated;
  width: 100%;
  max-width: min(75vh, 100%);
  aspect-ratio: 1;
  box-shadow:
    0 8px 32px rgba(0,0,0,0.3),
    0 0 0 3px var(--gb-dark),
    inset 0 2px 15px rgba(255,255,255,0.4);
}

/* Evolution Progress Bar */
.evolution-bar {
  background: var(--gb-light);
  border-radius: 8px;
  padding: 10px 12px;
}

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

.evo-label span:first-child {
  font-size: 18px;
  font-weight: bold;
  color: var(--gb-darkest);
}

.evo-next {
  font-size: 12px;
  color: var(--gb-dark);
  opacity: 0.8;
}

.evo-next::before {
  content: ">";
  margin-right: 5px;
}

.evo-progress {
  height: 14px;
  background: var(--gb-darkest);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}

.evo-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gb-dark), var(--gb-light));
  transition: width 0.5s ease;
  position: relative;
}

.evo-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.2) 50%, transparent 100%);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.evo-xp {
  font-size: 12px;
  color: var(--gb-darkest);
  text-align: center;
}


/* Pet display area */
.pet-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 0;
}

.machine-sprite {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: auto;
  height: 95%;
  max-height: 95%;
  aspect-ratio: 1;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  z-index: 1;
  display: none;
}

.machine-sprite.visible {
  display: block;
}

.pet-sprite {
  width: auto;
  height: 90%;
  max-height: 90%;
  aspect-ratio: 1;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(3px 3px 0 var(--gb-dark));
  z-index: 2;
  position: relative;
}

.pet-sprite.in-machine {
  height: 75%;
  max-height: 75%;
  width: auto;
  aspect-ratio: 1;
  object-fit: contain;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -48%);
}

/* Stats bars */
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 20px;
  padding: 12px 15px;
  background: var(--gb-dark);
  border-radius: 8px;
  width: 100%;
  flex-shrink: 0;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 11px;
  color: var(--gb-lightest);
}

.stat-bar {
  height: 16px;
  background: var(--gb-darkest);
  border-radius: 4px;
  overflow: hidden;
}

.stat-fill {
  height: 100%;
  background: var(--gb-light);
  transition: width 0.3s ease;
}

.stat-fill.health-bar {
  background: var(--gb-light);
}

.stat-fill.low {
  background: #8B0000;
  animation: pulse 0.5s infinite;
}

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

/* Death overlay */
.death-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 56, 15, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--gb-lightest);
  text-align: center;
  padding: 20px;
  border-radius: 10px;
  z-index: 10;
}

.death-overlay h2 {
  font-size: 20px;
  margin-bottom: 12px;
  color: #ff6b6b;
}

.death-overlay p {
  font-size: 10px;
  margin-bottom: 20px;
  line-height: 1.8;
}

.rebirth-btn {
  background: var(--gb-light);
  color: var(--gb-darkest);
  border: none;
  padding: 14px 24px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--gb-dark);
  transition: all 0.1s;
}

.rebirth-btn:hover {
  background: var(--gb-lightest);
}

.rebirth-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--gb-dark);
}

/* Pet summary bar */
.pet-summary {
  display: flex;
  justify-content: space-around;
  padding: 12px;
  font-size: 13px;
  color: var(--gb-light);
  width: 100%;
  flex-shrink: 0;
}

.pet-summary strong {
  color: var(--gb-lightest);
}

/* Side Panel */
.side-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-self: stretch;
  min-height: 0;
}

/* Wallet section */
.wallet-section {
  background: var(--gb-darkest);
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}

.wallet-header {
  background: var(--gb-dark);
  padding: 12px 15px;
  font-size: 14px;
  color: var(--gb-lightest);
}

.wallet-info {
  padding: 14px 15px;
  font-size: 13px;
  color: var(--gb-light);
}

.balance-display {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.balance-label {
  color: var(--gb-light);
  opacity: 0.8;
}

.balance-amount {
  font-size: 20px;
  color: var(--gb-lightest);
}

.connect-btn {
  width: 100%;
  background: var(--gb-light);
  color: var(--gb-darkest);
  border: none;
  padding: 16px 20px;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.1s;
}

.connect-btn:hover {
  background: var(--gb-lightest);
}

.connect-btn:disabled {
  opacity: 0.7;
  cursor: default;
}

/* Deposit controls */
.deposit-controls {
  display: flex;
  gap: 8px;
  padding: 12px 15px;
  background: rgba(0,0,0,0.2);
}

.deposit-input {
  flex: 1;
  background: var(--gb-lightest);
  border: 2px solid var(--gb-dark);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 13px;
  color: var(--gb-darkest);
  border-radius: 4px;
  min-width: 0;
}

.deposit-input::placeholder {
  color: var(--gb-dark);
  opacity: 0.7;
}

.deposit-btn {
  background: var(--gb-dark);
  color: var(--gb-lightest);
  border: none;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.1s;
  white-space: nowrap;
}

.deposit-btn:hover {
  background: var(--gb-light);
  color: var(--gb-darkest);
}

.wallet-balance {
  opacity: 0.7;
  font-size: 12px;
}

/* Activity section */
.activity-section {
  background: var(--gb-darkest);
  border-radius: 10px;
  overflow: hidden;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 200px;
}

.activity-header {
  background: var(--gb-dark);
  padding: 12px 15px;
  font-size: 14px;
  color: var(--gb-lightest);
  flex-shrink: 0;
}

.activity {
  padding: 12px;
  font-size: 12px;
  color: var(--gb-light);
  flex: 1;
  overflow-y: auto;
}

.activity-item {
  padding: 10px 8px;
  border-bottom: 1px solid var(--gb-dark);
  line-height: 1.6;
}

.activity-item:last-child {
  border-bottom: none;
}

/* Chat Panel */
.chat-panel {
  background: var(--gb-darkest);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  align-self: stretch;
  min-height: 0;
}

.chat-header {
  background: var(--gb-dark);
  padding: 12px 15px;
  font-size: 14px;
  color: var(--gb-lightest);
  flex-shrink: 0;
}

.chat-messages {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-message {
  font-size: 12px;
  color: var(--gb-light);
  padding: 10px 12px;
  background: rgba(48, 98, 48, 0.3);
  border-radius: 6px;
  word-wrap: break-word;
  line-height: 1.5;
}

.chat-message.system {
  color: var(--gb-lightest);
  background: transparent;
  font-style: italic;
  text-align: center;
  opacity: 0.8;
}

.chat-message.system a {
  color: var(--gb-lightest);
  text-decoration: underline;
  font-weight: bold;
}

.chat-message.system a:hover {
  color: #fff;
}

.chat-message .chat-wallet {
  color: var(--gb-lightest);
  font-weight: bold;
  margin-right: 6px;
}

.chat-message.own {
  background: rgba(139, 172, 15, 0.3);
}

.chat-input-area {
  display: flex;
  gap: 6px;
  padding: 10px;
  background: var(--gb-dark);
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  background: var(--gb-darkest);
  border: 2px solid var(--gb-light);
  border-radius: 6px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 13px;
  color: var(--gb-lightest);
  outline: none;
  transition: border-color 0.2s;
}

.chat-input:focus {
  border-color: var(--gb-lightest);
}

.chat-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-input::placeholder {
  color: var(--gb-light);
  opacity: 0.6;
}

.chat-send-btn {
  background: var(--gb-light);
  color: var(--gb-darkest);
  border: none;
  padding: 12px 18px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.1s;
  flex-shrink: 0;
}

.chat-send-btn:hover:not(:disabled) {
  background: var(--gb-lightest);
}

.chat-send-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.chat-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pokedex-header {
  background: var(--gb-dark);
  padding: 12px 14px;
  font-size: 14px;
  color: var(--gb-lightest);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.pokedex-count {
  font-size: 13px;
  opacity: 0.8;
}

.pokedex-tabs {
  display: flex;
  gap: 4px;
  padding: 8px;
  background: rgba(48, 98, 48, 0.3);
  flex-shrink: 0;
}

.pokedex-tab {
  flex: 1;
  background: var(--gb-dark);
  border: none;
  padding: 10px 8px;
  font-family: inherit;
  font-size: 11px;
  color: var(--gb-light);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s;
}

.pokedex-tab:hover {
  background: var(--gb-light);
  color: var(--gb-darkest);
}

.pokedex-tab.active {
  background: var(--gb-lightest);
  color: var(--gb-darkest);
}

.pokedex-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 6px;
  overflow-y: auto;
  min-height: 0;
}

.pokedex-entry {
  aspect-ratio: 1;
  background: var(--gb-dark);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  overflow: hidden;
}

.pokedex-entry:hover {
  background: var(--gb-light);
  transform: scale(1.05);
}

.pokedex-entry.locked {
  opacity: 0.4;
}

.pokedex-entry.locked::after {
  content: '?';
  font-size: 20px;
  color: var(--gb-light);
}

.pokedex-entry img {
  width: 85%;
  height: 85%;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(2px 2px 0 var(--gb-dark));
}

.pokedex-entry.locked img {
  display: none;
}

.pokedex-entry.selected {
  background: var(--gb-lightest);
  box-shadow: 0 0 0 2px var(--gb-light);
}

.pokedex-entry .entry-number {
  position: absolute;
  bottom: 2px;
  right: 3px;
  font-size: 9px;
  color: var(--gb-lightest);
  opacity: 0.7;
}

.pokedex-preview {
  background: var(--gb-light);
  margin: 8px;
  border-radius: 6px;
  padding: 12px;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.preview-placeholder {
  font-size: 12px;
  color: var(--gb-dark);
  text-align: center;
  opacity: 0.7;
}

.preview-content {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.preview-sprite {
  width: 50px;
  height: 50px;
  image-rendering: pixelated;
  filter: drop-shadow(2px 2px 0 var(--gb-dark));
}

.preview-info {
  flex: 1;
}

.preview-name {
  font-size: 14px;
  color: var(--gb-darkest);
  font-weight: bold;
  margin-bottom: 4px;
}

.preview-desc {
  font-size: 11px;
  color: var(--gb-dark);
  line-height: 1.4;
}

.preview-locked {
  text-align: center;
}

.preview-locked .lock-icon {
  font-size: 28px;
  margin-bottom: 6px;
}

.preview-locked .lock-text {
  font-size: 11px;
  color: var(--gb-dark);
}

.pokedex-rewards {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--gb-dark);
  flex-shrink: 0;
}

.reward-label {
  font-size: 11px;
  color: var(--gb-light);
}

.reward-amount {
  flex: 1;
  font-size: 18px;
  color: var(--gb-lightest);
}

.claim-btn {
  background: var(--gb-light);
  color: var(--gb-darkest);
  border: none;
  padding: 10px 16px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.1s;
}

.claim-btn:hover:not(:disabled) {
  background: var(--gb-lightest);
}

.claim-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.claim-btn.has-rewards {
  animation: reward-pulse 1s infinite;
}

@keyframes reward-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(155, 188, 15, 0.5); }
  50% { box-shadow: 0 0 0 4px rgba(155, 188, 15, 0); }
}

/* Online info */
.online-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  background: var(--gb-dark);
  border-radius: 8px;
  font-size: 14px;
  color: var(--gb-lightest);
  flex-shrink: 0;
}

.online-dot {
  width: 8px;
  height: 8px;
  background: #00ff00;
  border-radius: 50%;
  animation: blink-dot 2s infinite;
}

@keyframes blink-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}


/* ==========================================================================
   LARGE DESKTOP (1400px+) - Pet as dominant hero
   ========================================================================== */
@media (min-width: 1400px) {
  .game-container {
    /* Pet panel dominant but balanced sides */
    grid-template-columns: 1fr 3fr 1.5fr 1fr;
    max-width: 1900px;
    margin: 0 auto;
    gap: 25px;
    min-height: 75vh;
  }

  .screen {
    width: 100%;
    max-width: min(80vh, 100%);
    padding: 25px;
    border-radius: 16px;
    box-shadow:
      0 12px 40px rgba(0,0,0,0.4),
      0 0 0 4px var(--gb-dark),
      inset 0 2px 20px rgba(255,255,255,0.3);
  }

  .pet-container {
    flex: 1;
    min-height: 0;
  }

  .screen-wrapper {
    flex: 1;
    min-height: 0;
  }

  .tab-btn {
    padding: 16px 20px;
    width: 80px;
  }

  .professor-sprite {
    width: 180px;
  }

  .action-tabs {
    width: 100%;
    max-width: 600px;
  }

  .tab-btn {
    padding: 14px 20px;
  }

  .tab-icon {
    width: 28px;
    height: 28px;
  }

  .tab-label {
    font-size: 13px;
  }

  .level-stage-display {
    gap: 12px;
    padding: 15px;
  }

  .level-label {
    font-size: 28px;
  }

  .level-value {
    font-size: 56px;
  }

  .stage-indicator {
    font-size: 24px;
    padding: 8px 16px;
  }

  .buy-egg-btn-inline {
    padding: 12px 18px;
  }

  .buy-egg-btn-inline .buy-label {
    font-size: 16px;
  }

  .buy-egg-btn-inline .egg-price {
    font-size: 11px;
  }

  .battle-overlay p {
    font-size: 32px;
    letter-spacing: 6px;
  }

  .soon-text {
    font-size: 64px;
  }

  .lock-icon-large {
    font-size: 100px;
  }
}

/* ==========================================================================
   DESKTOP (1100px - 1399px) - Pet prominent but balanced
   ========================================================================== */
@media (min-width: 1100px) and (max-width: 1399px) {
  .game-container {
    /* Pet panel hero with balanced sides */
    grid-template-columns: 1fr 2.5fr 1.3fr 1fr;
    gap: 20px;
    min-height: 72vh;
  }

  .screen {
    width: 100%;
    max-width: min(78vh, 100%);
    padding: 20px;
  }

  .pet-container {
    flex: 1;
    min-height: 0;
  }

  .screen-wrapper {
    flex: 1;
    min-height: 0;
  }

  .professor-sprite {
    width: 150px;
  }
}

/* Responsive - Tablet */
@media (max-width: 1100px) {
  .game-container {
    grid-template-columns: 1fr 2fr;
    grid-template-rows: auto auto;
    align-items: stretch;
    min-height: 70vh;
  }

  .dex-professor-panel {
    grid-column: 1;
    grid-row: 1 / 3;
  }

  .pet-panel {
    grid-column: 2;
    grid-row: 1;
  }

  .chat-panel {
    grid-column: 2;
    grid-row: 2;
    min-height: 200px;
    max-height: 300px;
  }

  .side-panel {
    grid-column: 1 / 3;
    grid-row: 3;
    flex-direction: row;
  }

  .professor-section {
    flex-direction: row;
    gap: 10px;
  }

  .professor-sprite {
    width: 100px;
  }

  .professor-speech {
    margin-bottom: 0;
  }

  .professor-speech::after,
  .professor-speech::before {
    display: none;
  }

  .pokedex-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .chat-messages {
    flex-direction: column;
  }

  .screen-wrapper {
    flex-direction: column;
    gap: 12px;
  }

  .screen {
    width: 100%;
    max-width: min(70vh, 100%);
  }

  .action-tabs {
    flex-direction: row;
    width: 90%;
    max-width: 380px;
  }

  .level-stage-display {
    flex-direction: row;
    gap: 15px;
    padding: 8px 15px;
    background: rgba(47, 107, 81, 0.3);
    border-radius: 8px;
    margin-bottom: 10px;
  }

  .level-indicator {
    flex-direction: row;
    gap: 4px;
    align-items: baseline;
  }

  .level-label {
    font-size: 18px;
  }

  .level-value {
    font-size: 28px;
  }

  .stage-indicator {
    font-size: 16px;
  }

  .buy-egg-btn-inline {
    padding: 8px 12px;
  }

  .buy-egg-btn-inline .buy-label {
    font-size: 12px;
  }

  .buy-egg-btn-inline .egg-price {
    font-size: 9px;
  }

  .tab-btn {
    flex: 1;
    width: auto;
    padding: 10px 12px;
  }

  .pet-container {
    min-height: 280px;
  }

  .soon-text {
    font-size: 36px;
  }
}

@media (max-width: 800px) {
  .main-wrapper {
    padding: 10px;
  }

  .header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .header-left {
    text-align: center;
  }

  .game-container {
    grid-template-columns: 1fr;
    max-width: 520px;
    margin: 0 auto;
  }

  /* Pet panel comes FIRST on tablet/small desktop */
  .pet-panel {
    order: -1;
    grid-column: span 1;
    grid-row: span 1;
  }

  .dex-professor-panel {
    grid-column: span 1;
    grid-row: span 1;
  }

  .professor-section {
    flex-direction: row;
    padding: 10px;
    gap: 10px;
  }

  .professor-sprite {
    width: 240px;
  }

  .professor-speech {
    font-size: 10px;
    padding: 8px 10px;
    margin-bottom: 0;
  }

  .professor-speech::after,
  .professor-speech::before {
    display: none;
  }

  .pokedex-section {
    max-height: 250px;
  }

  .pokedex-grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .chat-panel {
    grid-column: span 1;
    min-height: 180px;
    max-height: 220px;
  }

  .chat-messages {
    flex-direction: column;
  }

  .side-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    flex-direction: row;
    gap: 10px;
  }

  .activity-section {
    grid-column: span 2;
  }

  .screen {
    width: 100%;
    max-width: min(65vh, 100%);
  }

  .action-tabs {
    width: 95%;
    max-width: 360px;
  }

  .pet-container {
    min-height: 260px;
  }

  .header h1 {
    font-size: 22px;
  }

  .header .subtitle {
    font-size: 11px;
  }

  .header .tagline {
    font-size: 9px;
  }

}

/* ==========================================================================
   MOBILE-FIRST REDESIGN - Pet as Hero (max-width: 550px)
   ========================================================================== */
@media (max-width: 550px) {
  body {
    padding-bottom: 60px; /* Space for bottom nav */
    overflow-x: hidden;
  }

  .main-wrapper {
    padding: 0;
    max-width: 100%;
  }

  /* HEADER - Minimal on mobile */
  .header {
    padding: 8px 12px;
    margin-bottom: 0;
    background: var(--gb-darkest);
    gap: 0;
  }

  .header h1 {
    font-size: 18px;
    margin-bottom: 0;
    color: var(--gb-lightest);
  }

  .header .subtitle,
  .header .tagline {
    display: none;
  }

  /* GAME CONTAINER - Stack vertically */
  .game-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-width: 100%;
    padding: 0;
  }

  /* HIDE SECONDARY PANELS ON MOBILE - Accessible via bottom nav */
  .dex-professor-panel,
  .chat-panel,
  .side-panel {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 60px;
    z-index: 90;
    overflow-y: auto;
    background: var(--gb-darkest);
  }

  .dex-professor-panel.mobile-visible,
  .chat-panel.mobile-visible,
  .side-panel.mobile-visible {
    display: flex;
    flex-direction: column;
    padding: 12px;
    gap: 12px;
    height: calc(100vh - 60px);
    max-height: none;
  }

  /* Mobile Panel Improvements */
  .dex-professor-panel.mobile-visible .pokedex-section {
    flex: 1;
    min-height: 0;
    max-height: none;
  }

  .dex-professor-panel.mobile-visible .pokedex-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .dex-professor-panel.mobile-visible .professor-section {
    flex-direction: row;
    padding: 12px;
    gap: 12px;
  }

  .dex-professor-panel.mobile-visible .professor-sprite {
    width: 240px;
  }

  .dex-professor-panel.mobile-visible .professor-speech {
    margin-bottom: 0;
    flex: 1;
  }

  .dex-professor-panel.mobile-visible .professor-speech::after,
  .dex-professor-panel.mobile-visible .professor-speech::before {
    display: none;
  }

  .chat-panel.mobile-visible .chat-messages {
    flex: 1;
  }

  .chat-panel.mobile-visible .chat-input {
    font-size: 16px; /* Prevent zoom on iOS */
    padding: 14px;
  }

  .chat-panel.mobile-visible .chat-send-btn {
    min-height: 48px;
    padding: 12px 20px;
  }

  .side-panel.mobile-visible {
    gap: 12px;
  }

  .side-panel.mobile-visible .wallet-section,
  .side-panel.mobile-visible .activity-section {
    flex: 0 0 auto;
  }

  .side-panel.mobile-visible .activity-section {
    flex: 1;
    min-height: 200px;
  }

  .side-panel.mobile-visible .connect-btn {
    min-height: 56px;
    font-size: 14px;
  }

  .side-panel.mobile-visible .online-info {
    margin-top: auto;
  }

  /* PET PANEL - THE HERO */
  .pet-panel {
    width: 100%;
    min-height: calc(100vh - 120px); /* Full height minus header and bottom nav */
    padding: 8px;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, var(--gb-darkest) 0%, #0a2010 100%);
  }

  /* EVOLUTION BAR - Prominent on mobile */
  .pet-panel .evolution-bar {
    padding: 12px 16px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--gb-dark) 0%, #1a4030 100%);
    border-radius: 12px;
    border: 2px solid var(--gb-light);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  }

  .pet-panel .evolution-bar .evo-label span:first-child {
    font-size: 20px;
    font-weight: bold;
    text-shadow: 2px 2px 0 var(--gb-darkest);
  }

  .pet-panel .evolution-bar .evo-next {
    font-size: 12px;
    color: var(--gb-lightest);
    opacity: 0.9;
  }

  .pet-panel .evolution-bar .evo-progress {
    height: 16px;
    border-radius: 8px;
    border: 2px solid var(--gb-light);
  }

  .pet-panel .evolution-bar .evo-xp {
    font-size: 12px;
    color: var(--gb-lightest);
    margin-top: 4px;
  }

  /* PET TABS - Compact */
  .pet-tabs {
    margin-bottom: 8px;
    gap: 4px;
  }

  .pet-tab {
    padding: 8px 6px;
    font-size: 11px;
    border-radius: 8px 8px 0 0;
  }

  /* SCREEN WRAPPER - Reorder: Screen first, then actions */
  .screen-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    min-height: 0;
    order: 1;
  }

  /* Level/Stage display on mobile - horizontal above screen */
  .level-stage-display {
    flex-direction: row;
    gap: 15px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--gb-dark) 0%, #1a4030 100%);
    border-radius: 10px;
    border: 2px solid var(--gb-light);
    margin-bottom: 8px;
    order: 0;
  }

  .level-indicator {
    flex-direction: row;
    gap: 2px;
    align-items: baseline;
  }

  .level-label {
    font-size: 16px;
  }

  .level-value {
    font-size: 24px;
  }

  .stage-indicator {
    font-size: 14px;
    background: rgba(0,0,0,0.2);
  }

  .buy-egg-btn-inline {
    padding: 8px 12px;
    flex-direction: row;
    gap: 8px;
  }

  .buy-egg-btn-inline .buy-label {
    font-size: 12px;
  }

  .buy-egg-btn-inline .egg-price {
    font-size: 10px;
  }

  .battle-overlay p {
    font-size: 18px;
    letter-spacing: 2px;
  }

  .soon-text {
    font-size: 32px;
  }

  .lock-icon-large {
    font-size: 60px;
  }

  .locked-overlay p {
    font-size: 14px;
  }

  /* THE PET STAGE - Maximum prominence */
  .screen {
    width: 90%;
    max-width: 350px;
    padding: 12px;
    border-radius: 16px;
    aspect-ratio: 1;
    background: linear-gradient(180deg, var(--gb-lightest) 0%, #c8e8b8 100%);
    box-shadow:
      inset 0 4px 20px rgba(255,255,255,0.5),
      0 8px 30px rgba(0,0,0,0.4),
      0 0 0 4px var(--gb-dark);
    order: 1;
  }

  .pet-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 250px;
  }

  /* PET SPRITE - Scale to fill */
  .pet-sprite {
    width: auto;
    height: 85%;
    max-height: 85%;
    aspect-ratio: 1;
    filter: drop-shadow(4px 4px 0 var(--gb-dark)) drop-shadow(0 8px 20px rgba(0,0,0,0.3));
    animation: pet-float 3s ease-in-out infinite;
  }

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

  .pet-sprite.in-machine {
    height: 70%;
    max-height: 70%;
    width: auto;
    animation: none;
    transform: translate(-50%, -48%);
  }

  .machine-sprite.visible {
    height: 90%;
    max-height: 90%;
    width: auto;
  }

  /* ACTION BUTTONS - Large, thumb-friendly, below screen */
  .action-tabs {
    flex-direction: row;
    width: 100%;
    max-width: 100%;
    gap: 8px;
    padding: 12px 4px;
    margin-top: 8px;
    background: var(--gb-darkest);
    border-radius: 12px;
    order: 2;
  }

  .tab-btn {
    flex: 1;
    min-height: 56px;
    padding: 10px 8px;
    border-radius: 12px;
    background: linear-gradient(180deg, var(--gb-dark) 0%, #1a4030 100%);
    border: 2px solid var(--gb-light);
    box-shadow: 0 4px 0 #0a2010;
    transition: all 0.1s ease;
  }

  .tab-btn:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 #0a2010;
    background: var(--gb-light);
  }

  .tab-btn:active .tab-icon,
  .tab-btn:active .tab-label {
    color: var(--gb-darkest);
  }

  .tab-icon {
    width: 28px;
    height: 28px;
  }

  .tab-label {
    font-size: 10px;
    font-weight: bold;
    margin-top: 2px;
  }

  /* STATS - Compact horizontal bar */
  .stats {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px 12px;
    padding: 10px 12px;
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    margin-top: 8px;
    order: 3;
  }

  .stat {
    flex: 1 1 45%;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .stat-label {
    font-size: 9px;
    min-width: 42px;
    color: var(--gb-light);
  }

  .stat-bar {
    flex: 1;
    height: 12px;
    border-radius: 6px;
  }

  /* PET SUMMARY - Inline with stats */
  .pet-summary {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    font-size: 11px;
    color: var(--gb-light);
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    margin-top: 6px;
    order: 4;
  }

  .pet-summary strong {
    color: var(--gb-lightest);
    font-size: 13px;
  }


  /* Death overlay improvements */
  .death-overlay {
    border-radius: 16px;
  }

  .death-overlay h2 {
    font-size: 24px;
  }

  .rebirth-btn {
    padding: 16px 32px;
    font-size: 14px;
    min-height: 48px;
  }

  /* Empty slot improvements */
  .empty-slot,
  .battle-slot {
    min-height: 50vh;
    aspect-ratio: auto;
  }

  .buy-egg-btn {
    padding: 16px 24px;
    font-size: 16px;
    min-height: 56px;
  }
}

/* ==========================================================================
   BOTTOM NAVIGATION - Mobile Only
   ========================================================================== */
.bottom-nav {
  display: none;
}

@media (max-width: 550px) {
  .pet-panel.mobile-hidden {
    display: none;
  }

  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--gb-darkest);
    border-top: 2px solid var(--gb-dark);
    z-index: 100;
    justify-content: space-around;
    align-items: center;
    padding: 0 8px;
  }

  .nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 4px;
    background: none;
    border: none;
    color: var(--gb-light);
    font-family: inherit;
    font-size: 10px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.15s;
    min-height: 48px;
  }

  .nav-btn:hover,
  .nav-btn.active {
    background: var(--gb-dark);
    color: var(--gb-lightest);
  }

  .nav-btn svg {
    width: 24px;
    height: 24px;
  }

  .nav-btn span {
    font-size: 9px;
    text-transform: uppercase;
  }
}

/* Very small screens */
@media (max-width: 380px) {
  .header h1 {
    font-size: 16px;
  }

  .header .tagline,
  .header .subtitle {
    display: none;
  }

  /* Keep action tabs usable */
  .tab-btn {
    min-height: 52px;
    padding: 8px 6px;
  }

  .tab-icon {
    width: 24px;
    height: 24px;
  }

  .tab-label {
    font-size: 8px;
  }

  .pet-panel .evolution-bar .evo-label span:first-child {
    font-size: 16px;
  }

  .pet-sprite {
    min-width: 150px;
    min-height: 150px;
  }

  .stats {
    gap: 4px 8px;
    padding: 8px;
  }

  .stat-label {
    font-size: 8px;
    min-width: 36px;
  }

  .stat-bar {
    height: 10px;
  }

  .nav-btn span {
    font-size: 8px;
  }
}

/* ==========================================================================
   MARQUEE BANNER
   ========================================================================== */
.marquee-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--gb-darkest);
  border-top: 3px solid var(--gb-light);
  overflow: hidden;
  z-index: 99;
  display: flex;
  align-items: center;
}

.marquee-content {
  display: flex;
  white-space: nowrap;
  animation: marquee 15s linear infinite;
}

.marquee-content span {
  padding: 0 60px;
  color: var(--gb-lightest);
  font-size: 32px;
  font-family: inherit;
  font-weight: bold;
}

.marquee-content span a,
.marquee-content span {
  color: var(--gb-lightest);
}

@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* Adjust body padding for marquee */
body {
  padding-bottom: 60px;
}

@media (max-width: 550px) {
  .marquee-banner {
    display: none;
  }

  body {
    padding-bottom: 60px; /* Just bottom nav */
  }
}

/* No Tokens Overlay */
.no-tokens-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(7, 24, 32, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: overlayFadeIn 0.3s ease;
}

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

.no-tokens-modal {
  background: linear-gradient(135deg, var(--gb-dark) 0%, var(--gb-darkest) 100%);
  border: 4px solid var(--gb-light);
  border-radius: 20px;
  padding: 40px;
  text-align: center;
  max-width: 450px;
  margin: 20px;
  animation: modalBounce 0.5s ease;
  box-shadow: 0 0 60px rgba(136, 193, 122, 0.4);
}

@keyframes modalBounce {
  0% { transform: scale(0.8); opacity: 0; }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

.no-tokens-icon {
  font-size: 64px;
  margin-bottom: 16px;
  animation: iconPulse 1.5s ease-in-out infinite;
}

@keyframes iconPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.no-tokens-modal h2 {
  color: var(--gb-lightest);
  font-size: 28px;
  margin-bottom: 12px;
  text-shadow: 2px 2px 0 var(--gb-darkest);
}

.no-tokens-modal p {
  color: var(--gb-light);
  font-size: 16px;
  margin-bottom: 24px;
  line-height: 1.5;
}

.buy-tokens-btn {
  display: block;
  background: linear-gradient(180deg, #9BBC0F 0%, #7AA30D 100%);
  color: var(--gb-darkest);
  text-decoration: none;
  padding: 18px 36px;
  border-radius: 12px;
  font-size: 18px;
  font-weight: bold;
  font-family: inherit;
  border: 3px solid var(--gb-lightest);
  cursor: pointer;
  transition: all 0.2s ease;
  animation: btnGlow 2s ease-in-out infinite;
  box-shadow: 0 4px 15px rgba(155, 188, 15, 0.4);
}

.buy-tokens-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 25px rgba(155, 188, 15, 0.6);
}

@keyframes btnGlow {
  0%, 100% { box-shadow: 0 4px 15px rgba(155, 188, 15, 0.4); }
  50% { box-shadow: 0 4px 30px rgba(155, 188, 15, 0.8); }
}

.dismiss-btn {
  background: transparent;
  border: 2px solid var(--gb-dark);
  color: var(--gb-light);
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  margin-top: 16px;
  transition: all 0.2s ease;
  opacity: 0.7;
}

.dismiss-btn:hover {
  opacity: 1;
  border-color: var(--gb-light);
}

/* Red flash for no tokens warning */
@keyframes redFlash {
  0%, 100% { box-shadow: inset 0 0 0 transparent; }
  50% { box-shadow: inset 0 0 30px rgba(255, 100, 100, 0.5); }
}

.wallet-section.no-tokens {
  animation: redFlash 1s ease-in-out 3;
  border: 2px solid #ff6b6b;
}

/* Professor urgent state */
.professor-section.urgent {
  animation: professorUrgent 0.5s ease-in-out 3;
}

@keyframes professorUrgent {
  0%, 100% { background: var(--gb-darkest); }
  50% { background: #3d2020; }
}
