:root {
  --ink: #101621;
  --muted: #637083;
  --paper: #f8fafc;
  --panel: #ffffff;
  --line: #dfe5ef;
  --blue: #216fed;
  --green: #12a06f;
  --shadow: 0 20px 50px rgba(16, 22, 33, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Noto Sans JP", system-ui, sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  min-height: 70px;
  padding: 0 28px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "Outfit", sans-serif;
  font-weight: 900;
}

.brand span {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  display: grid;
  place-items: center;
}

nav {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.page {
  width: min(1220px, calc(100% - 32px));
  margin: 34px auto 60px;
}

.back-link {
  display: inline-flex;
  margin-bottom: 18px;
  color: var(--blue);
  font-weight: 900;
}

.play-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 20px;
  align-items: start;
}

.player-card,
.side-panel,
.related {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.player-card {
  padding: 18px;
}

.player-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 18px;
  align-items: center;
  padding-bottom: 16px;
}

.player-head img {
  width: 132px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-family: "Outfit", sans-serif;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.player-head p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.player-shell {
  position: relative;
  background: #05070c;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  min-height: 320px;
}

#game-player {
  width: 100%;
  height: 100%;
}

.loader {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  color: #fff;
  z-index: 2;
}

.loader span {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.side-panel {
  padding: 18px;
  display: grid;
  gap: 22px;
}

.side-panel h2,
.related h2 {
  margin: 0 0 12px;
  font-size: 1.05rem;
}

dl {
  margin: 0;
  display: grid;
  gap: 10px;
}

dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

dt {
  color: var(--muted);
  font-weight: 800;
}

dd {
  margin: 0;
  font-weight: 900;
}

.keys {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 10px;
  align-items: center;
}

.keys span {
  padding: 5px 8px;
  border-radius: 6px;
  background: #eef4ff;
  color: var(--blue);
  font-family: "Outfit", sans-serif;
  font-weight: 900;
}

.keys b {
  font-size: 0.88rem;
}

ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 0.92rem;
}

.related {
  margin-top: 24px;
  padding: 18px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 14px;
}

.related-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  background: #fff;
}

.related-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.related-card span {
  margin: 10px 10px 0;
  color: var(--blue);
  font-size: 0.74rem;
  font-weight: 900;
}

.related-card strong {
  padding: 4px 10px 12px;
  font-size: 0.9rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .play-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 16px;
  }

  nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 3px;
  }

  .player-head {
    grid-template-columns: 1fr;
  }

  .player-head img {
    width: 100%;
    max-width: 220px;
  }

  h1 {
    font-size: 1.55rem;
  }

  .player-shell {
    min-height: 230px;
  }
}
