:root{--bg:#000;--fg:#00ff41;--err:#ff4d4d;--info:#61dafb;--muted:#8f8f8f}
html,body{height:100%;margin:0;font-family:monospace;font-size:16px;background:var(--bg);color:var(--fg)}
.container{display:flex;flex-direction:column;height:100vh}
.terminal{flex:1;overflow:auto;padding:12px;box-sizing:border-box}
.line{white-space:pre-wrap}
.prompt{display:inline}
.input{outline:none;border:none;background:transparent;color:var(--fg);font:inherit;width:80%}
.system{color:var(--muted)}
.err{color:var(--err)}
.info{color:var(--info)}
.muted{color:var(--muted)}
.bottom-line{border-top:1px solid #333;padding:8px;display:flex;gap:8px;align-items:center}
.flag-box{display:flex;gap:6px;align-items:center}
.flag-box input{padding:6px;border-radius:4px;border:1px solid #333;background:#111;color:var(--fg)}
.flag-box button{padding:6px 10px;border-radius:4px;border:none;background:#222;color:var(--fg);cursor:pointer}
/* Fix the Reset button */
.reset-btn {
  padding: 6px 12px;
  border-radius: 6px;
  background: #8b0000;
  border: 1px solid #550000;
  color: #fff;
  cursor: pointer;
  font: inherit;
}

/* On hover */
.reset-btn:hover {
  filter: brightness(1.1);
}


.modal{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);background:#111;border:1px solid #333;padding:12px;z-index:50;max-height:80vh;overflow:auto}
.overlay{position:fixed;inset:0;background:rgba(0,0,0,0.6);z-index:40}
.nano-area {
  width: 90vw;
  height: 55vh;
  background: #000;
  color: var(--fg);
  padding: 8px;
  border: 1px solid #333;
  resize: both;
  box-sizing: border-box;
  font-family: monospace;
  font-size: clamp(12px, 3vw, 16px);
}

/* Make Nano window usable on mobile */
@media (max-width: 600px) {
  .nano-area {
    width: 95vw;
    height: 45vh;  /* leaves room for keyboard and buttons */
  }

  .modal {
    width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
  }

  .modal button {
    font-size: 14px;
    padding: 6px 10px;
  }
}
.table{width:90vw;border-collapse:collapse}
.table td,.table th{border:1px solid #333;padding:4px}




.browser-window {
    position: fixed;  /* float above all other elements */
    top: 50px;
    left: 50px;
    width: 600px;
    height: 80vh;
    border: 2px solid #333;
    background: #f5f5f5;  /* light background */
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    z-index: 9999;  /* VERY high so it appears above everything */
    border-radius: 8px;
    overflow: hidden;
	resize: both
}





.browser-titlebar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(90deg, #4a90e2, #357ABD);
    color: #fff;
    padding: 5px 10px;
    font-weight: bold;
    cursor: move;
}

.browser-controls button {
    margin-left: 5px;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: none;
    font-weight: bold;
    cursor: pointer;
    background: rgba(255,255,255,0.2);
    color: #fff;
    transition: background 0.2s;
}

.browser-controls button:hover {
    background: rgba(255,255,255,0.4);
}

.browser-addressbar {
    display: flex;
    border-bottom: 1px solid #ccc;
    padding: 5px;
    background: #eee;
}

.browser-addressbar input {
    flex: 1;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.browser-addressbar button {
    margin-left: 5px;
    padding: 5px 10px;
    border: none;
    background: #357ABD;
    color: white;
    border-radius: 4px;
    cursor: pointer;
}

.browser-content {
    flex: 1;
    border: none;
    width: 100%;
    background: white;
}



/* Mobile-friendly terminal layout */
html, body {
  touch-action: manipulation;
  overscroll-behavior: contain;
}

.container {
  max-width: 100vw;
  max-height: 100vh;
  overflow: hidden;
}

.terminal {
  font-size: clamp(10px, 3vw, 16px); /* scale text for smaller screens */
  padding: 8px;
  overflow-y: auto;
  white-space: pre-wrap;
}

.bottom-line {
  flex-wrap: wrap;
  gap: 4px;
  justify-content: space-between;
  font-size: clamp(10px, 3vw, 14px);
}

.flag-box input {
  flex: 1 1 100px;
  min-width: 70px;
  font-size: inherit;
}

.flag-box button {
  flex: 0 0 auto;
  font-size: inherit;
}


@media (max-width: 600px) {
  .bottom-line {
    flex-direction: column;
    align-items: stretch;
  }
  .terminal {
    height: calc(100vh - 160px);
  }
}

/* === Responsive Fix for Modals and Floating Windows === */

/* General modals */
.modal {
  max-width: 95vw;
  max-height: 85vh;
  overflow-y: auto;
  font-size: clamp(12px, 3vw, 16px);
}

/* Draggable browser windows (Chronium, Wireshark, etc.) */
.browser-window {
  width: 90vw;
  height: 80vh;
  top: 10vh;
  left: 5vw;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  resize: both
}

/* For small devices (phones) */
@media (max-width: 600px) {
  .browser-window {
    width: 95vw;
    height: 85vh;
    top: 7.5vh;
    left: 2.5vw;
	resize: both
  }

  .browser-titlebar {
    font-size: 14px;
    padding: 6px 8px;
  }

  .browser-addressbar input {
    font-size: 14px;
    padding: 4px;
  }

  .browser-addressbar button {
    font-size: 14px;
    padding: 4px 8px;
  }

  .nano-area {
    width: 90vw;
    height: 60vh;
  }
}

/* Mobile history / tab buttons */
.mobile-controls {
  display: none; /* desktop: hidden */
}

@media (max-width: 600px) {
  .mobile-controls {
    position: fixed;
    top: 50%;               /* middle vertically */
    right: 10px;            /* right edge */
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 60;
    pointer-events: auto;
  }

  .mobile-controls button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(0,0,0,0.25);
    color: var(--fg);
    font-size: 18px;
    padding: 0;
    cursor: pointer;
  }

  .mobile-controls button:active {
    background: rgba(0,0,0,0.45);
  }
}

@media(max-width:600px){
  #resetBtn {
    display: none !important;
  }
}

@media(max-width:600px){
  #btnReboot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255,0,0,0.4);
    background: rgba(255,0,0,0.15);
    color: rgba(255,0,0,0.8);
    font-size: 20px;
    padding: 0;
    cursor: pointer;
  }

  #btnReboot:active {
    background: rgba(255,0,0,0.3);
  }
}



@media(max-width:600px){.nano-area{width:95vw;height:55vh}}
.reset-btn:hover{filter:brightness(1.1)}
