/* 1. Global Reset & Box Model Fix */
* {
  /* This ensures padding doesn't push elements off the screen */
  box-sizing: border-box; 
  -webkit-text-size-adjust: 100%; /* Prevents mobile font-size "inflation" */
  text-size-adjust: 100%;
}

/* 2. Main Page Layout */
body {
  font-family: "Courier New", Courier, mono;
  background-color: #000000;
  color: #ffffff;
  
  /* Desktop/Default: The 90px margin you like */
  margin: 20px 0 20px 90px;
  max-width: 800px;
  width: auto;
  
  /* Safety & Scaling */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  word-wrap: break-word;
  overflow-x: hidden;
}

/* 3. Typography & Links */
p { 
  text-align: justify; 
  line-height: 1.4; 
}

a:link, a:visited {
  color: #ffffff;
}

td, th {
  font-family: "Courier New", Courier, mono;
}

/* 4. Images & Media */
.topicimage, img {
  max-width: 100%; /* Never wider than the phone screen */
  height: auto;
  display: block;
  margin-top: 10px;
  margin-bottom: 10px;
}

/* 5. Inputs & Forms */
textarea {
  font-family: "Courier New", Courier, mono;
  resize: none;
  padding: 10px;
  width: 100%; /* Fills the 800px (or phone width) container */
  background-color: #111; /* Slight offset for contrast */
  color: #ffffff;
  border: 1px solid #444;
}

/* 6. Header Logic */
/* Ensuring the Flexbox header doesn't force a horizontal scroll */
.header-container {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 20px;
  max-width: 100%;
}

.header-container img {
  height: auto;
  width: auto;
  flex-shrink: 0;
}

/* New input rules for the whole site */
input[type="text"], 
input[type="password"] {
    width: 300px; 
    max-width: 100%; 
    padding: 8px;
    font-family: "Courier New", Courier, mono;
    box-sizing: border-box;
    background-color: #000;
    color: #fff;
    border: 1px solid #ffffff;
}

input[type="submit"] {
    padding: 10px 20px;
    cursor: pointer;
    font-family: "Courier New", Courier, mono;
    background-color: #ffffff;
    color: #000000;
    border: none;
}

/* Mobile Fix: If the screen is smaller than 800px... */
@media screen and (max-width: 800px) {
  body {
    /* Remove the 90px margin so it doesn't squash the text on a phone */
    margin: 20px 0;
    /* Use 20px padding instead so text doesn't touch the glass edge */
    padding-left: 20px;
    padding-right: 20px;
  }
}