/* ───────────────────────────────────────
   oldromsite — Retro 2000s Styles
   ─────────────────────────────────────── */

/* ── Base ────────────────────────────────── */
* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 8px;
  background-color: #000080;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.08'%3E%3Ccircle cx='30' cy='30' r='1.5'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  font-size: 13px;
  color: #c0c0c0;
  line-height: 1.5;
}

a { color: #22D3EE; text-decoration: underline; }
a:hover { color: #C026D3; text-decoration: blink; }
a:visited { color: #C026D3; }

h1, h2, h3, h4 { color: #FFD60A; margin-top: 0; font-family: "Comic Sans MS", "Trebuchet MS", Verdana, sans-serif; }
h1 { font-size: 2rem; text-align: center; text-shadow: 2px 2px #FF3B3B; }
h2 { font-size: 1.4rem; border-bottom: 2px solid #FF3B3B; padding-bottom: 4px; }
h3 { font-size: 1.1rem; color: #22D3EE; }

/* ── Site wrapper ─────────────────────────── */
.site-wrapper {
  background-color: #0B0A2E;
  border: 3px ridge #8B31D6;
  box-shadow: 0 0 20px rgba(0,0,255,0.3);
}

/* ── Header ──────────────────────────────── */
.site-header {
  /* fundo void contínuo com o logo (o SVG já traz CRT + scanlines + rainbow) */
  background: #0B0A2E;
  border-bottom: 2px solid #2A0F52;
}
.site-logo {
  display: block;
  margin: 0 auto;
  width: 100%;
  max-width: 460px;
  height: auto;
  image-rendering: pixelated; /* regra do kit: nunca suavizar a grade */
}
.marquee {
  color: #22C55E;
  font-size: 12px;
  font-weight: bold;
  background: #000;
  padding: 3px 0;
  border: 1px inset #666;
}

/* ── Navigation ──────────────────────────── */
.nav-bar {
  background: #2A0F52;
  border: 2px outset #C026D3;
  margin: 4px 0;
}
.nav-bar td {
  border-right: 1px solid #C026D3;
  padding: 4px 0;
}
.nav-bar td:last-child { border-right: none; }
.nav-bar a {
  color: #ffffff;
  text-decoration: none;
  font-weight: bold;
  font-size: 12px;
  padding: 4px 12px;
  display: block;
}
.nav-bar a:hover {
  background: #C026D3;
  color: #FFD60A;
}

/* ── Rainbow HR ──────────────────────────── */
.rainbow-hr {
  height: 4px;
  border: none;
  /* ordem oficial da barra arco-íris do kit de identidade */
  background: linear-gradient(to right,
    #FF3B3B, #FF8A00, #FFD60A, #22C55E, #22D3EE, #3B82F6, #C026D3
  );
  margin: 6px 0;
}

/* ── ROM grid ────────────────────────────── */
.rom-grid {
  width: 100%;
}
.rom-grid td {
  vertical-align: top;
  padding: 8px;
}
.rom-card {
  background: #171545;
  border: 2px outset #8B31D6;
  padding: 8px;
  text-align: center;
  transition: border-color 0.2s;
}
.rom-card:hover {
  border-color: #FFD60A;
  border-style: solid;
}
.rom-card img {
  width: 120px;
  height: 90px;
  object-fit: cover;
  border: 1px solid #8B31D6;
}
.rom-card h4 {
  margin: 6px 0 2px;
  font-size: 12px;
  color: #22D3EE;
}
.rom-card h4 a { color: #22D3EE; }
.rom-card .manufacturer {
  font-size: 10px;
  color: #FFD60A;
  margin: 2px 0;
}
.rom-card .size {
  font-size: 10px;
  color: #aaa;
}
.rom-date {
  font-size: 10px;
  color: #888;
  margin-top: 4px;
}

/* ── ROM detail ──────────────────────────── */
.rom-detail-table { width: 100%; border: 1px solid #8B31D6; }
.rom-detail-table td { padding: 8px; border: 1px solid #333; }
.rom-detail-table .label {
  background: #171545;
  color: #FFD60A;
  font-weight: bold;
  width: 140px;
  font-size: 12px;
}
.rom-cover-large {
  max-width: 300px;
  border: 3px ridge #8B31D6;
}
.download-btn {
  display: inline-block;
  background: #006400;
  color: #22C55E;
  padding: 10px 24px;
  font-size: 1.1rem;
  font-weight: bold;
  text-decoration: none;
  border: 3px outset #00aa00;
  cursor: pointer;
  text-shadow: 1px 1px #000;
}
.download-btn:hover {
  background: #008800;
  color: #FFD60A;
  border-style: solid;
}

/* ── Search ──────────────────────────────── */
.search-box { margin-bottom: 16px; text-align: center; }
.search-box input[type="text"] {
  width: 300px;
  padding: 6px 10px;
  font-size: 14px;
  border: 2px inset #666;
  background: #000;
  color: #22C55E;
  font-family: "Courier New", monospace;
}
.search-box button {
  padding: 6px 16px;
  background: #2A0F52;
  color: #fff;
  border: 2px outset #C026D3;
  font-weight: bold;
  cursor: pointer;
  font-family: Verdana, sans-serif;
}
.search-box button:hover { background: #C026D3; }

/* ── Filter by manufacturer ──────────────── */
.manufacturer-filter {
  text-align: center;
  margin-bottom: 12px;
  font-size: 12px;
}
.manufacturer-filter a {
  padding: 2px 8px;
  margin: 0 2px;
  border: 1px solid #8B31D6;
  background: #171545;
  color: #22D3EE;
  text-decoration: none;
  white-space: nowrap;
}
.manufacturer-filter a:hover,
.manufacturer-filter a.active {
  background: #FF8A00;
  color: #fff;
  border-color: #FFD60A;
}

/* ── Pagination ──────────────────────────── */
.pagination-bar {
  text-align: center;
  padding: 8px;
  color: #c0c0c0;
  font-size: 12px;
}
.pagination-bar a {
  padding: 3px 8px;
  margin: 0 4px;
  background: #171545;
  border: 1px solid #8B31D6;
  color: #22D3EE;
  text-decoration: none;
}
.pagination-bar a:hover { background: #C026D3; }
.pagination-bar .current { color: #FFD60A; font-weight: bold; }

/* ── Data table (public ROM list) ────────── */
.rom-table {
  width: 100%;
  border: 2px solid #8B31D6;
  border-collapse: collapse;
}
.rom-table th {
  background: #2A0F52;
  color: #FFD60A;
  padding: 6px 10px;
  text-align: left;
  font-size: 11px;
  border: 1px solid #8B31D6;
  text-transform: uppercase;
}
.rom-table td {
  padding: 6px 10px;
  border: 1px solid #333;
  font-size: 12px;
}
.rom-table tr:nth-child(even) { background: #171545; }
.rom-table tr:hover { background: #0d2b4a; }
.rom-table .cover-cell { width: 60px; text-align: center; }
.rom-table .cover-cell img {
  width: 48px;
  height: 36px;
  object-fit: cover;
  border: 1px solid #8B31D6;
}

/* ── Footer ──────────────────────────────── */
.site-footer {
  background: #2A0F52;
  border-top: 2px solid #FF8A00;
  padding: 12px 0;
}
.footer-links { margin-bottom: 8px; }
.footer-links a {
  color: #22D3EE;
  font-size: 11px;
  margin: 0 8px;
}
.footer-badges { margin: 8px 0; }
.footer-badges img { margin: 2px 4px; }

.counter {
  background: #000;
  border: 2px inset #666;
  display: inline-block;
  padding: 4px 16px;
  font-family: "Courier New", monospace;
  color: #22C55E;
  margin: 8px 0;
}
.counter strong { color: #FFD60A; font-size: 1.1rem; }
.counter .counter-digits { letter-spacing: 3px; }

.copyright {
  font-size: 10px;
  color: #888;
  margin-top: 8px;
}
.disclaimer { color: #666; font-size: 9px; }

/* ── Animations ──────────────────────────── */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
.blink {
  animation: blink 1.5s step-end infinite;
}

@keyframes rainbow {
  0% { color: #FF3B3B; }
  20% { color: #ff8800; }
  40% { color: #FFD60A; }
  60% { color: #22C55E; }
  80% { color: #0088ff; }
  100% { color: #FF3B3B; }
}
.rainbow-text {
  animation: rainbow 3s linear infinite;
  font-weight: bold;
}

/* ── Misc ────────────────────────────────── */
.new-badge {
  color: #FF3B3B;
  font-weight: bold;
  font-size: 10px;
  animation: blink 1s step-end infinite;
}
.download-count { font-size: 11px; color: #FFD60A; }

.under-construction {
  text-align: center;
  margin: 16px 0;
}

.result-count {
  font-size: 11px;
  color: #FFD60A;
  margin-bottom: 12px;
}

.detail-description {
  color: #c0c0c0;
  font-size: 13px;
  line-height: 1.6;
}

.back-link {
  display: inline-block;
  margin-bottom: 12px;
  font-size: 11px;
}

/* ── Old-school form elements ────────────── */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
  outline: 1px solid #FFD60A;
}

/* ───────────────────────────────────────
   RETRO CHAT ROOM
   ─────────────────────────────────────── */

.chat-messages {
  height: 380px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px;
  background: #0B0A2E;
  background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='20' cy='20' r='1'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.chat-msg {
  padding: 5px 6px;
  border-bottom: 1px dotted #1a1a3a;
  word-wrap: break-word;
  line-height: 1.5;
  transition: background 0.3s;
}
.chat-msg:hover { background: rgba(255, 255, 255, 0.03); }
.chat-msg:last-child { border-bottom: none; }

.chat-msg-new {
  animation: chatFadeIn 0.4s ease;
}
@keyframes chatFadeIn {
  from { background: rgba(0, 255, 0, 0.15); }
  to   { background: transparent; }
}

.chat-avatar {
  font-size: 1.3rem;
  margin-right: 4px;
  vertical-align: middle;
  cursor: default;
}
.chat-nick {
  color: #FFD60A;
  font-weight: bold;
  font-size: 12px;
  margin-right: 6px;
}
.chat-time {
  color: #555;
  font-size: 9px;
  font-family: "Courier New", monospace;
  margin-right: 6px;
}
.chat-text {
  color: #c0c0c0;
  font-size: 13px;
  word-break: break-word;
}
.chat-sticker-msg {
  display: inline-block;
  margin: 2px 0;
}
.chat-sticker-msg .sticker-img {
  width: 64px;
  height: 64px;
  image-rendering: pixelated;
  border: 1px solid #333;
}

.chat-empty {
  text-align: center;
  padding: 80px 20px;
  color: #555;
  font-size: 14px;
}

/* ── Avatar picker ──────────────────────── */
.avatar-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-height: 100px;
  overflow-y: auto;
}
.avatar-opt {
  font-size: 1.5rem;
  padding: 4px 6px;
  border: 2px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  background: #2A0F52;
}
.avatar-opt:hover { border-color: #FFD60A; background: #171545; }
.avatar-opt.selected {
  border-color: #22C55E;
  background: #003300;
  box-shadow: 0 0 6px rgba(0,255,0,0.4);
}

/* ── Sticker picker ─────────────────────── */
.sticker-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 0;
}
.sticker-opt {
  border: 2px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  padding: 2px;
  transition: all 0.15s;
  display: inline-block;
}
.sticker-opt:hover { border-color: #FFD60A; background: #171545; transform: scale(1.1); }
.sticker-opt.selected {
  border-color: #22C55E;
  background: #003300;
  box-shadow: 0 0 8px rgba(0,255,0,0.5);
}
.sticker-opt img {
  image-rendering: pixelated;
  display: block;
}

/* ── Send button ────────────────────────── */
.btn-send {
  background: #006400;
  color: #22C55E;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: bold;
  border: 3px outset #00aa00;
  cursor: pointer;
  font-family: Verdana, sans-serif;
  text-shadow: 1px 1px #000;
}
.btn-send:hover {
  background: #008800;
  color: #FFD60A;
  border-style: solid;
}
.btn-send:active {
  border-style: inset;
}

/* Scrollbar styling (WebKit) */
.chat-messages::-webkit-scrollbar { width: 14px; }
.chat-messages::-webkit-scrollbar-track { background: #0B0A2E; border: 1px inset #333; }
.chat-messages::-webkit-scrollbar-thumb { background: #8B31D6; border: 1px outset #6a8fc5; }
.chat-messages::-webkit-scrollbar-thumb:hover { background: #6a8fc5; }

/* Firefox */
.chat-messages {
  scrollbar-width: auto;
  scrollbar-color: #8B31D6 #0B0A2E;
}

/* ───────────────────────────────────────
   SIDEBAR & WIDGETS (right column)
   ─────────────────────────────────────── */

.main-content {
  width: 75%;
  padding: 8px;
}

.sidebar-col {
  width: 180px;
  padding: 4px;
  vertical-align: top;
}

/* Sidebar widget box — like a Windows XP gadget */
.sidebar-widget {
  background: #171545;
  border: 2px ridge #8B31D6;
  margin-bottom: 8px;
  width: 100%;
}
.sidebar-widget .widget-title {
  background: #2A0F52;
  color: #FFD60A;
  font-size: 10px;
  font-weight: bold;
  padding: 4px 6px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid #8B31D6;
  font-family: "Comic Sans MS", Verdana, sans-serif;
}
.sidebar-widget .widget-body {
  padding: 4px;
}
.sidebar-widget .widget-footer {
  padding: 3px 4px;
  border-top: 1px solid #333;
  background: #2A0F52;
}
.sidebar-widget .widget-link {
  color: #22D3EE;
  font-size: 10px;
  font-weight: bold;
  text-decoration: none;
}
.sidebar-widget .widget-link:hover {
  color: #FFD60A;
}

/* ── Shoutbox messages ──────────────────── */
.shoutbox-messages {
  max-height: 260px;
  overflow-y: auto;
  padding: 2px;
  background: #0B0A2E;
}
.shout-msg {
  padding: 3px 4px;
  border-bottom: 1px dotted #1a1a3a;
  line-height: 1.4;
}
.shout-msg:last-child { border-bottom: none; }
.shout-msg:hover { background: rgba(255,255,255,0.04); }

.shout-msg-new {
  animation: shoutFadeIn 0.5s ease;
}
@keyframes shoutFadeIn {
  from { background: rgba(0, 255, 0, 0.2); }
  to   { background: transparent; }
}

.shout-avatar {
  font-size: 0.9rem;
  margin-right: 2px;
  vertical-align: middle;
}
.shout-nick {
  color: #FFD60A;
  font-weight: bold;
  font-size: 9px;
  margin-right: 3px;
  display: inline;
}
.shout-text {
  color: #aaa;
  font-size: 10px;
  word-break: break-word;
  display: block;
  margin-top: 1px;
}
.shout-sticker {
  font-size: 12px;
}

/* Shoutbox scrollbar */
.shoutbox-messages::-webkit-scrollbar { width: 8px; }
.shoutbox-messages::-webkit-scrollbar-track { background: #0B0A2E; }
.shoutbox-messages::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
.shoutbox-messages::-webkit-scrollbar-thumb:hover { background: #555; }
.shoutbox-messages {
  scrollbar-width: thin;
  scrollbar-color: #333 #0B0A2E;
}

/* ───────────────────────────────────────
   DOSBox PLAYER & GAME CATALOG
   ─────────────────────────────────────── */

/* ── DOS Game Catalog Grid ─────────────── */
.dos-grid { width: 100%; }
.dos-grid td { vertical-align: top; padding: 6px; }

.dos-card {
  background: #171545;
  border: 2px outset #8B31D6;
  overflow: hidden;
  transition: border-color 0.2s;
}
.dos-card:hover {
  border-color: #FFD60A;
  border-style: solid;
}
.dos-card-cover { display: block; }
.dos-card-cover img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-bottom: 1px solid #8B31D6;
  display: block;
}
.dos-card-info { padding: 8px; text-align: center; }
.dos-card-info h4 { margin: 0 0 4px; font-size: 13px; }
.dos-card-info h4 a { color: #22D3EE; }
.dos-card-info h4 a:hover { color: #FFD60A; }
.dos-meta { margin-bottom: 6px; }
.dos-genre {
  display: inline-block;
  font-size: 9px;
  background: #2A0F52;
  color: #FFD60A;
  padding: 1px 6px;
  border-radius: 2px;
  margin-right: 4px;
}
.dos-year { font-size: 10px; color: #888; }
.dos-card-footer { font-size: 10px; display: flex; justify-content: space-between; align-items: center; }
.dos-backend-badge {
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 2px;
  font-weight: bold;
}
.dos-backend-badge.wasm { background: #003300; color: #22C55E; }
.dos-backend-badge.server { background: #330000; color: #FF8A00; }
.dos-plays { color: #888; }

/* ── DOS Player Layout ────────────────── */
.dos-canvas-col { width: 75%; padding: 4px; }
.dos-info-col { width: 180px; padding: 4px; vertical-align: top; }

.dos-canvas-wrapper {
  position: relative;
  background: #000;
  border: 3px ridge #555;
  box-shadow:
    0 0 20px rgba(0, 255, 0, 0.15),
    inset 0 0 30px rgba(0, 0, 0, 0.5);
  min-height: 480px;
  overflow: hidden;
}

/* CRT scanlines overlay */
.dos-canvas-wrapper::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.08) 2px,
    rgba(0, 0, 0, 0.08) 4px
  );
  pointer-events: none;
  z-index: 2;
}

.dos-canvas-wrapper canvas {
  display: none;
  width: 100% !important;
  max-width: 848px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  cursor: crosshair;
  position: relative;
  z-index: 1;
}

/* Loading overlay */
.dos-loading {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #0B0A2E;
  z-index: 3;
}
.dos-progress {
  width: 250px;
  height: 14px;
  background: #000;
  border: 2px inset #555;
  margin-top: 12px;
}
.dos-progress-bar {
  height: 100%;
  background: linear-gradient(to bottom, #22C55E, #006400);
  transition: width 0.3s;
}

/* ── Controls Bar ─────────────────────── */
.dos-controls {
  background: #2A0F52;
  border: 2px ridge #8B31D6;
  border-top: none;
  margin-bottom: 8px;
}
.dos-ctrl-btn {
  background: #171545;
  color: #c0c0c0;
  border: 2px outset #8B31D6;
  padding: 5px 12px;
  font-size: 11px;
  font-family: Verdana, sans-serif;
  cursor: pointer;
  white-space: nowrap;
}
.dos-ctrl-btn:hover {
  background: #2A0F52;
  color: #FFD60A;
  border-style: solid;
}
.dos-ctrl-btn:active {
  border-style: inset;
}

/* ═══════════════════════════════════════════
   Máquinas do Tempo (VMs no Proxmox)
   ═══════════════════════════════════════════ */

/* ── Moldura de monitor CRT ── */
.crt-monitor {
  background: linear-gradient(145deg, #d8d0c0, #b8b0a0); /* plástico bege noventista */
  border-radius: 12px;
  padding: 22px 22px 30px;
  border: 2px outset #e8e0d0;
  position: relative;
  box-shadow: inset 0 -4px 8px rgba(0,0,0,.25);
}
.crt-screen {
  background: #000;
  min-height: 420px;
  border: 3px inset #555;
  border-radius: 6px;
  position: relative;
  overflow: hidden;
}
.crt-screen::after {  /* scanlines */
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.18) 0 1px, transparent 1px 3px);
  pointer-events: none;
}
.crt-badge {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: #665;
  letter-spacing: 2px;
  font-family: Verdana, sans-serif;
}
.vm-mock-screen {
  color: #22C55E;
  font-family: 'Courier New', monospace;
  padding: 16px;
  font-size: 12px;
}
.vm-mock-screen pre { color: #c0c0c0; }
