:root {
  --bg: #101217;
  --panel: #171d26;
  --panel-2: #232b37;
  --accent: #20c997;
  --accent-2: #ffcf5a;
  --danger: #ff5f6d;
  --ink: #f5f7fb;
  --muted: #aab3c2;
  --bs-body-font-family: "Noto Sans JP";
  --bs-font-sans-serif: "Noto Sans JP";
  --bs-btn-font-family: "Noto Sans JP";
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 20% 10%, rgba(32, 201, 151, 0.22), transparent 28rem),
    radial-gradient(circle at 80% 0%, rgba(255, 207, 90, 0.16), transparent 24rem),
    var(--bg);
  background-size: 24px 24px, 24px 24px, auto, auto, auto;
  font-family: "Noto Sans JP";
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.navbar {
  background: rgba(16, 18, 23, 0.84);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark {
  width: 2.25rem;
  height: 2.25rem;
  display: inline-grid;
  place-items: center;
  color: #101217;
  background: var(--accent);
  box-shadow: 4px 4px 0 var(--accent-2);
  font-weight: 900;
}

.brand-mark-logo {
  width: auto;
  height: 2rem;
  display: block;
  object-fit: contain;
}

.navbar-brand {
  gap: 0.5rem !important;
}

.brand-type-logo {
  width: auto;
  max-width: min(36vw, 12rem);
  height: 1.45rem;
  display: block;
  object-fit: contain;
}

.site-footer {
  color: var(--muted);
  font-size: 0.8125rem;
}

.hero {
  padding: 4rem 0 2rem;
}

.hero-title {
  max-width: 820px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.02;
}

.hero-copy {
  max-width: 680px;
  color: var(--muted);
  font-size: 1rem;
}

.game-card {
  height: 100%;
  overflow: hidden;
  color: var(--ink);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.game-card:hover,
.game-card:focus-within {
  transform: translateY(-4px);
  border-color: rgba(32, 201, 151, 0.7);
  box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.25);
}

.game-preview {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  background:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    #151a22;
  background-size: 16px 16px;
}

.pixel-scene {
  width: min(78%, 220px);
  image-rendering: pixelated;
}

.game-thumbnail {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.badge-pending {
  color: #101217;
  background: var(--accent-2);
}

.header-status {
  min-width: 7.5rem;
  margin-left: 0.75rem;
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto 0.35rem;
  align-items: center;
  column-gap: 0.45rem;
  row-gap: 0.25rem;
  padding: 0.4rem 0.55rem;
  color: var(--muted);
  background: rgba(23, 29, 38, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.header-status-label {
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
}

.header-status strong {
  color: var(--ink);
  font-size: 0.78rem;
  line-height: 1;
  text-align: right;
}

.header-progress {
  grid-column: 1 / -1;
  overflow: hidden;
  height: 0.35rem;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

.header-progress > div {
  height: 100%;
  width: 0;
  background: var(--accent);
}

.btn-play,
.btn-neon {
  --bs-btn-color: #101217;
  --bs-btn-bg: var(--accent);
  --bs-btn-border-color: var(--accent);
  --bs-btn-hover-color: #101217;
  --bs-btn-hover-bg: #43d9ad;
  --bs-btn-hover-border-color: #43d9ad;
  font-weight: 900;
}

.text-muted-custom {
  color: var(--muted);
}

.game-number {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
}

.game-description {
  font-size: 1rem;
}

.game-breadcrumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.25rem;
  padding: 0.45rem 0.75rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.game-breadcrumb:hover {
  color: #101217;
  background: var(--accent);
  border-color: var(--accent);
}

.game-page {
  min-height: calc(100vh - 66px);
}

.error-page {
  min-height: calc(100vh - 150px);
  display: grid;
  align-items: center;
  padding: 4rem 0;
}

.error-copy {
  max-width: 34rem;
}

.fw-black {
  font-weight: 900;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lead {
  color: var(--muted);
}

.game-actions {
  min-width: min(100%, 460px);
}

.score-panel {
  min-width: min(100%, 320px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.score-panel > div {
  padding: 0.85rem 1rem;
  background: rgba(23, 29, 38, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
}

.label {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.score-panel strong {
  display: block;
  font-size: 1.5rem;
  line-height: 1.1;
}

.icon-button {
  width: 2.35rem;
  height: 2.35rem;
  display: inline-grid;
  place-items: center;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
}

.icon-button:hover {
  color: #101217;
  background: var(--accent);
  border-color: var(--accent);
}

.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.icon-button:disabled:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.16);
}

.icon-glyph,
.icon-glyph svg {
  width: 1.25rem;
  height: 1.25rem;
  display: block;
}

.icon-glyph svg {
  fill: currentColor;
}

.game-frame {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 280px;
  background: #080b10;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.35);
}

.game-frame-controls {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  display: flex;
  gap: 0.5rem;
  padding: 0.35rem;
  background: rgba(8, 11, 16, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  backdrop-filter: blur(10px);
}

.game-frame:fullscreen {
  display: grid;
  place-items: center;
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 50%, rgba(32, 201, 151, 0.14), transparent 34rem),
    #080b10;
  border: 0;
  border-radius: 0;
}

.game-frame:fullscreen canvas {
  width: min(100vw, 177.7778vh);
  height: min(100vh, 56.25vw);
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(8, 11, 16, 0.62);
}

.overlay-panel {
  width: min(100%, 420px);
  padding: 1.5rem;
  text-align: center;
  background: rgba(23, 29, 38, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
}

@media (max-width: 575.98px) {
  .hero {
    padding-top: 2.75rem;
  }

  .game-frame {
    min-height: 240px;
  }

  .game-actions {
    min-width: 100%;
  }

  .game-description {
    display: none;
  }

  .score-panel {
    width: 100%;
    min-width: 100%;
    gap: 0.5rem;
  }

  .score-panel > div {
    padding: 0.45rem 0.65rem;
  }

  .score-panel strong {
    font-size: 1.05rem;
  }

  .label {
    font-size: 0.62rem;
  }

  .game-frame-controls {
    top: 0.5rem;
    right: 0.5rem;
    gap: 0.35rem;
    padding: 0.25rem;
  }

  .game-frame-controls .icon-button {
    width: 2rem;
    height: 2rem;
  }

  .overlay {
    padding: 0.5rem;
  }

  .overlay-panel {
    width: min(100%, 300px);
    max-height: calc(100% - 0.5rem);
    overflow: auto;
    padding: 0.85rem;
  }

  .overlay-panel .h3 {
    font-size: 1.05rem;
    margin-bottom: 0.5rem !important;
  }

  .overlay-panel p {
    font-size: 0.82rem;
    line-height: 1.45;
    margin-bottom: 0.75rem !important;
  }

  .overlay-panel .btn-lg {
    --bs-btn-padding-y: 0.45rem;
    --bs-btn-padding-x: 0.9rem;
    --bs-btn-font-size: 0.95rem;
  }

  .display-5 {
    font-size: 2rem;
  }

  .brand-type-logo {
    display: none;
  }

  .header-status {
    width: 100%;
    margin-left: 0;
    margin-top: 0.5rem;
  }
}
