/* Command Center — dark command-interface styling. Vanilla CSS, no build step. */
:root {
  --bg: #0b0f14;
  --panel: #131a22;
  --panel-2: #1a2430;
  --line: #26313d;
  --text: #e6edf3;
  --muted: #8b97a5;
  --accent: #4da3ff;
  --accent-dim: #2b5f96;
  --danger: #ff5c5c;
  --ok: #43d17a;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 50% -200px, #12202f 0%, var(--bg) 60%);
  color: var(--text);
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-weight: 400; font-size: .8em; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 1.4rem;
  background: rgba(13, 19, 26, .8);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: .55rem; color: var(--text); font-weight: 600; }
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--accent); font-size: 1.15rem; }
.brand-mark.large { font-size: 2.4rem; display: block; }
.topnav { display: flex; align-items: center; gap: 1.2rem; }
.topnav a, .linklike { color: var(--muted); font-size: .95rem; }
.topnav a:hover, .linklike:hover { color: var(--text); text-decoration: none; }
.inline { display: inline; }
.linklike { background: none; border: 0; cursor: pointer; padding: 0; font: inherit; }

.content { max-width: 1080px; margin: 0 auto; padding: 1.8rem 1.4rem 4rem; }

/* ---------- flashes ---------- */
.flashes { margin-bottom: 1.2rem; display: grid; gap: .5rem; }
.flash { padding: .7rem 1rem; border-radius: 8px; border: 1px solid var(--line); }
.flash-error { border-color: #5a2530; background: #2a1418; color: #ffb4b4; }
.flash-ok { border-color: #1f4d34; background: #10251a; color: #9fe9bd; }

/* ---------- login ---------- */
.login-page { display: flex; align-items: center; justify-content: center; }
.login-page .content { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card {
  width: 100%; max-width: 360px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 2rem 1.8rem; box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.login-head { text-align: center; margin-bottom: 1.4rem; }
.login-head h1 { margin: .5rem 0 .2rem; font-size: 1.4rem; }
.login-card label { display: block; font-size: .85rem; color: var(--muted); margin: .9rem 0 .3rem; }
.login-card input {
  width: 100%; padding: .7rem .8rem; background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; font-size: 1rem;
}
.login-card input:focus { outline: none; border-color: var(--accent-dim); }
.btn-primary {
  margin-top: 1.3rem; width: 100%; padding: .75rem 1rem; border: 0; border-radius: 8px;
  background: var(--accent); color: #06121f; font-weight: 600; font-size: 1rem; cursor: pointer;
}
.btn-primary:hover { background: #6cb5ff; }

/* ---------- home grid ---------- */
.grid-section { margin-bottom: 2.6rem; }
.section-label {
  font-size: .8rem; text-transform: uppercase; letter-spacing: .12em;
  color: var(--muted); border-bottom: 1px solid var(--line);
  padding-bottom: .5rem; margin: 0 0 1.2rem;
}
.group { margin-bottom: 1.6rem; }
.group-label { font-size: 1rem; margin: 0 0 .8rem; color: var(--text); font-weight: 600; }
.brand-header {
  display: inline-block; padding: .25rem .7rem; border: 1px solid var(--accent-dim);
  border-radius: 999px; font-size: .9rem; color: var(--accent);
}
.empty { padding: .5rem 0; }

.tile-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.tile {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--text); transition: border-color .15s, transform .15s, box-shadow .15s;
}
.tile:hover {
  text-decoration: none; border-color: var(--accent-dim);
  transform: translateY(-3px); box-shadow: 0 12px 32px rgba(0,0,0,.38);
}
/* Logos are mostly dark artwork on transparent backgrounds — a light panel makes
   them visible, and a full-width banner lets wide wordmarks render large + legible. */
.tile-logo {
  width: 100%; height: 104px; display: flex; align-items: center; justify-content: center;
  background: #eef1f5; padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.tile-logo img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.tile-fallback {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: #eef1f5; color: var(--accent-dim); font-weight: 800; font-size: 2.8rem;
}
.tile-body { display: flex; flex-direction: column; gap: .18rem; padding: .85rem 1rem 1rem; min-width: 0; }
.tile-name { font-weight: 600; font-size: 1.02rem; }
.tile-platform { font-size: .8rem; color: var(--accent); }
.tile-desc { font-size: .82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- admin ---------- */
.page-title { margin: 0 0 .2rem; }
.admin-block {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.3rem 1.4rem; margin: 1.4rem 0;
}
.admin-block h2 { margin: 0 0 1rem; font-size: 1.1rem; }
.stack { display: grid; gap: .8rem; }
.stack label, .editrow label { display: grid; gap: .3rem; font-size: .85rem; color: var(--muted); }
.row { display: flex; gap: 1rem; flex-wrap: wrap; }
.row > label { flex: 1 1 220px; }
.check { flex-direction: row; align-items: center; gap: .5rem; color: var(--text); }
input, select {
  padding: .55rem .65rem; background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 7px; font-size: .95rem; width: 100%;
}
input:focus, select:focus { outline: none; border-color: var(--accent-dim); }
.w-sort { width: 5rem !important; flex: 0 0 auto; }

.actions { display: flex; gap: .7rem; align-items: center; margin-top: .3rem; }
.btn-ghost, .btn-danger {
  display: inline-block; padding: .5rem .8rem; border-radius: 7px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font-size: .9rem;
}
.btn-ghost:hover { border-color: var(--accent-dim); text-decoration: none; }
.btn-danger { border-color: #5a2530; color: #ffb4b4; background: #23131700; }
.btn-danger:hover { background: #2a1418; }
.sm { padding: .35rem .6rem; font-size: .82rem; }

.editrow { display: flex; gap: .6rem; align-items: center; margin-bottom: .55rem; }
.editrow-form { display: flex; gap: .6rem; align-items: center; flex: 1 1 auto; }
.editrow input[type=text] { flex: 1 1 auto; }
.editlist { margin-top: 1rem; }

.admin-table { width: 100%; border-collapse: collapse; margin-top: 1.2rem; font-size: .9rem; }
.admin-table th, .admin-table td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table th { color: var(--muted); font-weight: 500; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.admin-table tr.is-off { opacity: .5; }
.admin-table .url { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rowactions { display: flex; gap: .4rem; flex-wrap: wrap; }
