:root {
  --bg: #1d1a24;
  --panel: rgba(29, 26, 36, 0.82);
  --text: #f4efe6;
  --muted: #b9b1c4;
  --accent: #5865f2;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
}

[hidden] {
  display: none !important;
}

#game {
  position: fixed;
  inset: 0;
  touch-action: none;
}

#game canvas {
  display: block;
}

#topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(8px + env(safe-area-inset-top)) calc(12px + env(safe-area-inset-right)) 8px calc(12px + env(safe-area-inset-left));
  background: linear-gradient(var(--panel), transparent);
  pointer-events: none;
}

#count {
  color: var(--muted);
  font-size: 13px;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#logout {
  pointer-events: auto;
  padding: 6px 12px;
  border: 0;
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

#logout:hover {
  color: var(--text);
}

#emotes {
  position: fixed;
  left: 50%;
  bottom: calc(10px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  max-width: calc(100vw - 16px);
  padding: 6px;
  border-radius: 14px;
  background: var(--panel);
}

#emotes button {
  flex: 0 1 44px;
  min-width: 0;
  height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

#emotes button:hover,
#emotes button:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  outline: none;
}

#emotes button:active {
  transform: scale(0.9);
}

#hint,
#banner {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100vw - 24px);
  padding: 6px 12px;
  border-radius: 10px;
  background: var(--panel);
  font-size: 13px;
  text-align: center;
  pointer-events: none;
}

#hint {
  bottom: calc(76px + env(safe-area-inset-bottom));
  color: var(--muted);
}

#banner {
  top: calc(48px + env(safe-area-inset-top));
}

.notice {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  background: var(--bg);
}

.notice h1 {
  margin: 0;
  font-size: 28px;
}

.notice p {
  margin: 0;
  max-width: 34ch;
  color: var(--muted);
}

.notice .small {
  font-size: 13px;
}

.notice form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(260px, 100%);
}

.notice input {
  padding: 10px 12px;
  border: 1px solid #453f52;
  border-radius: 10px;
  background: #272330;
  color: var(--text);
  font: inherit;
  text-align: center;
  -webkit-user-select: text;
  user-select: text;
}

.button {
  display: inline-block;
  padding: 11px 20px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  filter: brightness(1.1);
}
