/* PrizePilot game page polish. Loaded after legacy board CSS so hooks stay intact. */

#game {
  --pp-board-surface: rgba(9, 18, 31, .74);
  --pp-board-line: rgba(148, 163, 184, .16);
  --pp-board-text: #e7eef7;
  --pp-board-accent: #35c7a7;
  --pp-board-warm: #ddb86f;
  width: min(100% - 32px, 1480px);
  max-width: none !important;
}

#grid {
  scroll-margin-top: 92px;
}

#game .pp-mobile-board-jump {
  display: none;
}

#game .pp-live-summary-strip {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(420px, auto) auto;
  align-items: center;
  gap: 14px;
  margin: 14px 0 14px;
  padding: 14px 16px;
  border: 1px solid rgba(53, 199, 167, .22);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(53, 199, 167, .075), rgba(255, 255, 255, .012)),
    rgba(8, 18, 31, .78);
  box-shadow: 0 16px 34px rgba(2, 8, 18, .18);
}

#game .pp-live-summary-strip__title {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

#game .pp-live-summary-strip h1 {
  margin: 0;
  color: #f6fffc;
  font-size: clamp(1.2rem, 2vw, 1.62rem);
  line-height: 1.05;
  letter-spacing: -.025em;
}

#game .pp-live-summary-strip p {
  margin: 4px 0 0;
  color: #aebdcb;
  font-size: .9rem;
  line-height: 1.4;
}

#game .pp-live-summary-strip__stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(92px, 1fr));
  gap: 8px;
}

#game .pp-live-summary-strip__stats span {
  display: grid;
  gap: 5px;
  min-height: 54px;
  padding: 9px 10px;
  border: 1px solid rgba(148, 163, 184, .15);
  border-radius: 10px;
  background: rgba(255, 255, 255, .028);
}

#game .pp-live-summary-strip__stats small {
  color: #91a1b3;
  font-size: .66rem;
  font-weight: 850;
  letter-spacing: .07em;
  text-transform: uppercase;
}

#game .pp-live-summary-strip__stats strong {
  color: #f1f7fb;
  font-size: .98rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

#game .pp-live-summary-strip__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

#game .pp-live-summary-strip__actions .btn {
  min-height: 38px;
  padding: 9px 12px;
  border-radius: 9px;
}

#game .pp-game-entry-panel {
  margin-top: 0;
  padding: 16px !important;
}

#game .grid-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 370px);
  grid-template-areas:
    "status action"
    "head action"
    "board action"
    "bank action";
  align-items: start;
  gap: 20px;
  padding: 20px;
  border: 1px solid var(--pp-board-line);
  border-radius: 18px;
  background:
    radial-gradient(circle at 20% 0, rgba(53, 199, 167, .08), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.012)),
    var(--pp-board-surface);
  box-shadow: 0 20px 48px rgba(2, 8, 18, .22);
}

#game .panel-status {
  grid-area: status;
}

#game .pp-board-head {
  grid-area: head;
  padding: 4px 0 0;
}

#game .pp-board-head h2 {
  font-size: clamp(1.35rem, 2.2vw, 1.9rem);
  letter-spacing: -.025em;
}

#game .pp-board-legend {
  gap: 7px;
}

#game .pp-board-toolbar {
  display: grid;
  justify-items: end;
  gap: 9px;
}

#game .pp-density-toggle {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid rgba(148, 163, 184, .16);
  border-radius: 9px;
  background: rgba(3, 9, 18, .34);
}

#game .pp-density-toggle button {
  min-height: 28px;
  padding: 5px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #91a1b3;
  font: inherit;
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
  cursor: pointer;
}

#game .pp-density-toggle button[aria-pressed="true"] {
  background: rgba(53, 199, 167, .15);
  color: #dffff7;
  box-shadow: inset 0 0 0 1px rgba(53, 199, 167, .18);
}

#game .pp-board-legend span {
  min-height: 29px;
  padding: 5px 9px;
  border-color: var(--pp-board-line);
  border-radius: 7px;
  background: rgba(12, 23, 38, .7);
  color: #d4deea;
  font-size: .76rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}

#game .pp-board-legend i {
  position: relative;
  width: 12px;
  height: 12px;
  border-radius: 4px;
}

#game .pp-board-legend i[data-state="selected"]::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 999px;
  background: #dcfff7;
}

#game .pp-board-legend i[data-state="held"]::after,
#game .pp-board-legend i[data-state="sold"]::after {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  top: 50%;
  height: 1px;
  transform: translateY(-50%);
  background: currentColor;
}

#game .pp-number-board {
  grid-area: board;
  display: grid;
  width: 100%;
  max-width: none !important;
  gap: 7px !important;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,.008)),
    rgba(3, 9, 18, .34);
}

#game .bank-manual-block {
  grid-area: bank;
}

#game .vc-cell,
#grid .vc-cell {
  position: relative;
  min-width: 0 !important;
  width: auto !important;
  height: auto !important;
  min-height: 38px !important;
  aspect-ratio: 1 / 1;
  padding: 0 !important;
  border: 1px solid rgba(104, 121, 145, .22) !important;
  border-radius: 7px !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.012)),
    rgba(12, 24, 42, .86) !important;
  color: var(--pp-board-text) !important;
  font-size: .9rem !important;
  font-weight: 750 !important;
  font-variant-numeric: tabular-nums;
  text-decoration: none !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.035),
    0 1px 0 rgba(0,0,0,.18) !important;
  transition: transform .14s ease, border-color .14s ease, background .14s ease, color .14s ease, box-shadow .14s ease;
}

#game .vc-cell:hover {
  transform: translateY(-1px);
  border-color: rgba(53, 199, 167, .46) !important;
  background:
    linear-gradient(180deg, rgba(53,199,167,.12), rgba(255,255,255,.018)),
    rgba(13, 30, 48, .92) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.05),
    0 8px 16px rgba(2,8,18,.18) !important;
}

#game .vc-cell:focus-visible {
  outline: 2px solid rgba(53, 199, 167, .75) !important;
  outline-offset: 2px;
}

#game .vc-cell.is-picked,
#grid .vc-cell.is-picked {
  transform: translateY(-1px);
  border-color: rgba(53, 199, 167, .78) !important;
  background:
    linear-gradient(180deg, rgba(53,199,167,.32), rgba(17,89,77,.42)),
    rgba(15, 48, 64, .9) !important;
  color: #f6fffc !important;
  box-shadow:
    0 0 0 2px rgba(53,199,167,.14),
    0 12px 22px rgba(2,8,18,.22),
    inset 0 1px 0 rgba(255,255,255,.09) !important;
}

#game .vc-cell.is-picked::before,
#grid .vc-cell.is-picked::before {
  content: "✓";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 15px;
  height: 15px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #bffff1;
  color: #07131c;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

#game .vc-cell.is-res,
#grid .vc-cell.is-res {
  cursor: not-allowed;
  border-color: rgba(221, 184, 111, .32) !important;
  background:
    linear-gradient(180deg, rgba(221,184,111,.15), rgba(255,255,255,.012)),
    rgba(30, 27, 22, .72) !important;
  color: #f0d89d !important;
}

#game .vc-cell.is-res.is-mine,
#grid .vc-cell.is-res.is-mine {
  cursor: pointer;
  color: #ffe7ad !important;
  box-shadow: inset 0 0 0 1px rgba(221,184,111,.2) !important;
}

#game .vc-cell.is-res::after,
#grid .vc-cell.is-res::after {
  content: "Held";
  position: absolute;
  right: 4px;
  bottom: 4px;
  padding: 2px 4px;
  border-radius: 5px;
  background: rgba(221, 184, 111, .16);
  color: #f4dda8;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .02em;
  transform: none;
  pointer-events: none;
}

#game .vc-cell.is-sold,
#grid .vc-cell.is-sold {
  cursor: not-allowed;
  border-color: rgba(101, 116, 139, .14) !important;
  background:
    linear-gradient(180deg, rgba(148,163,184,.07), rgba(255,255,255,.006)),
    rgba(12, 19, 30, .7) !important;
  color: #6f7d8d !important;
  opacity: 1 !important;
}

#game .vc-cell.is-sold::before,
#grid .vc-cell.is-sold::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 42%;
  height: 1px;
  transform: translate(-50%, -50%);
  background: rgba(148, 163, 184, .42);
}

#game .vc-cell.is-sold::after,
#grid .vc-cell.is-sold::after {
  content: "Sold";
  position: absolute;
  right: 4px;
  bottom: 4px;
  padding: 2px 4px;
  border-radius: 5px;
  background: rgba(100, 116, 139, .16);
  color: #96a3b4;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .02em;
  transform: none;
  pointer-events: none;
}

#game .vc-cell[data-label] {
  padding-bottom: 0 !important;
}

#game .vc-cell[data-label]::before {
  content: "";
  display: none !important;
}

#game .pp-action-panel {
  grid-area: action;
  position: sticky;
  top: 86px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
  border-color: rgba(53, 199, 167, .26);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(53,199,167,.095), rgba(12,23,38,.82)),
    rgba(8, 18, 31, .82);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}

#game .pp-action-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(53,199,167,.5), transparent);
}

#game .pp-action-panel__copy {
  gap: 8px;
}

#game .pp-action-panel__copy > span {
  color: #9cebd7;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

#game .pp-action-panel__copy > strong {
  font-size: 1.08rem;
  line-height: 1.2;
}

#game .pp-action-panel__copy > p {
  color: #bfccd9;
}

#game .pp-action-panel__board-link {
  width: max-content;
  max-width: 100%;
  color: #9cebd7;
  font-size: .82rem;
  font-weight: 800;
  text-decoration: none;
}

#game .pp-action-panel__board-link:hover {
  color: #dffff7;
  text-decoration: underline;
}

#game .pp-action-form,
#game .pp-action-extra {
  margin: 2px 0;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 12px;
  background: rgba(3, 9, 18, .24);
}

#game .pp-action-form .pp-field-label {
  margin-bottom: 9px;
}

#game .pp-action-form .panel-controls-inputs {
  display: grid;
  gap: 8px;
}

#game .pp-action-form input,
#game .pp-action-extra input[type="text"] {
  width: 100%;
  min-width: 0;
  min-height: 40px;
}

#game .pp-action-extra {
  display: grid;
  gap: 10px;
}

#game .pp-action-extra .panel-skill {
  display: grid;
  gap: 7px;
}

#game .pp-action-extra .terms-confirm {
  align-items: flex-start;
}

#game .pp-selected-tray {
  display: grid;
  gap: 10px;
  margin: 5px 0 2px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, .15);
  border-radius: 12px;
  background: rgba(3, 9, 18, .3);
}

#game .pp-selected-tray__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

#game .pp-selected-tray__stats span {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .035);
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: 0;
  text-transform: none;
}

#game .pp-selected-tray__stats small {
  color: #91a1b3;
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

#game .pp-selected-tray__stats strong {
  font-size: 1.12rem;
  color: #f6fffc;
  font-variant-numeric: tabular-nums;
}

#game .pp-selected-tray p {
  min-height: 22px;
  margin: 0;
  color: #cbd8e6;
  font-size: .86rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

#game .pp-smart-controls {
  display: grid;
  gap: 10px;
  margin-top: 2px;
  padding: 12px;
  border: 1px solid rgba(53, 199, 167, .15);
  border-radius: 12px;
  background: rgba(53, 199, 167, .055);
}

#game .pp-smart-controls > div:first-child {
  display: grid;
  gap: 3px;
}

#game .pp-smart-controls strong {
  color: #e7fdf7;
  font-size: .92rem;
}

#game .pp-smart-controls small {
  color: #95a8b9;
  font-size: .78rem;
  line-height: 1.4;
}

#game .pp-smart-controls__buttons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

#game .pp-smart-controls__buttons .btn {
  min-height: 38px;
  justify-content: center;
  padding: 8px 10px;
  border-radius: 9px !important;
  background: rgba(255, 255, 255, .04);
  color: #d7e6f2;
  border-color: rgba(148, 163, 184, .18);
  font-size: .84rem;
}

#game .pp-smart-controls__buttons .btn:hover {
  background: rgba(53, 199, 167, .12);
  color: #f6fffc;
  border-color: rgba(53, 199, 167, .28);
}

#game .panel-cta {
  display: grid !important;
  gap: 10px !important;
  align-items: stretch !important;
}

#game #reserveBtn,
#game #clearBtn,
#game .vtb-btn {
  border-radius: 10px !important;
}

#game #reserveBtn {
  min-height: 48px;
  background: #35c7a7;
  color: #07131c;
  border-color: rgba(53,199,167,.42);
  box-shadow: 0 14px 28px rgba(2,8,18,.26), inset 0 1px 0 rgba(255,255,255,.16);
}

#game #reserveBtn:hover {
  background: #46d8b7;
}

#game .vtb-payment-actions,
#game .vtb-action-pills {
  display: grid !important;
  grid-template-columns: 1fr;
  gap: 10px;
}

#game .vtb-btn {
  min-height: 48px;
  background: rgba(53, 199, 167, .13);
  color: #dffff7;
  border-color: rgba(53, 199, 167, .28);
  box-shadow: none;
}

#game .vtb-btn:not([disabled]):hover {
  background: rgba(53, 199, 167, .2);
  color: #f6fffc;
}

#game #clearBtn {
  min-height: 48px;
  background: rgba(255,255,255,.035);
  color: #d4deea;
  border-color: rgba(148, 163, 184, .2);
}

#game #clearBtn:hover {
  border-color: rgba(148, 163, 184, .34);
  background: rgba(255,255,255,.055);
}

#game .vtb-btn[disabled],
#game #stripeBtn[disabled] {
  background: rgba(148, 163, 184, .08) !important;
  color: #8693a4 !important;
  border-color: rgba(148, 163, 184, .12) !important;
  box-shadow: none !important;
}

@media (min-width: 1180px) {
  #game .pp-number-board {
    max-width: none;
  }
}

body[data-board-density="compact"] #game .pp-number-board {
  gap: 5px !important;
  padding: 8px;
}

body[data-board-density="compact"] #game .vc-cell,
body[data-board-density="compact"] #grid .vc-cell {
  min-height: 32px !important;
  border-radius: 6px !important;
  font-size: .82rem !important;
}

#game .pp-game-summary--below {
  margin: 10px 0 0;
  padding: 16px;
  gap: 12px;
}

#game .pp-game-summary--below .pp-game-summary__main {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  gap: 12px;
  align-items: start;
}

#game .pp-game-summary--below .pp-game-summary__image {
  width: 100px;
  border-radius: 10px;
}

#game .pp-game-summary--below h2 {
  margin: 6px 0 0;
  font-size: clamp(1.2rem, 2vw, 1.72rem);
}

#game .pp-game-summary--below p {
  margin: 7px 0 0;
  font-size: .95rem;
  line-height: 1.45;
}

#game .pp-game-summary--below .pp-game-summary__stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

#game .pp-game-summary--below .pp-game-summary__stats span {
  min-height: 52px;
  gap: 5px;
  padding: 10px;
}

#game .pp-game-summary--below .pp-game-summary__stats strong {
  font-size: .98rem;
}

#game .pp-game-summary--below .pp-game-progress {
  gap: 6px;
}

#game .pp-game-summary--below .pp-game-progress div {
  font-size: .86rem;
}

#game .pp-game-proof-strip--below {
  margin: 8px 0 0;
}

#game .pp-game-proof-strip--below span {
  min-height: 62px;
  padding: 11px 12px;
}

@media (max-width: 860px) {
  #game {
    width: min(100% - 20px, 1480px);
  }

  #game .pp-live-summary-strip {
    grid-template-columns: 1fr;
    align-items: stretch;
    margin-top: 10px;
  }

  #game .pp-live-summary-strip__title {
    align-items: flex-start;
  }

  #game .pp-live-summary-strip__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #game .pp-live-summary-strip__actions {
    justify-content: stretch;
  }

  #game .pp-live-summary-strip__actions .btn {
    flex: 1 1 120px;
    justify-content: center;
  }

  #game .pp-game-summary--below .pp-game-summary__main {
    grid-template-columns: 1fr;
  }

  #game .pp-game-summary--below .pp-game-summary__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #game .pp-mobile-board-jump {
    display: inline-flex;
  }

  #game .pp-game-entry-panel {
    display: flex;
    flex-direction: column;
  }

  #game .pp-game-panel-head {
    order: 1;
  }

  #game .grid-card {
    order: 2;
    margin-top: 0;
  }

  #game .panel-controls {
    order: 3;
  }

  #game .panel-extra {
    order: 4;
  }

  #game details.panel {
    order: 5;
  }

  #game .pp-game-proof-strip--below {
    order: 6;
  }

  #game .pp-game-summary--below {
    order: 7;
  }

  #game .grid-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  #game .panel-status {
    order: 1;
  }

  #game .pp-board-head {
    order: 2;
  }

  #game .pp-board-toolbar {
    justify-items: start;
  }

  #game .pp-number-board {
    order: 3;
  }

  #game .pp-action-panel {
    order: 4;
    position: static !important;
    grid-template-columns: 1fr;
  }

  #game .pp-action-panel__board-link {
    display: none;
  }
}

@media (max-width: 540px) {
  #game .pp-live-summary-strip {
    padding: 12px;
    border-radius: 13px;
  }

  #game .pp-live-summary-strip__title {
    display: grid;
    gap: 8px;
  }

  #game .pp-live-summary-strip p {
    font-size: .84rem;
  }

  #game .pp-live-summary-strip__stats span {
    min-height: 52px;
    padding: 8px;
  }

  #game .pp-game-summary--below {
    padding: 14px;
    gap: 10px;
  }

  #game .pp-game-summary--below .pp-game-summary__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  #game .pp-game-summary--below .pp-game-summary__stats span {
    min-height: 46px;
    padding: 8px;
  }

  #game .grid-card {
    padding: 16px !important;
    border-radius: 16px;
  }

  #game .pp-board-head {
    gap: 12px;
  }

  #game .pp-board-legend {
    gap: 6px;
  }

  #game .pp-board-legend span {
    min-height: 28px;
    padding: 5px 8px;
    font-size: .74rem;
  }

  #game .pp-number-board {
    gap: 7px !important;
    padding: 10px;
  }

  #game .vc-cell,
  #grid .vc-cell {
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 47px !important;
    border-radius: 9px !important;
    font-size: .9rem !important;
  }

  #game .vc-cell.is-picked::before,
  #grid .vc-cell.is-picked::before {
    width: 14px;
    height: 14px;
    font-size: 9px;
  }

  #game .vc-cell.is-res::after,
  #grid .vc-cell.is-res::after,
  #game .vc-cell.is-sold::after,
  #grid .vc-cell.is-sold::after {
    right: 3px;
    bottom: 3px;
    padding: 1px 3px;
    font-size: 7px;
  }

  #game .pp-action-panel {
    padding: 14px;
  }

  #game .panel-cta[role="group"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
  }

  #game .vtb-payment-actions,
  #game .vtb-action-pills {
    width: 100% !important;
    flex-direction: column;
    align-items: stretch;
  }

  #game #reserveBtn,
  #game #clearBtn,
  #game .vtb-btn {
    width: 100% !important;
    min-height: 48px !important;
    height: auto !important;
    line-height: 1.2 !important;
  }
}
