/* Join shell — shared by every game. Styled after the BarcodeGames logo:
   heavy white type, thick outlines, BarcodeGames red. No glow, no shadows.
   Game controllers style themselves in games/<id>/controller.css */

:root {
  --bg: #000;
  --white: #fafafa;
  --red: #ff2200;
  --line: #fafafa;
  --dim: #5c5c5c;
  --radius: 12px;
  --stroke: 3px;
  --font: 'Archivo', system-ui, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
}

html,
body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--white);
  font-family: var(--font);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

.hidden {
  display: none !important;
}

/* ---------- Join screen ---------- */

.topbar {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: calc(14px + env(safe-area-inset-top)) 16px 14px;
  border-bottom: var(--stroke) solid var(--white);
}

.logo {
  display: block;
  height: 64px;
  width: auto;
}

.join-form {
  width: 100%;
  max-width: 526px;
  margin: 0 auto;
  padding: 28px 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

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

.field-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 0 4px;
  font-size: 20px;
  font-weight: 900;
  text-transform: uppercase;
}

.field-extra {
  font-size: 17px;
  color: var(--white);
}

#gameName {
  color: var(--red);
  text-align: right;
}

.input-wrap {
  position: relative;
  display: block;
}

.field input {
  width: 100%;
  height: 56px;
  padding: 0 52px 0 16px;
  background: var(--bg);
  border: var(--stroke) solid var(--dim);
  border-radius: var(--radius);
  color: var(--white);
  font-family: var(--font);
  font-size: 22px;
  font-weight: 900;
  text-transform: uppercase;
  outline: none;
  -webkit-appearance: none;
}

.field input:focus {
  border-color: var(--white);
}

.field input::placeholder {
  color: var(--dim);
  font-weight: 700;
}

/* Tick / X for the room code */
.code-status {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 30px;
  height: 30px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: center / 18px no-repeat;
}

.code-status.ok {
  background-color: var(--white);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 12.5l5 5L20 6.5' fill='none' stroke='%23000' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.code-status.bad {
  background-color: var(--red);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 6l12 12M18 6L6 18' fill='none' stroke='%23fafafa' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E");
}

.join-error {
  margin: -6px 0;
  font-size: 16px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
  color: var(--red);
}

.join-error:empty {
  display: none;
}

.join-btn {
  width: calc(100% - 60px);
  height: 62px;
  margin: 6px auto 0;
  border: var(--stroke) solid var(--white);
  border-radius: var(--radius);
  background: var(--red);
  color: var(--white);
  font-family: var(--font);
  font-size: 24px;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-appearance: none;
  transition: transform 0.08s;
}

.join-btn:disabled {
  background: var(--bg);
  border-color: var(--dim);
  color: var(--dim);
  cursor: default;
}

.join-btn:not(:disabled):active {
  transform: scale(0.97);
}

/* ---------- Game screen (games fill this) ---------- */

.game-screen {
  min-height: 100%;
}

/* ---------- Connection notice ---------- */

.notice {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--red);
  color: var(--white);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
  z-index: 100;
}
