/*
 * Retro 2000's theme - same selectors as the modern theme, era styling:
 * silver window faces, beveled borders, serif type, classic link colors.
 */
:root {
  --bg: #008080;
  --panel: #d4d0c8;
  --panel-2: #ffffff;
  --border: #808080;
  --text: #000000;
  --muted: #404040;
  --accent: #000080;
  --accent-2: #0000ce;
  --ok: #008000;
  --warn: #cc6600;
  --danger: #cc0000;
}

* { border-radius: 0 !important; box-shadow: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 "Times New Roman", Times, Georgia, serif;
}
a { color: #0000ee; text-decoration: underline; }
a:visited { color: #551a8b; }
a:hover { color: #cc0000; }
.wrap { max-width: 1000px; margin: 0 auto; padding: 0 10px; }

/* ---------- nav ---------- */
.topnav {
  background: var(--panel);
  border-bottom: 2px solid #000;
  position: sticky; top: 0; z-index: 10;
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: auto; padding: 6px 0; }
.brand { font-weight: bold; font-size: 20px; color: var(--accent); text-decoration: none; font-family: "Times New Roman", serif; }
.topnav nav { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.topnav nav a { color: var(--accent); text-decoration: underline; padding: 2px 0; }
.topnav nav a:hover, .topnav nav a.on { color: #cc0000; }
.admin-link { color: #800000 !important; font-weight: bold; }
.credits-badge { color: var(--ok); font-weight: bold; }
.nav-sep { width: 1px; height: 16px; background: #000; display: inline-block; }

/* ---------- language switcher ---------- */
.lang-switch { position: relative; }
.lang-switch > summary {
  list-style: none; cursor: pointer; user-select: none;
  color: #000; background: var(--panel);
  border: 2px outset #fff; padding: 2px 8px; font-size: 13px; font-weight: bold;
}
.lang-switch > summary::-webkit-details-marker { display: none; }
.lang-switch[open] > summary { border-style: inset; }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 4px);
  background: var(--panel); border: 2px outset #fff;
  padding: 4px; min-width: 150px;
  display: flex; flex-direction: column; gap: 1px; z-index: 200;
}
.lang-menu a { padding: 3px 8px !important; font-size: 14px; text-decoration: none; }
.lang-menu a:hover { background: var(--accent); color: #fff !important; }
.lang-menu a.on { font-weight: bold; }

/* ---------- layout blocks ---------- */
main.wrap { padding-top: 20px; padding-bottom: 40px; min-height: calc(100vh - 130px); }
.card {
  background: var(--panel);
  border: 2px outset #fff;
  padding: 14px 16px;
}
.card.wide { width: 100%; margin-bottom: 18px; }
.hero { text-align: center; padding: 48px 0 32px; }
.hero h1 { font-size: 34px; margin: 0 0 10px; color: var(--accent); }
.lead { color: var(--muted); max-width: 620px; margin: 0 auto 20px; font-size: 16px; font-style: italic; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 22px; }
.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; border: 1px inset #fff; padding: 8px; }
.stat .num { font-size: 24px; font-weight: bold; color: var(--accent); }
.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; }
.big-pad { padding: 50px 0; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* ---------- forms ---------- */
label { display: block; margin-bottom: 12px; color: var(--muted); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], select, textarea {
  width: 100%;
  background: var(--panel-2);
  border: 2px inset var(--border);
  color: var(--text);
  padding: 5px 7px;
  font-size: 14px;
  font-family: "Times New Roman", serif;
  margin-top: 3px;
}
input:focus, select:focus { outline: 1px dotted var(--accent); }
.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(--muted); }
.tiny { width: 70px !important; }

.btn {
  background: var(--panel);
  color: #000;
  border: 2px outset #fff;
  padding: 6px 16px;
  font-size: 15px;
  font-family: "Times New Roman", serif;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.btn:hover { color: var(--accent); }
.btn:active { border-style: inset; }
.btn-sm { padding: 3px 9px; font-size: 13px; }
.btn-lg { padding: 10px 24px; font-size: 17px; font-weight: bold; }
.btn-block { width: 100%; margin-top: 6px; }
.btn-ghost { border: 2px outset #fff; }
.btn-danger { color: var(--danger); font-weight: bold; }
.btn-danger:hover { background: #ffcccc; }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; margin-bottom: 18px; background: var(--panel); }
th, td { text-align: left; padding: 6px 8px; border: 1px solid var(--border); vertical-align: middle; }
th { background: var(--panel); font-weight: bold; font-size: 13px; border-bottom: 2px solid #000; }
tr:hover td { background: #e8e8e8; }
.url-cell a { word-break: break-all; }
.row-banned td { color: #808080; text-decoration: line-through; }

.status { padding: 1px 8px; border: 1px solid #000; font-size: 12.5px; font-weight: bold; background: #fff; }
.status-active { color: var(--ok); border-color: var(--ok); }
.status-paused { color: var(--warn); border-color: var(--warn); }
.tag { background: #e8e8e8; border: 1px solid var(--border); padding: 1px 5px; font-size: 11.5px; color: var(--muted); }
.tag-admin { color: #800000; border-color: #800000; font-weight: bold; }

/* ---------- site list: thumbs + options editor ---------- */
.site-thumb { border: 1px solid #000; 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: var(--accent); font-size: 13px; text-decoration: underline; }
.opt-details[open] summary { margin-bottom: 8px; font-weight: bold; }
.opt-body {
  display: flex; flex-direction: column; gap: 12px;
  width: 460px; max-width: 92vw;
  background: var(--panel); border: 2px inset #fff;
  padding: 12px;
}
.opt-body label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--muted); }

/* ---------- 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: 10px; margin-bottom: 0; }
.frow.end { justify-content: flex-end; margin-bottom: 0; }
.site-form label, .frow > label {
  display: flex; flex-direction: column; gap: 4px;
  flex: 1 1 170px; min-width: 0;
  font-size: 12.5px; color: var(--muted); 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: 7px;
  font-size: 14px; color: var(--text);
  border: 1px solid var(--border); padding: 6px 10px;
}
.frow label.check input { width: auto; margin: 0; }

/* ---------- geo target grid: strictly aligned columns ---------- */
.geo-wrap summary { cursor: pointer; color: var(--accent); font-size: 13.5px; text-decoration: underline; user-select: none; }
.geo-wrap[open] > summary { margin-bottom: 6px; }
.geo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 2px 18px;
  max-height: 240px; overflow-y: auto;
  background: var(--panel-2); border: 2px inset var(--border);
  padding: 8px 12px; margin-top: 6px;
}
.geo-grid label {
  display: flex; align-items: center; gap: 7px;
  margin: 0; padding: 2px 0;
  font-size: 13px; color: var(--text); cursor: pointer;
  border-bottom: 1px dotted #aaa;
  min-width: 0;
}
.geo-grid label:hover { background: #ffffcc; }
.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: 8px 12px; margin-bottom: 12px; border: 2px solid; background: #fffbe6; color: #000; }
.alert-info    { border-color: var(--accent); background: #e8ecff; }
.alert-success { border-color: var(--ok); background: #e6ffe6; }
.alert-error   { border-color: var(--danger); background: #ffecec; }
.ticks { list-style: square; padding-left: 22px; }
.ticks li::before { content: ""; margin-right: 0; }
.chart { display: flex; align-items: flex-end; gap: 6px; 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: 11px; color: var(--muted); margin-top: 3px; }
.bar { width: 100%; background: var(--accent); border: 1px solid #000; border-radius: 0; min-height: 2px; }

/* ---------- footer ---------- */
.footer { border-top: 2px solid #000; padding: 12px 0; color: var(--muted); font-size: 12px; }
.footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* ---------- surf controller ---------- */
.surf-body { background: var(--panel); }
.surf-bar {
  position: fixed; top: 0; left: 0; right: 0; height: 64px;
  background: var(--panel);
  border-bottom: 2px solid #000;
  display: flex; align-items: center; gap: 14px;
  padding: 0 14px; z-index: 100;
}
.surf-timer { font-size: 20px; font-weight: bold; min-width: 52px; text-align: center; color: var(--danger); }
.surf-progress { flex: none; width: 200px; height: 14px; background: #fff; border: 2px inset var(--border); overflow: hidden; }
.ad-slot { flex: none; width: 234px; height: 60px; overflow: hidden; background: #fff; border: 1px solid #000; }
.ad-slot img { display: block; height: 60px; width: auto; max-width: 100%; }
#timer-bar { height: 100%; width: 100%; background: #00cc00; transition: width 1s linear; }
.surf-site { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-style: italic; }
.surf-credits b { color: var(--ok); white-space: nowrap; }
#surf-msg { color: var(--ok); opacity: 0; transition: opacity .3s; white-space: nowrap; font-weight: bold; }
#surf-msg.show { opacity: 1; }
#surf-msg.warn { color: var(--warn); }
.surf-start { max-width: 540px; margin: 0 auto; padding-top: 100px; text-align: center; }
.surf-start .card h3 { margin-top: 4px; }
