html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

/* Mobile height fix */
@media screen and (max-width: 768px) {
  html, body {
    height: 100vh;
    height: 100svh; /* Use small viewport height for mobile */
    overflow: hidden;
  }
  
  .terminal {
    height: 100vh !important;
    height: 100svh !important;
    min-height: 100vh;
    min-height: 100svh;
    width: 100% !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
  }
  
  .terminal .terminal-output {
    height: calc(100vh - 60px) !important;
    height: calc(100svh - 60px) !important;
    overflow-y: auto;
    padding: 10px;
  }
  
  .terminal .terminal-scroller {
    height: 100% !important;
  }
  
  /* ASCII art logo - dynamic responsive sizing */
  .terminal-output div:first-child {
    font-family: 'Courier New', 'Monaco', 'Menlo', monospace !important;
    font-size: clamp(3px, 0.8vw, 14px) !important;
    line-height: 1.0 !important;
    letter-spacing: 0 !important;
    word-spacing: 0 !important;
    white-space: pre !important;
    overflow-x: auto;
    text-rendering: optimizeSpeed;
    -webkit-font-feature-settings: "kern" 0;
    font-feature-settings: "kern" 0;
    position: sticky !important;
    top: 0 !important;
    background-color: #000 !important;
    z-index: 10 !important;
    margin: 0 !important;
    padding: 10px 0 !important;
    border-bottom: none !important;
  }
  
  /* Input line mobile optimization */
  .terminal .terminal-cursor {
    font-size: 16px !important;
  }
  
  .terminal .terminal-command {
    font-size: 16px !important;
  }
}

.terminal {
  --color: rgba(0, 200, 0, 0.99);
  --glow: 1;
}

@media screen and (min-width: 1200px) {
  :root {
    --size: 1.5;
  }
  .terminal-output div:last-child {
    font-size: var(--size) !important;
  }
}

@media (max-width: 600px) {
  .terminal-output div:last-child {
    font-size: 20px !important;
  }
}

.terminal-output div:last-child {
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Game View Styles */
.game-view {
  position: fixed;
  inset: 0;
  background-color: #000;
  display: none;
  z-index: 1000;
}

.game-view.active {
  display: block;
}

.game-toggle {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 0.5rem 1rem;
  background-color: transparent;
  color: var(--color);
  border: 2px solid var(--color);
  font-family: monospace;
  cursor: pointer;
  z-index: 1001;
  font-size: 1rem;
}

.game-toggle:hover {
  background-color: var(--color);
  color: #000;
}

.grass-background {
  position: absolute;
  inset: 0;
  background-size: 32px 32px;
  background-image: 
    linear-gradient(to right, rgba(0, 200, 0, 0.1) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 200, 0, 0.1) 1px, transparent 1px);
}

.terminal-console {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 48px;
  border: 2px solid var(--color);
  background-color: #000;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
}

.terminal-console::after {
  content: '>';
  color: var(--color);
  font-family: monospace;
  font-size: 24px;
}

.terminal-console:hover {
  background-color: rgba(0, 200, 0, 0.2);
}

@media (max-width: 600px) {
  .game-toggle {
    font-size: 16px;
    bottom: 1rem;
    right: 1rem;
  }
  
  .terminal-console {
    width: 48px;
    height: 36px;
  }
}