/* MS HACK Plaza: Münsterhack look (red/yellow/black/white, Share Tech Mono, pixel borders). */

/* Self-hosted (SIL OFL, see fonts/OFL.txt) so no visitor data goes to Google (DSGVO). */
@font-face {
  font-family: 'Share Tech Mono';
  src: url('fonts/ShareTechMono-Regular.ttf') format('truetype');
  font-display: swap;
}

:root {
  --red: #DA121A;
  --yellow: #FCDD09;
  --black: #000;
  --white: #FFF;
  --navy: #2C3E50;
  --navy-dark: #1a252f;
  --px: 4px;
}

[hidden] { display: none !important; }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--navy-dark);
  color: var(--black);
  font-family: 'Share Tech Mono', monospace;
  -webkit-tap-highlight-color: transparent;
}

#game {
  position: fixed;
  inset: 0;
  display: block;
  touch-action: none;
  image-rendering: pixelated;
}

/* Notched pixel border: four hard shadows instead of a rounded border. */
.pixel-box {
  box-shadow:
    0 calc(-1 * var(--px)) 0 0 var(--black),
    0 var(--px) 0 0 var(--black),
    calc(-1 * var(--px)) 0 0 0 var(--black),
    var(--px) 0 0 0 var(--black);
}

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(26, 37, 47, 0.55);
  overflow-y: auto;
}

.panel {
  width: 100%;
  max-width: 340px;
  padding: 20px 20px 16px;
  background: var(--white);
  text-align: center;
}

/* Logo recreated in CSS: stepped red shield, yellow "10 JAHRE" banner. */
.logo {
  position: relative;
  width: 150px;
  margin: 0 auto 8px;
  padding-top: 14px;
}

.logo-shield {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px 0 26px;
  background: var(--red);
  color: var(--white);
  line-height: 1;
  clip-path: polygon(0 0, 100% 0, 100% 72%, 92% 72%, 92% 80%, 84% 80%, 84% 88%, 68% 88%, 68% 94%, 56% 94%, 56% 100%,
    44% 100%, 44% 94%, 32% 94%, 32% 88%, 16% 88%, 16% 80%, 8% 80%, 8% 72%, 0 72%);
}

.logo-ms {
  font-size: 64px;
  font-weight: bold;
  letter-spacing: 2px;
  text-shadow: 3px 0 0 var(--white);
}

.logo-hack {
  font-size: 26px;
  letter-spacing: 10px;
  margin-right: -10px;
}

.logo-year {
  margin-top: 6px;
  font-size: 26px;
  color: var(--yellow);
  letter-spacing: 4px;
  text-shadow: 2px 0 0 var(--yellow);
}

.logo-banner {
  position: absolute;
  left: -14px;
  right: -14px;
  top: 0;
  padding: 3px 0;
  background: var(--yellow);
  font-size: 16px;
  letter-spacing: 2px;
  clip-path: polygon(0 0, 100% 0, 94% 50%, 100% 100%, 0 100%, 6% 50%);
}

h1 {
  margin: 8px 0 4px;
  font-size: 22px;
  font-weight: normal;
  letter-spacing: 6px;
  text-transform: uppercase;
}

.intro {
  margin: 0 0 16px;
  font-size: 14px;
}

#login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

label, .label {
  font-size: 14px;
}

.look-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

#look-preview {
  width: 48px;
  height: 72px;
  image-rendering: pixelated;
}

.look-arrow {
  width: 40px;
  height: 40px;
  background: var(--yellow);
  cursor: pointer;
  box-shadow: inset 0 0 0 3px var(--black), 3px 3px 0 var(--black);
}

.look-arrow:active {
  transform: translate(2px, 2px);
  box-shadow: inset 0 0 0 3px var(--black), 1px 1px 0 var(--black);
}

input, button {
  font: inherit;
  font-size: 16px; /* 16px prevents iOS from zooming into focused inputs */
  border: 0;
  border-radius: 0;
  outline: none;
}

input {
  width: 100%;
  padding: 10px;
  background: var(--white);
  box-shadow: inset 0 0 0 3px var(--black);
}

input:focus {
  box-shadow: inset 0 0 0 3px var(--black), inset 0 0 0 6px var(--yellow);
}

#join-button {
  padding: 12px;
  background: var(--red);
  color: var(--yellow);
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: inset 0 0 0 3px var(--black), 4px 4px 0 var(--black);
}

#join-button:hover,
#join-button:focus-visible {
  background: var(--yellow);
  color: var(--black);
}

#join-button:active {
  transform: translate(2px, 2px);
  box-shadow: inset 0 0 0 3px var(--black), 2px 2px 0 var(--black);
}

#join-button:disabled {
  opacity: 0.7;
  cursor: wait;
}

.hint {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--navy);
}

.hint-touch { display: none; }

.hint-game {
  margin-top: 8px;
  color: var(--black);
}

@media (hover: none) and (pointer: coarse) {
  .hint-touch { display: block; }
  .hint-desktop { display: none; }
}

#hud {
  position: fixed;
  top: 12px;
  left: 12px;
  pointer-events: none;
}

#count {
  padding: 4px 8px;
  background: var(--black);
  color: var(--yellow);
  font-size: 14px;
}

#task {
  margin-top: 6px;
  padding: 4px 8px;
  background: var(--white);
  font-size: 13px;
  box-shadow: inset 0 0 0 2px var(--black);
}

.task-title {
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 1px;
}

#trophy-button {
  display: block;
  margin-top: 8px;
  padding: 4px 8px;
  background: var(--yellow);
  color: var(--black);
  font-size: 13px;
  cursor: pointer;
  pointer-events: auto;
}

.trophy-panel {
  position: relative;
  max-width: 420px;
  text-align: left;
}

.trophy-panel h2 {
  margin: 0 0 10px;
  color: var(--red);
  font-size: 20px;
  font-weight: normal;
  letter-spacing: 4px;
  text-transform: uppercase;
}

#trophy-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  padding: 0;
  background: var(--red);
  color: var(--white);
  cursor: pointer;
  box-shadow: inset 0 0 0 2px var(--black);
}

#trophy-list {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 60vh;
  overflow-y: auto;
}

#trophy-list li {
  padding: 6px 0;
  border-bottom: 2px dashed #ddd;
  font-size: 14px;
}

#trophy-list .trophy-name {
  font-size: 15px;
}

#trophy-list .locked {
  color: #777;
}

#toast {
  position: fixed;
  left: 50%;
  bottom: 160px;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 8px 14px;
  background: var(--yellow);
  color: var(--black);
  font-size: 15px;
  text-align: center;
  box-shadow: inset 0 0 0 3px var(--black), 4px 4px 0 var(--black);
  pointer-events: none;
}

#info {
  position: fixed;
  left: 50%;
  bottom: 216px;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 6px 14px;
  background: var(--white);
  text-align: center;
  box-shadow: inset 0 0 0 3px var(--black), 4px 4px 0 var(--black);
  pointer-events: none;
}

.info-label {
  color: var(--red);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

#info-name {
  font-size: 16px;
}

#info-desc {
  max-width: 380px;
  margin-top: 2px;
  font-size: 13px;
}

#notice {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 12px;
  background: var(--red);
  color: var(--white);
  font-size: 14px;
  white-space: nowrap;
}

/* Top of the screen: at the bottom, iOS/Android soft keyboards would cover the input. */
#chat-form {
  position: fixed;
  left: 16px;
  right: 16px;
  top: calc(12px + env(safe-area-inset-top));
  z-index: 5;
  max-width: 520px;
  margin: 0 auto;
}

#chat-button {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 56px;
  height: 56px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--red);
  cursor: pointer;
  box-shadow: inset 0 0 0 3px var(--black), 4px 4px 0 var(--black);
}

#wave-button {
  position: fixed;
  right: 16px;
  bottom: 88px;
  width: 56px;
  height: 56px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--red);
  cursor: pointer;
  box-shadow: inset 0 0 0 3px var(--black), 4px 4px 0 var(--black);
}

#bike-button {
  position: fixed;
  right: 88px;
  bottom: 16px;
  height: 56px;
  padding: 0 16px;
  border: 0;
  background: var(--yellow);
  color: var(--black);
  font: inherit;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: inset 0 0 0 3px var(--black), 4px 4px 0 var(--black);
}

/* Small pixel bike in front of the label */
#bike-button::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 15px;
  margin-right: 8px;
  vertical-align: -2px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 10' shape-rendering='crispEdges'%3E%3Cpath fill-rule='evenodd' d='M0 5h5v5H0zM1 6v3h3V6zM11 5h5v5h-5zM12 6v3h3V6zM3 7h9v1H3zM4 3h3v1H4zM5 4h1v3H5zM11 3h1v4h-1zM10 2h3v1h-3z'/%3E%3C/svg%3E") no-repeat center / contain;
  image-rendering: pixelated;
}

/* Pops when it appears or changes, so players notice they can get on or off */
#bike-button.pop {
  animation: pop 0.45s steps(4) 2;
}

@keyframes pop {
  50% { transform: scale(1.12); }
}

#chat-button:active,
#wave-button:active,
#bike-button:active {
  transform: translate(2px, 2px);
  box-shadow: inset 0 0 0 3px var(--black), 2px 2px 0 var(--black);
}
