/* index.php — dashboard grid in the Night PC-zaal world. */

/* Top bar */
.hbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.online { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); font: 600 13px/1 var(--f-num); color: var(--ink-2); }
.online i { width: 8px; height: 8px; border-radius: 50%; background: var(--off); }
.online b { color: var(--ink); }
.online.is-live i { background: var(--led); }
.online.is-live b { color: var(--led); }
.hsearch { position: relative; margin-left: auto; width: min(320px, 100%); }
.hsearch .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); width: 16px; height: 16px; pointer-events: none; }
.hsearch input { width: 100%; min-height: 40px; padding: 0 14px 0 36px; background: var(--inset); border: 1px solid var(--line-2); border-radius: 999px; color: var(--ink); }
.hsearch input:focus { outline: none; border-color: var(--act); box-shadow: 0 0 0 3px rgba(47, 139, 255, .18); }
.hbar .join-form .input { width: 150px; min-height: 40px; }
.hbar .btn { min-height: 40px; }

/* Two action banners */
.banners { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.banner {
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 104px; padding: 20px 24px; border-radius: var(--r); border: 1px solid var(--line); text-decoration: none;
  transition: transform .2s var(--ease), border-color .2s;
}
.banner:hover { transform: translateY(-2px); }
.banner b { display: block; font: 800 19px/1.15 var(--f-display); letter-spacing: 0; text-transform: uppercase; }
.banner small { display: block; margin-top: 6px; font-size: 14px; }
.banner-ic { flex: none; display: grid; place-items: center; width: 40px; height: 40px; }
.banner-ic .ic { width: 32px; height: 32px; }
.banner-go { background: var(--act); border-color: var(--act); color: var(--act-ink); }
.banner-go small { color: #ffffff; }
.banner-go .banner-ic { color: var(--act-ink); }
.banner-go:hover { background: var(--act-hi); }
.banner-rent { /* taste-skill-ignore: legibility scrim over map photo */ background: linear-gradient(90deg, var(--panel) 35%, rgba(13, 29, 56, .7)), var(--img) right center / cover, var(--panel); color: var(--ink); }
.banner-rent small { color: var(--ink-2); }
.banner-rent .banner-ic { color: var(--ink-2); }
.banner-rent:hover { border-color: var(--line-2); }

/* Hero carousel + most active */
.hero-row { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--gap); }
.hero { position: relative; min-height: 360px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: var(--panel); }
.slide {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: 10px;
  padding: 32px 36px 72px;
  /* taste-skill-ignore: legibility scrim over map photo */ background: linear-gradient(90deg, rgba(8, 20, 40, .96) 0%, rgba(8, 20, 40, .82) 45%, rgba(8, 20, 40, .25) 100%), var(--img) center / cover;
  opacity: 0; visibility: hidden; transition: opacity .6s var(--ease), visibility 0s .6s;
}
.slide.is-on { opacity: 1; visibility: visible; transition: opacity .6s var(--ease); }
.slide-tag { display: inline-block; margin-right: 6px; padding: 3px 8px; border-radius: 4px; background: var(--raise); font: 600 13px/1.4 var(--f-body); color: var(--ink); }
.slide-title { font: 800 clamp(22px, 2.5vw, 34px)/1.12 var(--f-display); letter-spacing: 0; text-transform: uppercase; max-width: 18ch; text-wrap: balance; }
.slide-text { color: var(--ink-2); max-width: 46ch; }
.slide .btn { margin-top: 8px; }
.hero-nav { position: absolute; left: 36px; right: 20px; bottom: 18px; display: flex; align-items: center; gap: 8px; }
.dots { display: flex; gap: 8px; margin-right: auto; }
.dots button { position: relative; width: 22px; height: 44px; border: 0; padding: 0; background: none; cursor: pointer; }
.dots button::after { content: ""; position: absolute; left: 0; right: 0; top: 20px; height: 4px; border-radius: 2px; background: var(--line-2); }
.dots button[aria-selected="true"] { width: 34px; }
.dots button[aria-selected="true"]::after { background: var(--ink); }
.dots button:focus-visible { outline-offset: 4px; }
.hero-arrow { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(8, 20, 40, .7); color: var(--ink); cursor: pointer; }
.hero-arrow:hover { background: var(--raise); }
.hero-arrow .ic-play { display: none; }
.hero.is-paused .hero-pause .ic-pause { display: none; }
.hero.is-paused .hero-pause .ic-play { display: block; }

.tops { display: flex; flex-direction: column; }
.seg-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: var(--r-sm); background: var(--inset); border: 1px solid var(--line); margin-bottom: 12px; }
.seg-tabs .tab { text-align: center; padding: 8px 6px; border-radius: 4px; border-bottom: 0; margin: 0; font-size: 13.5px; color: var(--ink-2); }
.seg-tabs .tab[aria-selected="true"] { background: var(--ink); color: var(--ground); }
.tops-list { list-style: none; padding: 0; display: grid; gap: 6px; }
.tops-list a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--inset); border: 1px solid var(--line); text-decoration: none; }
.tops-list a:hover { border-color: var(--line-2); }
.tops-list .is-me a { border-color: rgba(47, 139, 255, .45); }
.tops-name { min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tops-name small { display: block; font: 500 12.5px/1.4 var(--f-body); font-variant-numeric: tabular-nums; color: var(--ink-3); }
.tops-list .rank { width: auto; font-size: 18px; }
.tops-list .rank-1 { font-size: 24px; }
.tops-empty { padding: 18px 4px; }

/* Six stat tiles */
.tiles { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.tile { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel); }
.tile span { font-size: 13px; color: var(--ink-2); }
.tile b { font: 800 24px/1.1 var(--f-display); letter-spacing: 0; font-variant-numeric: tabular-nums; }
.tile .ic { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; color: var(--ink-3); }
.tile-live.is-live { border-color: rgba(255, 75, 75, .5); }
.tile-live.is-live b, .tile-live.is-live .ic { color: var(--led); }

/* Filter bar */
.grid-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.chip-n { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--raise); color: var(--ink-2); font-size: 12px; }
.chip[aria-pressed="true"] .chip-n { background: var(--ground); color: var(--ink); }
.switch { display: inline-flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: 14px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch span { position: relative; width: 36px; height: 20px; border-radius: 999px; background: var(--raise); border: 1px solid var(--line-2); transition: background .2s; }
.switch span::after { content: ""; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--ink-2); transition: transform .2s var(--ease); }
.switch input:checked + span { background: var(--ink); }
.switch input:checked + span::after { transform: translateX(16px); background: var(--ground); }
.switch input:focus-visible + span { outline: 2px solid var(--act); outline-offset: 2px; }
.grid-meta { margin-left: auto; font-size: 12.5px; color: var(--ink-3); }

/* Server cards: the seat board as a grid */
.srv-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.srv {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 10px; min-height: 132px;
  padding: 14px 16px 12px; border-radius: var(--r); border: 1px solid var(--line);
  /* taste-skill-ignore: legibility scrim over map photo */ background: linear-gradient(100deg, rgba(10, 24, 48, .97) 30%, rgba(10, 24, 48, .72)), var(--img, none) center / cover, var(--inset);
}
a.srv { min-height: 104px; color: inherit; text-decoration: none; transition: border-color .15s, transform .15s var(--ease); }
a.srv:hover { border-color: var(--line-2); transform: translateY(-2px); }
a.srv:focus-visible { outline: 2px solid var(--act); outline-offset: 2px; }
.srv-go { margin-left: auto; font-weight: 600; color: var(--sky); }
a.srv:hover .srv-go { color: var(--act-hi); }
.srv-empty { grid-column: 1 / -1; padding: 14px 4px; }
.board-title { font: 800 15px/1.3 var(--f-display); text-transform: uppercase; margin-right: 6px; }
.srv-top { display: flex; align-items: flex-start; gap: 12px; }
.srv-num { font: 800 28px/1 var(--f-display); color: var(--gold); }
.srv-id { min-width: 0; flex: 1; padding-top: 2px; }
.srv-name { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srv-type { display: block; font: 500 13px/1.4 var(--f-body); color: var(--ink-3); }
.srv-state { flex: none; font: 600 12.5px/1 var(--f-body); padding: 5px 8px; border-radius: 4px; background: var(--raise); color: var(--ink-2); }
.srv-line { display: flex; align-items: baseline; gap: 10px; font-size: 13.5px; color: var(--ink-2); margin-top: auto; }
.srv-line .mono b { color: var(--ink); }
.srv-fill { height: 6px; border-radius: 2px; background: var(--off); overflow: hidden; }
.srv-fill i { display: block; height: 100%; width: 0; background: var(--ink-3); transition: width .6s var(--ease); }
.srv.is-live { border-color: rgba(255, 75, 75, .35); }
.srv.is-live .srv-num { color: var(--gold); }
.srv.is-live .srv-state { background: var(--led-bg); color: #ff9a9a; }
.srv.is-live .srv-fill i { background: var(--led); }
.srv.is-loaded .srv-num { color: var(--ink-2); }
.srv.is-loaded .srv-fill { background: repeating-linear-gradient(90deg, var(--led) 0 8px, var(--led-bg) 8px 14px); } /* taste-skill-ignore: status stripe */
.srv.is-free .srv-num { color: var(--gold); }
.srv.is-free .srv-state { background: var(--on-bg); color: #6be39b; }
.srv.is-free .srv-fill { background: var(--on); opacity: .9; }
.srv.is-rented .srv-num { color: var(--ink-2); }
.srv.is-offline { background: var(--inset); }
.srv.is-offline .srv-num { color: #6f86ad; }
.srv.is-offline .srv-name { color: var(--ink-2); }
.srv.is-maint { border-color: rgba(255, 154, 107, .35); background: var(--inset); }
.srv.is-maint .srv-num { color: #6f86ad; }
.srv.is-maint .srv-state { background: var(--warn-bg); color: var(--warn); }
.srv.is-maint .srv-line { color: var(--warn); }
.srv.is-maint .srv-fill { background: repeating-linear-gradient(90deg, var(--warn) 0 6px, transparent 6px 12px); opacity: .5; } /* taste-skill-ignore: maintenance stripe = status */
.maint-notice { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; padding: 12px 16px; border-radius: var(--r); border: 1px solid rgba(255, 154, 107, .4); background: var(--warn-bg); }
.maint-notice .ic { width: 20px; height: 20px; color: var(--warn); margin-top: 1px; }
.maint-notice b { display: block; color: var(--ink); }
.maint-notice p { color: var(--ink-2); font-size: 14px; }
.srv.is-skeleton .srv-num { color: transparent; background: var(--raise); border-radius: 4px; }
.srv[hidden] { display: none; }
@keyframes srv-on { 0% { opacity: .2; filter: brightness(2.2); } 100% { opacity: 1; filter: none; } }
.srv.is-changed .srv-fill { animation: srv-on .9s var(--ease) both; }

@media (max-width: 1280px) { .srv-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .hero-row { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) {
  .banners { grid-template-columns: minmax(0, 1fr); }
  .banner b { font-size: 16px; }
  .hsearch { margin-left: 0; width: 100%; order: 3; }
  .hbar .join-form { width: 100%; }
  .hero { min-height: 320px; }
  .slide { padding: 24px 20px 64px; }
  .hero-nav { left: 20px; bottom: 14px; }
  .hero-arrow { width: 44px; height: 44px; }
  .seg-tabs .tab { padding: 14px 6px; }
  .switch { min-height: 44px; }
  .srv-grid, .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-meta { margin-left: 0; width: 100%; }
}
@media (max-width: 520px) {
  .srv-grid { grid-template-columns: minmax(0, 1fr); }
  /* Offline servers collapse to one line: nothing to read but the name. */
  .srv.is-offline { min-height: 0; padding: 10px 14px; }
  .srv.is-offline .srv-line, .srv.is-offline .srv-fill { display: none; }
  .srv.is-offline .srv-num { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) { .slide { transition: none; } }

@media (max-width: 900px) {
  /* 44px-wide hit areas; the bar inside keeps its size. */
  .dots { gap: 0; }
  .dots button { width: 44px; }
  .dots button::after { left: 11px; right: 11px; }
  .dots button[aria-selected="true"] { width: 52px; }
}
