*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #1d1c21;
  --bg2: #26252b;
  --bg3: #2e2d35;
  --border: rgba(255,255,255,.05);
  --border-hi: rgba(255,255,255,.1);
  --green: #80c71f;
  --green-dim: rgba(128,199,31,.12);
  --red: rgba(255,60,60,.4);
  --text: #f9ffff;
  --text-2: rgba(249,255,255,.45);
  --text-3: rgba(249,255,255,.18);
  --r: 8px;
}

html { height: 100%; }

body {
  font-family: 'Space Grotesk', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}

.mono { font-family: 'JetBrains Mono', monospace; }

/* ═══════════════ LOGIN ═══════════════ */

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  transition: opacity 0.4s, visibility 0.4s;
}

.login-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  position: fixed;
  inset: 0;
}

.login-left {
  flex: 1;
  padding: 3rem;
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.login-big {
  font-family: 'Unbounded', sans-serif;
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 900;
  color: var(--text);
  line-height: .9;
  letter-spacing: -.05em;
}

.login-big-dim {
  font-family: 'Unbounded', sans-serif;
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 900;
  color: rgba(255,255,255,.05);
  line-height: .9;
  letter-spacing: -.05em;
}

.login-tag {
  font-size: .7rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .2em;
  font-family: 'JetBrains Mono', monospace;
}

.login-right {
  width: 360px;
  padding: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.01);
}

.login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-label {
  font-size: .65rem;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .15em;
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 2px;
}

.login-inp {
  background: rgba(255,255,255,.04);
  border: .5px solid var(--border-hi);
  border-radius: var(--r);
  padding: 13px 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: .9rem;
  color: var(--text);
  outline: none;
  transition: border-color .2s;
  width: 100%;
}

.login-inp:focus { border-color: var(--green); }

.login-btn {
  background: var(--green);
  border: none;
  border-radius: var(--r);
  padding: 13px;
  font-family: 'Unbounded', sans-serif;
  font-size: .75rem;
  font-weight: 700;
  color: #1d1c21;
  cursor: pointer;
  letter-spacing: .02em;
  transition: opacity .15s;
}

.login-btn:hover { opacity: .85; }

.login-error {
  font-size: .75rem;
  color: #ff6060;
  opacity: 0;
  transition: opacity .2s;
  min-height: 1rem;
  text-align: center;
}

.login-error.show { opacity: 1; }

.login-hint {
  font-size: .6rem;
  color: var(--text-3);
  font-family: 'JetBrains Mono', monospace;
  text-align: center;
  margin-top: 2px;
}

/* ═══════════════ APP ═══════════════ */

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: opacity .3s;
}

.app.hidden { opacity: 0; pointer-events: none; display: none; }

/* BANNER */
.banner {
  padding: 2rem 2rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
}

.banner-eyebrow {
  font-size: .6rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .2em;
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: .625rem;
}

.banner-title {
  font-family: 'Unbounded', sans-serif;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 900;
  color: var(--text);
  line-height: 1;
  letter-spacing: -.04em;
}

.banner-title span { color: var(--green); }

.banner-right { text-align: right; flex-shrink: 0; }

.banner-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--green-dim);
  border: .5px solid rgba(128,199,31,.2);
  border-radius: 20px;
  padding: 5px 12px;
  margin-bottom: .375rem;
}

.badge-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--text-3);
  transition: background .3s;
}

.badge-dot.on { background: var(--green); box-shadow: 0 0 5px var(--green); }
.badge-dot.off { background: #ff6060; }

.badge-txt {
  font-size: .65rem;
  color: var(--green);
  font-family: 'JetBrains Mono', monospace;
}

.banner-time {
  font-size: .6rem;
  color: var(--text-3);
  font-family: 'JetBrains Mono', monospace;
}

/* STATS */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--border);
}

.stat-cell {
  padding: 1.25rem 1.5rem;
  border-right: 1px solid var(--border);
}

.stat-cell:last-child { border-right: none; }

.stat-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1;
  margin-bottom: 5px;
}

.stat-val span { color: var(--green); }

.stat-key {
  font-size: .6rem;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .1em;
}

.stat-bar {
  height: 1.5px;
  background: var(--border);
  border-radius: 1px;
  margin-top: 10px;
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  background: var(--green);
  opacity: .4;
  width: 0%;
  transition: width .6s ease;
}

/* CONTENT */
.content-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  border-bottom: 1px solid var(--border);
  flex: 1;
}

.players-col {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .875rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.col-title {
  font-size: .6rem;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-family: 'JetBrains Mono', monospace;
}

.col-badge {
  font-size: .65rem;
  color: var(--green);
  background: var(--green-dim);
  border-radius: 20px;
  padding: 2px 8px;
  font-family: 'JetBrains Mono', monospace;
}

.players-list { display: flex; flex-direction: column; }

.empty {
  padding: 1.5rem;
  font-size: .8rem;
  color: var(--text-3);
  text-align: center;
}

.player-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: .75rem 1.5rem;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}

.player-row:last-child { border-bottom: none; }
.player-row:hover { background: rgba(255,255,255,.02); }

.player-avatar-wrap { position: relative; flex-shrink: 0; }

.player-avatar {
  width: 30px; height: 30px;
  border-radius: 5px;
  background: var(--bg3);
  display: block;
  image-rendering: pixelated;
}

.player-status-dot {
  position: absolute;
  bottom: -2px; right: -2px;
  width: 8px; height: 8px;
  border-radius: 50%;
  border: 2px solid var(--bg);
}

.player-status-dot.online { background: var(--green); box-shadow: 0 0 4px var(--green); }
.player-status-dot.offline { background: #ff4444; }

.player-body { flex: 1; min-width: 0; }

.player-name {
  font-size: .875rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.is-offline .player-name { color: var(--text-2); }

.player-sub {
  font-size: .68rem;
  color: var(--text-2);
  font-family: 'JetBrains Mono', monospace;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.is-offline .player-sub { color: var(--text-3); }

.player-time {
  font-size: .62rem;
  color: var(--text-3);
  font-family: 'JetBrains Mono', monospace;
  flex-shrink: 0;
  text-align: right;
}

/* MAP */
.map-col { position: relative; overflow: hidden; background: #030308; min-height: 240px; }

.map-wrap { position: absolute; inset: 0; }

.map-frame { width: 100%; height: 100%; border: none; display: block; pointer-events: none; }

.map-click { position: absolute; inset: 0; cursor: pointer; }

.map-open-btn {
  position: absolute;
  bottom: 14px; right: 14px;
  background: rgba(3,3,8,.88);
  border: .5px solid rgba(128,199,31,.15);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: .7rem;
  color: var(--green);
  text-decoration: none;
  font-weight: 600;
  transition: background .2s;
  z-index: 2;
}

.map-open-btn:hover { background: rgba(10,10,20,.95); }

/* FOOTER */
.footer-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  border-bottom: 1px solid var(--border);
}

.footer-link {
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-right: 1px solid var(--border);
  text-decoration: none;
  transition: background .15s;
}

.footer-link:last-child { border-right: none; }
.footer-link:hover { background: rgba(255,255,255,.02); }

.footer-link-t {
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-2);
  transition: color .15s;
}

.footer-link:hover .footer-link-t { color: var(--text); }

.footer-link-a {
  font-size: .8rem;
  color: var(--text-3);
  transition: color .15s, transform .15s;
}

.footer-link:hover .footer-link-a { color: var(--green); transform: translateX(3px); }

/* SERVER INFO */
.server-info {
  padding: .25rem 0;
  border-bottom: 1px solid var(--border);
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .55rem 1.5rem;
  border-bottom: 1px solid var(--border);
  font-size: .8rem;
}

.info-row:last-child { border-bottom: none; }
.info-row span:first-child { color: var(--text-2); }
.info-row .mono { font-size: .75rem; color: var(--text); }

/* ═══════════════ MOBILE ═══════════════ */

@media (max-width: 768px) {
  /* Login */
  .login-screen {
    flex-direction: column;
    min-height: 100vh;
  }

  .login-left {
    flex: none;
    padding: 2.5rem 1.5rem 2rem;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .login-big { font-size: clamp(2.5rem, 12vw, 4rem); }
  .login-big-dim { font-size: clamp(2.5rem, 12vw, 4rem); }

  .login-right {
    width: 100%;
    padding: 2rem 1.5rem;
    flex: 1;
    align-items: flex-start;
  }

  .login-form { max-width: 100%; }

  /* App */
  .banner { padding: 1.5rem 1rem 1.25rem; flex-direction: column; align-items: flex-start; gap: .75rem; }
  .banner-right { text-align: left; }

  .stats-grid { grid-template-columns: 1fr; }
  .stat-cell { padding: 1rem; }
  .stat-val { font-size: 1.25rem; }

  .content-grid { grid-template-columns: 1fr; }
  .players-col { border-right: none; border-bottom: 1px solid var(--border); }

  .map-col { min-height: 220px; }

  .footer-grid { grid-template-columns: 1fr; }
  .footer-link { border-right: none; border-bottom: 1px solid var(--border); }
  .footer-link:last-child { border-bottom: none; }

  .info-row { padding: .55rem 1rem; }
  .col-header { padding: .75rem 1rem; }
  .player-row { padding: .7rem 1rem; }
}

/* ARCHIVE LINK */
.archive-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .875rem 1.5rem;
  border-top: 1px solid var(--border);
  text-decoration: none;
  transition: background .15s;
  flex-shrink: 0;
  margin-top: auto;
}
.archive-link:hover { background: rgba(255,255,255,.025); }
.archive-link-t { font-size: .8rem; font-weight: 500; color: var(--text-2); transition: color .15s; }
.archive-link:hover .archive-link-t { color: var(--text); }
.archive-link-a { font-size: .8rem; color: var(--text-3); transition: color .15s, transform .15s; }
.archive-link:hover .archive-link-a { color: var(--green); transform: translateX(3px); }

/* SERVER INFO ROW */
.server-info-row { justify-content: center;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem 1.5rem;
  border-bottom: 1px solid var(--border);
  font-size: .75rem;
  flex-wrap: wrap;
}
.server-info-row .mono { color: var(--text); }
.info-sep { color: var(--text-3); }
