html, body { margin: 0; padding: 0; overflow: hidden; background: #3aa0d8; font-family: system-ui, sans-serif; color: #fff; }
#game { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
#hud { position: fixed; inset: 0; pointer-events: none; }
#menu { position: fixed; inset: 0; pointer-events: none; display: flex; align-items: center; justify-content: center; }
.panel {
  pointer-events: auto; background: rgba(20, 20, 30, 0.85); border-radius: 18px; padding: 28px 36px;
  display: flex; flex-direction: column; align-items: center; gap: 14px; min-width: 320px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35); text-align: center;
}
.title { margin: 0; font-size: 48px; font-weight: 900; letter-spacing: 2px; text-shadow: 0 4px 0 rgba(0,0,0,0.35); }
.title.win { color: #ffd84a; }
h2 { margin: 0; font-size: 28px; }
.big { font-size: 22px; font-weight: 700; }
.row { display: flex; gap: 12px; }
.status { min-height: 1.2em; opacity: 0.8; }
.hint { font-size: 12px; opacity: 0.6; max-width: 360px; }
#name {
  font-size: 20px; padding: 10px 14px; border-radius: 10px; border: 3px solid rgba(43,43,43,0.6);
  width: 240px; text-align: center; outline: none;
}
.btn {
  font: inherit; font-size: 20px; font-weight: 800; color: #fff; cursor: pointer;
  background: #5a6b7d; border: 3px solid rgba(43,43,43,0.6); border-radius: 12px; padding: 10px 24px;
  box-shadow: 0 4px 0 rgba(0,0,0,0.35);
}
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,0.35); }
.btn-green { background: #5fd35f; }
.btn.small { font-size: 15px; padding: 6px 14px; }
.bar {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  flex-direction: row; padding: 10px 16px; min-width: 0; border-radius: 14px;
}
#spec-name { font-weight: 700; font-size: 18px; padding: 0 8px; }
#game { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#touch-ui { position: fixed; right: max(8px, env(safe-area-inset-right)); bottom: 8px; display: none; flex-wrap: wrap; width: 136px; gap: 8px; z-index: 5; }
#touch-ui button {
  width: 64px; height: 40px; border: 0; border-radius: 12px; font: 700 13px system-ui, sans-serif; color: #fff;
  background: rgba(20, 20, 30, 0.55); box-shadow: 0 3px 0 rgba(0,0,0,0.35); touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
#touch-ui button:active { background: rgba(95, 211, 95, 0.8); transform: translateY(2px); }
.hint-touch { display: none; }
@media (pointer: coarse) {
  .hint-desktop { display: none; }
  .hint-touch { display: block; }
}
@media (max-width: 700px), (max-height: 500px) {
  .panel { padding: 16px 20px !important; gap: 10px !important; max-width: 92vw; }
  .title { font-size: 32px; }
  h2 { font-size: 22px; }
  .big { font-size: 17px; }
  .btn { font-size: 17px; padding: 8px 18px; }
}
