:root {
  color-scheme: dark;
  font-family: Inter, "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  --bg: #090d10;
  --panel: rgba(9, 18, 22, 0.86);
  --line: rgba(225, 255, 248, 0.22);
  --cyan: #2fffd1;
  --yellow: #ffe65a;
  --coral: #ff6d5a;
  --violet: #b96cff;
  --blue: #57a8ff;
  color: #f2fffb;
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(circle at 16% 10%, rgba(47, 255, 209, 0.12), transparent 26%),
    radial-gradient(circle at 82% 6%, rgba(255, 230, 90, 0.11), transparent 24%),
    linear-gradient(135deg, #090d10 0%, #111c18 45%, #1a111f 100%);
}

button,
a {
  color: inherit;
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

a {
  text-decoration: none;
}

.hub-shell {
  min-height: 100vh;
  padding: 18px;
  display: grid;
  gap: 14px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr;
  gap: 14px;
}

.brand,
.statusbar,
.library,
.player-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(10, 22, 27, 0.9), rgba(5, 10, 13, 0.74));
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}

.brand {
  min-height: 78px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, var(--cyan) 0 48%, transparent 49%),
    linear-gradient(0deg, var(--coral) 0 48%, transparent 49%),
    radial-gradient(circle at 72% 28%, var(--yellow) 0 11%, var(--violet) 12% 100%);
  box-shadow: 0 0 26px rgba(47, 255, 209, 0.35);
}

.brand p,
.statusbar span,
.library-head span,
.game-card span,
.player-toolbar span,
.tag-row span {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0;
  color: rgba(232, 255, 249, 0.66);
  font-size: 11px;
}

.brand h1,
.library h2,
.player-toolbar h2 {
  margin: 2px 0 0;
  line-height: 1;
}

.brand h1 {
  font-size: 26px;
}

.statusbar {
  display: grid;
  grid-template-columns: 1.1fr 0.8fr 1fr;
  overflow: hidden;
}

.statusbar div {
  min-height: 78px;
  padding: 13px 14px;
  display: grid;
  align-content: center;
  gap: 6px;
  border-left: 1px solid rgba(225, 255, 248, 0.12);
}

.statusbar div:first-child {
  border-left: 0;
}

.statusbar strong {
  font-size: 20px;
  line-height: 1.1;
}

.layout {
  display: grid;
  grid-template-columns: minmax(310px, 430px) minmax(520px, 1fr);
  gap: 14px;
  align-items: start;
}

.library {
  padding: 12px;
  display: grid;
  gap: 12px;
}

.library-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 10px;
}

.library h2 {
  font-size: 22px;
}

.game-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.game-card {
  min-height: 112px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(225, 255, 248, 0.14);
  background: rgba(5, 12, 15, 0.62);
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 11px;
  text-align: left;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.game-card:not(.empty):hover,
.game-card.active {
  transform: translateY(-1px);
  border-color: rgba(47, 255, 209, 0.58);
  background: rgba(8, 22, 25, 0.82);
}

.game-card.empty {
  cursor: default;
  opacity: 0.58;
  border-style: dashed;
}

.thumb {
  border-radius: 6px;
  min-height: 88px;
  background-position: center;
  background-size: cover;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.thumb.empty-thumb {
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(47, 255, 209, 0.12), rgba(185, 108, 255, 0.12)),
    rgba(255, 255, 255, 0.04);
}

.thumb.empty-thumb::before {
  content: "+";
  font-size: 34px;
  color: rgba(242, 255, 251, 0.54);
}

.game-card h3 {
  margin: 4px 0 6px;
  font-size: 18px;
  line-height: 1.15;
}

.game-card p {
  margin: 0;
  color: rgba(232, 255, 249, 0.74);
  font-size: 13px;
  line-height: 1.42;
}

.player-panel {
  min-width: 0;
  padding: 12px;
  display: grid;
  gap: 12px;
}

.player-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.player-toolbar h2 {
  font-size: 26px;
}

.toolbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.toolbar-actions button,
.toolbar-actions a {
  min-height: 40px;
  border-radius: 8px;
  padding: 10px 14px;
  display: inline-grid;
  place-items: center;
  background: rgba(4, 12, 16, 0.72);
  border: 1px solid rgba(225, 255, 248, 0.18);
}

.toolbar-actions a {
  background: linear-gradient(90deg, var(--cyan), var(--yellow));
  color: #081014;
  font-weight: 900;
}

.frame-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(225, 255, 248, 0.2);
  background: #05090c;
}

iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #05090c;
}

.player-meta {
  display: grid;
  gap: 10px;
}

.player-meta p {
  margin: 0;
  color: rgba(232, 255, 249, 0.78);
  line-height: 1.55;
}

.tag-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag-row span {
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(47, 255, 209, 0.08);
  border: 1px solid rgba(47, 255, 209, 0.18);
  color: rgba(242, 255, 251, 0.78);
}

@media (max-width: 1100px) {
  .topbar,
  .layout {
    grid-template-columns: 1fr;
  }

  .game-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .hub-shell {
    min-height: 100dvh;
    padding: 8px;
    gap: 8px;
  }

  .topbar {
    gap: 8px;
  }

  .brand {
    min-height: 58px;
    padding: 10px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand h1 {
    font-size: 20px;
  }

  .statusbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .statusbar div {
    min-height: 48px;
    padding: 8px;
    border-top: 0;
    border-left: 1px solid rgba(225, 255, 248, 0.12);
    overflow: hidden;
  }

  .statusbar div:first-child {
    border-left: 0;
  }

  .statusbar strong {
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .game-card {
    grid-template-columns: 78px minmax(0, 1fr);
    min-height: 82px;
    padding: 8px;
    gap: 8px;
  }

  .thumb {
    min-height: 64px;
  }

  .game-card h3 {
    margin: 2px 0 4px;
    font-size: 15px;
  }

  .game-card p,
  .player-meta p {
    display: none;
  }

  .player-panel {
    order: -1;
    padding: 10px;
    gap: 8px;
  }

  .player-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .player-toolbar h2 {
    font-size: 21px;
  }

  .frame-wrap {
    display: none;
  }

  .toolbar-actions {
    justify-content: stretch;
  }

  .toolbar-actions button,
  .toolbar-actions a {
    flex: 1;
  }

  .tag-row span {
    padding: 5px 8px;
    font-size: 10px;
  }
}
