/* src/index.css */
@font-face {
  font-family: Monocraft;
  src: url("/_bun/asset/68dc5ef0686d008d.ttf") format(truetype);
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-0: #050b1d;
  --bg-1: #0a1430;
  --grass: #2f6d22;
  --gold: #ffd23f;
  --ink: #eef2f8;
  --ink-dim: #9fb4d8;
  --btn: #46537a;
  --btn-hi: #6c7ba8;
  --btn-lo: #2a3354;
  --accent: #58c33a;
  --accent-dk: #2f7a1c;
  --danger: #ff5d5d;
  --panel: #080e22f0;
  --border: #060a18;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body, #root {
  height: 100%;
  width: 100%;
  height: 100dvh;
}

body {
  color: var(--ink);
  background: radial-gradient(circle at 50% 0%, #18306b 0%, #0c1838 38%, var(--bg-0) 80%);
  -webkit-font-smoothing: none;
  image-rendering: pixelated;
  overflow: hidden;
  position: fixed;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  font-family: Monocraft, monospace;
  inset: 0;
}

button, input, .mc-server, .wallet-pill, .team-cell {
  touch-action: manipulation;
}

.pk-stage, .pk-zone {
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.app-root, .menu-screen, .pk-screen {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

.mc-btn {
  color: var(--ink);
  text-shadow: 2px 2px #000;
  background: linear-gradient(var(--btn-hi), var(--btn) 50%, var(--btn-lo));
  border: 3px solid var(--border);
  cursor: pointer;
  letter-spacing: 1px;
  padding: 12px 16px;
  transition: filter 80ms, transform 50ms;
  font-family: inherit;
  font-size: 13px;
  box-shadow: inset 2px 2px #ffffff40, inset -2px -2px #00000073;
}

@media (hover: hover) {
  .mc-btn:hover:not(:disabled) {
    filter: brightness(1.18);
  }

  .mc-server:hover {
    background: #0009;
  }

  .mc-icon:hover {
    filter: brightness(1.2);
  }

  .team-cell:hover {
    filter: brightness(1.25);
  }

  .pk-zone:hover {
    filter: brightness(1.3);
  }
}

.mc-btn:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: inset 2px 2px #0000004d;
}

.mc-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.mc-btn.small {
  padding: 8px 10px;
  font-size: 11px;
}

.mc-btn-primary {
  background: linear-gradient(#7fe05a, var(--accent) 50%, var(--accent-dk));
}

.menu-bg-canvas {
  position: absolute;
  display: block;
  image-rendering: pixelated;
  z-index: 0;
  width: 100%;
  height: 100%;
  inset: 0;
}

.menu-topbar {
  position: relative;
  z-index: 2;
  display: flex;
  padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 14px max(14px, env(safe-area-inset-left));
  justify-content: flex-end;
}

.menu-center, .menu-footer {
  position: relative;
  z-index: 2;
}

.menu-center {
  display: flex;
  padding: 10px max(10px, env(safe-area-inset-right)) 10px max(10px, env(safe-area-inset-left));
  overflow-y: auto;
  flex-direction: column;
  flex: 1;
  justify-content: flex-start;
  align-items:  center;
  gap: 18px;
  min-height: 0;
}

.menu-center > :first-child {
  margin-top: auto;
}

.menu-center > :last-child {
  margin-bottom: auto;
}

.mc-logo-link {
  display: block;
  cursor: pointer;
  line-height: 0;
}

.mc-logo-link:hover .mc-logo-img {
  transform: scale(1.04);
}

.mc-logo-img {
  filter: drop-shadow(4px 4px 0 #0000008c);
  -webkit-user-select: none;
  user-select: none;
  width: clamp(110px, 22vmin, 180px);
  height: auto;
  transition: transform .15s;
}

.mc-cup-badge {
  color: #060a18;
  background: linear-gradient(var(--gold), #d4a017);
  border: 3px solid var(--border);
  letter-spacing: 2px;
  padding: 8px 14px;
  font-size: 11px;
  box-shadow: 0 0 18px #ffd23f59;
}

.mc-logo-text {
  text-align: center;
  color: #f2f5f7;
  text-shadow: 4px 4px 0 #000, 5px 5px 0 var(--accent-dk);
  letter-spacing: 2px;
  font-size: clamp(26px, 6.5vw, 58px);
  line-height: 1.2;
}

.mc-logo-text span {
  color: var(--gold);
}

.mc-tagline {
  color: var(--ink-dim);
  text-shadow: 2px 2px #000;
  text-align: center;
  max-width: 560px;
  font-size: 12px;
  line-height: 1.8;
}

.mc-name {
  color: var(--ink);
  text-align: center;
  border: 3px solid var(--border);
  outline: none;
  background: #0000008c;
  width: min(360px, 88vw);
  padding: 12px;
  font-family: inherit;
  font-size: 12px;
  box-shadow: inset 2px 2px #0006;
}

.mc-name:focus {
  border-color: var(--accent);
}

.team-pick {
  display: flex;
  flex-direction: column;
  align-items:  center;
  gap: 10px;
  width: min(560px, 94vw);
}

.team-pick-label {
  color: var(--gold);
  letter-spacing: 2px;
  text-shadow: 1px 1px #000;
  font-size: 10px;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  overflow-y: auto;
  gap: 6px;
  width: 100%;
  max-height: 196px;
  padding-right: 4px;
}

.team-grid::-webkit-scrollbar {
  width: 8px;
}

.team-grid::-webkit-scrollbar-thumb {
  border: 2px solid var(--border);
  background: #3a4a7a;
}

.team-cell {
  display: flex;
  border: 3px solid var(--border);
  cursor: pointer;
  color: var(--ink-dim);
  background: #00000080;
  flex-direction: column;
  align-items:  center;
  gap: 4px;
  padding: 8px 2px 6px;
  transition: filter 80ms;
  font-family: inherit;
}

.team-cell .team-flag {
  font-size: 18px;
  line-height: 1;
}

.team-cell .team-code {
  font-size: 9px;
}

.team-cell.active {
  border-color: var(--gold);
  color: var(--gold);
  background: #ffd23f24;
  box-shadow: 0 0 12px #ffd23f59;
}

.mc-menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(360px, 88vw);
}

.mc-menu-buttons .mc-btn {
  width: 100%;
}

.mc-server {
  display: block;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  cursor: pointer;
  text-shadow: 1px 1px #000;
  background: #0006;
  border: 2px dashed #3a4a7a;
  padding: 10px;
  font-size: 12px;
}

.mc-ca {
  color: var(--gold);
  cursor: pointer;
  text-shadow: 1px 1px #000;
  display: flex;
  background: #00000080;
  border: 2px solid #5a4a2a;
  flex-direction: column;
  align-items:  center;
  gap: 6px;
  padding: 10px;
  font-family: inherit;
  font-size: 11px;
}

.mc-ca-hint {
  color: var(--ink-dim);
  font-size: 9px;
}

.career-strip {
  display: flex;
  color: var(--ink-dim);
  border: 2px solid var(--border);
  text-shadow: 1px 1px #000;
  background: #00000073;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  padding: 10px 14px;
  font-size: 10px;
}

.menu-footer {
  display: flex;
  padding: 14px max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  color: var(--ink-dim);
  text-shadow: 1px 1px #000;
  justify-content: space-between;
  align-items:  center;
  font-size: 11px;
}

.menu-footer-right {
  display: flex;
  gap: 8px;
}

.mc-icon {
  background: linear-gradient(var(--btn-hi), var(--btn) 50%, var(--btn-lo));
  border: 3px solid var(--border);
  color: var(--ink);
  cursor: pointer;
  width: 38px;
  height: 38px;
  font-family: inherit;
  font-size: 16px;
  box-shadow: inset 2px 2px #ffffff40, inset -2px -2px #00000073;
}

.wallet-connect {
  background: linear-gradient(#a06bff, #7a3fe0 50%, #5320a0);
}

.wallet-pill {
  display: flex;
  cursor: pointer;
  text-shadow: 1px 1px #000;
  background: #0000008c;
  border: 2px solid #4a3a6a;
  align-items:  center;
  gap: 10px;
  padding: 8px 10px;
  font-size: 11px;
}

.wallet-dot {
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
  width: 8px;
  height: 8px;
}

.wallet-addr {
  color: #c9b6ff;
}

.wallet-bal {
  color: var(--ink-dim);
}

.wallet-bal.token {
  color: var(--gold);
}

.wallet-x {
  color: #ff7a7a;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 12px;
}

.mc-perks {
  display: flex;
  flex-direction: column;
  align-items:  center;
  gap: 10px;
  width: min(360px, 88vw);
}

.perk-hint {
  text-align: center;
  color: var(--ink-dim);
  text-shadow: 1px 1px #000;
  font-size: 10px;
  line-height: 1.6;
}

.mc-perks .mc-btn {
  width: 100%;
}

.perk-badge {
  display: inline-block;
  color: var(--ink-dim);
  text-shadow: 1px 1px #000;
  background: #00000080;
  border: 2px solid #5a4a2a;
  padding: 8px 10px;
  font-size: 10px;
}

.perk-badge.on {
  color: #1a1208;
  background: linear-gradient(var(--gold), #b8860b);
  border-color: var(--border);
  text-shadow: none;
}

.perk-badge.special {
  color: var(--gold);
  border-color: var(--gold);
  background: #ffd23f1a;
}

.game-hud {
  display: flex;
  padding: max(10px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 10px max(14px, env(safe-area-inset-left));
  border-bottom: 3px solid var(--border);
  background: #00000073;
  flex-wrap: wrap;
  align-items:  center;
  gap: 12px;
}

.hud-stats {
  display: flex;
  flex-wrap: wrap;
  flex: 1;
  align-items:  center;
  gap: 16px;
}

.hud-coins {
  color: var(--gold);
  text-shadow: 1px 1px #000;
  font-size: 13px;
}

.hud-players {
  color: #ffae6b;
  text-shadow: 1px 1px #000;
  font-size: 11px;
}

.hud-holder {
  color: #1a1208;
  background: linear-gradient(var(--gold), #b8860b);
  border: 2px solid var(--border);
  text-shadow: none;
  padding: 4px 6px;
  font-size: 10px;
}

.pk-score {
  display: flex;
  border: 2px solid var(--border);
  background: #00000080;
  align-items:  center;
  gap: 10px;
  padding: 7px 12px;
}

.pk-team {
  text-shadow: 1px 1px #000;
  font-size: 11px;
}

.pk-vs {
  color: var(--gold);
  text-shadow: 1px 1px #000;
  font-size: 14px;
}

.pk-dots {
  display: flex;
  gap: 4px;
}

.pk-dot {
  display: inline-flex;
  color: var(--ink-dim);
  background: #ffffff14;
  border: 1px solid #2a3354;
  justify-content: center;
  align-items:  center;
  width: 16px;
  height: 16px;
  font-size: 11px;
}

.pk-dot.goal {
  border-color: var(--accent);
  background: #58c33a40;
}

.pk-dot.no {
  border-color: var(--danger);
  color: var(--danger);
  background: #ff5d5d38;
}

.pk-stage {
  position: relative;
  overflow: hidden;
  flex: 1;
}

.pk-stage.aiming {
  cursor: crosshair;
}

.pk-canvas {
  position: absolute;
  display: block;
  background: var(--bg-0);
  width: 100%;
  height: 100%;
  inset: 0;
}

.pk-banner {
  position: absolute;
  display: flex;
  text-align: center;
  pointer-events: none;
  z-index: 6;
  animation: bannerIn .22s steps(4) both;
  flex-direction: column;
  align-items:  center;
  gap: 12px;
  top: 16%;
  left: 50%;
  transform: translateX(-50%);
}

.pk-banner-title {
  color: var(--gold);
  text-shadow: 3px 3px #000, 5px 5px #0006;
  border: 3px solid var(--gold);
  white-space: nowrap;
  background: #000000a6;
  padding: 14px 22px;
  font-size: clamp(24px, 6vw, 46px);
}

.pk-banner-sub {
  color: var(--ink);
  text-shadow: 2px 2px #000;
  background: #0009;
  padding: 8px 14px;
  font-size: 12px;
}

@keyframes bannerIn {
  from {
    opacity: 0;
    transform: translateX(-50%)scale(1.4);
  }

  to {
    opacity: 1;
    transform: translateX(-50%)scale(1);
  }
}

.pk-dirs {
  position: absolute;
  left: max(18px, env(safe-area-inset-left));
  bottom: calc(26px + env(safe-area-inset-bottom));
  display: flex;
  z-index: 7;
  gap: 8px;
}

.pk-dir {
  color: var(--ink-dim);
  cursor: pointer;
  touch-action: none;
  user-select: none;
  background: #080e22c7;
  border: 3px solid #3a4a7a;
  width: 58px;
  height: 58px;
  font-family: inherit;
  font-size: 18px;
  box-shadow: inset 2px 2px #ffffff1f;
}

.pk-dir.active {
  color: var(--gold);
  border-color: var(--gold);
  background: #ffd23f29;
  box-shadow: 0 0 12px #ffd23f66;
}

.pk-shoot {
  position: absolute;
  right: max(18px, env(safe-area-inset-right));
  bottom: calc(26px + env(safe-area-inset-bottom));
  background: radial-gradient(circle at 35% 30%, #7fe05a, var(--accent) 60%, var(--accent-dk));
  border: 4px solid var(--border);
  cursor: pointer;
  touch-action: none;
  user-select: none;
  z-index: 7;
  border-radius: 50%;
  width: 86px;
  height: 86px;
  font-family: inherit;
  font-size: 34px;
  box-shadow: inset 2px 2px #ffffff40, inset -3px -3px #0006;
}

.pk-shoot.on {
  background: radial-gradient(circle at 35% 30%, #ffe27a, var(--gold) 60%, #b8860b);
  animation: shootPulse .5s steps(2) infinite;
  box-shadow: 0 0 18px #ffd23f99, inset 2px 2px #ffffff40;
}

@keyframes shootPulse {
  50% {
    transform: scale(1.06);
  }
}

.pk-shoot:active {
  transform: scale(.94);
}

.pk-panenka {
  position: absolute;
  right: max(18px, env(safe-area-inset-right));
  bottom: calc(130px + env(safe-area-inset-bottom));
  color: #1a1208;
  background: linear-gradient(#ffe27a, var(--gold) 50%, #b8860b);
  border: 3px solid var(--border);
  cursor: pointer;
  letter-spacing: 1px;
  z-index: 7;
  touch-action: none;
  user-select: none;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 10px;
  box-shadow: 0 0 14px #ffd23f80;
}

.pk-panenka:disabled {
  opacity: .4;
  box-shadow: none;
  cursor: not-allowed;
}

.pk-aim-ui {
  position: absolute;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  display: flex;
  z-index: 6;
  pointer-events: none;
  flex-direction: column;
  align-items:  center;
  gap: 10px;
  width: min(420px, 86vw);
  transform: translateX(-50%);
}

.pk-power {
  position: relative;
  border: 3px solid var(--border);
  opacity: .55;
  background: #000;
  width: 100%;
  height: 26px;
  transition: opacity .1s;
  box-shadow: inset 2px 2px #0009, 0 0 0 2px #2a3354;
}

.pk-power.on {
  opacity: 1;
  box-shadow: inset 2px 2px #0009, 0 0 14px #ffd23f73;
}

.pk-power-fill {
  background: linear-gradient(90deg, #58c33a 0%, #ffd23f 55%, #ff5d2e 100%);
  width: 0%;
  height: 100%;
}

.pk-power-label {
  position: absolute;
  display: flex;
  letter-spacing: 3px;
  color: var(--ink);
  text-shadow: 1px 1px #000;
  justify-content: center;
  align-items:  center;
  font-size: 11px;
  inset: 0;
}

.pk-hint {
  color: var(--ink-dim);
  text-shadow: 1px 1px #000;
  letter-spacing: 1px;
  background: #0000008c;
  padding: 7px 12px;
  font-size: 10px;
}

.pk-pick {
  position: absolute;
  left: 50%;
  bottom: calc(26px + env(safe-area-inset-bottom));
  display: flex;
  z-index: 6;
  flex-direction: column;
  align-items:  center;
  gap: 8px;
  transform: translateX(-50%);
}

.pk-pick-title {
  color: var(--gold);
  text-shadow: 2px 2px #000;
  background: #0009;
  margin-bottom: 2px;
  padding: 8px 12px;
  font-size: 12px;
}

.pk-pick-row {
  display: flex;
  gap: 8px;
}

.pk-zone {
  letter-spacing: 1px;
  color: var(--ink);
  cursor: pointer;
  background: #080e22c7;
  border: 3px solid #3a4a7a;
  min-width: 104px;
  height: 58px;
  padding: 0 10px;
  transition: filter 80ms;
  font-family: inherit;
  font-size: 12px;
  box-shadow: inset 2px 2px #ffffff1f;
}

.pk-zone:active {
  border-color: var(--gold);
  transform: translateY(2px);
}

.pk-end {
  position: absolute;
  display: flex;
  z-index: 10;
  background: #02040ca8;
  justify-content: center;
  align-items:  center;
  padding: 16px;
  inset: 0;
}

.pk-end-card {
  overflow-y: auto;
  display: flex;
  background: var(--panel);
  border: 4px solid var(--border);
  animation: bannerIn .25s steps(5) both;
  flex-direction: column;
  align-items:  center;
  gap: 16px;
  width: min(440px, 100%);
  max-height: 92%;
  padding: 26px 22px;
  box-shadow: 0 0 0 2px #3a4a7a, 0 0 40px #000000b3;
}

.pk-end-title {
  color: var(--gold);
  text-shadow: 3px 3px #000;
  text-align: center;
  font-size: clamp(22px, 6vw, 34px);
}

.pk-end-score {
  text-shadow: 2px 2px #000;
  font-size: 18px;
}

.pk-reward {
  display: flex;
  border: 2px solid var(--border);
  background: #0006;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  padding: 12px;
}

.pk-reward-row {
  display: flex;
  color: var(--ink-dim);
  justify-content: space-between;
  align-items:  center;
  font-size: 10px;
}

.pk-reward-row b {
  color: var(--gold);
  font-size: 12px;
}

.pk-reward-row.total {
  color: var(--ink);
  border-top: 1px dashed #3a4a7a;
  padding-top: 9px;
}

.pk-end-btns {
  display: flex;
  gap: 10px;
  width: 100%;
}

.pk-end-btns .mc-btn {
  flex: 1;
}

@media (width <= 600px) {
  .game-hud {
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
    gap: 8px;
  }

  .hud-stats {
    gap: 10px;
  }

  .hud-coins {
    font-size: 12px;
  }

  .pk-score {
    gap: 6px;
    padding: 6px 8px;
  }

  .pk-team {
    font-size: 10px;
  }

  .pk-dot {
    width: 13px;
    height: 13px;
    font-size: 10px;
  }

  .wallet-pill {
    gap: 6px;
    padding: 6px 8px;
  }

  .wallet-pill .wallet-bal {
    display: none;
  }

  .team-grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .pk-zone {
    min-width: 84px;
    height: 52px;
    font-size: 10px;
  }

  .pk-dir {
    width: 50px;
    height: 50px;
    font-size: 17px;
  }

  .pk-shoot {
    width: 72px;
    height: 72px;
    font-size: 28px;
  }

  .pk-aim-ui {
    bottom: calc(142px + env(safe-area-inset-bottom));
    gap: 6px;
    width: min(300px, 64vw);
  }

  .pk-power {
    height: 22px;
  }

  .pk-hint {
    text-align: center;
    padding: 5px 8px;
    font-size: 9px;
    line-height: 1.6;
  }

  .pk-panenka {
    bottom: calc(106px + env(safe-area-inset-bottom));
    padding: 8px 9px;
    font-size: 9px;
  }

  .game-hud .mc-btn.small {
    padding: 6px 7px;
    font-size: 10px;
  }

  .pk-banner-title {
    padding: 10px 14px;
    font-size: clamp(18px, 6vw, 28px);
  }

  .pk-banner-sub {
    font-size: 10px;
  }

  .team-grid {
    max-height: 150px;
  }

  .career-strip {
    gap: 8px;
    font-size: 9px;
  }

  .pk-banner-title {
    white-space: normal;
  }

  .menu-footer {
    font-size: 10px;
  }
}

@media (height <= 480px) {
  .menu-center {
    gap: 12px;
  }

  .mc-logo-img {
    width: 90px;
  }

  .pk-aim-ui {
    bottom: calc(12px + env(safe-area-inset-bottom));
    width: min(260px, 38vw);
  }

  .pk-power {
    height: 20px;
  }

  .pk-panenka {
    bottom: calc(80px + env(safe-area-inset-bottom));
    padding: 7px 8px;
    font-size: 9px;
  }

  .pk-pick {
    bottom: calc(10px + env(safe-area-inset-bottom));
  }

  .pk-zone {
    min-width: 78px;
    height: 42px;
    font-size: 10px;
  }

  .pk-dirs {
    bottom: calc(12px + env(safe-area-inset-bottom));
  }

  .pk-dir {
    width: 44px;
    height: 44px;
    font-size: 15px;
  }

  .pk-shoot {
    bottom: calc(12px + env(safe-area-inset-bottom));
    width: 60px;
    height: 60px;
    font-size: 24px;
  }

  .team-grid {
    max-height: 120px;
  }

  .pk-banner {
    top: 10%;
  }
}

.pk-end-card::-webkit-scrollbar {
  width: 10px;
}

.menu-center::-webkit-scrollbar {
  width: 10px;
}

.pk-end-card::-webkit-scrollbar-thumb {
  border: 2px solid var(--border);
  background: #3a4a7a;
}

.menu-center::-webkit-scrollbar-thumb {
  border: 2px solid var(--border);
  background: #3a4a7a;
}
