:root {
  --container: 1000px;
  --primary: #f50085;
  --secondary: #3795e2;
  --tertiary: #9de500;
  --quaternary: #bf7af0;
  --text: #222;
  --muted: #676174;
  --hud-blue: #2975e7;
  --hud-purple: #9b73ee;
  --font: Verdana, Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: #000;
}

body {
  background:
    url("/assets/site/background.png") center top / 1920px 630px no-repeat,
    #62cffe url("/assets/site/default-bg.png") repeat;
  color: var(--text);
  font: 12px var(--font);
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.navbar-tools {
  background: rgba(255, 255, 255, .92);
  border-bottom: 2px solid #59b9ff;
  min-height: 24px;
  position: relative;
  z-index: 5;
}

.navbar-tools__inner {
  align-items: center;
  display: flex;
  gap: .35rem;
  justify-content: center;
  margin: 0 auto;
  max-width: var(--container);
  min-height: 24px;
}

.navbar-tools__pill,
.navbar-tools__stat {
  background: #fff;
  border: 1px solid #d9e8ff;
  border-radius: 999px;
  color: #1683dd;
  display: inline-flex;
  font-weight: 700;
  line-height: 1;
  padding: .3rem .6rem;
  text-decoration: none;
}

.navbar-tools__pill {
  color: #2888ec;
}

button.navbar-tools__pill {
  appearance: none;
}

.navbar-tools__discord {
  background: #6d76ff;
  color: #fff;
}

.navbar-tools__stat--online {
  color: var(--primary);
}

.site-header {
  margin: 0 auto;
  max-width: var(--container);
  position: relative;
  z-index: 2;
}

.navbar-banner {
  height: 150px;
  position: relative;
}

.navbar-banner > img {
  display: block;
  height: 150px;
  object-fit: contain;
  width: 1000px;
}

.login-box {
  align-items: flex-start;
  display: flex;
  gap: .7rem;
  height: 100%;
  justify-content: flex-end;
  padding-top: 16px;
  position: absolute;
  right: 0;
  top: 0;
  width: 315px;
}

.login-avatar {
  background: rgba(255, 255, 255, .75);
  border: 2px solid #fff;
  border-radius: .45rem;
  object-fit: cover;
}

.login-form,
.player-summary {
  display: grid;
  gap: .28rem;
  width: 185px;
}

.login-form input {
  border: 0;
  border-radius: .15rem;
  box-shadow: inset 0 0 0 1px #ddd;
  height: 25px;
  padding: .25rem .45rem;
}

.login-form button,
.player-summary button,
.shop-grid button,
.skin-grid button,
.shop-highlight button {
  background: var(--primary);
  border: 0;
  color: #fff;
  font-weight: 700;
  min-height: 28px;
  padding: .35rem .7rem;
}

.login-form .link-button {
  background: transparent;
  color: #1683dd;
  min-height: auto;
  padding: 0;
  text-decoration: underline;
}

.player-summary {
  color: #1683dd;
  font-size: 12px;
}

.player-summary strong {
  color: #d50000;
  font-size: 21px;
}

.player-summary span {
  align-items: center;
  background: rgba(255, 255, 255, .78);
  border-radius: 999px;
  display: flex;
  gap: .25rem;
  min-height: 18px;
  padding: 0 .45rem;
}

.player-summary img {
  max-height: 16px;
}

.main-nav {
  align-items: stretch;
  background: var(--primary);
  border-radius: .45rem;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .22);
  display: flex;
  height: 42px;
  justify-content: center;
  margin-top: -16px;
  overflow: hidden;
}

.main-nav button {
  background: transparent;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, .22);
  color: #fff;
  flex: 1 0 auto;
  font-size: 13px;
  font-weight: 700;
  padding: 0 1rem;
  text-shadow: 0 1px rgba(0, 0, 0, .25);
}

.main-nav button:hover,
.main-nav button.is-active {
  background: #d90076;
}

.main-nav .btn-play,
.main-nav .btn-play.is-active {
  background: var(--tertiary);
}

.site-main {
  margin: 1rem auto 0;
  max-width: var(--container);
  position: relative;
  z-index: 1;
}

.flash-message {
  background: #fff3cd;
  border: 2px solid #ffc657;
  border-radius: .4rem;
  color: #805500;
  font-weight: 700;
  margin-bottom: .75rem;
  padding: .8rem;
}

.view {
  display: none;
}

.view.is-visible {
  display: block;
}

.columns {
  display: grid;
  gap: 1.35rem;
  grid-template-columns: minmax(0, 1fr) 235px;
}

.main-column,
.side-column {
  display: grid;
  gap: .9rem;
  align-content: start;
}

.box {
  border-radius: .45rem;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .12);
  overflow: hidden;
}

.box h2 {
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  margin: 0;
  padding: .7rem;
  text-transform: uppercase;
}

.box-primary h2 {
  background: var(--primary);
}

.box-secondary h2 {
  background: var(--secondary);
}

.box-quaternary h2 {
  background: var(--quaternary);
}

.box-content {
  background: rgba(255, 255, 255, .96);
  border: 2px solid currentColor;
  border-top: 0;
  color: var(--primary);
  min-height: 38px;
  padding: .75rem;
}

.box-secondary .box-content {
  color: var(--secondary);
}

.box-quaternary .box-content {
  color: var(--quaternary);
}

.box-content p {
  color: #222;
  margin: 0 0 .45rem;
}

.box-content .muted,
.muted {
  color: var(--muted);
}

.two-cols {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}

.shop-highlight .box-content {
  display: grid;
  gap: .55rem;
  justify-items: center;
  text-align: center;
}

.shop-highlight strong {
  color: var(--primary);
  font-size: 18px;
}

.ranking-table {
  border-collapse: collapse;
  color: #222;
  width: 100%;
}

.ranking-table td {
  border-bottom: 1px solid #eee;
  padding: .35rem;
}

.game-shell {
  background: #000;
  margin: 0 auto;
  max-width: 950px;
}

.game-screen {
  background: #a3dafd;
  height: 430px;
  overflow: hidden;
  position: relative;
}

#world {
  display: block;
  height: 430px;
  touch-action: none;
  width: 950px;
}

.perf-badge {
  background: rgba(255, 255, 255, .86);
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: .5rem;
  color: #315c8c;
  font-weight: 700;
  padding: .3rem .45rem;
  position: absolute;
  right: .45rem;
  top: .45rem;
}

.map-switcher {
  display: flex;
  gap: .35rem;
  left: .45rem;
  position: absolute;
  top: .45rem;
}

.map-switcher button {
  background: rgba(245, 0, 133, .86);
  border: 1px solid #fff;
  border-radius: .35rem;
  color: #fff;
  font-weight: 700;
  padding: .25rem .5rem;
}

.map-switcher button.is-active {
  background: var(--tertiary);
}

.game-hud {
  background: linear-gradient(90deg, var(--hud-blue), var(--hud-purple) 46%, #ff6fdd);
  border-top: 4px solid var(--primary);
  display: grid;
  gap: .35rem;
  grid-template-columns: 370px 145px 220px 200px;
  min-height: 130px;
  padding: .35rem;
}

.chat-panel,
.smiley-panel,
.inventory-panel,
.player-panel {
  background: #fff;
  border: 2px solid #ff8dde;
  border-radius: .45rem;
  overflow: hidden;
}

.chat-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 24px;
}

.chat-log {
  color: #00a000;
  line-height: 1.28;
  overflow: auto;
  padding: .35rem;
}

.chat-line {
  margin: 0;
}

.chat-line strong {
  color: #ca00ff;
}

.chat-line--system {
  color: var(--primary);
}

.chat-input {
  align-items: center;
  display: flex;
  gap: .35rem;
  padding: .2rem;
}

.chat-input input {
  border: 2px solid #a5caff;
  border-radius: 999px;
  flex: 1;
  min-width: 0;
  padding: .2rem .45rem;
}

.chat-input button {
  background: var(--primary);
  border: 0;
  border-radius: 999px;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: .3rem .6rem;
  text-transform: uppercase;
}

.smiley-panel {
  display: grid;
  gap: .2rem;
  grid-template-columns: repeat(5, 1fr);
  padding: .35rem;
}

.smiley-panel span {
  align-items: center;
  background: #ffe500;
  border: 2px solid #111;
  border-radius: 50%;
  display: inline-flex;
  font-size: 14px;
  font-weight: 700;
  justify-content: center;
}

.inventory-panel {
  display: grid;
  gap: .25rem;
  grid-template-columns: repeat(5, 1fr);
  padding: .35rem;
}

.slot {
  align-items: center;
  aspect-ratio: 1;
  background: #fff2fb;
  border: 2px solid #ff9cdf;
  border-radius: .3rem;
  color: #7b3ca3;
  display: inline-flex;
  font-size: 10px;
  font-weight: 700;
  justify-content: center;
  overflow: hidden;
  text-align: center;
}

.player-panel {
  align-items: center;
  color: #bb00e9;
  display: flex;
  gap: .5rem;
  padding: .45rem;
}

.player-panel img {
  background: #d9f7ff;
  border-radius: .35rem;
  object-fit: cover;
}

.player-panel div {
  display: grid;
  gap: .16rem;
}

.player-panel strong {
  color: #1978df;
  font-size: 14px;
}

.touch-controls {
  display: none;
}

.shop-grid,
.skin-grid {
  display: grid;
  gap: .75rem;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.shop-card,
.skin-card {
  background: #fff;
  border: 1px solid #e7d6f4;
  border-radius: .45rem;
  display: grid;
  gap: .45rem;
  justify-items: center;
  min-height: 150px;
  padding: .75rem;
  text-align: center;
}

.shop-card img,
.skin-card img {
  height: 86px;
  object-fit: contain;
  width: 86px;
}

.shop-card strong,
.skin-card strong {
  color: #222;
}

.skin-card.is-owned {
  border-color: var(--tertiary);
}

.skin-card.is-active {
  background: #f4ffe6;
  border-color: var(--primary);
}

.account-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 230px minmax(0, 1fr);
}

[data-console-log] {
  background: #1a1424;
  border-radius: .35rem;
  color: #b7ff89;
  min-height: 260px;
  overflow: auto;
  padding: .75rem;
}

.status-grid {
  display: grid;
  gap: .75rem;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  margin-top: .75rem;
}

.status-grid article {
  background: linear-gradient(145deg, #fff, #fbf4ff);
  border: 1px solid #ead4ff;
  border-radius: .65rem;
  box-shadow: 0 8px 18px rgba(88, 35, 126, .08);
  display: grid;
  gap: .25rem;
  min-height: 82px;
  padding: .8rem;
}

.status-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.status-grid strong {
  color: #2b2145;
  font-size: 24px;
  line-height: 1;
}

.site-footer {
  align-items: center;
  background: #f3f3f3;
  border-top: 16px solid var(--primary);
  display: grid;
  gap: .65rem;
  justify-items: center;
  margin-top: 2rem;
  min-height: 170px;
  padding: 1rem;
  text-align: center;
}

.site-footer > img {
  height: auto;
  max-width: min(742px, 96vw);
}

.site-footer p {
  margin: .2rem 0 0;
}

@media (max-width: 1020px) {
  .site-header,
  .site-main,
  .navbar-tools__inner {
    max-width: 950px;
  }

  .navbar-banner {
    height: auto;
  }

  .navbar-banner > img {
    height: auto;
    width: 100%;
  }

  .login-box {
    transform: scale(.92);
    transform-origin: top right;
  }

  .main-nav {
    justify-content: flex-start;
    margin-inline: .35rem;
    overflow-x: auto;
  }

  .main-nav button {
    flex: 0 0 auto;
    min-width: max-content;
  }

  .game-shell {
    overflow: hidden;
  }

  .game-screen,
  #world {
    height: auto;
    max-width: 100%;
  }

  #world {
    aspect-ratio: 950 / 430;
  }

  .game-hud {
    grid-template-columns: minmax(260px, 1fr) 145px minmax(180px, .8fr);
  }

  .player-panel {
    display: none;
  }
}

@media (max-width: 760px) {
  body {
    background-size: 1320px 433px, 64px 64px;
  }

  .navbar-tools__inner {
    justify-content: flex-start;
    overflow-x: auto;
    padding-inline: .35rem;
  }

  .login-box {
    background: rgba(255, 255, 255, .86);
    border-radius: .35rem;
    height: auto;
    margin: .35rem;
    padding: .35rem;
    position: static;
    transform: none;
    width: auto;
  }

  .login-avatar {
    height: 58px;
    width: 58px;
  }

  .login-form,
  .player-summary {
    width: 100%;
  }

  .main-nav {
    margin-top: .35rem;
  }

  .site-main {
    margin-top: .5rem;
    padding-inline: .35rem;
  }

  .columns,
  .account-grid {
    grid-template-columns: 1fr;
  }

  .side-column {
    display: none;
  }

  .game-hud {
    grid-template-columns: 1fr;
  }

  .smiley-panel,
  .inventory-panel {
    display: none;
  }
}

@media (orientation: landscape) and (hover: none) and (pointer: coarse) {
  .navbar-tools,
  .navbar-banner,
  .site-footer,
  .view:not(.view--game) {
    display: none;
  }

  .main-nav {
    border-radius: 0;
    height: 36px;
    margin: 0;
  }

  .site-main {
    margin-top: 0;
    max-width: 100vw;
    padding: 0;
  }

  .game-shell {
    max-width: 100vw;
  }

  .game-screen {
    height: calc(100vh - 146px);
    min-height: 300px;
  }

  #world {
    height: 100%;
    width: 100%;
  }

  .game-hud {
    grid-template-columns: minmax(240px, 1fr) 140px 180px;
    min-height: 110px;
  }

  .touch-controls {
    bottom: .8rem;
    display: grid;
    gap: .35rem;
    grid-template-areas:
      ". up ."
      "left down right";
    grid-template-columns: repeat(3, 3.2rem);
    grid-template-rows: repeat(2, 3.2rem);
    left: .8rem;
    position: absolute;
    z-index: 4;
  }

  .touch-controls button {
    background: rgba(190, 0, 120, .86);
    border: 2px solid rgba(255, 255, 255, .86);
    border-radius: .85rem;
    color: #fff;
    font-size: 1.55rem;
    font-weight: 700;
  }

  .touch-controls button[data-dir="up"] { grid-area: up; }
  .touch-controls button[data-dir="left"] { grid-area: left; }
  .touch-controls button[data-dir="down"] { grid-area: down; }
  .touch-controls button[data-dir="right"] { grid-area: right; }
}
