.portal-game-pack {
  max-width: 1580px;
  margin: 0 auto;
  padding: 30px;
  display: grid;
  gap: 20px;
}

.pg-hero {
  min-height: 390px;
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  border: 1px solid color-mix(in srgb, var(--region-accent) 55%, #74363a);
  border-radius: 28px;
  background:
    radial-gradient(circle at 20% 25%, rgba(255,70,80,.12), transparent 37%),
    linear-gradient(120deg, #171219 0%, #08151d 64%);
}

.pg-hero--snake {
  background:
    radial-gradient(circle at 18% 20%, rgba(62,211,140,.11), transparent 38%),
    linear-gradient(120deg, #111a18 0%, #07151b 64%);
}

.pg-hero--signal {
  background:
    radial-gradient(circle at 20% 20%, rgba(180,100,255,.16), transparent 38%),
    linear-gradient(120deg, #18111d 0%, #07151c 64%);
}

.pg-hero-copy {
  align-self: center;
  position: relative;
  z-index: 3;
  padding: clamp(44px,5vw,72px);
}

.pg-breadcrumb {
  margin-bottom: 32px;
  display: flex;
  gap: 12px;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .14em;
}

.pg-breadcrumb a,
.pg-footer a {
  color: #ff666b;
  text-decoration: none;
}

.pg-breadcrumb span {
  opacity: .35;
}

.pg-hero h1 {
  margin: 12px 0 8px;
  font-size: clamp(4rem,7vw,7rem);
  line-height: .9;
  font-weight: 950;
  letter-spacing: -.07em;
}

.pg-hero h1 span {
  color: #ff6268;
}

.pg-hero--snake h1 span {
  color: #4bd89a;
}

.pg-hero--signal h1 span {
  color: #c182ff;
}

.pg-hero p {
  max-width: 680px;
  color: var(--text-secondary);
  font-size: 1.04rem;
  line-height: 1.65;
}

.pg-tags {
  margin-top: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pg-tags span {
  padding: 6px 11px;
  border: 1px solid #19313d;
  border-radius: 999px;
  background: #07131a;
  color: #6f8996;
  font-size: .63rem;
  font-weight: 900;
  letter-spacing: .1em;
}

.pg-hero-stage {
  position: relative;
  min-height: 390px;
}

.pg-orbit {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 290px;
  height: 290px;
  transform: translate(-50%,-50%);
  border: 1px solid rgba(255,90,95,.48);
  border-radius: 50%;
  box-shadow:
    0 0 0 34px rgba(255,80,90,.035),
    0 0 80px rgba(255,80,90,.08);
}

.pg-hero--snake .pg-orbit {
  border-color: rgba(70,215,155,.45);
  box-shadow:
    0 0 0 34px rgba(70,215,155,.035),
    0 0 80px rgba(70,215,155,.08);
}

.pg-hero--signal .pg-orbit {
  border-color: rgba(190,115,255,.48);
  box-shadow:
    0 0 0 34px rgba(190,115,255,.04),
    0 0 80px rgba(190,115,255,.1);
}

.pg-mon {
  position: absolute;
  z-index: 2;
  width: clamp(145px,15vw,230px);
  height: clamp(145px,15vw,230px);
  object-fit: contain;
  filter: drop-shadow(0 22px 26px rgba(0,0,0,.45));
}

.pg-mon--left {
  left: 12%;
  top: 23%;
}

.pg-mon--right {
  right: 9%;
  top: 28%;
}

.pg-versus {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: 47%;
  width: 66px;
  height: 66px;
  transform: translate(-50%,-50%);
  display: grid;
  place-items: center;
  border: 1px solid #ff6066;
  border-radius: 50%;
  background: #07131a;
  color: #ff666b;
  font-weight: 950;
  font-size: 1.35rem;
}

.pg-hero--snake .pg-versus {
  border-color: #46d49a;
  color: #54dfa7;
}

.pg-hero--signal .pg-versus {
  border-color: #bf7eff;
  color: #cf9bff;
}

.pg-ghost-word {
  position: absolute;
  right: -20px;
  bottom: -45px;
  color: rgba(255,90,95,.055);
  font-size: clamp(7rem,13vw,14rem);
  font-weight: 950;
  letter-spacing: -.1em;
  pointer-events: none;
}

.pg-trainer {
  min-height: 84px;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid #1b3442;
  border-radius: 18px;
  background: #091720;
}

.pg-avatar {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  border: 2px solid #ff5e64;
  border-radius: 50%;
  font-weight: 950;
}

.pg-trainer-name {
  flex: 1;
}

.pg-trainer span,
.pg-ball-count span {
  display: block;
  color: #687f8d;
  font-size: .61rem;
  font-weight: 900;
  letter-spacing: .13em;
}

.pg-trainer strong {
  display: block;
  margin-top: 4px;
}

.pg-ball-count {
  padding-left: 28px;
  border-left: 1px solid #1e3542;
  text-align: right;
}

.pg-ball-count strong {
  color: #ff646a;
  font-size: 1.35rem;
}

.pg-ball-count i {
  display: inline-block;
  width: 19px;
  height: 19px;
  margin-right: 8px;
  vertical-align: -4px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%,#fff,#e5caff 50%,#817199);
}

.pg-two-column,
.snake-layout,
.signal-layout {
  display: grid;
  grid-template-columns: 1.6fr .85fr;
  gap: 18px;
}

.pg-lobby,
.pg-info-panel,
.pg-game-panel,
.snake-console,
.signal-console {
  padding: 24px;
  border: 1px solid #193441;
  border-radius: 20px;
  background: #081720;
}

.pg-lobby h2,
.pg-info-panel h2 {
  margin: 7px 0 20px;
  font-size: 1.65rem;
}

.pg-create {
  width: 100%;
  min-height: 76px;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid rgba(255,90,95,.6);
  border-radius: 14px;
  background:
    linear-gradient(110deg,rgba(255,75,80,.13),rgba(255,75,80,.035));
  color: #eef6fb;
  text-align: left;
  cursor: pointer;
}

.pg-create small,
.pg-open-row small {
  display: block;
  color: #ff686d;
  font-size: .61rem;
  font-weight: 900;
  letter-spacing: .12em;
}

.pg-create strong {
  display: block;
  margin-top: 5px;
  font-size: 1rem;
}

.pg-create > b {
  color: #ff656b;
}

.pg-open-list {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.pg-open-row {
  min-height: 68px;
  padding: 13px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid #1a3441;
  border-radius: 13px;
  background: #06131a;
}

.pg-open-row > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pg-open-row > div > div {
  display: block;
}

.pg-open-row img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.pg-open-row button,
.pg-game-actions button,
.pg-primary {
  padding: 11px 18px;
  border: 1px solid rgba(255,95,100,.55);
  border-radius: 10px;
  background: rgba(255,75,80,.11);
  color: #ff7b80;
  font-weight: 950;
  cursor: pointer;
}

.pg-primary {
  width: 100%;
  min-height: 52px;
  margin-top: 14px;
  background:
    linear-gradient(120deg,rgba(255,90,95,.24),rgba(255,90,95,.08));
}

.pg-primary:disabled {
  opacity: .45;
  cursor: default;
}

.pg-info-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 8px;
}

.pg-info-grid article {
  padding: 18px 8px;
  border: 1px solid #1c3542;
  border-radius: 11px;
  text-align: center;
}

.pg-info-grid strong {
  display: block;
  font-size: 1.35rem;
}

.pg-info-grid span {
  margin-top: 6px;
  color: #607887;
  font-size: .54rem;
  font-weight: 900;
}

.pg-info-panel > p {
  margin-top: 20px;
  color: #78909d;
  line-height: 1.6;
}

.pg-empty {
  padding: 24px;
  text-align: center;
  color: #677f8c;
}

.pg-status {
  margin: 20px 0;
  padding: 13px;
  border: 1px solid #243b47;
  border-radius: 11px;
  background: #061219;
  text-align: center;
  font-weight: 950;
  letter-spacing: .08em;
}

.pg-status[data-type="your-turn"] {
  border-color: #ddb759;
  color: #edc967;
}

.pg-status[data-type="win"] {
  border-color: #47c994;
  color: #56d7a4;
}

.pg-status[data-type="loss"] {
  border-color: #ff5d63;
  color: #ff6d72;
}

.pg-status[data-type="draw"] {
  border-color: #cfae5b;
  color: #e5c66d;
}

.pg-game-actions {
  margin-top: 24px;
  text-align: center;
}

.pg-game-actions .danger {
  border-color: rgba(255,80,90,.5);
}

.pg-footer {
  padding: 4px 2px 20px;
  display: flex;
  justify-content: space-between;
  color: #617987;
  font-size: .62rem;
  font-weight: 900;
  letter-spacing: .08em;
}

.pg-message {
  margin-top: 14px;
  min-height: 48px;
  padding: 13px;
  display: grid;
  place-items: center;
  border: 1px solid #1c3542;
  border-radius: 10px;
  background: #06131a;
  color: #748c99;
  text-align: center;
  font-weight: 900;
  font-size: .75rem;
  letter-spacing: .06em;
}

.pg-message[data-type="success"] {
  border-color: rgba(65,210,150,.5);
  color: #55d9a5;
}

.pg-message[data-type="error"] {
  border-color: rgba(255,90,95,.55);
  color: #ff7378;
}

.pg-message[data-type="info"] {
  color: #76bad9;
}


/* 3 I RAD */

.ttt-versus {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}

.ttt-player {
  min-height: 76px;
  padding: 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #1c3542;
  border-radius: 13px;
  background: #06131a;
}

.ttt-player:last-child {
  flex-direction: row-reverse;
  text-align: right;
}

.ttt-player.is-turn {
  border-color: #ff6268;
  box-shadow:
    inset 0 0 30px rgba(255,80,85,.08);
}

.ttt-player img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.ttt-player small,
.ttt-match-id small {
  display: block;
  color: #607987;
  font-size: .57rem;
  font-weight: 900;
  letter-spacing: .1em;
}

.ttt-player em {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 6px;
  border-radius: 5px;
  background: #ff5e64;
  color: #10161a;
  font-size: .53rem;
  font-style: normal;
  font-weight: 950;
}

.ttt-match-id {
  text-align: center;
}

.ttt-match-id strong {
  display: block;
  margin-top: 4px;
}

.ttt-board {
  width: min(100%,520px);
  margin: 26px auto;
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 9px;
}

.ttt-cell {
  aspect-ratio: 1;
  position: relative;
  display: grid;
  place-items: center;
  border: 1px solid #203b49;
  border-radius: 16px;
  background:
    linear-gradient(145deg,#10242f,#08171e);
  cursor: pointer;
}

.ttt-cell:not(:disabled):hover {
  border-color: #ff6268;
  transform: translateY(-2px);
}

.ttt-cell img {
  width: 75%;
  height: 75%;
  object-fit: contain;
  filter:
    drop-shadow(0 12px 10px rgba(0,0,0,.4));
}

.ttt-cell.is-winning {
  border-color: #f2c35e;
  box-shadow:
    0 0 25px rgba(240,190,75,.18),
    inset 0 0 25px rgba(240,190,75,.08);
}


/* CHESS */

.chess-players {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 15px;
  align-items: center;
}

.chess-players article {
  padding: 15px;
  border: 1px solid #1d3541;
  border-radius: 12px;
  background: #06131a;
}

.chess-players article:last-child {
  text-align: right;
}

.chess-players article.is-turn {
  border-color: #ff6268;
}

.chess-players small {
  display: block;
  color: #627b88;
  font-size: .57rem;
  font-weight: 900;
  letter-spacing: .1em;
}

.chess-players em {
  margin-left: 6px;
  color: #ff7075;
  font-size: .58rem;
  font-style: normal;
}

.chess-players > div {
  text-align: center;
}

.chess-players > div small {
  display: block;
}

.chess-board-shell {
  max-width: 710px;
  margin: 0 auto;
  padding: 14px;
  border-radius: 18px;
  background: #030b10;
}

.chess-board {
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(8,1fr);
}

.chess-square {
  position: relative;
  aspect-ratio: 1;
  border: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-family:
    "Segoe UI Symbol",
    "Arial Unicode MS",
    sans-serif;
}

.chess-square.light {
  background: #bcc9c6;
}

.chess-square.dark {
  background: #526d68;
}

.chess-square span {
  position: relative;
  z-index: 2;
  font-size: clamp(1.7rem,4vw,4rem);
  line-height: 1;
}

.chess-square span[data-piece^="w"] {
  color: #f8faf8;
  text-shadow:
    0 2px 2px #1b2523,
    0 0 2px #1b2523;
}

.chess-square span[data-piece^="b"] {
  color: #111817;
  text-shadow:
    0 1px 1px rgba(255,255,255,.28);
}

.chess-square.selected {
  box-shadow:
    inset 0 0 0 4px #ff6167;
}

.chess-square.legal i {
  position: absolute;
  z-index: 3;
  width: 18%;
  height: 18%;
  border-radius: 50%;
  background: #ff6268;
  box-shadow:
    0 0 12px rgba(255,90,95,.7);
}

.chess-help {
  margin-top: 13px;
  color: #637c89;
  text-align: center;
  font-size: .72rem;
}


/* SNAKE */

.snake-hud,
.signal-hud {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.signal-hud {
  grid-template-columns: repeat(4,1fr);
}

.snake-hud article,
.signal-hud article {
  padding: 15px 8px;
  border: 1px solid #1b3541;
  border-radius: 11px;
  text-align: center;
  background: #06131a;
}

.snake-hud span,
.signal-hud span {
  display: block;
  color: #607987;
  font-size: .55rem;
  font-weight: 900;
  letter-spacing: .1em;
}

.snake-hud strong,
.signal-hud strong {
  display: block;
  margin-top: 5px;
  font-size: 1.4rem;
}

.snake-canvas-shell {
  width: min(100%,560px);
  margin: auto;
  padding: 12px;
  border: 1px solid #17343f;
  border-radius: 16px;
  background: #030c11;
}

.snake-canvas {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  border-radius: 10px;
}

.snake-controls {
  margin-top: 14px;
  display: grid;
  justify-content: center;
  gap: 6px;
}

.snake-controls > button {
  margin: auto;
}

.snake-controls div {
  display: flex;
  gap: 6px;
}

.snake-controls button {
  width: 54px;
  height: 48px;
  border: 1px solid #23404b;
  border-radius: 9px;
  background: #06131a;
  color: #8da1aa;
  font-weight: 950;
  cursor: pointer;
}

.snake-leader-tabs,
.signal-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.snake-leader-tabs button,
.signal-tabs button {
  flex: 1;
  padding: 8px 5px;
  border: 1px solid #1d3945;
  border-radius: 8px;
  background: #06131a;
  color: #6c8592;
  font-size: .6rem;
  font-weight: 900;
  cursor: pointer;
}

.snake-leader-tabs button.active,
.signal-tabs button.active {
  border-color: #ff6268;
  color: #ff7479;
}

.snake-leaders,
.signal-leaders {
  display: grid;
}

.snake-leaders article,
.signal-leaders article {
  padding: 12px 2px;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #18313d;
  color: #8297a1;
  font-size: .74rem;
}

.snake-leaders strong,
.signal-leaders strong {
  color: #eef6fa;
}


/* SIGNAL */

.signal-board {
  width: min(100%,520px);
  aspect-ratio: 1;
  position: relative;
  margin: 10px auto 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.signal-pad {
  position: relative;
  border: 1px solid rgba(255,255,255,.08);
  cursor: pointer;
  overflow: hidden;
  transition:
    transform .12s ease,
    filter .12s ease,
    box-shadow .12s ease;
}

.signal-pad span {
  opacity: .28;
  font-size: 1.4rem;
  font-weight: 950;
}

.signal-pad--1 {
  border-radius: 100% 18px 18px 18px;
  background: #6f4cc8;
}

.signal-pad--2 {
  border-radius: 18px 100% 18px 18px;
  background: #227d96;
}

.signal-pad--3 {
  border-radius: 18px 18px 18px 100%;
  background: #b5456b;
}

.signal-pad--4 {
  border-radius: 18px 18px 100% 18px;
  background: #a78a35;
}

.signal-pad.active {
  z-index: 4;
  transform: scale(1.025);
  filter: brightness(1.9);
  box-shadow:
    0 0 50px currentColor;
}

.signal-core {
  position: absolute;
  z-index: 8;
  left: 50%;
  top: 50%;
  width: 120px;
  height: 120px;
  transform: translate(-50%,-50%);
  display: grid;
  place-items: center;
  align-content: center;
  border: 2px solid #9d72dc;
  border-radius: 50%;
  background: #07121a;
  box-shadow:
    0 0 0 12px rgba(10,20,30,.88),
    0 0 40px rgba(170,100,255,.2);
  pointer-events: none;
}

.signal-core span {
  color: #748a98;
  font-size: .52rem;
  font-weight: 900;
  letter-spacing: .16em;
}

.signal-core strong {
  margin-top: 5px;
  color: #ce9aff;
  font-size: 2rem;
}


/* LOGIN */

.pg-locked {
  min-height: 550px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  text-align: center;
}

.pg-locked h1 {
  margin: 0;
  font-size: clamp(2.5rem,6vw,5rem);
}

.pg-locked p {
  color: #758d99;
}

.pg-locked a {
  padding: 12px 18px;
  border: 1px solid #ff6066;
  border-radius: 9px;
  color: #ff777c;
  text-decoration: none;
  font-weight: 900;
}

.pg-locked a.secondary {
  border-color: #26424e;
  color: #78909d;
}


@media (max-width: 980px) {
  .portal-game-pack {
    padding: 16px;
  }

  .pg-hero,
  .pg-two-column,
  .snake-layout,
  .signal-layout {
    grid-template-columns: 1fr;
  }

  .pg-hero-stage {
    min-height: 290px;
  }

  .ttt-versus,
  .chess-players {
    grid-template-columns: 1fr;
  }

  .ttt-player:last-child,
  .chess-players article:last-child {
    text-align: left;
  }

  .ttt-player:last-child {
    flex-direction: row;
  }
}


@media (max-width: 600px) {
  .pg-hero-copy {
    padding: 28px 22px;
  }

  .pg-hero-stage {
    min-height: 235px;
  }

  .pg-mon {
    width: 125px;
    height: 125px;
  }

  .pg-trainer {
    flex-wrap: wrap;
  }

  .pg-ball-count {
    width: 100%;
    padding: 12px 0 0;
    border-top: 1px solid #1d3542;
    border-left: 0;
    text-align: left;
  }

  .pg-info-grid,
  .snake-hud {
    grid-template-columns: repeat(3,1fr);
  }

  .signal-hud {
    grid-template-columns: repeat(2,1fr);
  }

  .pg-footer {
    flex-direction: column;
    gap: 10px;
  }

  .chess-board-shell {
    padding: 6px;
  }

  .signal-core {
    width: 86px;
    height: 86px;
  }
}
