/* miniman: the page around the game, in the colours of nimaltd.com. */

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #071226;
  color: #e8f1ff;
  font: 15px/1.5 Inter, system-ui, sans-serif;
}

canvas {
  display: block;
  width: 100vw;
  height: 100vh;
  outline: none;
}

.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow-y: auto;
  background: rgba(7, 18, 38, .55);
  backdrop-filter: blur(3px);
}

.panel {
  width: min(460px, 100%);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border: 1px solid rgba(125, 211, 252, .3);
  border-radius: 16px;
  background: rgba(12, 28, 56, .95);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
}

.trio { width: 100%; height: auto; margin-bottom: -8px; }

h1, h2 {
  margin: 0;
  font: 700 40px/1.1 Outfit, system-ui, sans-serif;
  text-align: center;
}

h2 { font-size: 32px; }

.lead {
  margin: -10px 0 0;
  text-align: center;
  color: #9db2cf;
}

.modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: -4px;
}

.mode {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid rgba(125, 211, 252, .3);
  border-radius: 10px;
  background: #071226;
  color: #e8f1ff;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.mode b {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 600 16px Outfit, system-ui, sans-serif;
}

.mode span {
  font-size: 13px;
  line-height: 1.4;
  color: #9db2cf;
}

.mode em {
  padding: 1px 7px;
  border: 1px solid #f59e0b;
  border-radius: 999px;
  font: 500 11px 'Fira Code', ui-monospace, monospace;
  font-style: normal;
  color: #f59e0b;
  text-transform: uppercase;
}

.mode[aria-checked="true"] {
  border-color: #38bdf8;
  box-shadow: inset 0 0 0 1px #38bdf8;
  background: rgba(56, 189, 248, .08);
}

.note {
  padding: 14px 16px;
  border: 1px dashed rgba(125, 211, 252, .3);
  border-radius: 10px;
  color: #c7d6ea;
  font-size: 14.5px;
}

.note p { margin: 0; }
.note p + p { margin-top: 8px; color: #9db2cf; }

.local {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.trio-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label, .label {
  font: 500 12px 'Fira Code', ui-monospace, monospace;
  color: #9db2cf;
  text-transform: uppercase;
  letter-spacing: .06em;
}

input, select {
  height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(125, 211, 252, .3);
  border-radius: 8px;
  background: #071226;
  color: #e8f1ff;
  font: 15px Inter, system-ui, sans-serif;
}

input:focus, select:focus, button:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 1px;
}

.names {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.name-row {
  position: relative;
  display: flex;
  align-items: center;
}

.name-row .dot {
  position: absolute;
  left: 12px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.name-row input {
  width: 100%;
  padding-left: 32px;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.btn {
  height: 50px;
  border: 0;
  border-radius: 10px;
  background: #f59e0b;
  color: #1a1205;
  font: 600 17px Outfit, system-ui, sans-serif;
  cursor: pointer;
}

.btn:hover { background: #fbbf24; }

.keys {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 13px;
  color: #9db2cf;
}

kbd {
  display: inline-block;
  min-width: 22px;
  margin-right: 3px;
  padding: 1px 6px;
  border: 1px solid rgba(125, 211, 252, .3);
  border-radius: 5px;
  font: 500 12px 'Fira Code', ui-monospace, monospace;
  color: #e8f1ff;
  text-align: center;
}

.mute {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(125, 211, 252, .3);
  border-radius: 10px;
  background: rgba(7, 18, 38, .8);
  color: #e8f1ff;
  cursor: pointer;
}

.mute svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mute .off, .mute.off .on { display: none; }
.mute.off .off { display: block; }

/* The poster before a game: the picture fills the screen, the name over it,
   the keys at the side, and how long until the first turn at the bottom. */
.poster {
  position: fixed;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  background: #0a1430;
  animation: poster-in .5s ease-out;
}

@keyframes poster-in {
  from { opacity: 0; transform: scale(1.03); }
}

.poster canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.poster-head {
  position: absolute;
  top: 6vh;
  left: 0;
  right: 0;
  text-align: center;
  pointer-events: none;
  text-shadow: 0 4px 24px rgba(5, 8, 20, .55);
}

.poster-kicker {
  margin: 0;
  font: 500 13px 'Fira Code', ui-monospace, monospace;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: #fde68a;
}

.poster-title {
  margin: 6px 0 10px;
  font: 700 clamp(56px, 10vw, 128px)/1 Outfit, system-ui, sans-serif;
  letter-spacing: -.02em;
  color: #fff;
  -webkit-text-stroke: 2px rgba(10, 20, 48, .35);
  animation: poster-title 1s cubic-bezier(.2, .9, .3, 1.3);
}

@keyframes poster-title {
  from { opacity: 0; transform: translateY(-18px) scale(.92); }
}

.poster-teams {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 6px 12px;
  margin: 0;
  padding: 0 16px;
  font: 700 clamp(18px, 2.4vw, 26px) Outfit, system-ui, sans-serif;
}

.poster-teams i {
  font: 500 13px 'Fira Code', ui-monospace, monospace;
  font-style: normal;
  color: rgba(232, 241, 255, .7);
  text-transform: uppercase;
}

.poster-keys {
  position: absolute;
  right: 4vw;
  top: 57%;
  transform: translateY(-50%);
  width: 420px;
  padding: 20px 22px;
  border: 1px solid rgba(125, 211, 252, .35);
  border-radius: 16px;
  background: rgba(7, 18, 38, .78);
  backdrop-filter: blur(6px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
  animation: poster-keys .7s .25s ease-out both;
}

@keyframes poster-keys {
  from { opacity: 0; transform: translate(24px, -50%); }
}

.poster-keys h2 {
  margin: 0 0 12px;
  font: 500 12px 'Fira Code', ui-monospace, monospace;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-align: left;
  color: #7dd3fc;
}

.poster-keys dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 9px 14px;
  align-items: center;
  margin: 0;
}

.poster-keys dt { white-space: nowrap; }
.poster-keys dd { margin: 0; font-size: 14px; color: #c7d6ea; }

.poster-foot {
  position: absolute;
  left: 4vw;
  right: 4vw;
  bottom: 4vh;
  display: flex;
  align-items: center;
  gap: 18px;
}

.poster-count {
  font: 500 13px 'Fira Code', ui-monospace, monospace;
  color: #e8f1ff;
  white-space: nowrap;
}

.poster-count b { display: inline-block; min-width: 1ch; color: #fde68a; }

.poster-bar {
  flex: 1;
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .18);
  overflow: hidden;
}

.poster-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #fde68a);
  transform-origin: left;
  transform: scaleX(0);
}

.poster-go {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 16px;
  font-size: 15px;
}

.poster-go kbd { border-color: rgba(26, 18, 5, .35); color: #1a1205; }

@media (max-width: 900px) {
  .poster-keys {
    top: auto;
    right: 50%;
    bottom: calc(4vh + 64px);
    transform: translateX(50%);
    width: min(440px, 92vw);
    padding: 14px 16px;
    animation: none;
  }
  .poster-keys dl { gap: 6px 14px; }
  .poster-keys dd { font-size: 13px; }
  .poster-keys h2 { display: none; }
}

@media (max-height: 640px) and (min-width: 901px) {
  .poster-keys { padding: 14px 18px; }
  .poster-keys dl { gap: 6px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .poster, .poster-title, .poster-keys { animation: none; }
}

/* Before the first click the poster waits, its button gently pulsing. */
.poster-tap {
  margin: 0 auto;
  height: 52px;
  padding: 0 28px;
  font-size: 17px;
  box-shadow: 0 0 0 0 rgba(245, 158, 11, .5);
  animation: tap 1.6s ease-out infinite;
}

@keyframes tap {
  70% { box-shadow: 0 0 0 16px rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* The menu button, top left, as the sound button is top right. */
.menu-btn {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(125, 211, 252, .3);
  border-radius: 10px;
  background: rgba(7, 18, 38, .8);
  color: #e8f1ff;
  cursor: pointer;
}

.menu-btn:hover, .mute:hover { border-color: #38bdf8; }

.menu-btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.btn.ghost {
  background: transparent;
  border: 1px solid rgba(125, 211, 252, .35);
  color: #e8f1ff;
}

.btn.ghost:hover { background: rgba(56, 189, 248, .1); border-color: #38bdf8; }

.menu-panel { width: min(440px, 100%); }
.menu-actions { display: grid; gap: 10px; }
.menu-sure { padding: 14px; border: 1px solid rgba(245, 158, 11, .5); border-radius: 12px; background: rgba(245, 158, 11, .08); }
.menu-sure p { margin: 0 0 10px; color: #fde68a; text-align: center; }

.menu-keys h3 {
  margin: 4px 0 10px;
  font: 500 12px 'Fira Code', ui-monospace, monospace;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #7dd3fc;
}

.menu-keys dl, .poster-keys dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 7px 14px;
  align-items: center;
  margin: 0;
}

.menu-keys dt, .poster-keys dt { white-space: nowrap; font-size: 13px; color: #9db2cf; }
.menu-keys dd { margin: 0; font-size: 14px; color: #c7d6ea; }

/* The weapon in hand, bottom middle: a click, Shift or a right-click opens them all. */
.weapon-chip {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 2;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 14px 0 6px;
  border: 1px solid rgba(125, 211, 252, .35);
  border-radius: 14px;
  background: rgba(7, 18, 38, .82);
  color: #e8f1ff;
  cursor: pointer;
  font: inherit;
}

.weapon-chip:hover { border-color: #38bdf8; }
.weapon-chip canvas { width: 66px; height: 42px; }
.chip-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.chip-text b { font: 600 15px Outfit, system-ui, sans-serif; white-space: nowrap; }
.chip-text span { font: 500 11.5px 'Fira Code', ui-monospace, monospace; color: #9db2cf; white-space: nowrap; }

/* All the weapons, by group. */
.arsenal {
  position: fixed;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(7, 18, 38, .45);
}

.arsenal-panel {
  width: min(880px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 20px 22px 16px;
  border: 1px solid rgba(125, 211, 252, .35);
  border-radius: 18px;
  background: rgba(10, 22, 44, .96);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
  animation: arsenal-in .16s ease-out;
}

@keyframes arsenal-in {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
}

.arsenal-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 16px;
  margin-bottom: 14px;
}

.arsenal-head h2 { font-size: 24px; text-align: left; }
.arsenal-head span { font-size: 13px; color: #9db2cf; }

.arsenal-groups {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.arsenal-group h3 {
  margin: 0 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(125, 211, 252, .2);
  font: 500 12px 'Fira Code', ui-monospace, monospace;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #7dd3fc;
}

.arsenal-list { display: grid; gap: 8px; }

.arm {
  position: relative;
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 6px 10px 6px 6px;
  border: 1px solid rgba(125, 211, 252, .2);
  border-radius: 12px;
  background: rgba(7, 18, 38, .7);
  color: #e8f1ff;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.arm canvas { width: 58px; height: 40px; }
.arm b { display: block; font: 600 14.5px Outfit, system-ui, sans-serif; line-height: 1.2; }
.arm small { font: 500 11.5px 'Fira Code', ui-monospace, monospace; color: #9db2cf; }
.arm:hover, .arm:focus-visible { border-color: #38bdf8; background: rgba(56, 189, 248, .1); outline: none; }
.arm[aria-pressed="true"] { border-color: #f59e0b; box-shadow: inset 0 0 0 1px #f59e0b; background: rgba(245, 158, 11, .1); }
.arm:disabled { opacity: .38; cursor: not-allowed; }

.arsenal-info {
  min-height: 1.5em;
  margin: 14px 2px 0;
  font-size: 14px;
  color: #c7d6ea;
}

@media (max-width: 760px) {
  .arsenal-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
