:root {
  --page-margin: clamp(20px, 4vw, 40px);
  --logo-max-width: clamp(100px, 15vw, 200px);
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background-image: url("Background.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.brand {
  position: fixed;
  top: var(--page-margin);
  left: var(--page-margin);
  display: inline-block;
  padding: 10px;
}

.brand img {
  max-width: var(--logo-max-width);
  width: 100%;
  height: auto;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
  user-select: none;
  -webkit-user-drag: none;
}

/* Retro Chat Navigation Styles */
.chat-container {
  position: fixed;
  bottom: var(--page-margin);
  right: var(--page-margin);
  width: 400px;
  max-width: calc(100vw - 2 * var(--page-margin));
  z-index: 1000;
}

.chat-window {
  background: rgba(0, 0, 0, 0.9);
  border: 2px solid #00ff00;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
  font-family: 'VT323', monospace;
  color: #00ff00;
  overflow: hidden;
  position: relative;
  transition: height 0.3s ease;
}

.chat-header {
  background: #001100;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #00ff00;
}

.terminal-title {
  font-size: 14px;
  font-weight: bold;
  text-shadow: 0 0 5px #00ff00;
}

.terminal-controls {
  display: flex;
  gap: 8px;
}

.control {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.2s ease;
  font-size: 12px;
  font-weight: bold;
}

.control:hover {
  background: rgba(0, 255, 0, 0.2);
  transform: scale(1.1);
}

.control:active {
  transform: scale(0.95);
}

.control.minimize {
  color: #ffff00;
}

.control.maximize {
  color: #00ffff;
}

.control.close {
  color: #ff6666;
}

.control.close:hover {
  background: rgba(255, 102, 102, 0.2);
}

.chat-content {
  height: 300px;
  padding: 12px;
  overflow-y: auto;
  line-height: 1.4;
  transition: display 0.3s ease;
}

.chat-message {
  margin-bottom: 8px;
  animation: fadeIn 0.3s ease-in;
}

.chat-message.computer {
  color: #00ff00;
}

.chat-message.user {
  color: #ffff00;
}

.chat-message.system {
  color: #ff6600;
}

.chat-input-area {
  padding: 12px;
  border-top: 1px solid #00ff00;
  background: #000800;
  transition: display 0.3s ease;
}

.prompt {
  color: #00ff00;
  font-weight: bold;
  margin-right: 8px;
}

.input-options {
  margin-top: 8px;
}

.option-button {
  display: block;
  width: 100%;
  padding: 8px 12px;
  margin: 4px 0;
  background: transparent;
  border: 1px solid #00ff00;
  color: #00ff00;
  font-family: 'VT323', monospace;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.option-button:hover {
  background: rgba(0, 255, 0, 0.1);
  box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.option-button:active {
  background: rgba(0, 255, 0, 0.2);
}

.typing-indicator {
  color: #00ff00;
  animation: blink 1s infinite;
}

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

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

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

/* Responsive adjustments */
@media (max-width: 480px) {
  :root {
    --logo-max-width: clamp(100px, 28vw, 180px);
  }
  
  .chat-container {
    width: calc(100vw - 2 * var(--page-margin));
    bottom: 10px;
    right: 10px;
  }
  
  .chat-content {
    height: 250px;
  }
}

/* Smooth transitions for window controls */
.chat-content, .chat-input-area {
  transition: display 0.3s ease;
}

/* Responsive adjustments for maximized state */
.chat-container.maximized {
  width: calc(100vw - 2 * var(--page-margin)) !important;
  height: calc(100vh - 2 * var(--page-margin)) !important;
}

.chat-container.minimized .chat-window {
  height: 40px !important;
}



/* Inside mode background */
body.inside-mode {
  background-image: url("inside.png");
}

/* Pong overlay */
.pong-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pong-wrapper {
  position: relative;
  background: #000;
  border: 2px solid #00ff00;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
  padding: 16px 16px 12px;
}

.pong-instructions {
  color: #00ff00;
  font-family: 'VT323', monospace;
  font-size: 16px;
  margin-bottom: 8px;
  text-align: center;
}

.pong-canvas {
  display: block;
  background: #000000;
}

.pong-close {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #00ff00;
  background: #000;
  color: #00ff00;
  font-family: 'VT323', monospace;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.pong-close:hover {
  background: rgba(0, 255, 0, 0.1);
}
