:root {
  color-scheme: dark;
  font-family: "Arial Black", Impact, system-ui, sans-serif;
  background: #05040d;
  color: #fff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 0%, #35145b 0, transparent 38%),
    linear-gradient(#0d071c, #03030a);
}

body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 10px;
}

.game-shell {
  width: min(100%, 1440px);
  filter: drop-shadow(0 28px 45px #000);
}

.marquee {
  height: 104px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.marquee img {
  width: auto;
  height: 96px;
  display: block;
  filter:
    drop-shadow(0 4px 0 #090611)
    drop-shadow(0 0 13px #ff2cb499)
    drop-shadow(0 0 17px #25deff66);
}

.stage {
  position: relative;
  aspect-ratio: 16 / 9;
  max-height: calc(100vh - 166px);
  margin: auto;
  border: 4px solid #19162d;
  border-radius: 8px;
  overflow: hidden;
  background: #080719;
  box-shadow:
    inset 0 0 0 2px #ff30be,
    inset 0 0 28px #001c35,
    0 0 0 3px #05040c,
    0 0 26px #ff1dac66;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: none;
  image-rendering: auto;
}

.scanlines {
  pointer-events: none;
  position: absolute;
  inset: 0;
  opacity: .13;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 3px,
    #000 4px
  );
  mix-blend-mode: multiply;
}

.cabinet-controls {
  min-height: 42px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 17px;
  color: #8986a8;
  font: 700 11px/1 system-ui, sans-serif;
  letter-spacing: .05em;
  text-transform: uppercase;
}

kbd {
  display: inline-block;
  min-width: 20px;
  padding: 3px 5px;
  margin-right: 2px;
  border: 1px solid #4a4568;
  border-bottom-width: 3px;
  border-radius: 4px;
  background: #171429;
  color: #e8e6ff;
  font: inherit;
  text-align: center;
}

.language-widget {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  z-index: 60;
  direction: ltr;
  font-family: system-ui, sans-serif;
}

.language-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid #42efffaa;
  border-radius: 999px;
  background:
    linear-gradient(135deg, #080719dd, #17112ccc),
    radial-gradient(circle at 20% 0%, #ff38b866, transparent 46%);
  color: #eafcff;
  cursor: pointer;
  font: 900 11px/1 system-ui, sans-serif;
  letter-spacing: .06em;
  text-transform: uppercase;
  box-shadow:
    0 0 0 2px #05040c,
    0 0 18px #42efff55,
    inset 0 0 14px #ff38b81f;
  opacity: .88;
}

.language-toggle:hover,
.language-toggle[aria-expanded="true"] {
  opacity: 1;
  border-color: #ffe74a;
  color: #ffe74a;
}

.language-current-flag {
  flex: 0 0 auto;
}

.flag-icon {
  position: relative;
  display: inline-block;
  width: 25px;
  height: 17px;
  overflow: hidden;
  border: 1px solid #ffffff55;
  border-radius: 3px;
  background: #fff;
  box-shadow: 0 0 0 1px #05040c, 0 0 9px #42efff66;
  vertical-align: middle;
}

.flag-icon::before,
.flag-icon::after {
  content: "";
  position: absolute;
}

.flag-us {
  background: repeating-linear-gradient(to bottom, #b22234 0 2px, #fff 2px 4px);
}

.flag-us::before {
  left: 0;
  top: 0;
  width: 42%;
  height: 54%;
  background: #3c3b6e;
}

.flag-mx {
  background: linear-gradient(to right, #006847 0 33%, #fff 33% 66%, #ce1126 66% 100%);
}

.flag-mx::before {
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #9c7a18;
  transform: translate(-50%, -50%);
}

.flag-fr { background: linear-gradient(to right, #0055a4 0 33%, #fff 33% 66%, #ef4135 66% 100%); }
.flag-de { background: linear-gradient(to bottom, #000 0 33%, #dd0000 33% 66%, #ffce00 66% 100%); }
.flag-it { background: linear-gradient(to right, #009246 0 33%, #fff 33% 66%, #ce2b37 66% 100%); }
.flag-ru { background: linear-gradient(to bottom, #fff 0 33%, #0039a6 33% 66%, #d52b1e 66% 100%); }

.flag-br {
  background: #009b3a;
}

.flag-br::before {
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  background: #ffdf00;
  transform: translate(-50%, -50%) rotate(45deg);
}

.flag-br::after {
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #002776;
  transform: translate(-50%, -50%);
}

.flag-jp::before {
  left: 50%;
  top: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #bc002d;
  transform: translate(-50%, -50%);
}

.flag-cn {
  background: #de2910;
}

.flag-cn::before {
  content: "★";
  left: 3px;
  top: -1px;
  color: #ffde00;
  font: 900 9px/1 Arial, sans-serif;
}

.flag-kr::before {
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(to bottom, #cd2e3a 0 50%, #0047a0 50% 100%);
  transform: translate(-50%, -50%) rotate(28deg);
}

.flag-kr::after {
  left: 3px;
  top: 3px;
  width: 3px;
  height: 11px;
  border-top: 2px solid #111;
  border-bottom: 2px solid #111;
  transform: rotate(-25deg);
}

.flag-in {
  background: linear-gradient(to bottom, #ff9933 0 33%, #fff 33% 66%, #138808 66% 100%);
}

.flag-in::before {
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  border: 1px solid #000080;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.flag-sa {
  background: #006c35;
}

.flag-sa::before {
  left: 5px;
  top: 11px;
  width: 15px;
  height: 2px;
  border-radius: 2px;
  background: #fff;
}

.flag-sa::after {
  left: 9px;
  top: 5px;
  width: 7px;
  height: 3px;
  border-top: 1px solid #fff;
  border-bottom: 1px solid #fff;
}

.language-menu[hidden] { display: none; }

.language-menu {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  width: min(330px, calc(100vw - 24px));
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 10px;
  border: 2px solid #42efff;
  border-radius: 15px;
  background:
    radial-gradient(circle at 12% 0%, #ff38b844 0, transparent 34%),
    linear-gradient(180deg, #17132bee 0%, #070611f2 100%);
  box-shadow:
    0 0 0 3px #05040c,
    0 0 26px #42efff77,
    inset 0 0 18px #ff38b822;
  backdrop-filter: blur(6px);
}

.language-menu button {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px;
  border: 1px solid #524a76;
  border-radius: 10px;
  background: #0a0818cc;
  color: #efeaff;
  cursor: pointer;
  text-align: left;
}

.language-menu button:hover,
.language-menu button.is-selected {
  border-color: #ffe74a;
  color: #ffe74a;
  background: #18112c;
  box-shadow: inset 0 0 12px #42efff22;
}

.language-menu .flag-icon {
  width: 25px;
  height: 17px;
}

.language-menu strong {
  overflow: hidden;
  font: 900 11px/1.1 system-ui, sans-serif;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pay-own-price {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 20;
  min-width: 210px;
  padding: 12px 16px 11px;
  border: 2px solid #ff38b8;
  border-radius: 12px;
  background:
    linear-gradient(135deg, #19112f 0%, #101126 42%, #30123f 100%),
    radial-gradient(circle at 20% 0%, #42efff66, transparent 38%);
  color: #fff;
  cursor: pointer;
  font: 900 13px/1.05 "Arial Black", Impact, system-ui, sans-serif;
  letter-spacing: .03em;
  text-transform: uppercase;
  box-shadow:
    0 0 0 2px #05040c,
    0 0 18px #ff2dbb99,
    inset 0 0 18px #3deaff24;
}

.pay-own-price::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid #42efff66;
  border-radius: 8px;
  pointer-events: none;
}

.pay-own-price span,
.pay-own-price small {
  display: block;
  position: relative;
}

.pay-own-price small {
  margin-top: 5px;
  color: #9defff;
  font: 800 10px/1 system-ui, sans-serif;
  letter-spacing: .08em;
}

.pay-own-price.is-unlocked {
  border-color: #ffe74a;
  color: #09111c;
  background: linear-gradient(135deg, #ffe74a, #42efff);
  box-shadow: 0 0 0 2px #05040c, 0 0 22px #ffe74aaa;
}

.pay-own-price.is-unlocked small { color: #321437; }

.payment-modal[hidden] { display: none; }

.payment-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: start center;
  padding: max(20px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom));
  overflow-y: auto;
  background: #05030dcc;
  backdrop-filter: blur(5px);
  overscroll-behavior: contain;
}

.payment-card {
  position: relative;
  width: min(520px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 27px;
  border: 3px solid #ff38b8;
  border-radius: 18px;
  background:
    radial-gradient(circle at 16% 0%, #42efff33 0, transparent 36%),
    linear-gradient(180deg, #17132b 0%, #080715 100%);
  box-shadow:
    0 0 0 3px #05040c,
    0 0 40px #ff2dbb80,
    inset 0 0 24px #42efff18;
  scrollbar-color: #42efff #0a0717;
}

.payment-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 1px solid #635a88;
  border-radius: 50%;
  background: #0a0816;
  color: #ff80d6;
  cursor: pointer;
  font: 900 23px/1 system-ui, sans-serif;
}

.payment-card h2 {
  margin: 0 0 10px;
  color: #ffe74a;
  font-size: 30px;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 0 16px #ff38b8;
}

.payment-card p {
  margin: 0 0 20px;
  color: #c8c2e9;
  font: 700 14px/1.45 system-ui, sans-serif;
}

.payment-card label {
  display: block;
  margin-bottom: 8px;
  color: #9defff;
  font: 900 11px/1 system-ui, sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.price-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 2px solid #3bdfff99;
  border-radius: 12px;
  background: #060511;
  color: #ffe74a;
  box-shadow: inset 0 0 16px #38e9ff1e;
}

.price-row span {
  font: 900 24px/1 "Arial Black", Impact, system-ui, sans-serif;
}

.price-row input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font: 900 24px/1 "Arial Black", Impact, system-ui, sans-serif;
}

.payment-status {
  min-height: 36px;
  margin: 0 0 14px;
  color: #8f89aa;
  font: 800 12px/1.45 system-ui, sans-serif;
}

.payment-status.is-error { color: #ff6e98; }
.payment-status.is-ok { color: #70f7c8; }

.paypal-button-container {
  display: grid;
  gap: 10px;
  min-height: 168px;
  padding-bottom: 8px;
}

.paypal-funding-slot {
  min-height: 44px;
}

.paypal-funding-card {
  min-height: 56px;
}


.mobile-browser-notice[hidden] { display: none; }

.mobile-browser-notice {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: #05030ddd;
  backdrop-filter: blur(5px);
}

.mobile-browser-card {
  width: min(430px, 100%);
  padding: 24px 20px 20px;
  border: 3px solid #42efff;
  border-radius: 18px;
  background:
    radial-gradient(circle at 18% 0%, #ff38b833 0, transparent 34%),
    linear-gradient(180deg, #17142d 0%, #070614 100%);
  box-shadow:
    0 0 0 3px #05040c,
    0 0 32px #42efff88,
    inset 0 0 22px #ff38b81f;
  text-align: center;
}

.mobile-browser-card h2 {
  margin: 0 0 10px;
  color: #ffe74a;
  font-size: 22px;
  line-height: 1.15;
  text-transform: uppercase;
  text-shadow: 0 0 14px #ff38b8;
}

.mobile-browser-card p {
  margin: 0 0 16px;
  color: #c9c4e8;
  font: 800 13px/1.4 system-ui, sans-serif;
}

.browser-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 0 0 18px;
}

.browser-choice {
  display: grid;
  place-items: center;
  gap: 7px;
  padding: 10px 5px;
  border: 1px solid #524a76;
  border-radius: 12px;
  background: #0a0818cc;
  color: #efeaff;
  font: 900 10px/1 system-ui, sans-serif;
  text-transform: uppercase;
}

.browser-logo {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  box-shadow: 0 0 13px #000, 0 0 16px #42efff55;
}

.chrome-logo {
  background:
    radial-gradient(circle, #40a9ff 0 25%, #fff 26% 32%, transparent 33%),
    conic-gradient(#e44335 0 33%, #f6d64a 0 66%, #24a85a 0 100%);
}

.edge-logo {
  background: conic-gradient(from 210deg, #15d2ff, #1c65ff, #20d19d, #15d2ff);
  color: #071423;
  font: 900 25px/1 Arial Black, Impact, sans-serif;
  text-transform: lowercase;
}

.firefox-logo {
  background:
    radial-gradient(circle at 58% 55%, #37115f 0 22%, transparent 23%),
    conic-gradient(from 35deg, #ffcf3d, #ff7a21, #d92783, #6d39ff, #ffcf3d);
}

.firefox-logo::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #15102b;
}

.safari-logo {
  background:
    linear-gradient(135deg, transparent 47%, #ff4f68 48% 52%, transparent 53%),
    radial-gradient(circle, #2ddcff 0 45%, #0f4bff 46% 100%);
}

.safari-logo::after {
  content: "";
  position: absolute;
  width: 26px;
  height: 26px;
  border: 2px solid #fff;
  border-radius: 50%;
}

@media (max-width: 700px) {
  body { padding: 0; }
  .marquee { height: 68px; }
  .marquee img { width: auto; height: 60px; }
  .stage {
    max-height: calc(100vh - 68px);
    border-width: 2px;
    border-radius: 0;
  }
  .cabinet-controls { display: none; }
  .language-widget {
    top: max(8px, env(safe-area-inset-top));
    right: max(8px, env(safe-area-inset-right));
  }
  .language-toggle {
    padding: 7px 9px;
    font-size: 10px;
  }
  .language-menu {
    width: min(300px, calc(100vw - 16px));
    grid-template-columns: 1fr;
    max-height: calc(100vh - 72px);
    overflow-y: auto;
  }
  .pay-own-price {
    min-width: 170px;
    right: max(10px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    padding: 10px 12px;
    font-size: 11px;
  }
  .payment-modal { padding: 10px; }
  .payment-card {
    width: min(520px, calc(100vw - 20px));
    max-height: calc(100vh - 20px);
    padding: 23px 18px;
  }
}
