/* ============================================================
   portal.css  ·  ARCADE STATION · LOBBY
   主页(单机 / 联机 列表页)的样式体系
   与 game.css / admin.css 共享同一套颜色 token 与字体语言
   独立设计,不沿用旧 main.css 的胶囊胶囊风
   - 顶部控制台 + Hero 介绍区 + 状态条
   - 游戏卡片网格(像选机台)+ 终端风格搜索
   ============================================================ */

.gp-app {
  --gp-pri:        #ff5b3a;
  --gp-pri-2:      #ff7e5c;
  --gp-pri-ink:    #ffffff;
  --gp-pri-ring:   rgba(255, 91, 58, .22);

  --gp-ok:         #00c389;
  --gp-warn:       #ffb800;
  --gp-err:        #ff5577;
  --gp-cool:       #4cc9f0;

  --gp-surface:    var(--bg-surface);
  --gp-elev:       var(--bg-elev);
  --gp-sunken:     var(--bg-sunken);
  --gp-bg:         var(--bg-base);
  --gp-line:       var(--line-soft);
  --gp-line-2:     var(--line-strong);
  --gp-fg:         var(--fg-strong);
  --gp-fg-2:       var(--fg-normal);
  --gp-fg-3:       var(--fg-muted);
  --gp-fg-4:       var(--fg-faint);

  --gp-mono: "JetBrains Mono", "SFMono-Regular", "Menlo", "Consolas", monospace;

  --gp-radius:     4px;
  --gp-radius-lg:  10px;
  --gp-ease:       cubic-bezier(.2, .7, .2, 1);
}
:root[data-theme="dark"] .gp-app {
  --gp-pri:      #ff6b48;
  --gp-pri-2:    #ff8a6a;
  --gp-pri-ring: rgba(255, 107, 72, .28);
}

/* ============================================================
   页面背景(机房地板)
   ============================================================ */
.gp-app {
  position: relative;
  min-height: 100vh;
  padding: 14px;
}
.gp-app::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-color: var(--gp-bg);
  background-image:
    linear-gradient(var(--gp-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--gp-line) 1px, transparent 1px);
  background-size: 56px 56px, 56px 56px;
  background-position: -1px -1px;
  opacity: .55;
  pointer-events: none;
}
.gp-app::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: var(--grain);
  background-attachment: fixed;
  pointer-events: none;
}

/* ============================================================
   顶部控制台 (BAR) - 与 game.php 一致
   ============================================================ */
.gp-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: var(--gp-surface);
  border: 1px solid var(--gp-line-2);
  border-radius: var(--gp-radius);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .08),
    0 2px 0 var(--gp-line),
    0 12px 30px rgba(0, 0, 0, .08);
  margin-bottom: 18px;
}

.gp-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--gp-fg);
  letter-spacing: -.005em;
  text-decoration: none;
}
.gp-brand-mark {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--gp-pri);
  color: var(--gp-pri-ink);
  border-radius: var(--gp-radius);
  position: relative;
  overflow: hidden;
}
.gp-brand-mark::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1.5px solid currentColor;
  opacity: .35;
  border-radius: 2px;
}
.gp-brand-mark svg { width: 20px; height: 20px; }
.gp-brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.gp-brand-name { font-weight: 800; font-size: 16px; }
.gp-brand-tag {
  font-family: var(--gp-mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  color: var(--gp-fg-3);
  margin-top: 3px;
  text-transform: uppercase;
}

/* 分类切换 */
.gp-tabs {
  display: inline-flex;
  align-items: stretch;
  background: var(--gp-sunken);
  border: 1px solid var(--gp-line-2);
  border-radius: var(--gp-radius);
  padding: 3px;
  gap: 2px;
}
.gp-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--gp-fg-3);
  border-radius: 2px;
  text-decoration: none;
  text-transform: uppercase;
  transition: color .2s var(--gp-ease), background .2s var(--gp-ease);
}
.gp-tab:hover { color: var(--gp-fg); }
.gp-tab.is-on {
  background: var(--gp-fg);
  color: var(--gp-bg);
}
.gp-tab.is-locked { cursor: not-allowed; }
.gp-tab.is-locked::after {
  content: "LOCK";
  font-family: var(--gp-mono);
  font-size: 9.5px;
  letter-spacing: .12em;
  padding: 2px 6px;
  border: 1px solid currentColor;
  border-radius: 2px;
  margin-left: 4px;
  opacity: .65;
}
.gp-tab-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: .55;
}

.gp-bar-tools {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
}
.gp-led {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gp-line-2);
  position: relative;
  flex: none;
  display: inline-block;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), inset 0 -1px 0 rgba(0, 0, 0, .25);
}
.gp-led::before {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .2);
}
.gp-led-on {
  background: var(--gp-ok);
  animation: gp-pulse 1.6s var(--gp-ease) infinite;
}
.gp-led-on::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid var(--gp-ok);
  opacity: .25;
  animation: gp-halo 1.6s var(--gp-ease) infinite;
}
@keyframes gp-pulse {
  0%, 100% { filter: brightness(1); }
  50%      { filter: brightness(.65); }
}
@keyframes gp-halo {
  0%   { transform: scale(.6); opacity: .45; }
  100% { transform: scale(1.5); opacity: 0; }
}

.gp-btn-icon {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: var(--gp-elev);
  border: 1px solid var(--gp-line-2);
  border-radius: var(--gp-radius);
  color: var(--gp-fg);
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 2px 0 var(--gp-line);
  transition: transform .12s var(--gp-ease), background .15s var(--gp-ease);
}
.gp-btn-icon:hover { background: var(--gp-surface); }
.gp-btn-icon:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 0 0 var(--gp-line); }
.gp-btn-icon svg { width: 17px; height: 17px; }
.gp-btn-icon .icon-dark { display: none; }
:root[data-theme="dark"] .gp-btn-icon .icon-light { display: none; }
:root[data-theme="dark"] .gp-btn-icon .icon-dark { display: block; }

/* ============================================================
   Hero / 介绍区
   ============================================================ */
.gp-hero {
  position: relative;
  padding: 48px 36px 40px;
  background: var(--gp-surface);
  border: 1px solid var(--gp-line-2);
  border-radius: var(--gp-radius);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .06),
    0 2px 0 var(--gp-line);
  overflow: hidden;
}
/* 右上角刻度尺 + 右下角标记 */
.gp-hero::before {
  content: "";
  position: absolute;
  top: 18px; right: 18px;
  width: 12px; height: 12px;
  border: 1.5px solid var(--gp-pri);
  border-radius: 50%;
  opacity: .55;
}
.gp-hero::after {
  content: "";
  position: absolute;
  right: 18px; bottom: 18px;
  width: 64px; height: 1px;
  background: var(--gp-line-2);
  opacity: .4;
}

.gp-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  font-family: var(--gp-mono);
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gp-pri);
  font-weight: 700;
  background: color-mix(in srgb, var(--gp-pri) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--gp-pri) 30%, transparent);
  border-radius: 2px;
}
.gp-eyebrow::before {
  content: "";
  width: 6px; height: 6px;
  background: var(--gp-pri);
  border-radius: 1px;
}

.gp-hero-title {
  margin: 18px 0 14px;
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 900;
  letter-spacing: -.025em;
  line-height: 1.05;
  color: var(--gp-fg);
  font-style: italic;
  transform: skewX(-4deg);
  transform-origin: left center;
}
.gp-hero-title .hl {
  color: var(--gp-pri);
  position: relative;
}
.gp-hero-title .hl::after {
  content: "";
  position: absolute;
  left: 2px; right: 2px; bottom: 6px;
  height: 6px;
  background: color-mix(in srgb, var(--gp-pri) 22%, transparent);
  border-radius: 3px;
  z-index: -1;
}
.gp-hero-lead {
  max-width: 620px;
  margin: 0 0 24px;
  color: var(--gp-fg-3);
  font-size: 15.5px;
  line-height: 1.7;
}

.gp-hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding-top: 18px;
  border-top: 1px dashed var(--gp-line-2);
}
.gp-hero-stat {
  flex: 1;
  min-width: 140px;
  padding: 6px 18px 6px 0;
  border-right: 1px dashed var(--gp-line-2);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.gp-hero-stat:last-child { border-right: 0; padding-right: 0; }
.gp-hero-stat-k {
  font-family: var(--gp-mono);
  font-size: 10.5px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gp-fg-3);
  font-weight: 700;
}
.gp-hero-stat-k::before {
  content: "//";
  color: var(--gp-pri);
  margin-right: 4px;
}
.gp-hero-stat-v {
  font-family: var(--gp-mono);
  font-size: 16px;
  color: var(--gp-fg);
  letter-spacing: .02em;
}

/* ============================================================
   区块头(标题 + 搜索)
   ============================================================ */
.gp-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 28px 0 16px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--gp-line-2);
}
.gp-section-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--gp-fg);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.gp-section-head h2::before {
  content: "";
  width: 4px; height: 20px;
  background: var(--gp-pri);
  border-radius: 1px;
}
.gp-section-head .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 22px;
  padding: 0 9px;
  border-radius: 2px;
  background: var(--gp-elev);
  border: 1px solid var(--gp-line-2);
  color: var(--gp-fg);
  font-family: var(--gp-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
}
.gp-section-head .filter { min-width: 280px; flex: none; }
.gp-section-head .filter input {
  width: 100%;
  background: var(--gp-elev);
  color: var(--gp-fg);
  border: 1px solid var(--gp-line-2);
  border-radius: 2px;
  padding: 11px 14px 11px 38px;
  font-size: 13.5px;
  font-family: var(--gp-mono);
  letter-spacing: .04em;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.gp-section-head .filter input:focus {
  outline: none;
  border-color: var(--gp-pri);
  box-shadow: 0 0 0 3px var(--gp-pri-ring);
  background: var(--gp-surface);
}
/* 搜索图标只在真正装着 input 的 .filter 上绘制;
   避免「联机大厅」标题旁的「实时公开对局」状态徽章被错误渲染上放大镜 */
.gp-section-head .filter:has(> input) {
  position: relative;
}
.gp-section-head .filter:has(> input)::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 50%;
  width: 13px;
  height: 13px;
  border: 1.6px solid var(--gp-fg-3);
  border-radius: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}
.gp-section-head .filter:has(> input)::after {
  content: "";
  position: absolute;
  left: 25px;
  top: 50%;
  width: 5px;
  height: 1.6px;
  background: var(--gp-fg-3);
  border-radius: 1px;
  transform: translateY(2px) rotate(45deg);
  pointer-events: none;
}

/* ============================================================
   卡片网格
   ============================================================ */
.gp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

/* 单张卡片 - 切角街机机台风 */
.gp-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--gp-surface);
  border: 1px solid var(--gp-line-2);
  border-radius: var(--gp-radius);
  overflow: hidden;
  cursor: pointer;
  transition:
    transform .2s var(--gp-ease),
    border-color .2s var(--gp-ease),
    box-shadow .2s var(--gp-ease);
  text-decoration: none;
  color: inherit;
}
.gp-card:hover {
  transform: translateY(-3px);
  border-color: var(--gp-pri);
  box-shadow: 0 4px 0 var(--gp-line-2), 0 18px 40px rgba(0, 0, 0, .15);
}
.gp-card:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--gp-pri-ring), 0 18px 40px rgba(0, 0, 0, .15);
}

.gp-card-cover {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--gp-sunken);
  overflow: hidden;
}
.gp-card-cover .ph {
  position: absolute; inset: 0;
  display: grid;
  place-items: center;
  background: var(--gp-sunken);
}
.gp-card-cover .glyph {
  font-family: var(--gp-mono);
  font-weight: 900;
  font-size: 64px;
  line-height: 1;
  color: var(--gp-pri);
  letter-spacing: -.04em;
}
.gp-card-cover img.cover-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .35s var(--gp-ease);
}
.gp-card:hover .cover-img { transform: scale(1.04); }

.gp-card-stamp {
  position: absolute;
  left: 10px; top: 10px;
  font-family: var(--gp-mono);
  font-size: 11px;
  letter-spacing: .02em;
  padding: 3px 8px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--gp-surface) 78%, transparent);
  border: 1px solid var(--gp-line-2);
  color: var(--gp-fg-3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.gp-card-status {
  position: absolute;
  right: 10px; top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  font-family: var(--gp-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  border-radius: 2px;
  background: var(--gp-ok);
  color: #fff;
}
.gp-card-status::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 0 4px rgba(255, 255, 255, .8);
}
.gp-card.is-locked .gp-card-status {
  background: var(--gp-warn);
  color: #1a1a1a;
}

.gp-card-body {
  padding: 14px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gp-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--gp-fg);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -.005em;
}
.gp-card-title .dot {
  width: 6px; height: 6px;
  background: var(--gp-pri);
  flex: none;
}
.gp-card-title .custom-mark {
  margin-left: auto;
  font-family: var(--gp-mono);
  font-size: 9.5px;
  font-weight: 700;
  color: var(--gp-pri);
  border: 1px solid color-mix(in srgb, var(--gp-pri) 35%, transparent);
  background: color-mix(in srgb, var(--gp-pri) 10%, transparent);
  padding: 1px 6px;
  border-radius: 2px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.gp-card-desc {
  margin: 0;
  font-size: 13px;
  color: var(--gp-fg-3);
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 38px;
}
.gp-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.gp-card-tag {
  font-family: var(--gp-mono);
  font-size: 10.5px;
  letter-spacing: .04em;
  padding: 2px 7px;
  border-radius: 2px;
  background: var(--gp-elev);
  border: 1px solid var(--gp-line-2);
  color: var(--gp-fg-3);
}
.gp-card-tag::before {
  content: "#";
  color: var(--gp-pri);
  margin-right: 2px;
}

.gp-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  padding: 10px 16px;
  border-top: 1px dashed var(--gp-line-2);
  font-family: var(--gp-mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--gp-fg-3);
  text-transform: uppercase;
  background: var(--gp-elev);
}
.gp-card.is-locked .gp-card-foot { opacity: .8; }
.gp-card-foot .meta-time {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.gp-card-foot .meta-time::before {
  content: "";
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--gp-fg-4);
}
.gp-card-play {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--gp-pri);
  font-weight: 700;
}
.gp-card-play .arrow { transition: transform .2s var(--gp-ease); }
.gp-card:hover .gp-card-play .arrow { transform: translateX(2px); }
.gp-card.is-locked .gp-card-play { color: var(--gp-fg-4); }

/* 锁定卡片 */
.gp-card.is-locked { opacity: .9; cursor: not-allowed; }
.gp-card.is-locked:hover {
  transform: none;
  border-color: var(--gp-line-2);
  box-shadow: none;
}

/* ============================================================
   空状态
   ============================================================ */
.gp-empty {
  margin: 0 0 22px;
  padding: 56px 28px;
  border: 1px dashed var(--gp-line-2);
  border-radius: var(--gp-radius);
  background: var(--gp-surface);
  text-align: center;
  color: var(--gp-fg-3);
}
.gp-empty .ico {
  width: 64px; height: 64px;
  margin: 0 auto 16px;
  border-radius: 4px;
  background: var(--gp-elev);
  border: 1px solid var(--gp-line-2);
  display: grid;
  place-items: center;
  color: var(--gp-fg-4);
}
.gp-empty p { margin: 4px 0; }
.gp-empty code {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 2px;
  background: var(--gp-elev);
  border: 1px solid var(--gp-line-2);
  color: var(--gp-fg);
  font-size: 12.5px;
  font-family: var(--gp-mono);
}

/* ============================================================
   页脚状态栏
   ============================================================ */
.gp-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  padding: 12px 18px;
  background: var(--gp-surface);
  border: 1px solid var(--gp-line-2);
  border-radius: var(--gp-radius);
  font-family: var(--gp-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gp-fg-3);
}
.gp-foot-l, .gp-foot-r {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.gp-foot-mark {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  background: var(--gp-pri);
  color: var(--gp-pri-ink);
  font-weight: 900;
  font-size: 11px;
  border-radius: 2px;
}
.gp-foot-px {
  width: 10px;
  height: 10px;
  background: var(--gp-ok);
  display: inline-block;
  animation: gp-pulse 1.6s var(--gp-ease) infinite;
}

/* ============================================================
   入场动画
   ============================================================ */
@keyframes gp-rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.gp-hero { animation: gp-rise .4s var(--gp-ease) backwards; }
.gp-section-head { animation: gp-rise .4s var(--gp-ease) .06s backwards; }
.gp-grid > * {
  animation: gp-rise .35s var(--gp-ease) backwards;
}
.gp-grid > *:nth-child(1)  { animation-delay: .10s; }
.gp-grid > *:nth-child(2)  { animation-delay: .14s; }
.gp-grid > *:nth-child(3)  { animation-delay: .18s; }
.gp-grid > *:nth-child(4)  { animation-delay: .22s; }
.gp-grid > *:nth-child(5)  { animation-delay: .26s; }
.gp-grid > *:nth-child(6)  { animation-delay: .30s; }
.gp-grid > *:nth-child(n+7) { animation-delay: .34s; }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 980px) {
  .gp-hero { padding: 36px 24px 32px; }
  .gp-hero-stat { min-width: 120px; padding-right: 14px; }
}

@media (max-width: 720px) {
  .gp-app { padding: 10px; }
  .gp-bar {
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 12px 14px;
  }
  .gp-bar-tools { grid-column: 2; grid-row: 1; }
  .gp-tabs { grid-column: 1 / -1; grid-row: 2; width: 100%; justify-content: center; }
  .gp-tab { padding: 7px 12px; font-size: 12px; }
  .gp-tab.is-locked::after { display: none; }
  .gp-hero { padding: 28px 18px 24px; }
  .gp-hero-stats { flex-direction: column; }
  .gp-hero-stat {
    border-right: 0;
    border-bottom: 1px dashed var(--gp-line-2);
    padding: 8px 0;
  }
  .gp-hero-stat:last-child { border-bottom: 0; }
  .gp-section-head { flex-direction: column; align-items: stretch; margin: 22px 0 12px; }
  .gp-section-head .filter { min-width: 0; }
  .gp-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .gp-card-cover .glyph { font-size: 48px; }
  .gp-foot { font-size: 10px; padding: 10px 14px; }
}

@media (max-width: 480px) {
  .gp-hero-title { font-size: 30px; }
  .gp-hero-lead { font-size: 14px; }
  .gp-grid { grid-template-columns: 1fr; }
}