/* Styles extracted from Multiplayer.js */
:root { --mp-band-h: 160px; }

.mp-root { position: relative; width: 100%; height: 100%; overflow: hidden; }

.mp-layer { position: absolute; left: 0; right: 0; }
.mp-dark {
  background-image: url('/ui/Dark_Dirt.webp');
  background-size: auto 480px;
  background-repeat: repeat;
  background-position: center;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: brightness(1) saturate(1);
  top: 0; bottom: 0;
  z-index: 0;
}

.mp-top, .mp-footer-bg {
  pointer-events: none;
  height: var(--mp-band-h);
  left: 0; right: 0;
  background-image: url('/ui/Light_Dirt.webp');
  background-size: auto 420px;
  background-repeat: repeat;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border-top: 2px solid rgba(0,0,0,1);
  border-bottom: 2px solid rgba(0,0,0,1);
  z-index: 3;
}
.mp-top { top: 0; bottom: auto; background-position: center top; }
.mp-footer-bg { bottom: 0; top: auto; background-position: center bottom; }

/* Global falling overlay above dark background, below bands and content */
.mp-global-fall { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }

.mp-sep-top, .mp-sep-bottom { position: absolute; left: 0; right: 0; pointer-events: none; z-index: 3; }
.mp-sep-top { top: var(--mp-band-h); height: 35px; background: linear-gradient(to bottom, rgba(0,0,0,0.9), rgba(0,0,0,0)); }
.mp-sep-bottom { bottom: var(--mp-band-h); height: 35px; background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0)); }

.mp-content { position: relative; height: 100%; display: flex; flex-direction: column; }
.mp-header { height: 140px; display: flex; align-items: flex-end; justify-content: center; position: relative; z-index: 4; }
.mp-title { color: #ffffff; margin: 0 0 12px 0; font-size: 20px; text-shadow: 2px 2px 0 #000; }

.mp-list-wrap {
  position: absolute; left: 0; right: 0; top: var(--mp-band-h); bottom: var(--mp-band-h);
  z-index: 4; /* ensure servers always on top of falling tetrominos */
  display: flex; justify-content: center; overflow-y: auto; overflow-x: hidden;
}
.mp-list { width: min(880px, 92vw); margin-top: 10px; margin-bottom: 10px; background: transparent; padding: 6px 0; }
.mp-row { display: flex; align-items: center; gap: 14px; padding: 10px 12px; cursor: pointer; }
.mp-row + .mp-row { border-top: 1px solid rgba(0,0,0,0.5); }
.mp-row:hover { background: rgba(255,255,255,0.05); }
.mp-row.selected { outline: 2px solid #c6a200; background: rgba(255,220,120,0.06); }
.mp-row.mp-row-separator {
  cursor: default;
  background: transparent;
  justify-content: center;
  padding: 12px 0;
}
.mp-separator-col {
  text-align: center;
  pointer-events: none;
}
.mp-separator-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 18px;
  text-shadow: 2px 2px 0 #000;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}
.mp-separator-icon {
  width: 26px;
  height: 26px;
  display: inline-block;
  background-size: contain;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.mp-sep-icon-coop { background-image: url('/ui/Firework.png'); }
.mp-sep-icon-single { background-image: url('/ui/Sword.png'); transform: rotate(-12deg); }
.mp-sep-icon-clock { background-image: url('/ui/Clock.gif'); }
.mp-sep-icon-pvp {
  position: relative;
  width: 28px;
  height: 28px;
  transform: rotate(15deg);
}
.mp-sep-icon-pvp::before,
.mp-sep-icon-pvp::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('/ui/Sword.png');
  background-size: contain;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  transform-origin: center;
}
.mp-sep-icon-pvp::before { transform: rotate(-15deg) translate(-8px, 0px); }
.mp-sep-icon-pvp::after { transform: scaleX(-1) rotate(15deg) translate(0px, 0px) ; }
.mp-separator-dots {
  font-family: monospace;
  color: #fff;
  text-shadow: 2px 2px 0 #000;
  letter-spacing: 6px;
}

.mp-icon {
  width: 48px; height: 48px; border: 1px solid #000; border-radius: 6px;
  box-shadow: inset 1px 1px 0 rgba(255,255,255,0.35), inset -1px -1px 0 rgba(0,0,0,0.55);
  image-rendering: pixelated; flex: 0 0 48px; display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #111; background: #999;
}
.bg-green { background: #6c3 !important; }
.bg-orange { background: #f90 !important; }
.bg-red { background: #e45c5c !important; }
.bg-blue { background: #7ca6ff !important; }

.mp-info { display: flex; align-items: baseline; gap: 12px; flex: 1; }
.mp-col { flex: 1; }
.mp-name { color: #fff; font-size: 18px; text-shadow: 2px 2px 0 #000; }
.mp-name-primary { color: #fff; }
.mp-name-sep { color: #c8c8c8; }
.mp-tag-mode { font-weight: 600; }
.mp-tag-single { color: #7ce070; }
.mp-tag-pvp { color: #e45c5c; }
.mp-tag-coop { color: #7ca6ff; }
.mp-tag-status { font-weight: 600; }
.mp-tag-status-waiting { color: #7ce070; }
.mp-tag-status-running { color: #e45c5c; }
.mp-duration { color: #cdd7ff; font-weight: 600; }
.mp-count { margin-left: auto; color: #c0ffb4; text-shadow: 2px 2px 0 #000; }
.mp-players { margin-left: 0; color: #ddd; font-size: 14px; text-shadow: 2px 2px 0 #000; }
/* Generic secondary line used by Singleplayer history (no icon) */
.mp-meta { color: #ddd; font-size: 14px; text-shadow: 2px 2px 0 #000; }

/* Mode-specific coloring for Singleplayer history */
.mp-mode { font-weight: 700; text-shadow: 2px 2px 0 #000; }
.mp-mode-singleplayer { color: #b2ffad; }
.mp-mode-pvp { color: #ff9a9a; }
.mp-mode-cooperation { color: #a9c9ff; }
.mp-mode-coop { color: #7ca6ff; }


.mp-footer { position: absolute; left: 0; right: 0; bottom: 0; height: var(--mp-band-h); display: flex; align-items: center; justify-content: center; gap: 14px; z-index: 4; }

/* Create server form */
.mp-form-wrap { align-items: center; }
.srv-card {
  width: min(520px, 92vw);
  margin: 0 auto;
  padding: 0 20px 12px;
}
.srv-root .mp-title,
.srv-root .srv-label,
.srv-root .srv-mode-btn,
.srv-root .srv-mode,
.srv-root .srv-mode-label,
.srv-root .srv-input,
.srv-root .ui-btn {
  font-size: 16px;
}
.srv-field { margin-bottom: 16px; }
.srv-root .srv-field { margin-bottom: 34px; }
.srv-label {
  display: block;
  color: #ddd;
  margin-bottom: 6px;
  text-shadow: 2px 2px 0 #000;
}
.srv-input {
  width: 100%;
  padding: 12px 14px;
  background: linear-gradient(#0f0f0f, #171717);
  border: 2px solid #000;
  color: #fff;
  border-radius: 4px;
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.25),
    inset -1px -1px 0 rgba(0,0,0,0.55);
  font-size: 16px;
}
.srv-input:focus { outline: 2px solid #c6a200; }
.srv-mode-btn {
  width: 100%;
  padding: 12px 14px;
  margin: 0 0 16px 0;
  background: linear-gradient(#9a9a9a, #757575);
  border: 2px solid #000;
  border-radius: 4px;
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.38),
    inset -1px -1px 0 rgba(0,0,0,0.62),
    0 2px 0 rgba(0,0,0,0.45);
  color: #fff;
  font-weight: 400;
  cursor: pointer;
  text-shadow:
    -1px 0 0 #000,
    1px 0 0 #000,
    0 -1px 0 #000,
    0 1px 0 #000;
}
.srv-mode-btn:hover,
.srv-mode-btn:focus-visible {
  background: linear-gradient(#8fb2e8, #6f8fc6);
  color: #f0d774;
}
.srv-mode-btn:hover .srv-mode-label,
.srv-mode-btn:focus-visible .srv-mode-label {
  color: #f0d774;
}
.srv-mode-btn:active { transform: translateY(1px); }
.srv-mode-label {
  color: #fff;
  margin-right: 6px;
  text-shadow:
    -1px 0 0 #000,
    1px 0 0 #000,
    0 -1px 0 #000,
    0 1px 0 #000;
}
.srv-mode { margin-left: 0; }
.srv-root .srv-mode .mp-mode {
  text-shadow:
    -1px 0 0 #000,
    1px 0 0 #000,
    0 -1px 0 #000,
    0 1px 0 #000;
}
.srv-mode-note { margin-top: 12px; color: #f3f3f3; }
.srv-mode-note summary { list-style: none; cursor: pointer; }
.srv-mode-summary { display: inline-flex; align-items: center; gap: 8px; color: #fff; text-shadow: 1px 1px 0 #000; }
.srv-mode-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  color: #111;
  border: 1px solid rgba(0,0,0,0.15);
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.srv-mode-summary-text { font-weight: 700; }
.srv-mode-modal {
  margin-top: 8px;
  background: linear-gradient(180deg, rgba(15,15,15,0.94), rgba(28,28,28,0.96));
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.35), inset 1px 1px 0 rgba(255,255,255,0.08), inset -1px -1px 0 rgba(0,0,0,0.5);
  border: 1px solid rgba(0,0,0,0.35);
  color: #e8e8e8;
}
.srv-mode-section + .srv-mode-section { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.08); }
.srv-mode-title { font-weight: 700; margin-bottom: 4px; }
.srv-mode-desc { font-size: 0.95rem; line-height: 1.45; color: #e0e0e0; }
.srv-mode-title[data-mode="pvp"] { color: #ff9a9a; }
.srv-mode-title[data-mode="coop"] { color: #7ca6ff; }
.srv-mode-title[data-mode="single"] { color: #b2ffad; }
.srv-mode-row { display: flex; align-items: center; gap: 10px; justify-content: flex-start; }
.srv-mode-help-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #000;
  background: linear-gradient(#d0d0d0, #8a8a8a);
  color: #111;
  font-weight: 800;
  box-shadow: inset 1px 1px 0 rgba(255,255,255,0.35), inset -1px -1px 0 rgba(0,0,0,0.5), 0 2px 6px rgba(0,0,0,0.4);
  cursor: pointer;
}
.srv-mode-help-btn:hover { filter: brightness(1.1); }
.srv-mode-help-btn:active { transform: translateY(1px); }
.srv-mode-modal.floating {
  position: fixed;
  right: 48px;
  top: 220px;
  width: 260px;
  z-index: 100;
}
.srv-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 4px;
  flex-wrap: wrap;
}
.srv-actions .ui-btn { min-width: 200px; }

.shop-root { position: relative; width: 100%; min-height: 100vh; overflow: hidden; }

/* Right-side modal (rounded), floats above 3D with margin around */
.shop-modal {
  position: absolute; top: 24px; right: 24px; bottom: 24px; width: min(880px, 65vw);
  background: rgba(28, 28, 28, 0.7);
  border: 2px solid #000; border-radius: 14px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.45);
  z-index: 6;
  backdrop-filter: blur(2px);
}
.shop-title { color: #fff; margin: 0 0 12px 0; font-size: 18px; text-shadow: 2px 2px 0 #000; }
.shop-tabs { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 0 12px 0; border: 1px solid #000; border-radius: 12px; overflow: hidden; background: rgba(0,0,0,0.25); box-shadow: inset 1px 1px 0 rgba(255,255,255,0.2), inset -1px -1px 0 rgba(0,0,0,0.6); }
.shop-tab { appearance: none; border: none; border-right: 1px solid #000; padding: 12px 18px; background: transparent; color: #eee; text-shadow: 1px 1px 0 #000; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-size: 18px; }
.shop-tab:last-child { border-right: 0; }
.shop-tab.active { background: rgba(0,0,0,0.35); color: #fff; }
.shop-tab-icon { width: 24px; height: 24px; image-rendering: pixelated; border: none; border-radius: 0; }
.shop-list { display: grid; grid-auto-rows: minmax(48px, auto); gap: 10px; padding-right: 14px; }
/* Two-row grid so status text sits under the title while cost+button stay aligned right */
.shop-item { display: grid; grid-template-columns: 1fr auto auto; grid-template-rows: auto auto; grid-template-areas: 'name cost btn' 'status cost btn'; align-items: center; gap: 6px 12px; background: rgba(0,0,0,0.25); padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(0,0,0,0.6); }
.shop-item.shop-craft-card { display: flex; }
.shop-item.shop-upgrade-card { display: flex; gap: 16px; align-items: stretch; }
.shop-upgrade-icon {
  flex: 0 0 140px;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(0,0,0,0.5);
  border-radius: 10px;
  overflow: hidden;
}
.shop-upgrade-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.shop-upgrade-main { flex: 1 1 auto; display: flex; flex-direction: column; gap: 6px; }
.shop-upgrade-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.shop-upgrade-title { color: #fff; font-size: 20px; text-shadow: 2px 2px 0 #000; }
.shop-upgrade-level { font-style: italic; color: #bfe5ff; }
.shop-upgrade-effect { color: #9fcf63; font-size: 15px; }
.shop-upgrade-total { color: #9fcf63; font-size: 15px; }
.shop-upgrade-effect { color: #ddd; font-size: 15px; }
.shop-upgrade-costs { display: flex; gap: 8px; }
.shop-item.shop-upgrade-card { display: flex; }
.shop-item-trade { grid-template-rows: auto; grid-template-areas: 'name cost btn'; }
.shop-item-name { grid-area: name; color: #fff; text-shadow: 2px 2px 0 #000; font-size: 16px; }
.shop-item-name { display: flex; align-items: center; }
.shop-item-status { grid-area: status; color: #ddd; font-size: 13px; }
.shop-craft-progress { font-style: italic; color: #bfe5ff; }
.shop-craft-progress.maxed { color: #89ff89; }
.shop-status-purchased { color: #6cc642; }
.shop-craft-card {
  display: flex;
  gap: 20px;
  align-items: stretch;
  min-height: 140px;
}
.shop-craft-icon-block {
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(0,0,0,0.5);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  flex: 0 0 140px;
}
.shop-craft-icon {
  display: flex;
  align-items: stretch;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.shop-craft-icon .shop-chip-no-label {
  width: 100%;
  height: 100%;
  padding: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
}
.shop-craft-icon .shop-chip-img {
  display: block;
  width: calc(100% + 12px);
  height: calc(100% + 12px);
  object-fit: cover;
  margin: -6px;
}
.shop-craft-main { display: flex; flex-direction: column; gap: 8px; flex: 1 1 auto; }
.shop-craft-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.shop-craft-title { color: #fff; font-size: 22px; text-shadow: 2px 2px 0 #000; }
.shop-craft-progress { font-style: italic; color: #bfe5ff; }
.shop-craft-progress.maxed { color: #89ff89; }
.shop-craft-effects-list { list-style: none; margin: 0; padding: 0; color: #9fcf63; font-size: 16px; }
.shop-craft-costs { display: flex; flex-direction: column; gap: 6px; }
.shop-craft-label { font-size: 15px; color: #dcdcdc; text-transform: none; letter-spacing: 0.4px; }
.shop-craft-cost-list { display: flex; flex-wrap: wrap; gap: 8px; }
.shop-craft-cost-chip { display: inline-flex; align-items: center; gap: 6px; background: rgba(0,0,0,0.35); padding: 4px 8px; border-radius: 6px; border: 1px solid rgba(0,0,0,0.55); }
.shop-craft-cost-chip img { width: 22px; height: 22px; object-fit: cover; image-rendering: pixelated; }
.shop-craft-cost-chip .amount { font-weight: 600; color: #f4d29c; }
.shop-craft-cost-chip.insufficient { border-color: #a60000; color: #ff9494; }
.shop-craft-cost-chip.insufficient .amount { color: #ff9494; }
.shop-craft-card .shop-btn-wrap { align-self: center; }
.shop-cost { grid-area: cost; display: inline-flex; align-items: center; gap: 8px; background: rgba(0,0,0,0.35); padding: 4px 8px; border-radius: 8px; border: 1px solid rgba(0,0,0,0.55); }
.shop-cost .shop-chip-img { border: none; border-radius: 0; box-shadow: none; }
.shop-item .ui-btn-narrow { grid-area: btn; }
.shop-item .ui-btn, .shop-btns .ui-btn { margin-top: 0; margin-bottom: 0; }
.shop-btns { grid-area: btn; display: flex; gap: 8px; align-items: center; }
.shop-btns .ui-btn-narrow { grid-area: auto; }
.shop-item-trade > .shop-cost { display: none; }
.shop-trade { display: grid; grid-template-columns: minmax(260px, 1fr) 62px minmax(260px, 1fr); align-items: center; gap: 10px; }
.shop-trade .shop-cost { display: inline-flex; align-items: center; }
.shop-arrow {
  width: 54px;
  height: 16px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.shop-arrow::before {
  content: '';
  width: 60%;
  height: 4px;
  background: #a8a8a8;
}
.shop-arrow::after {
  content: '';
  position: absolute;
  right: 6px;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 10px solid #a8a8a8;
}
.shop-btn-wrap { grid-area: btn; position: relative; height: 100%; display: flex; align-items: center; justify-content: flex-end; }
.shop-btn-shield { position: absolute; inset: 0; z-index: 2; background: rgba(0,0,0,0); cursor: not-allowed; }
.shop-chip-img { width: 22px; height: 22px; object-fit: cover; image-rendering: pixelated; border: none; border-radius: 0; box-shadow: none; }
.shop-chip-text { display: inline-flex; align-items: center; gap: 6px; color: #eee; text-shadow: 1px 1px 0 #000; font-size: 14px; }
.shop-chip-cost { background: rgba(0,0,0,0.25); color: #f4d29c; }
.shop-chip-output { background: rgba(0,0,0,0.25); }
.shop-chip-no-label { padding: 4px; display: inline-flex; align-items: center; justify-content: center; }
.shop-chip-no-label .shop-chip-img { width: 90%; height: 90%; }
.shop-craft-icon-block { height: 100%; }
.shop-craft-icon .shop-chip-no-label { width: 100%; height: 100%; padding: 0; }
.shop-craft-icon .shop-chip-no-label .shop-chip-img {
  width: 100%;
  height: 100%;
}
.shop-menu { position: absolute; inset: 16px; overflow-y: auto; overflow-x: hidden; }
.shop-menu,
.utility-panel-stats,
.game-card-roster,
.game-float-panel { scrollbar-width: thin; scrollbar-color: #6d6d6d transparent; }
/* Minecraft-like pixelated scrollbar (WebKit/Blink) */
.shop-menu::-webkit-scrollbar,
.utility-panel-stats::-webkit-scrollbar,
.game-card-roster::-webkit-scrollbar,
.game-float-panel::-webkit-scrollbar { width: 14px; height: 14px; }
.shop-menu::-webkit-scrollbar-track,
.utility-panel-stats::-webkit-scrollbar-track,
.game-card-roster::-webkit-scrollbar-track,
.game-float-panel::-webkit-scrollbar-track {
  background:
    repeating-linear-gradient(
      0deg,
      #1d1d1d 0, #1d1d1d 6px,
      #232323 6px, #232323 12px
    );
  border-left: 2px solid #000;
}
.utility-panel-stats::-webkit-scrollbar-track,
.game-card-roster::-webkit-scrollbar-track,
.game-float-panel::-webkit-scrollbar-track {
  background: transparent;
  border: none;
}
.shop-menu::-webkit-scrollbar-thumb,
.utility-panel-stats::-webkit-scrollbar-thumb,
.game-card-roster::-webkit-scrollbar-thumb,
.game-float-panel::-webkit-scrollbar-thumb {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.18), rgba(0,0,0,0.18)),
    repeating-linear-gradient(
      0deg,
      #6f6f6f 0, #6f6f6f 6px,
      #5b5b5b 6px, #5b5b5b 12px
    );
  border: 2px solid #000;
  border-right-width: 1px;
  border-left-width: 1px;
  box-shadow: inset 1px 1px 0 rgba(255,255,255,0.25), inset -1px -1px 0 rgba(0,0,0,0.5);
}
.utility-panel-stats::-webkit-scrollbar-thumb,
.game-card-roster::-webkit-scrollbar-thumb,
.game-float-panel::-webkit-scrollbar-thumb {
  border: none;
  box-shadow: none;
}
/* Corners & buttons kept square for the blocky look */
.shop-menu::-webkit-scrollbar-corner,
.utility-panel-stats::-webkit-scrollbar-corner,
.game-card-roster::-webkit-scrollbar-corner,
.game-float-panel::-webkit-scrollbar-corner { background: #1d1d1d; }
.shop-menu::-webkit-scrollbar-button,
.utility-panel-stats::-webkit-scrollbar-button,
.game-card-roster::-webkit-scrollbar-button,
.game-float-panel::-webkit-scrollbar-button { display: none; }

.utility-panel-stats { scrollbar-width: auto; }
.utility-panel-stats::-webkit-scrollbar { width: 18px; }
.shop-title { color: #fff; margin: 0 0 12px 0; font-size: 18px; text-shadow: 2px 2px 0 #000; }
.shop-list { display: grid; grid-auto-rows: minmax(48px, auto); gap: 10px; padding-right: 14px; }
.shop-item { display: grid; grid-template-columns: 1fr auto auto; grid-template-rows: auto auto; grid-template-areas: 'name cost btn' 'status cost btn'; align-items: center; gap: 6px 12px; background: rgba(0,0,0,0.25); padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(0,0,0,0.6); }
.shop-item-trade { grid-template-rows: auto; grid-template-areas: 'name cost btn'; }
.shop-item-name { grid-area: name; color: #fff; text-shadow: 2px 2px 0 #000; font-size: 16px; }
.shop-item-name { display: flex; align-items: center; }
.shop-item-status { grid-area: status; color: #ddd; font-size: 13px; }
.shop-craft-progress { font-style: italic; color: #bfe5ff; }
.shop-craft-progress.maxed { color: #89ff89; }
.shop-status-purchased { color: #6cc642; }
.shop-cost { grid-area: cost; display: inline-flex; align-items: center; gap: 8px; background: rgba(0,0,0,0.35); padding: 4px 8px; border-radius: 8px; border: 1px solid rgba(0,0,0,0.55); }
.shop-cost .shop-chip-img { border: none; border-radius: 0; box-shadow: none; }
.shop-item .ui-btn-narrow { grid-area: btn; }
.shop-item .ui-btn, .shop-btns .ui-btn { margin-top: 0; margin-bottom: 0; }
.shop-btns { grid-area: btn; display: flex; gap: 8px; align-items: center; }
.shop-btns .ui-btn-narrow { grid-area: auto; }
.shop-item-trade > .shop-cost { display: none; }
.shop-trade { display: flex; align-items: center; gap: 10px; }
.shop-trade .shop-cost { display: inline-flex; align-items: center; }
.shop-trade-arrow { color: #ddd; text-shadow: 1px 1px 0 #000; font-size: 18px; }
.shop-btn-wrap { grid-area: btn; position: relative; height: 100%; display: flex; align-items: center; justify-content: flex-end; }
.shop-btn-shield { position: absolute; inset: 0; z-index: 2; background: rgba(0,0,0,0); cursor: not-allowed; }
.shop-chip-img { width: 22px; height: 22px; object-fit: cover; image-rendering: pixelated; border: none; border-radius: 0; box-shadow: none; }
.shop-chip-text { color: #eee; text-shadow: 1px 1px 0 #000; font-size: 14px; }
.shop-inv { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.shop-inventory { display: block !important; background: transparent; border: none; padding: 0; }
.shop-item-title { color: #fff; text-shadow: 2px 2px 0 #000; font-size: 16px; margin-bottom: 6px; }

/* Utility toolbar + modal stack (inventory/spawn/stat) */
.shop-utility { position: absolute; top: 24px; left: 24px; z-index: 7; display: flex; flex-direction: column; gap: 10px; }
.shop-utility-buttons { display: flex; gap: 10px; }
.shop-utility-button {
  width: 62px; height: 62px; padding: 8px;
  border: 2px solid #000; border-radius: 12px;
  background: linear-gradient(#9c9c9c, #5f5f5f);
  box-shadow: inset 1px 1px 0 rgba(255,255,255,0.6), inset -1px -1px 0 rgba(0,0,0,0.85), 0 4px 10px rgba(0,0,0,0.4);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: transform 120ms ease, background 120ms ease;
}
.shop-utility-button img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.shop-utility-button:hover { background: linear-gradient(#8fb2e8, #6f8fc6); }
.shop-utility-button.active { background: linear-gradient(#a2c8ff, #6c8ed5); transform: translateY(1px); }
.shop-utility-button:focus-visible { outline: 2px solid #7bc043; outline-offset: 2px; }

/* Inventory modal styling reused for the utility modal */
.shop-utility-modal,
.shop-inventory-modal {
  background: rgba(28,28,28,0.55);
  border: 2px solid #000; border-radius: 14px; padding: 12px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.45);
  display: block;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.shop-utility-modal {
  position: relative;
  width: min(680px, 56vw);
}
.shop-utility-modal.utility-panel-inventory { width: min(460px, 38vw); }
.shop-utility-modal.utility-panel-stats {
  width: min(calc(420px - 16px), calc(35vw - 16px));
  max-width: calc(420px - 16px);
  max-height: calc(100vh - 280px);
  overflow-y: auto;
  padding-right: 8px;
}
.shop-inventory-modal .shop-chip-img { border: none; border-radius: 0; box-shadow: none; }
.shop-inventory-panel { display: flex; flex-direction: column; gap: 12px; }
.shop-inventory-section { background: rgba(0,0,0,0.25); border: 1px solid rgba(0,0,0,0.45); border-radius: 10px; padding: 10px 12px; }
.shop-inventory-heading { color: #fff; text-shadow: 2px 2px 0 #000; font-size: 16px; margin-bottom: 8px; letter-spacing: 0.4px; }
.shop-inventory-entry { display: flex; justify-content: space-between; color: #dcdcdc; font-size: 16px; align-items: center; padding: 4px 0; }
.shop-inventory-label { text-transform: capitalize; display: flex; align-items: center; gap: 8px; }
.shop-inventory-value { font-weight: 600; color: #9fcf63; }
.shop-inventory-empty { color: #bdbdbd; font-size: 13px; font-style: italic; }
.shop-inventory-icon { width: 20px; height: 20px; object-fit: cover; border-radius: 0; border: none; }

.shop-panel {
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(0,0,0,0.6);
  border-radius: 12px;
  padding: 12px 14px;
  color: #eee;
  text-shadow: 1px 1px 0 #000;
}
.shop-panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.shop-panel-title { margin: 0; font-size: 18px; color: #fff; }
.shop-panel-total,
.shop-panel-tag {
  font-size: 13px;
  padding: 2px 8px;
  border: 1px solid rgba(0,0,0,0.5);
  border-radius: 999px;
  background: rgba(0,0,0,0.4);
}
.shop-panel-caption { margin: 0 0 12px 0; font-size: 14px; color: #dcdcdc; }
.shop-panel-grid { display: flex; flex-direction: column; gap: 10px; }
.shop-rate-row { display: grid; grid-template-columns: 90px 1fr 60px; align-items: center; gap: 10px; font-size: 14px; }
.shop-rate-label { color: #fff; }
.shop-rate-row input[type="range"] { width: 100%; accent-color: #8fce4f; }
.shop-rate-value { justify-self: end; font-weight: 600; color: #9fcf63; }
.shop-panel-note { margin-top: 10px; font-size: 12px; color: #bdbdbd; }
.shop-stat-sections { display: flex; flex-direction: column; gap: 12px; }
.shop-stat-section { background: rgba(0,0,0,0.2); border: 1px solid rgba(0,0,0,0.5); border-radius: 10px; padding: 10px 12px; }
.shop-stat-heading { color: #fff; font-size: 15px; margin-bottom: 8px; text-shadow: 2px 2px 0 #000; }
.shop-stat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.shop-stat-row { display: flex; align-items: center; justify-content: space-between; font-size: 16px; background: rgba(0,0,0,0.25); border: 1px solid rgba(0,0,0,0.5); border-radius: 8px; padding: 8px 12px; }
.shop-stat-label { color: #dcdcdc; display: flex; align-items: center; gap: 8px; }
.shop-stat-icon { width: 20px; height: 20px; object-fit: cover; border-radius: 0; border: none; }
.shop-stat-value { font-weight: 600; color: #9fcf63; }
.shop-empty { color: #dcdcdc; text-shadow: 1px 1px 0 #000; text-align: center; padding: 24px 12px; }
.shop-rate-stack { display: flex; flex-direction: column; gap: 12px; }
.shop-rate-card { background: rgba(0,0,0,0.25); border: 1px solid rgba(0,0,0,0.45); border-radius: 10px; padding: 10px 12px; }
.shop-rate-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.shop-rate-name { color: #fff; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.shop-rate-max { font-size: 12px; color: #bdbdbd; }
.shop-prob-row { width: 100%; }
.shop-prob-row .gc-slider { flex: 1; }
.shop-prob-row .gc-prob-val { width: 48px; }
.shop-dist-wrap { margin: 14px 0 0 0; }
.shop-dist-wrap .gc-dist-row { align-items: center; }
.shop-dist-wrap .gc-auto { margin: 0; }
.shop-panel-buttons { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.shop-panel-buttons .ui-btn { min-width: 120px; }

/* Shop bottom-left navigation */
.shop-nav {
  position: absolute;
  left: 24px;
  bottom: 24px;
  z-index: 8;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.shop-nav .ui-btn { min-width: 120px; }
.shop-nav .shop-reset { min-width: 80px; }

/* Options page */
.opt-root { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.opt-panel { position: relative; width: min(720px, 60vw); background: rgba(28,28,28,0.55); border: 2px solid #000; border-radius: 14px; box-shadow: 0 10px 24px rgba(0,0,0,0.45); padding: 16px; }
.opt-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
.opt-grid-2 { grid-template-columns: 1fr 1fr; row-gap: 80px; column-gap: 14px; }
.opt-cell { background: transparent; border: none; border-radius: 0; padding: 0; display: flex; align-items: center; justify-content: center; }
.opt-cell .ui-btn { width: 100%; min-width: 0; }
.opt-done { display: block; margin: 80px auto 0; }
.opt-label { color: #fff; text-shadow: 1px 1px 0 #000; min-width: 160px; }
.opt-slider { position: relative; width: 100%; height: 40px; background: linear-gradient(#2e2e2e,#1f1f1f); border: 1px solid #000; border-radius: 0; box-shadow: inset 1px 1px 0 rgba(255,255,255,0.2), inset -1px -1px 0 rgba(0,0,0,0.6); overflow: hidden; }
.opt-slider-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; text-shadow: 1px 1px 0 #000; pointer-events: none; font-size: 16px; }
.opt-range { position: absolute; inset: 1px; width: auto; height: auto; -webkit-appearance: none; appearance: none; background: transparent; }
/* Track */
.opt-range::-webkit-slider-runnable-track { height: 100%; background: transparent; }
.opt-range::-moz-range-track { height: 100%; background: transparent; }
/* Thumb */
.opt-range::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 100%; margin: 0; background: linear-gradient(#a6a6a6,#7b7b7b); border: 1px solid #000; border-radius: 0; box-shadow: inset 1px 1px 0 #dcdcdc, inset -1px -1px 0 #575757; box-sizing: border-box; }
.opt-range::-moz-range-thumb { width: 20px; height: 100%; background: linear-gradient(#a6a6a6,#7b7b7b); border: 1px solid #000; border-radius: 0; box-shadow: inset 1px 1px 0 #dcdcdc, inset -1px -1px 0 #575757; box-sizing: border-box; }
.shop-inv-chip { display: inline-flex; align-items: center; gap: 8px; background: rgba(0,0,0,0.25); padding: 6px 10px; border-radius: 8px; border: 1px solid rgba(0,0,0,0.55); }

/* Tetromino preview gallery */
.mp-tetro-gallery { position: relative; z-index: 4; display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 0 auto; width: min(880px, 92vw); }

/* Falling overlay on sides (non-interactive) */
.mp-fall-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 2; overflow: hidden; }
.mp-fall-lane { position: absolute; top: 0; bottom: 0; left: 0; right: 0; }
.mp-fall-item { position: absolute; will-change: transform; }

/* ---------------- Create Game styles ---------------- */
.gc-table { display: grid; grid-template-columns: 64px 1fr 180px 1.4fr; align-items: center; padding: 8px 12px; gap: 12px; }
.gc-header { color: #ddd; text-shadow: 2px 2px 0 #000; font-size: 14px; }
.gc-table + .gc-table { border-top: 1px solid rgba(0,0,0,0.5); }
.gc-cell { color: #fff; text-shadow: 2px 2px 0 #000; }
.gc-icon { display: flex; align-items: center; justify-content: center; }
.gc-name { font-size: 16px; }
.gc-max { color: #c0ffb4; }
.gc-prob-row { display: flex; align-items: center; gap: 10px; }
.gc-prob-row input[type="range"] {
  width: 100%;
  accent-color: #9fcf63;
  position: relative;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  height: 22px;
}

/* Track with gray limit marker overlay; thumb remains above */
.gc-prob-row input[type="range"]::-webkit-slider-runnable-track {
  height: 10px;
  border-radius: 6px;
  background:
    /* limit marker on top */
    linear-gradient(to right, transparent var(--gc-marker), #9a9a9a var(--gc-marker), #9a9a9a calc(var(--gc-marker) + 2px), transparent calc(var(--gc-marker) + 2px)),
    /* filled value left of thumb */
    linear-gradient(to right, #9fcf63 0%, #9fcf63 var(--gc-value), transparent var(--gc-value), transparent 100%),
    /* base track */
    linear-gradient(180deg, #5a5a5a, #2f2f2f);
}
.gc-prob-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: #9fcf63; border: 2px solid #6ea33a;
  margin-top: -3px; /* center on 10px track */
  position: relative; z-index: 2;
}

/* Firefox track */
.gc-prob-row input[type="range"]::-moz-range-track {
  height: 10px; border-radius: 6px;
  background:
    linear-gradient(to right, transparent var(--gc-marker), #9a9a9a var(--gc-marker), #9a9a9a calc(var(--gc-marker) + 2px), transparent calc(var(--gc-marker) + 2px)),
    linear-gradient(to right, #9fcf63 0%, #9fcf63 var(--gc-value), transparent var(--gc-value), transparent 100%),
    linear-gradient(180deg, #5a5a5a, #2f2f2f);
}
.gc-prob-row input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: #9fcf63; border: 2px solid #6ea33a;
  position: relative; z-index: 2;
}
.gc-prob-val { width: 54px; text-align: right; }
/* Slider with visual cap indication */
.gc-slider { position: relative; width: 100%; }
.gc-slider .gc-cap { position: absolute; top: 6px; bottom: 6px; right: 0; background: rgba(0,0,0,0.45); pointer-events: none; border-radius: 4px; }
/* Marker is rendered via input background gradient; no extra element needed */

/* Icons now use Three.js SpinningCube; removed CSS 3D cube and tints */

/* Distribution bar (XP-like) */
.gc-dist-wrap { margin: 14px 12px 0 12px; }
.gc-dist-row { display: flex; align-items: center; gap: 10px; }
.gc-auto { color: #ddd; text-shadow: 2px 2px 0 #000; font-size: 12px; user-select: none; }
.gc-auto input { vertical-align: middle; margin-right: 6px; }
.gc-dist { position: relative; flex: 1 1 auto; height: 13px; display: flex; border: 2px solid #000; box-shadow: inset 1px 1px 0 rgba(255,255,255,0.35), inset -1px -1px 0 rgba(0,0,0,0.65); background: #222; overflow: hidden; border-radius: 9px; }
.gc-dist::after { /* 20 visual sections */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to right,
    transparent 0, transparent calc(5% - 1px), rgba(0,0,0,0.55) calc(5% - 1px), rgba(0,0,0,0.55) 5%);
}
.gc-seg { height: 100%; background-size: auto 100%; background-repeat: repeat; background-position: center; image-rendering: pixelated; }
.gc-empty { background: linear-gradient(90deg, #333 0%, #222 100%); }
.gc-dist-legend { color: #ddd; text-shadow: 2px 2px 0 #000; font-size: 12px; margin-top: 6px; }

/* In-game board + stats layout */
.game-root {
  position: relative; width: 100%; height: 100%; overflow: hidden;
  --game-pad: clamp(12px, 3vw, 24px);
  background:
    radial-gradient(circle at 35% 25%, rgba(255,255,255,0.08), transparent 40%),
    radial-gradient(circle at 70% 60%, rgba(0,0,0,0.35), transparent 45%),
    #0c0f13;
  background-image:
    radial-gradient(circle at 35% 25%, rgba(255,255,255,0.08), transparent 40%),
    radial-gradient(circle at 70% 60%, rgba(0,0,0,0.35), transparent 45%);
  background-size: auto, auto;
  background-repeat: no-repeat, no-repeat;
  background-position: 0 0, 0 0;
  color: #e8e8e8; padding: var(--game-pad); box-sizing: border-box; display: flex; flex-direction: column; gap: 16px;
  min-height: 100vh;
}
.game-root::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url('/ui/gameBG.png') center/cover no-repeat;
  filter: blur(0px);
  transform: scale(1.02);
  z-index: 0;
  pointer-events: none;
}
.game-root > * { position: relative; z-index: 1; }
.game-root.spectator-view {
  padding-top: calc(clamp(12px, 3vw, 24px) + 96px);
}
@media (max-width: 640px) {
  .game-root.spectator-view {
    padding-top: calc(clamp(12px, 3vw, 24px) + 72px);
  }
}
.spectator-banner {
  margin-top: -8px;
}
.game-layout {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  justify-content: center;
  justify-items: center;
  align-items: center;
  align-content: center;
  gap: 24px;
  flex: 1;
  min-height: 0;
  max-width: 100%;
  margin: auto;
  width: 100%;
  padding-top: clamp(12px, 3vh, 28px);
  height: calc(100vh - var(--game-pad) * 2);
  max-height: calc(100vh - var(--game-pad) * 2);
}
.game-board-shell {
  position: relative;
  display: inline-flex;
  align-items: flex-start;
}
.game-left { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.game-left-stack { display: flex; flex-direction: column; gap: 10px; }
.game-left { justify-self: start; width: 100%; max-width: 320px; }
.game-spectrums {
  width: 100%;
}
.game-spectrums-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  max-height: min(520px, 72vh);
  overflow-y: auto;
  padding-right: 2px;
}
.game-spectrums-row {
  display: grid;
  grid-template-columns: repeat(var(--spec-cols, 1), auto);
  gap: 6px;
  justify-content: center;
  width: 100%;
}
.game-spectrum-card {
  padding: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.game-spectrum-grid {
  --s-cell: 6px;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 2px;
  background: rgba(0,0,0,0.35);
  border-radius: 6px;
}
.game-spectrum-row { display: grid; grid-template-columns: repeat(10, var(--s-cell)); gap: 0; 
  backdrop-filter: blur(6px);}
.game-spectrum-cell {
  width: var(--s-cell);
  height: var(--s-cell);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(0,0,0,0.4);
}
.game-spectrum-cell.filled {
  background: rgba(50,56,65,0.9);
  border: none;
}
.game-spectrum-name {
  color: #d9e4f2;
  font-size: 12px;
  font-weight: 600;
  text-shadow: 1px 1px 0 #000;
}
.game-spectrums-empty {
  font-size: 13px;
  color: #9da9b5;
  padding: 4px 6px;
}

.spectator-name-card {
  width: 100%;
  margin-top: 2px;
  padding: 6px 10px;
  background: transparent;
  /* border: 1px solid rgba(255,255,255,0.05); */
  /* border-radius: 10px; */
  /* box-shadow: 0 6px 14px rgba(0,0,0,0.25); */
  text-align: center;
}
.spectator-player-name {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #e6ecf5;
  font-weight: 600;
}
.spectator-view .spectator-card {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

@media (max-width: 1100px) {
  .game-layout {
    grid-template-columns: minmax(0, auto);
    grid-template-rows: auto auto;
    justify-items: center;
    align-items: start;
    gap: 16px;
  }
  .game-left {
    display: flex;
    width: min(420px, 94vw);
    justify-self: center;
  }
  .game-sidebar {
    width: min(440px, 94vw);
    justify-self: center;
  }
  .game-card-grid {
    grid-template-columns: 1fr;
  }
}
.game-board {
  --cell: clamp(
    28px,
    min(calc((100vh - 200px) / 20), calc((100vw - 48px) / 10)),
    56px
  );
  display: inline-flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
  background: rgba(0,0,0,0.4);
  border: 3px solid #000; border-radius: 8px;
  padding: 6px;
  width: auto; height: fit-content; margin: 0 auto;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.08),
    0 6px 16px rgba(0,0,0,0.55),
    0 0 0 1px rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
}
.game-float-panel {
  position: absolute;
  top: 0;
  right: -15px;
  transform: translateX(100%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  max-height: 80vh;
  overflow-y: auto;
  padding-right: 6px;
  background: transparent;
}
.game-grid {
  width: calc(var(--cell) * 10);
  height: calc(var(--cell) * 20);
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0 auto;
}
.game-row { display: grid; grid-template-columns: repeat(10, var(--cell)); }
.game-cell { width: var(--cell); height: var(--cell); border: 1px solid rgba(255,255,255,0.08); box-sizing: border-box; background: rgba(0,0,0,0.08); }
.game-cell.filled {
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.55);
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.game-board.eliminated::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  pointer-events: none;
}
.game-board-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.game-over-text {
  color: #f0d4d4;
  font-size: 28px;
  font-weight: 800;
  text-shadow: 2px 2px 0 #000;
}
.game-over-subtext {
  margin-top: 8px;
  color: #f5e8c7;
  font-size: 16px;
  font-weight: 600;
  text-shadow: 1px 1px 0 #000;
}
.game-cell.ghost { background: rgba(255,255,255,0.08); border: 1px dashed rgba(255,255,255,0.35); box-shadow: none; }
.game-shard-layer { pointer-events: none; position: fixed; inset: 0; z-index: 2147483647; overflow: visible; }
.game-shard {
  position: absolute;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  background: url('/blocks/Dirt.jpg') center/cover no-repeat;
  border: 1px solid rgba(0,0,0,0.35);
  box-shadow: 0 6px 10px rgba(0,0,0,0.4);
  border-radius: 3px;
  transform-origin: center;
  transition: transform 0.65s cubic-bezier(0.22, 0.61, 0.36, 1), opacity 0.55s ease;
  opacity: 0.95;
}
.game-shard.mat-dirt { background-image: url('/blocks/Dirt.jpg'); }
.game-shard.mat-stone { background-image: url('/blocks/Stone.jpeg'); }
.game-shard.mat-iron { background-image: url('/blocks/Iron.jpeg'); }
.game-shard.mat-diamond { background-image: url('/blocks/Diamond.jpg'); }
.game-shard.accelerate { opacity: 0.9; }
.game-shard.done { opacity: 0; transition-delay: 0ms !important; }
.game-bonus-badge {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(0,0,0,0.75);
  color: #f5e4b8;
  border: 1px solid rgba(0,0,0,0.8);
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.45);
  font-weight: 700;
  font-size: 14px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  pointer-events: none;
}
.game-bonus-badge.active {
  opacity: 1;
  transform: translateY(-4px);
}
.game-bonus-icon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.35);
  background-size: cover;
  background-position: center;
}
.game-collect-row.bonus-flash {
  animation: bonusFlash 0.5s ease;
}
@keyframes bonusFlash {
  0% { transform: translateX(0); color: #f5e4b8; }
  30% { transform: translateX(4px); color: #ffe9b5; }
  60% { transform: translateX(-2px); color: #fff7d1; }
  100% { transform: translateX(0); color: inherit; }
}
.game-sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-self: end;
  width: auto;
  max-width: 360px;
  align-items: center;
}
.game-card {
  background: rgba(18,18,18,0.7);
  border: 3px solid #000;
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.06),
    0 8px 18px rgba(0,0,0,0.55),
    0 0 0 1px rgba(0,0,0,0.6);
  backdrop-filter: blur(2px);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.game-card-grid {
  display: flex;
  gap: 8px;
  width: auto;
  justify-content: center;
  flex-wrap: wrap;
}
.game-card-two {
  min-width: 160px;
  max-width: 200px;
  width: auto;
  padding: 8px 12px;
}
.game-card-next {
  width: auto;
  padding: 10px 12px;
}
.game-card-collect {
  min-width: 170px;
  max-width: 210px;
}
.game-stat-label { font-size: 14px; color: #cfd8e3; }
.game-stat-value { font-size: 20px; font-weight: 700; color: #fff; text-shadow: 1px 1px 0 #000; }
.game-stat-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.game-next {
  width: 90px;
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  margin: 4px auto 0;
}
.game-next-row { display: flex; gap: 3px; }
.game-next-cell { width: 18px; height: 18px; border: 1px solid rgba(255,255,255,0.08); background: transparent; }
.game-next-cell.filled {
  background-size: cover;
  background-position: center;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.game-next-empty { font-size: 12px; color: #9da9b5; text-align: center; width: 100%; }
.game-collect { display: flex; flex-direction: column; gap: 4px; }
.game-collect-row { display: flex; align-items: center; justify-content: space-between; font-size: 14px; }
.game-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}
.game-footer-left,
.game-footer-right {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.game-footer-right { margin-left: auto; }
.game-footer .ui-btn,
.game-footer .ui-btn-wide {
  min-width: auto;
}
.game-footer-left { flex-direction: column; }
.game-card-settings { min-width: 240px; max-width: 320px; width: 100%; }
.game-settings-title { font-size: 14px; font-weight: 700; color: #f4f6fb; }
.game-settings-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.game-settings-label { font-size: 13px; color: #cfd8e3; }
.game-settings-select {
  background: #0f141b;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: #f0f4f8;
  padding: 9px 32px 9px 12px;
  min-width: 190px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 2l4 4 4-4' stroke='%23f0f4f8' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
}
.game-settings-select.mode-pvp { color: #e45c5c; }
.game-settings-select.mode-coop { color: #7ca6ff; }
.game-settings-select:disabled { opacity: 0.65; }
.game-settings-select option { color: #f0f4f8; }
.game-settings-select option[value="PvP"] { color: #e45c5c; }
.game-settings-select option[value="Cooperation"] { color: #7ca6ff; }
.game-settings-row-slider { flex-direction: column; align-items: stretch; }
.game-settings-row-slider .opt-slider.is-disabled { opacity: 0.65; }
.game-settings-notice { font-size: 12px; color: #ffb4b4; margin-top: 4px; }
.game-settings-float {
  position: absolute;
  left: var(--game-pad);
  bottom: calc(var(--game-pad) + 72px);
  z-index: 5;
  max-width: 340px;
}
@media (max-width: 800px) {
  .game-settings-float {
    left: 8px;
    right: 8px;
    bottom: 96px;
  }
}
.game-modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.65); display: flex; align-items: center; justify-content: center; z-index: 20; }
.game-modal { background: #151b24; border: 1px solid rgba(255,255,255,0.1); border-radius: 10px; padding: 16px; width: min(360px, 90vw); box-shadow: 0 14px 28px rgba(0,0,0,0.55); display: flex; flex-direction: column; gap: 10px; }
.game-modal-title { font-size: 18px; font-weight: 700; color: #fff; }
.game-modal-body { font-size: 14px; color: #cfd8e3; }
.game-modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
.game-modal-actions .ui-btn,
.game-modal-actions .ui-btn-wide,
.game-modal-actions .ui-btn-narrow { min-width: auto; padding-left: 14px; padding-right: 14px; }
.game-roster-modal { width: min(560px, 92vw); }
.game-roster-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.game-roster-section { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07); border-radius: 8px; padding: 10px; }
.game-roster-heading { font-size: 13px; font-weight: 700; letter-spacing: 0.3px; color: #e0e6ef; margin: 8px 0 6px; text-transform: uppercase; }
.game-roster-list { display: flex; flex-direction: column; gap: 6px; }
.game-roster-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 8px; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.05); border-radius: 6px; }
.game-roster-left { display: inline-flex; align-items: center; gap: 8px; }
.game-roster-name { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: #f4f6fb; }
.game-roster-name.is-eliminated .game-roster-text { text-decoration: line-through; opacity: 0.7; }
.game-roster-host { color: #ffd166; font-size: 13px; }
.game-roster-tag { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12); text-transform: capitalize; }
.game-roster-meta { display: inline-flex; align-items: center; gap: 8px; }
.game-roster-kick { background: linear-gradient(135deg, #3b1d1d, #2a0f0f); color: #ffb4b4; border: 1px solid rgba(255,80,80,0.35); border-radius: 50%; width: 26px; height: 26px; padding: 0; font-size: 16px; font-weight: 900; line-height: 1; cursor: pointer; transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease, background 0.12s ease; display: inline-flex; align-items: center; justify-content: center; }
.game-roster-kick:hover { transform: translateY(-1px) scale(1.05); box-shadow: 0 6px 14px rgba(0,0,0,0.35); border-color: rgba(255, 120, 120, 0.5); background: linear-gradient(135deg, #4a1c1c, #301010); }
.game-roster-kick:active { transform: translateY(0); }
.game-roster-tag.status-playing { color: #b6f7b1; background: rgba(45, 156, 90, 0.22); border-color: rgba(45, 156, 90, 0.4); }
.game-roster-tag.status-eliminated { color: #f0b4b4; background: rgba(156, 45, 45, 0.18); border-color: rgba(156, 45, 45, 0.4); }
.game-roster-tag.status-spectating { color: #c8e1ff; background: rgba(82, 129, 198, 0.2); border-color: rgba(82, 129, 198, 0.35); }
.game-roster-tag.status-waiting,
.game-roster-tag.status-unknown { color: #fce6b3; background: rgba(180, 136, 57, 0.2); border-color: rgba(180, 136, 57, 0.35); }
.game-roster-empty { color: #9da9b5; font-size: 13px; padding: 6px 4px; }
.game-card-roster { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; flex: 1 1 auto; min-height: 0; max-height: calc(100% - 24px); overflow-y: auto; padding-right: 6px; }
.game-roster-header { display: flex; justify-content: space-between; align-items: center; }
.game-roster-title { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; }
.game-roster-sub { font-size: 12px; color: #9da9b5; }
.game-roster-name.is-self { color: #7dd3fc; }
.game-kick-banner { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); background: linear-gradient(135deg, rgba(32, 39, 53, 0.95), rgba(24, 28, 38, 0.95)); color: #f6d7b0; padding: 10px 14px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.12); box-shadow: 0 10px 24px rgba(0,0,0,0.45); display: inline-flex; align-items: center; gap: 10px; z-index: 18; }
.game-kick-icon { font-size: 16px; }
.game-kick-text { font-size: 14px; }
.game-kick-text strong { color: #fff; }
.game-timer-float {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 9;
  min-width: 170px;
  width: auto;
  padding: 8px 12px;
}
