@import url('https://fonts.googleapis.com/css2?family=VT323&family=Press+Start+2P&display=swap');

@font-face {
  font-family: "Pixelated MS Sans Serif";
  src: url(https://unpkg.com/98.css@0.1.16/dist/ms_sans_serif.woff) format("woff");
  src: url(https://unpkg.com/98.css@0.1.16/dist/ms_sans_serif.woff2) format("woff2");
  font-weight: 400;
  font-style: normal;
  -webkit-font-smoothing: none;
}

:root {
  --win-bg: #c0c0c0;
  --win-title: #000080;
  --win-title-inactive: #808080;
  --win-border-light: #ffffff;
  --win-border-dark: #808080;
  --win-border-darker: #000000;
  --win-button: #c0c0c0;
  --desktop-bg: #008080;
  --text: #000000;
  --link: #0000ff;
  --link-visited: #800080;
  --input-bg: #ffffff;
  --error: #ff0000;
  --success: #008000;
  --highlight: #ffff00;
}

*, html, body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
  font-smooth: never;
}

body {
  font-family: "Pixelated MS Sans Serif", 'Arial', sans-serif;
  font-size: 14px;
  background: var(--desktop-bg);
  color: var(--text);
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
}

/* taskbar */

.taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 36px;
  background: var(--win-bg);
  border-top: 2px solid var(--win-border-light);
  display: flex;
  align-items: center;
  padding: 2px 4px;
  z-index: 9999;
  gap: 4px;
}

.start-btn {
  font-family: "Pixelated MS Sans Serif", Arial, sans-serif;
  font-size: 12px;
  padding: 4px 12px;
  background: var(--win-bg);
  border-top: 2px solid var(--win-border-light);
  border-left: 2px solid var(--win-border-light);
  border-right: 2px solid var(--win-border-dark);
  border-bottom: 2px solid var(--win-border-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: bold;
}

.start-btn:active {
  border-top: 2px solid var(--win-border-dark);
  border-left: 2px solid var(--win-border-dark);
  border-right: 2px solid var(--win-border-light);
  border-bottom: 2px solid var(--win-border-light);
}

.start-btn img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
}

.taskbar-clock {
  margin-left: auto;
  font-size: 12px;
  padding: 2px 8px;
  border-top: 2px solid var(--win-border-dark);
  border-left: 2px solid var(--win-border-dark);
  border-right: 2px solid var(--win-border-light);
  border-bottom: 2px solid var(--win-border-light);
  background: var(--win-bg);
}

.taskbar-tab {
  font-family: "Pixelated MS Sans Serif", Arial, sans-serif;
  font-size: 12px;
  padding: 3px 8px;
  background: var(--win-bg);
  border-top: 2px solid var(--win-border-light);
  border-left: 2px solid var(--win-border-light);
  border-right: 2px solid var(--win-border-dark);
  border-bottom: 2px solid var(--win-border-dark);
  cursor: pointer;
  max-width: 150px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.taskbar-tab.active {
  border-top: 2px solid var(--win-border-dark);
  border-left: 2px solid var(--win-border-dark);
  border-right: 2px solid var(--win-border-light);
  border-bottom: 2px solid var(--win-border-light);
  background: #dfdfdf;
}

/* desktop */

.desktop {
  padding: 8px;
  padding-bottom: 44px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.desktop-icons {
  position: fixed;
  top: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 1;
}

.desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 4px;
  width: 80px;
  text-align: center;
}

.desktop-icon:hover {
  background: rgba(0, 0, 128, 0.3);
}

.desktop-icon span {
  font-size: 12px;
  color: white;
  text-shadow: 1px 1px 0 #000;
}

.desktop-icon .icon-img {
  font-size: 32px;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
}

/* windows */

.window {
  background: var(--win-bg);
  border-top: 2px solid var(--win-border-light);
  border-left: 2px solid var(--win-border-light);
  border-right: 2px solid var(--win-border-darker);
  border-bottom: 2px solid var(--win-border-darker);
  box-shadow: 1px 1px 0 var(--win-border-darker);
  min-width: 400px;
  max-width: 900px;
  width: 90%;
  margin-top: 20px;
}

.window-title {
  background: linear-gradient(90deg, var(--win-title), #1084d0);
  color: white;
  padding: 3px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: bold;
  font-size: 13px;
  user-select: none;
}

.window-title-text {
  display: flex;
  align-items: center;
  gap: 6px;
}

.window-controls {
  display: flex;
  gap: 2px;
}

.window-controls button {
  width: 18px;
  height: 18px;
  background: var(--win-bg);
  border-top: 2px solid var(--win-border-light);
  border-left: 2px solid var(--win-border-light);
  border-right: 2px solid var(--win-border-dark);
  border-bottom: 2px solid var(--win-border-dark);
  font-size: 10px;
  line-height: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-family: "Pixelated MS Sans Serif", Arial, sans-serif;
}

.window-controls button:active {
  border-top: 2px solid var(--win-border-dark);
  border-left: 2px solid var(--win-border-dark);
  border-right: 2px solid var(--win-border-light);
  border-bottom: 2px solid var(--win-border-light);
}

.window-body {
  padding: 8px;
  border-top: 2px solid var(--win-border-dark);
  border-left: 2px solid var(--win-border-dark);
  border-right: 2px solid var(--win-border-light);
  border-bottom: 2px solid var(--win-border-light);
  margin: 2px;
}

.window-statusbar {
  border-top: 2px solid var(--win-border-dark);
  padding: 2px 6px;
  font-size: 12px;
  display: flex;
  gap: 8px;
}

.statusbar-section {
  border-top: 2px solid var(--win-border-dark);
  border-left: 2px solid var(--win-border-dark);
  border-right: 2px solid var(--win-border-light);
  border-bottom: 2px solid var(--win-border-light);
  padding: 1px 6px;
  flex: 1;
}

/* menu bar */

.menu-bar {
  display: flex;
  gap: 0;
  padding: 2px 4px;
  border-bottom: 1px solid var(--win-border-dark);
}

.menu-item {
  padding: 2px 8px;
  cursor: pointer;
  font-size: 13px;
}

.menu-item:hover {
  background: var(--win-title);
  color: white;
}

/* buttons */

.btn {
  font-family: "Pixelated MS Sans Serif", Arial, sans-serif;
  font-size: 14px;
  padding: 4px 16px;
  background: var(--win-bg);
  border-top: 2px solid var(--win-border-light);
  border-left: 2px solid var(--win-border-light);
  border-right: 2px solid var(--win-border-dark);
  border-bottom: 2px solid var(--win-border-dark);
  cursor: pointer;
  line-height: normal;
  height: auto;
  color: var(--text);
  text-align: center;
  outline: none;
}

.btn:active {
  border-top: 2px solid var(--win-border-dark);
  border-left: 2px solid var(--win-border-dark);
  border-right: 2px solid var(--win-border-light);
  border-bottom: 2px solid var(--win-border-light);
}

.btn:disabled {
  color: var(--win-border-dark);
  cursor: not-allowed;
}

.btn-primary {
  font-weight: bold;
  outline: 1px solid var(--win-border-darker);
}

/* inputs */

input[type="text"],
input[type="number"],
input[type="search"],
textarea,
select {
  font-family: "Pixelated MS Sans Serif", Arial, sans-serif;
  font-size: 14px;
  padding: 3px 4px;
  background: var(--input-bg);
  border-top: 2px solid var(--win-border-dark);
  border-left: 2px solid var(--win-border-dark);
  border-right: 2px solid var(--win-border-light);
  border-bottom: 2px solid var(--win-border-light);
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus {
  outline: 1px dotted var(--win-title);
}

/* tables */

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th {
  background: var(--win-bg);
  border: 1px solid var(--win-border-dark);
  padding: 3px 6px;
  text-align: left;
  font-weight: bold;
  cursor: pointer;
}

.data-table th:hover {
  background: var(--win-title);
  color: white;
}

.data-table td {
  border: 1px solid var(--win-border-dark);
  padding: 3px 6px;
  background: white;
}

.data-table tr:hover td {
  background: #e0e0ff;
}

/* tabs */

.tab-bar {
  display: flex;
  gap: 0;
  margin-bottom: -2px;
  position: relative;
  z-index: 1;
}

.tab {
  padding: 4px 16px;
  background: var(--win-bg);
  border-top: 2px solid var(--win-border-light);
  border-left: 2px solid var(--win-border-light);
  border-right: 2px solid var(--win-border-darker);
  border-bottom: 2px solid var(--win-border-darker);
  cursor: pointer;
  font-size: 13px;
  margin-right: 2px;
}

.tab.active {
  background: var(--win-bg);
  border-bottom-color: var(--win-bg);
  position: relative;
  z-index: 2;
}

.tab-content {
  border-top: 2px solid var(--win-border-light);
  border-left: 2px solid var(--win-border-light);
  border-right: 2px solid var(--win-border-darker);
  border-bottom: 2px solid var(--win-border-darker);
  padding: 12px;
  background: var(--win-bg);
}

/* log viewer */

.log-viewer {
  background: #000;
  color: #00ff00;
  font-family: 'VT323', 'Courier New', monospace;
  font-size: 14px;
  padding: 8px;
  height: 400px;
  overflow-y: auto;
  border-top: 2px solid var(--win-border-dark);
  border-left: 2px solid var(--win-border-dark);
  border-right: 2px solid var(--win-border-light);
  border-bottom: 2px solid var(--win-border-light);
  white-space: pre-wrap;
  word-break: break-all;
}

.log-line { line-height: 1.4; }
.log-debug { color: #00ffff; }
.log-info { color: #00ff00; }
.log-warning { color: #ffff00; }
.log-error { color: #ff4444; }
.log-critical { color: #ff00ff; }

/* stats boxes */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.stat-box {
  border-top: 2px solid var(--win-border-dark);
  border-left: 2px solid var(--win-border-dark);
  border-right: 2px solid var(--win-border-light);
  border-bottom: 2px solid var(--win-border-light);
  padding: 8px;
  text-align: center;
  background: white;
}

.stat-box .stat-number {
  font-family: 'VT323', monospace;
  font-size: 32px;
  color: var(--win-title);
  display: block;
  margin: 8px 0;
}

.stat-box .stat-label {
  font-size: 12px;
  color: var(--win-border-dark);
}

/* login */

.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-window {
  width: 380px;
  max-width: 95vw;
}

.login-body {
  text-align: center;
  padding: 24px;
}

.login-body h2 {
  font-family: 'VT323', monospace;
  font-size: 28px;
  margin-bottom: 8px;
}

.login-body p {
  margin-bottom: 16px;
  font-size: 14px;
}

.discord-btn {
  font-family: "Pixelated MS Sans Serif", Arial, sans-serif;
  font-size: 14px;
  padding: 8px 24px;
  background: #5865F2;
  color: white;
  border-top: 2px solid #7289da;
  border-left: 2px solid #7289da;
  border-right: 2px solid #3a45a0;
  border-bottom: 2px solid #3a45a0;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.discord-btn:hover {
  background: #4752c4;
}

.discord-btn:active {
  border-top: 2px solid #3a45a0;
  border-left: 2px solid #3a45a0;
  border-right: 2px solid #7289da;
  border-bottom: 2px solid #7289da;
}

/* marquee and retro */

.marquee-bar {
  background: var(--win-title);
  color: var(--highlight);
  padding: 4px 0;
  overflow: hidden;
  font-size: 10px;
  font-family: 'VT323', monospace;
}

.marquee-bar marquee {
  display: inline;
}

.blink {
  animation: blink 1s step-start infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.rainbow {
  animation: rainbow 3s linear infinite;
}

@keyframes rainbow {
  0%   { color: #ff0000; }
  17%  { color: #ff8800; }
  33%  { color: #ffff00; }
  50%  { color: #00ff00; }
  67%  { color: #0088ff; }
  83%  { color: #8800ff; }
  100% { color: #ff0000; }
}

/* pagination */

.pagination {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
}

/* bot status bar */

.bot-status-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  margin-bottom: 10px;
  border-top: 2px solid var(--win-border-dark);
  border-left: 2px solid var(--win-border-dark);
  border-right: 2px solid var(--win-border-light);
  border-bottom: 2px solid var(--win-border-light);
  background: white;
  font-size: 13px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid #000;
}

.status-online  { background: #00aa00; }
.status-offline { background: #cc0000; }
.status-unknown { background: #888888; }

/* sensitivity panel */

.sensitivity-panel {
  margin-top: 10px;
  border-top: 2px solid var(--win-border-dark);
  border-left: 2px solid var(--win-border-dark);
  border-right: 2px solid var(--win-border-light);
  border-bottom: 2px solid var(--win-border-light);
  background: white;
  padding: 8px;
}

.sensitivity-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.sensitivity-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sensitivity-row input[type="range"] {
  -webkit-appearance: none;
  height: 4px;
  background: var(--win-border-dark);
  border: none;
  outline: none;
  padding: 0;
}

.sensitivity-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: var(--win-bg);
  border-top: 2px solid var(--win-border-light);
  border-left: 2px solid var(--win-border-light);
  border-right: 2px solid var(--win-border-dark);
  border-bottom: 2px solid var(--win-border-dark);
  cursor: pointer;
}

/* activity graph */

.activity-panel {
  margin-top: 10px;
  border-top: 2px solid var(--win-border-dark);
  border-left: 2px solid var(--win-border-dark);
  border-right: 2px solid var(--win-border-light);
  border-bottom: 2px solid var(--win-border-light);
  background: white;
  padding: 8px;
}

.activity-graph {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 80px;
  overflow: hidden;
}

.activity-bar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  height: 100%;
}

.activity-bar-inner {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
}

.activity-bar {
  width: 100%;
  background: var(--win-title);
  min-height: 2px;
  border-top: 1px solid #0000ff;
}

.activity-label {
  font-size: 9px;
  color: #808080;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  width: 100%;
}

/* flag history */

.flag-history-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  border-bottom: 1px solid var(--win-border-dark);
}

.flag-action {
  font-size: 11px;
  font-weight: bold;
  padding: 1px 5px;
  display: inline-block;
}

.flag-action-detected     { color: #ff8800; }
.flag-action-approved     { color: #cc0000; }
.flag-action-ignored      { color: #808080; }
.flag-action-warned       { color: #cc6600; }
.flag-action-boomer_start { color: #800080; }
.flag-action-boomer_end   { color: #008080; }

.flag-content {
  font-size: 13px;
  word-break: break-word;
}

.flag-time {
  font-size: 11px;
  color: #808080;
}

/* misc */

.field-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.field-row label {
  min-width: 100px;
}

.field-row input,
.field-row select {
  flex: 1;
}

.toolbar {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-bottom: 1px solid var(--win-border-dark);
  flex-wrap: wrap;
  align-items: center;
}

.separator {
  width: 2px;
  height: 20px;
  border-left: 1px solid var(--win-border-dark);
  border-right: 1px solid var(--win-border-light);
  margin: 0 4px;
}

.roast-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border-bottom: 1px solid var(--win-border-dark);
}

.roast-item:hover {
  background: #e0e0ff;
}

.roast-text {
  flex: 1;
  word-break: break-word;
}

.roast-actions {
  display: flex;
  gap: 4px;
}

.visitor-counter {
  text-align: center;
  padding: 8px;
  font-family: 'VT323', monospace;
  font-size: 14px;
  color: white;
}

/* mobile */

@media (max-width: 700px) {
  html, body {
    width: 100vw;
    overflow-x: hidden;
  }

  .desktop {
    padding: 4px;
    padding-bottom: 44px;
  }

  .desktop-icons {
    display: none;
  }

  .window {
    min-width: 0;
    width: 98vw;
    margin-top: 8px;
  }

  .window-title {
    font-size: 12px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }

  .stat-box .stat-number {
    font-size: 22px;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  .toolbar input,
  .toolbar select {
    width: 100%;
  }

  .toolbar .separator {
    display: none;
  }

  .data-table {
    font-size: 12px;
  }

  .data-table th,
  .data-table td {
    padding: 2px 4px;
  }

  .log-viewer {
    height: 300px;
    font-size: 12px;
  }

  .field-row {
    flex-direction: column;
    align-items: stretch;
  }

  .field-row label {
    min-width: 0;
  }

  .roast-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .roast-actions {
    align-self: flex-end;
  }

  .taskbar {
    height: auto;
    min-height: 36px;
    flex-wrap: wrap;
    padding: 2px;
  }

  .taskbar-tab {
    font-size: 10px;
    padding: 2px 6px;
    max-width: none;
  }

  .taskbar .separator {
    display: none;
  }

  .login-window {
    width: 95vw;
  }

  .marquee-bar {
    font-size: 8px;
  }

  .btn {
    font-size: 12px;
    padding: 4px 10px;
  }

  #edit-user-dialog,
  #flag-history-dialog {
    width: 95vw !important;
    max-width: 95vw !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
  }

  .activity-graph {
    height: 60px;
  }

  .activity-label {
    display: none;
  }

  .sensitivity-row {
    flex-wrap: wrap;
  }
}

@media (max-width: 400px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .taskbar-tab {
    font-size: 9px;
    padding: 2px 4px;
  }
}
