/*
 * Windows 3.11 theme - Program Manager aesthetics: flat #c0c0c0 everywhere,
 * chunky two-step bevels, centered navy titlebars, MS Sans Serif type.
 * No wallpaper, no rounded corners, no mercy.
 */
:root {
  --bg: #c0c0c0;
  --panel: #c0c0c0;
  --panel-2: #ffffff;
  --border: #808080;
  --text: #000000;
  --muted: #404040;
  --accent: #000080;
  --accent-2: #1084d0;
  --ok: #008000;
  --warn: #808000;
  --danger: #800000;
}

* { box-sizing: border-box; border-radius: 0 !important; box-shadow: none; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 12px/1.5 "MS Sans Serif", Tahoma, Geneva, sans-serif;
}
.wrap { max-width: 960px; margin: 0 auto; padding: 0 10px; }
a { color: #000080; }

/* 3.x bevels: raised for windows/buttons, sunken for fields */
.win311-raised {
  box-shadow: inset -1px -1px #808080, inset 1px 1px #ffffff,
              inset -2px -2px #0a0a0a, inset 2px 2px #dfdfdf;
}
.win311-sunken {
  box-shadow: inset -1px -1px #ffffff, inset 1px 1px #808080,
              inset -2px -2px #dfdfdf, inset 2px 2px #0a0a0a;
}

/* ---------- nav ---------- */
.topnav { background: var(--panel); border-bottom: 1px solid #ffffff; position: sticky; top: 0; z-index: 10; }
.nav-inner { display: flex; align-items: center; justify-content: space-between; min-height: 34px; padding: 4px 8px; gap: 10px; flex-wrap: wrap; }
.brand { font-weight: bold; font-size: 13px; color: var(--text); text-decoration: none; padding: 2px 8px; }
.topnav nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.topnav nav a { color: var(--text); text-decoration: none; padding: 2px 6px; }
.topnav nav a:hover { background: #000080; color: #fff; }
.topnav nav a.on { background: #000080; color: #fff; outline: 1px dotted #fff; outline-offset: -3px; }
.admin-link { color: #800000 !important; font-weight: bold; }
.credits-badge { color: #008000; font-weight: bold; }
.nav-sep { width: 2px; height: 16px; background: #808080; display: inline-block; }

/* ---------- language + theme switcher ---------- */
.lang-switch { position: relative; }
.lang-switch > summary {
  list-style: none; cursor: pointer; user-select: none;
  color: var(--text); background: var(--panel); padding: 2px 9px; font-size: 11px; font-weight: bold;
  box-shadow: inset -1px -1px #808080, inset 1px 1px #ffffff,
              inset -2px -2px #0a0a0a, inset 2px 2px #dfdfdf;
}
.lang-switch > summary::-webkit-details-marker { display: none; }
.lang-switch[open] > summary {
  box-shadow: inset -1px -1px #ffffff, inset 1px 1px #808080,
              inset -2px -2px #dfdfdf, inset 2px 2px #0a0a0a;
}
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 3px);
  background: var(--panel); padding: 2px; min-width: 150px;
  display: flex; flex-direction: column; gap: 0; z-index: 200;
  box-shadow: inset -1px -1px #808080, inset 1px 1px #dfdfdf,
              inset -2px -2px #0a0a0a, inset 2px 2px #ffffff;
}
.lang-menu a { padding: 3px 18px !important; font-size: 11px; color: var(--text); text-decoration: none; }
.lang-menu a:hover { background: #000080; color: #fff; }
.lang-menu a.on::before { content: "\2713\00a0"; }

/* ---------- layout blocks ---------- */
main.wrap { padding-top: 18px; padding-bottom: 38px; min-height: calc(100vh - 120px); }
.card {
  /* white client area inside a gray window frame */
  background: var(--panel-2);
  border: 3px solid var(--panel);
  padding: 10px 12px;
  box-shadow:
    inset 0 0 0 1px #808080,   /* sunken hairline at the client-area edge */
    -1px -1px 0 #ffffff,        /* raised outer bevel */
     1px  1px 0 #0a0a0a;
}
.card.wide { width: 100%; margin-bottom: 18px; }
.card > h3:first-child {
  /* 3.x window caption: solid navy, centered bold text */
  background: #000080;
  color: #ffffff;
  font-weight: bold; font-size: 12px; text-align: center;
  margin: -10px -12px 10px;
  padding: 3px 10px;
  border-bottom: 1px solid #808080;
}
.hero { text-align: center; padding: 40px 0 26px; }
.hero h1 {
  font-size: 22px; font-weight: bold; margin: 0 0 12px; color: #008080;
  background: var(--panel-2); display: inline-block; padding: 8px 24px;
  border: 3px solid var(--panel);
  box-shadow: inset 0 0 0 1px #808080, -1px -1px 0 #ffffff, 2px 2px 0 #0a0a0a;
}
.lead { color: var(--text); max-width: 600px; margin: 0 auto 20px; font-size: 13px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 16px 0; }
.stat { text-align: center; display: flex; flex-direction: column; gap: 3px; }
.stat .num { font-size: 21px; font-weight: bold; color: #008080; }
.cta-row { display: flex; gap: 10px; justify-content: center; align-items: center; margin: 20px 0; flex-wrap: wrap; }
.auth-box { max-width: 420px; margin: 40px auto; }
.auth-box.card > h2 {
  background: #000080; color: #fff;
  font-weight: bold; font-size: 13px; text-align: center;
  margin: -10px -12px 12px; padding: 3px 10px;
  border-bottom: 1px solid #808080;
}
.big-pad { padding: 50px 0; }
.muted { color: var(--muted); }
.center { text-align: center; }
h2 { font-size: 15px; font-weight: bold; }

/* ---------- forms ---------- */
label { display: block; margin-bottom: 10px; color: var(--text); font-size: 11px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], select {
  width: 100%;
  background: var(--panel-2);
  color: var(--text);
  border: none;
  padding: 4px 5px;
  font-size: 12px;
  font-family: "MS Sans Serif", Tahoma, sans-serif;
  margin-top: 2px;
  box-shadow: inset -1px -1px #ffffff, inset 1px 1px #808080,
              inset -2px -2px #dfdfdf, inset 2px 2px #0a0a0a;
}
input:focus, select:focus { outline: 1px dotted #000; outline-offset: -4px; }
.form-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.form-row input, .form-row select { width: auto; flex: 1 1 180px; margin: 0; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.inline { display: inline-flex; gap: 6px; align-items: center; margin: 0; color: var(--text); }
.tiny { width: 70px !important; }

.btn {
  background: var(--panel);
  color: var(--text);
  border: none;
  padding: 4px 15px;
  font-size: 12px;
  font-family: "MS Sans Serif", Tahoma, sans-serif;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  box-shadow: inset -1px -1px #808080, inset 1px 1px #ffffff,
              inset -2px -2px #0a0a0a, inset 2px 2px #dfdfdf;
}
.btn:hover { outline: 1px dotted #000; outline-offset: -4px; }
.btn:active {
  box-shadow: inset -1px -1px #ffffff, inset 1px 1px #808080,
              inset -2px -2px #dfdfdf, inset 2px 2px #0a0a0a;
}
.btn-sm { padding: 2px 9px; font-size: 11px; }
.btn-lg { padding: 6px 20px; font-size: 13px; font-weight: bold; }
.btn-block { width: 100%; margin-top: 6px; }
.btn-danger { color: #800000; font-weight: bold; }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; margin-bottom: 16px; background: var(--panel-2); border: 2px solid; 
        border-color: #808080 #ffffff #ffffff #808080; }
th, td { text-align: left; padding: 4px 7px; border-bottom: 1px solid #b0b0b0; vertical-align: middle; font-size: 12px; }
th { background: var(--panel); font-weight: bold; border-bottom: 2px solid #808080; }
tr:hover td { background: #000080; color: #fff; }
tr:hover td a { color: #fff; }
.url-cell a { word-break: break-all; }
.row-banned td { color: #808080; text-decoration: line-through; }

.status { padding: 1px 6px; font-size: 11px; font-weight: bold; background: var(--panel-2); border: 1px solid var(--border); }
.status-active { color: var(--ok); }
.status-paused { color: #800000; }
.tag { background: var(--panel); border: 1px solid var(--border); padding: 0 5px; font-size: 10.5px; color: var(--muted); }
.tag-admin { color: #800000; font-weight: bold; }

/* ---------- site list: thumbs + options editor ---------- */
.site-thumb { border: 1px solid var(--border); object-fit: cover; background: #fff; display: block; }
.tags-line { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.opt-details summary { cursor: pointer; color: #000080; font-size: 12px; font-weight: bold; }
.opt-details[open] summary { margin-bottom: 8px; }
.opt-body {
  display: flex; flex-direction: column; gap: 11px;
  width: 460px; max-width: 92vw;
  background: var(--panel-2);
  border: 3px solid var(--panel);
  padding: 9px 11px;
  box-shadow:
    inset 0 0 0 1px #808080,
    -1px -1px 0 #ffffff,
     1px  1px 0 #0a0a0a;
}
.opt-body label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--text); }

/* ---------- structured site forms ---------- */
.site-form { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.frow { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.frow.tight { gap: 9px; margin-bottom: 0; }
.frow.end { justify-content: flex-end; margin-bottom: 0; }
.site-form label, .frow > label {
  display: flex; flex-direction: column; gap: 3px;
  flex: 1 1 170px; min-width: 0;
  font-size: 11px; color: var(--text); margin: 0;
}
.site-form .fgrow2 { flex: 2 1 300px; }
.fgrow3 { flex: 3 1 240px !important; }
.frow label.check {
  flex: 0 0 auto; flex-direction: row; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text);
  padding: 4px 8px;
  box-shadow: inset -1px -1px #808080, inset 1px 1px #ffffff;
}
.frow label.check input { width: auto; margin: 0; }

/* ---------- geo target grid: strictly aligned columns ---------- */
.geo-wrap summary { cursor: pointer; color: #000080; font-size: 12px; font-weight: bold; user-select: none; }
.geo-wrap[open] > summary { margin-bottom: 6px; }
.geo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1px 16px;
  max-height: 240px; overflow-y: auto;
  background: var(--panel-2);
  padding: 8px 12px; margin-top: 5px;
  box-shadow: inset -1px -1px #ffffff, inset 1px 1px #808080,
              inset -2px -2px #dfdfdf, inset 2px 2px #0a0a0a;
}
.geo-grid label {
  display: flex; align-items: center; gap: 7px;
  margin: 0; padding: 2px 0;
  font-size: 12px; color: var(--text); cursor: pointer;
  border-bottom: 1px dotted #999;
  min-width: 0;
}
.geo-grid label:hover { background: #000080; color: #fff; }
.geo-grid input { width: auto; margin: 0; flex: 0 0 auto; }
.geo-grid label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- alerts / lists / chart ---------- */
.alert { padding: 6px 10px; margin-bottom: 12px; border: 1px solid #000; background: #ffffe1; color: #000;
         box-shadow: 1px 1px 0 #000; }
.alert-info    { background: #ffffe1; }
.alert-success { border-color: #008000; background: #e6ffe6; }
.alert-error   { border-color: #800000; background: #ffdddd; }
.ticks { list-style: square; padding-left: 20px; }
.chart { display: flex; align-items: flex-end; gap: 5px; height: 150px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.bar-col span { font-size: 10px; color: var(--muted); margin-top: 3px; }
.bar {
  width: 100%;
  background: repeating-linear-gradient(90deg, #008080 0 8px, #00a5a5 8px 12px);
  border: 1px solid #000; border-bottom: none; min-height: 2px;
}

/* ---------- footer ---------- */
.footer { border-top: 1px solid #ffffff; padding: 9px 0; color: var(--muted); font-size: 11px; background: var(--panel); }
.footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* ---------- surf controller ---------- */
.surf-body { background: var(--bg); }
.surf-bar {
  position: fixed; top: 0; left: 0; right: 0; height: 64px;
  background: var(--panel);
  border-bottom: 1px solid #ffffff;
  box-shadow: inset 0 1px #dfdfdf, inset -1px 0 #0a0a0a, 0 2px 5px rgba(0,0,0,.4);
  display: flex; align-items: center; gap: 12px;
  padding: 0 12px; z-index: 100;
}
.surf-timer { font-size: 19px; font-weight: bold; min-width: 52px; text-align: center; color: #008080; }
.surf-progress { flex: none; width: 210px; height: 14px; background: #fff; overflow: hidden;
  box-shadow: inset -1px -1px #ffffff, inset 1px 1px #808080,
              inset -2px -2px #dfdfdf, inset 2px 2px #0a0a0a; }
.ad-slot { flex: none; width: 234px; height: 60px; overflow: hidden; background: #fff; border: 1px solid #808080; }
.ad-slot img { display: block; height: 60px; width: auto; max-width: 100%; }
#timer-bar {
  height: 100%; width: 100%;
  background: repeating-linear-gradient(90deg, #008080 0 8px, #00a5a5 8px 12px);
  transition: width 1s linear;
}
.surf-site { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.surf-credits b { color: #008000; white-space: nowrap; }
#surf-msg { color: #008000; opacity: 0; transition: opacity .3s; white-space: nowrap; font-weight: bold; }
#surf-msg.show { opacity: 1; }
#surf-msg.warn { color: #800000; }
.surf-start { max-width: 540px; margin: 0 auto; padding-top: 90px; text-align: center; }
.surf-start .card h3 { margin-top: 4px; }
