:root {
  --red: #d7191f;
  --red-dark: #a50f14;
  --ink: #141414;
  --panel: rgba(255, 255, 255, .94);
  --sky: #9fd3f0;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--sky);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

h1, h2 { font-family: "Archivo Black", Inter, sans-serif; line-height: 1.05; margin: 0 0 .4em; }
h1 { font-size: clamp(2rem, 8vw, 3.2rem); }
h1 span { color: var(--red); }
h2 { font-size: 2rem; color: var(--red); }

.hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 16px;
  pointer-events: none;
  font-weight: 700;
}
.hud-score {
  font-family: "Archivo Black", Inter, sans-serif;
  font-size: 2rem;
  line-height: 1;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, .35);
}
.hud-score small { display: block; font: 600 .75rem Inter, sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.hud-best {
  background: var(--panel);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: .9rem;
}

.panel {
  position: fixed;
  left: 50%; bottom: 16px;
  transform: translateX(-50%);
  width: min(420px, 100% - 32px);
  background: var(--panel);
  border-radius: 18px;
  padding: 40px 24px 24px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
}
.panel[hidden], .hud[hidden], .touch-hint[hidden] { display: none; }
.panel p { margin: 0 0 1em; line-height: 1.5; }

.back {
  position: absolute;
  top: 12px; left: 16px;
  font-size: .85rem;
  color: #5f6368;
  text-decoration: none;
}
.back:hover { color: var(--red); }

.lplate {
  display: inline-block;
  background: #fff;
  color: var(--red);
  border: 2px solid #ccc;
  border-radius: 3px;
  padding: 0 5px;
  font-family: "Archivo Black", sans-serif;
}

.keys { list-style: none; padding: 0; margin: 0 0 1.2em; font-size: .9rem; color: #444; }
.keys li { margin: .3em 0; }
kbd {
  display: inline-block;
  min-width: 1.8em;
  padding: 1px 6px;
  margin-right: 3px;
  border: 1px solid #ccc;
  border-bottom-width: 3px;
  border-radius: 6px;
  background: #fff;
  font: 600 .8rem Inter, sans-serif;
}

.final { font-family: "Archivo Black", sans-serif; font-size: 1.6rem; }

.btn {
  display: inline-block;
  border: 0;
  border-radius: 999px;
  padding: 13px 28px;
  margin: 4px;
  background: var(--red);
  color: #fff;
  font: 700 1rem Inter, sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, transform .15s;
}
.btn:hover:not(:disabled) { background: var(--red-dark); transform: translateY(-1px); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-ghost { background: transparent; color: var(--red); box-shadow: inset 0 0 0 2px var(--red); }
.btn-ghost:hover { background: var(--red); color: #fff; }

.touch-hint {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, .55);
  color: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: .85rem;
  white-space: nowrap;
  pointer-events: none;
  animation: fade 4s forwards;
}
@keyframes fade { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }

@media (max-width: 480px) {
  .panel { padding: 38px 18px 18px; }
  .keys { display: none; }
}
