* {
  box-sizing: border-box;
}

body {
  text-align: center;
  background-color: #000000;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  margin: 0;
  padding: 0;
  color: #00ff00;
  line-height: 1.5;
  overflow-x: hidden;
}

/* CRT scanlines effect */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.09) 2px,
    rgba(0, 0, 0, 0.09) 4px
  );
  pointer-events: none;
  z-index: 100;
}

/* Terminal window frame */
div {
  position: relative;
  max-width: 900px;
  margin: 40px auto;
  padding: 20px;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a0a1a 100%);
  border: 3px solid #00ff00;
  box-shadow: 
    0 0 10px rgba(0, 255, 0, 0.5),
    inset 0 0 20px rgba(0, 255, 0, 0.1),
    0 0 40px rgba(0, 0, 0, 0.8);
  background-clip: padding-box;
}

/* Terminal header bar */
div::before {
  content: '[ PORTFOLIO.EXE ] [ STATUS: RUNNING ] [ USER: VIEWER ]';
  display: block;
  background-color: #00ff00;
  color: #000000;
  padding: 8px;
  margin: -20px -20px 20px -20px;
  font-weight: bold;
  border-bottom: 2px solid #00ff00;
  border-radius: 0;
  font-size: 0.9em;
  letter-spacing: 2px;
}

div .pad::before {
  content: '';
  display: block;
  background-color: #00ff00;
  color: #000000;
  padding: 8px;
  margin: -20px -20px 20px -20px;
  font-weight: bold;
  border-bottom: 2px solid #00ff00;
  border-radius: 0;
  font-size: 0.9em;
  letter-spacing: 2px;
}

h3.story {
  color: #00ff00;
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  text-align: left;
  background-color: rgba(0, 0, 0, 0.5);
  border: 2px solid #00ff00;
  border-radius: 2px;
  text-shadow: 0 0 10px #00ff00;
  white-space: pre-wrap;
  word-wrap: break-word;
  min-height: 200px;
}

img {
  max-width: 100%;
  height: auto;
  margin: 20px 0;
  opacity: 0.9;
}

/* Story text animation */
.story {
  text-align: center !important;
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

li {
  color: #00ff00;
  padding: 10px 15px;
  margin: 8px 0;
  background-color: rgba(0, 0, 0, 0.6);
  border-left: 3px solid #00ff00;
  border-right: 3px solid #00ff00;
  transition: all 0.2s ease;
  text-align: center;
  position: relative;
}

li::before {
  content: '';
  color: #00ff00;
  font-weight: bold;
}

.well {
  background: none;
  padding: 20px;
  border-radius: 0;
  line-height: 2;
  background-color: rgba(0, 0, 0, 0.4);
}

/* Input field styling */
.pad {
  padding: 20px;
  background-color: rgba(0, 0, 0, 0.6);
  border: 2px solid #00ff00;
  border-radius: 0;
  margin: 20px 0;
}

#input {
  padding: 12px 15px;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  background: transparent;
  color: #00ff00;
  border: none;
  border-bottom: 2px solid #00ff00;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  outline: none;
  text-shadow: 0 0 5px #00ff00;
  transition: all 0.2s ease;
  caret-color: #00ff00;
}

#input::placeholder {
  color: rgba(0, 255, 0, 0.5);
}

#input:focus {
  border-bottom-color: #ffff00;
  box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
  text-shadow: 0 0 10px #00ff00;
}

/* Submit button */
#submit,
.bttn {
  color: #000000;
  background-color: #00ff00;
  border: 2px solid #00ff00;
  border-radius: 0;
  padding: 12px 30px;
  font-family: 'Courier New', monospace;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 12px;
}

#submit:hover,
.bttn:hover {
  background-color: #ffff00;
  box-shadow: 0 0 20px rgba(255, 255, 0, 0.7);
  transform: scale(1.05);
}

#submit:active,
.bttn:active {
  transform: scale(0.95);
}

/* Morse code footer */
.morse {
  color: rgba(0, 255, 0, 0.3);
  font-size: 10px;
  margin: 30px 0 10px 0;
  letter-spacing: 3px;
  animation: morse-pulse 10s ease-in-out infinite;
}

@keyframes morse-pulse {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.5; }
}

/* Terminal blink animations */
@keyframes termBlink {
  0%, 49% { color: #00ff00; text-shadow: 0 0 10px #00ff00; }
  50%, 100% { color: #008000; text-shadow: none; }
}

@keyframes blackWhite {
  0%, 49% { background-color: #000000; }
  50%, 100% { background-color: #0a0a0a; }
}

.blinkdiv {
  animation: blackWhite 12s ease-in-out infinite;
}

.blink {
  animation: termBlink 15s ease-in-out infinite;
}

/* Color classes for game text */
.term-col {
  color: #00ff00;
  text-shadow: 0 0 10px #00ff00;
}

.err-col {
  color: #ff0000;
  text-shadow: 0 0 10px #ff0000;
}

/* Typewriter effect */
.typewriter {
  color: #00ff00;
  font-family: 'Courier New', monospace;
  overflow: hidden;
  border-right: 2px solid #00ff00;
  white-space: pre-wrap;
  margin: 0 auto;
  letter-spacing: 0.1em;
  animation: 
    typing 3.5s steps(40, end),
    blink-caret 0.75s step-end infinite;
  text-shadow: 0 0 10px #00ff00;
}

@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink-caret {
  from, to { border-right-color: transparent; }
  50% { border-right-color: #00ff00; }
}

/* System status messages */
.system-msg {
  color: #ffff00;
  background-color: rgba(0, 0, 0, 0.7);
  padding: 10px;
  margin: 10px 0;
  border: 1px dashed #ffff00;
  font-size: 12px;
  text-shadow: 0 0 5px #ffff00;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  h3.story {
    padding: 15px;
    min-height: 150px;
    font-size: 13px;
  }
  
  #input {
    max-width: 90%;
    font-size: 13px;
  }
  
  li {
    font-size: 13px;
  }
  
  div {
    margin: 20px auto;
    padding: 15px;
  }
}