:root {
  --bg: #0a111d;
  --panel: #111c2a;
  --panel2: #17263a;
  --line: #263d56;
  --text: #edf5ff;
  --muted: #91a5ba;
  --green: #64c7ff;
  --green2: #348fc5;
  --blue: #8bd3ff;
  --gold: #f0c873;
  --red: #f27670;
  --radius: 12px;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  scroll-padding-top: 120px;
}

html {
  background: var(--bg);
}

body {
  background:
    linear-gradient(180deg, #08111bd9 0%, #091522ed 42%, #091421f5 100%),
    url("/gambel-banner.jpg") center 50px / min(100vw, 1280px) auto no-repeat fixed,
    url("/voxel-world.svg") center 38% / cover fixed no-repeat,
    var(--bg);
  color: var(--text);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid #8bd3ff;
  outline-offset: 3px;
}

.topbar {
  height: 72px;
  gap: 24px;
  padding-inline: clamp(14px, 3vw, 42px);
  border-color: #293d52;
  background: #0a1320ed;
  box-shadow: 0 8px 26px #02071155;
  backdrop-filter: blur(18px);
}

.brand {
  gap: 11px;
  font-family: "Arial Black", "Trebuchet MS", sans-serif;
  font-size: 17px;
  letter-spacing: .8px;
}

.brand-mark {
  border: 1px solid #8bd3ff;
  border-radius: 9px;
  background: linear-gradient(145deg, #4aabe1, #205d91);
  box-shadow: 0 5px 16px #2c9cda42, inset 0 1px #ffffff55;
  transform: none;
}

.brand-mark i {
  border: 0;
  background: #d8f2ff;
}

.brand-accent {
  color: #8bd3ff;
}

.main-nav,
.top-actions {
  gap: 7px;
}

.nav-link {
  border-radius: 8px;
  color: #b6c8d9;
  font-size: 12px;
}

.nav-link:hover,
.nav-link.active {
  border-color: #355b79;
  background: #142a40;
  color: #a7deff;
}

.nav-glyph {
  border-color: #355775;
  border-radius: 5px;
  background: #172d43;
  color: #8bd3ff;
}

.balance-pill,
.profile-button {
  border-color: #2a435d;
  border-radius: 9px;
  background: #111e2d;
}

.profile-button {
  min-width: 142px;
}

.avatar {
  border-color: #3d6382;
  border-radius: 7px;
  background: #0c1724;
}

.button {
  min-height: 39px;
  border-radius: 8px;
  box-shadow: 0 3px 0 #07101a, 0 7px 16px #0002;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 11px;
  letter-spacing: .4px;
  text-transform: uppercase;
}

.button-green {
  border: 1px solid #82d3ff;
  background: linear-gradient(180deg, #70caff, #3e9bd2);
  color: #071724;
  box-shadow: 0 3px 0 #1d5e86, 0 7px 18px #3ea7e32b;
}

.button-muted {
  border: 1px solid #304a63;
  background: #17283a;
  color: #d7e8f7;
  box-shadow: 0 3px 0 #0a1420;
}

.button-outline {
  border-color: #4a8fba;
  color: #a8ddff;
}

.subnav {
  height: 34px;
  padding-inline: clamp(14px, 3vw, 42px);
  border-color: #1d3043;
  background: #0c1724e8;
  color: #9fb3c7;
}

.subnav a {
  color: #b8d7ed;
}

.live-dot,
.online-count i,
.server-chip i {
  box-shadow: 0 0 0 3px #4fc98c1a, 0 0 12px #4fc98c;
}

.layout {
  max-width: 1680px;
  grid-template-columns: 252px minmax(0, 1fr);
  gap: 20px;
  padding: 24px clamp(14px, 3vw, 42px);
}

.chat-panel {
  top: 122px;
  height: calc(100vh - 146px);
  min-height: 520px;
  border-color: #273d54;
  border-radius: 13px;
  background: #0b1420ed;
  box-shadow: 0 12px 32px #0003;
  backdrop-filter: blur(14px);
}

.panel-heading {
  border-color: #263d53;
  background: #122236;
  color: #d5e7f6;
}

.panel-heading > span:first-child::before {
  color: #74caff;
  content: "◆ ";
  font-size: 8px;
}

.online-list,
.chat-compose {
  border-color: #22374b;
}

.online-name,
.chat-message,
.chat-compose input {
  border: 1px solid #263d52;
  border-radius: 7px;
  background: #111f2f;
}

.online-name {
  color: #c9e6fa;
}

.chat-message {
  padding: 9px 10px;
  box-shadow: inset 0 1px #ffffff05;
}

.chat-message strong {
  color: #8bd3ff;
  font-family: "Trebuchet MS", sans-serif;
  text-shadow: none;
}

.chat-message strong::before,
.chat-message strong::after {
  content: none;
}

.chat-message span {
  color: #e2edf6;
}

.chat-compose input {
  min-height: 38px;
}

.icon-button {
  border-radius: 7px;
  background: #3c9bd1;
  color: #071724;
}

main {
  min-width: 0;
}

.hero-card {
  min-height: 300px;
  height: 300px;
  border: 1px solid #355875;
  border-radius: 16px;
  background: #0b1928;
  box-shadow: 0 16px 38px #0005, inset 0 1px #ffffff14;
}

.hero-card::before {
  z-index: 1;
  background:
    linear-gradient(90deg, #08131ff7 0%, #08131fe8 35%, #08131f7a 62%, #08131f0d 100%),
    linear-gradient(0deg, #08131fa8, transparent 48%);
}

.hero-card::after {
  z-index: 2;
  border: 0;
  background:
    linear-gradient(90deg, transparent 49%, #a7dcff0c 50%, transparent 51%),
    linear-gradient(0deg, transparent 49%, #a7dcff0a 50%, transparent 51%);
  background-size: 32px 32px;
  pointer-events: none;
}

.hero-copy {
  z-index: 3;
  width: min(68%, 680px);
  padding: 36px clamp(22px, 4vw, 54px);
}

.eyebrow {
  color: #85cdf8;
  font-size: 9px;
  letter-spacing: 1.4px;
}

.hero-copy h1,
.section-heading h2,
.game-title-row h3,
.info-card h3,
.server-game-card h3,
.modal-card h2 {
  font-family: "Arial Black", "Trebuchet MS", sans-serif;
  font-weight: 900;
  letter-spacing: -.5px;
  text-shadow: 0 2px 10px #0005;
}

.hero-copy h1 {
  margin: 18px 0 11px;
  font-size: clamp(32px, 4vw, 52px);
  line-height: .99;
}

.hero-copy h1 span {
  color: #83cfff;
}

.hero-copy p {
  max-width: 460px;
  color: #c0d0dd;
  font-size: 12px;
  line-height: 1.7;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 24px;
  min-height: 42px;
  border-radius: 9px;
}

.hero-art {
  inset: 0;
  opacity: 1;
  overflow: hidden;
}

.hero-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 63%;
  image-rendering: pixelated;
}

.hero-scene-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #07121b28, transparent 58%), linear-gradient(0deg, #07121b30, transparent 45%);
}

.hero-scene-tag {
  right: 18px;
  bottom: 17px;
  border: 1px solid #91d9ff67;
  border-radius: 6px;
  background: #071724d9;
  color: #d0edff;
}

.catalog-section,
.game-section,
.server-games-section {
  scroll-margin-top: 120px;
}

.catalog-section {
  margin: 18px 0 31px;
}

.section-heading {
  align-items: end;
  margin-bottom: 14px;
}

.section-heading h2 {
  margin: 5px 0 0;
  font-size: clamp(20px, 2vw, 25px);
}

.catalog-filters {
  display: flex;
  gap: 5px;
  padding: 4px;
  border: 1px solid #263e56;
  border-radius: 10px;
  background: #0e1926;
}

.catalog-filters button {
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #9db1c5;
  font-size: 10px;
  font-weight: 800;
}

.catalog-filters button:hover,
.catalog-filters button.active {
  background: #1c3c58;
  color: #ccecff;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.catalog-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #29415a;
  border-radius: 15px;
  background: linear-gradient(155deg, #17283b, #101b29);
  box-shadow: 0 10px 24px #0003;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.catalog-card:hover {
  transform: translateY(-3px);
  border-color: #65addb;
  box-shadow: 0 12px 26px #0004, 0 0 0 1px #65addb22;
}

.category-card {
  display: block;
  padding: 8px;
  color: inherit;
  text-align: left;
}

.category-preview {
  position: relative;
  height: clamp(180px, 22vw, 290px);
  display: block;
  overflow: hidden;
  border: 1px solid #34516e;
  border-radius: 10px;
  background: #0c1724;
}

.category-preview::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, #07111b66, transparent 45%);
  content: "";
  pointer-events: none;
}

.category-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform .35s ease, filter .2s ease;
}

.category-card:hover .category-preview img {
  transform: scale(1.035);
  filter: brightness(1.08);
}

.catalog-card-info {
  min-height: 72px;
  padding: 14px 12px 10px;
  background: transparent;
}

.catalog-card-info > span {
  flex: 1;
}

.catalog-card-info b {
  color: #eff7ff;
  font-size: 17px;
}

.catalog-card-info small {
  color: #92a9be;
  font-size: 10px;
  line-height: 1.5;
  white-space: normal;
}

.catalog-card-info i {
  align-self: center;
  border: 1px solid #355b79;
  border-radius: 7px;
  background: #17314a;
  padding: 7px 9px;
  color: #a7deff;
  font-size: 8px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.game-section {
  margin-top: 27px;
}

.server-chip {
  max-width: 52%;
  border: 1px solid #315875;
  border-radius: 20px;
  background: #102236;
  padding: 8px 11px;
  color: #b1ddf8;
  font-size: 9px;
  text-transform: uppercase;
}

.game-tabs {
  gap: 10px;
}

.game-tab {
  min-height: 66px;
  border: 1px solid #2c455e;
  border-radius: 11px;
  background: #111e2c;
  box-shadow: 0 5px 14px #0002;
}

.game-tab:hover {
  border-color: #60a6d4;
  background: #172b40;
}

.game-tab.active {
  border-color: #68b7e9;
  border-radius: 11px;
  background: linear-gradient(100deg, #193b56, #13273b);
  box-shadow: inset 3px 0 #77cbff, 0 5px 14px #0002;
}

.tab-icon,
.game-title-icon,
.server-game-icon {
  border: 1px solid #3d6c8e;
  border-radius: 9px;
  background: #19354d;
  color: #9bd9ff;
}

.tab-icon {
  width: 38px;
  height: 38px;
}

.chicken-icon {
  background: #29364a;
  color: #f3d37e;
}

.game-tab b {
  color: #eaf5ff;
  font-size: 13px;
}

.game-tab small {
  color: #9cb1c6;
  font-size: 10px;
}

.tab-arrow {
  color: #8bd1ff;
}

.game-workspace {
  grid-template-columns: minmax(220px, 270px) minmax(0, 1fr);
  gap: 16px;
  margin-top: 12px;
  padding: 16px;
  border: 1px solid #293f57;
  border-radius: 14px;
  background: #0d1825f5;
  box-shadow: 0 10px 28px #0003;
}

.game-controls {
  padding: 5px;
}

.game-title-row {
  margin-bottom: 20px;
}

.game-title-icon {
  width: 38px;
  height: 38px;
  font-size: 17px;
}

.game-title-row h3 {
  font-size: 17px;
}

.game-subtitle,
.small-note {
  color: #96abc0;
}

.field-label {
  color: #afc5da;
  letter-spacing: .8px;
}

.bet-input-row,
select,
#auth-form input {
  border: 1px solid #304b67;
  border-radius: 8px;
  background: #0a1521;
}

.bet-input-row {
  min-height: 42px;
}

.bet-input-row input {
  color: #f3f9ff;
}

.bet-input-row button,
.quick-bets button {
  border: 1px solid #304b67;
  border-radius: 6px;
  background: #192d42;
  color: #cbe7f8;
}

.bet-input-row button:hover,
.quick-bets button:hover {
  border-color: #71c5fa;
  background: #1d405c;
}

select {
  color: #e4f2ff;
}

.game-summary {
  border: 1px solid #2b435c;
  border-radius: 9px;
  background: #111f2e;
}

.game-summary strong,
.game-summary .accent-text {
  color: #91d3ff;
}

.main-game-button {
  min-height: 43px;
  border-radius: 9px;
}

.board-wrap {
  min-height: 390px;
  border: 1px solid #2e4a64;
  border-radius: 12px;
  background-color: #0b1724;
  background-image:
    linear-gradient(90deg, #85cfff0a 1px, transparent 1px),
    linear-gradient(#85cfff0a 1px, transparent 1px),
    radial-gradient(ellipse at center, #1b3045, #101925 78%);
  box-shadow: inset 0 1px #ffffff0a;
}

.board-topline {
  border-color: #2b465e;
  color: #c1d9e9;
}

.round-status {
  border: 1px solid #355973;
  border-radius: 20px;
  background: #12283a;
  color: #9dd8fc;
}

.mine-cell {
  border: 1px solid #416786;
  border-radius: 9px;
  background: linear-gradient(145deg, #294a63, #152d43);
  box-shadow: 0 4px 0 #09131d, inset 0 1px #d5f0ff16;
}

.mine-cell:hover:not(:disabled) {
  border-color: #9cddff;
  background: #2d6388;
}

.mine-cell.safe {
  border-color: #64bbef;
  background: linear-gradient(135deg, #2885bd, #15547d);
}

.mine-cell.mine {
  border-color: #ef8175;
  background: linear-gradient(135deg, #a9494c, #5d2935);
}

.board-caption {
  border-color: #29445c;
  color: #9db4c6;
}

.chicken-board {
  width: min(100%, 900px);
  overflow-x: auto;
  scrollbar-color: #4a89b3 #0b1925;
  scrollbar-width: thin;
}

.road-sign {
  border: 1px solid #3a5a73;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

.road-curb {
  border-radius: 0 0 8px 8px;
}

.lower-grid {
  gap: 12px;
  margin: 18px 0 32px;
}

.info-card {
  padding: 18px;
  border: 1px solid #2c425a;
  border-radius: 13px;
  background: linear-gradient(145deg, #182638, #121c29);
  box-shadow: 0 8px 24px #0002;
}

.info-card h3 {
  color: #eef7ff;
}

.info-card p,
.profile-summary p {
  color: #a5b8ca;
  line-height: 1.65;
}

.profile-head {
  border-color: #4b7899;
  border-radius: 9px;
}

.safe-chip i {
  background: #64bfff;
  box-shadow: 0 0 9px #64bfff80;
}

.games-menu {
  border-color: #34516e;
  border-radius: 12px;
  background: #142235;
  box-shadow: 0 20px 55px #000a;
}

.menu-game {
  border-radius: 8px;
}

.menu-game-glyph {
  border-radius: 7px;
}

.modal-card {
  border-color: #365a7a;
  border-radius: 14px;
  background: linear-gradient(145deg, #1c2d40, #121d2b);
}

.modal-close {
  border-radius: 50%;
}

.auth-switch {
  border-radius: 8px;
}

.auth-switch button {
  border-radius: 6px;
}

#auth-form input,
.command-box {
  border-radius: 8px;
}

.auth-challenge {
  margin-top: 14px;
}

.auth-challenge .command-box {
  margin: 8px 0 10px;
  border-color: #477da1;
  background: #0c1a28;
  color: #a9e0ff;
  font-size: 13px;
  text-align: center;
}

.toast {
  border-color: #365a7a;
  border-radius: 9px;
  background: #182b3d;
  color: #e0f2ff;
}

.toast.error {
  border-color: #724045;
  background: #352126;
}

#game-workspace,
#rewards,
#fairness,
#chat {
  scroll-margin-top: 120px;
}

@media (max-width: 1200px) {
  .layout {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 15px;
  }

  .catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .topbar {
    top: 0;
  }

  .subnav {
    top: 0;
  }

  .layout {
    display: flex;
    flex-direction: column;
    padding: 15px;
  }

  .layout > main {
    order: 1;
  }

  .layout > .chat-panel {
    order: 2;
    width: 100%;
    height: 300px;
    min-height: 0;
    margin: 16px 0 0;
  }

  .hero-card {
    height: 270px;
    min-height: 270px;
  }

  .hero-copy {
    width: 72%;
  }

  .game-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .game-controls {
    order: 2;
  }

  .board-wrap {
    order: 1;
    min-height: 330px;
  }

  .mines-board {
    width: min(100%, 390px);
  }

}

@media (max-width: 560px) {
  :root {
    scroll-padding-top: 100px;
  }

  .topbar {
    height: auto;
    min-height: 58px;
    padding: 7px 10px;
  }

  .brand {
    gap: 7px;
    font-size: 13px;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
  }

  .main-nav {
    order: 3;
    flex: 0 0 100%;
    width: 100%;
  }

  .top-actions {
    gap: 4px;
    margin-left: auto;
  }

  .top-actions .button {
    width: 32px;
    min-width: 32px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    overflow: hidden;
    font-size: 0;
  }

  .top-actions .button-glyph {
    font-size: 14px;
  }

  .balance-pill {
    height: 34px;
    padding: 0 7px;
    font-size: 10px;
  }

  .balance-pill small,
  .profile-button small {
    display: none;
  }

  .profile-button {
    min-width: 38px;
    width: 38px;
    height: 36px;
    display: block;
    overflow: hidden;
    padding: 2px;
  }

  .profile-button > span:not(.avatar) {
    display: none;
  }

  .profile-button .avatar {
    width: 30px;
    height: 30px;
  }

  .subnav {
    height: 31px;
    padding-inline: 10px;
  }

  .subnav a:first-of-type {
    display: none;
  }

  .layout {
    gap: 0;
    padding: 10px;
  }

  .games-menu {
    position: fixed;
    top: 95px;
    left: 10px;
    width: calc(100vw - 20px);
    max-height: 66vh;
  }

  .menu-category {
    grid-template-columns: 1fr;
  }

  .menu-category h2 {
    grid-column: 1;
  }

  .hero-card {
    height: 224px;
    min-height: 224px;
  }

  .hero-art {
    left: 38%;
    opacity: .58;
  }

  .hero-copy {
    width: 90%;
    padding: 22px 18px;
  }

  .hero-copy h1 {
    margin-top: 14px;
    font-size: clamp(24px, 7vw, 29px);
  }

  .hero-copy p {
    max-width: 300px;
    font-size: 10px;
  }

  .hero-scene-tag {
    right: 8px;
    bottom: 8px;
    padding: 5px 7px;
    font-size: 7px;
  }

  .section-heading {
    align-items: flex-start;
    gap: 8px;
  }

  .section-heading h2 {
    font-size: 19px;
  }

  .catalog-filters {
    gap: 2px;
  }

  .catalog-filters button {
    min-height: 27px;
    padding-inline: 8px;
    font-size: 9px;
  }

  .catalog-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .category-card {
    padding: 6px;
  }

  .category-preview {
    height: clamp(180px, 64vw, 250px);
  }

  .catalog-card-info {
    min-height: 65px;
    padding: 11px 9px 7px;
  }

  .catalog-card-info b {
    font-size: 15px;
  }

  .catalog-card-info small {
    max-width: 230px;
    font-size: 9px;
  }

  .server-chip {
    max-width: 48%;
    padding: 6px 8px;
    font-size: 8px;
    line-height: 1.4;
  }

  .game-tabs {
    gap: 6px;
  }

  .game-tab {
    gap: 7px;
    min-height: 60px;
    padding: 8px 7px;
  }

  .game-tab small {
    font-size: 8px;
  }

  .tab-icon {
    width: 30px;
    height: 30px;
  }

  .game-workspace {
    gap: 8px;
    padding: 9px;
  }

  .mines-board {
    gap: 5px;
  }

  .mine-cell {
    border-radius: 8px;
    font-size: 17px;
  }

  .board-wrap {
    min-height: 290px;
    padding: 9px;
  }

  .board-caption {
    gap: 8px;
    font-size: 8px;
  }

  .lower-grid {
    grid-template-columns: 1fr;
  }

  .info-card {
    padding: 14px;
  }

  .chat-panel {
    height: 260px;
    margin-top: 12px;
  }

  .modal-card {
    padding: 22px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
