:root {
  color-scheme: dark;
  font-family: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: #e0ebfd;
  background: #08090a;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: #08090a;
}

button,
a {
  font: inherit;
}

.app {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header {
  position: fixed;
  z-index: 100;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: clamp(1rem, 3vw, 2rem);
  pointer-events: none;
}

.back-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  color: #888;
  font-size: clamp(0.75rem, 2vw, 0.9rem);
  line-height: 1.6;
  text-decoration: none;
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 99px;
  backdrop-filter: blur(10px);
  pointer-events: auto;
  transition:
    color 0.2s,
    border-color 0.2s,
    opacity 0.2s;
}

.back-link:hover {
  color: #aaa;
  border-color: rgba(255, 255, 255, 0.25);
}

.back-link:focus-visible,
.ripple-grid:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.72);
  outline-offset: 4px;
}

h1 {
  position: absolute;
  left: 50%;
  margin: 0;
  color: rgba(255, 255, 255, 0.5);
  font-size: clamp(0.75rem, 2vw, 0.9rem);
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: 0.05em;
  text-align: center;
  text-transform: uppercase;
  transform: translateX(-50%);
}

.ripple-grid {
  display: grid;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
}

.tile {
  width: 45px;
  height: 45px;
  padding: 0;
  appearance: none;
  cursor: pointer;
  background-color: #2a2a2a;
  border: 0;
  border-radius: 4px;
  transition:
    transform 0.1s var(--ease-spring),
    background-color 0.2s;
}

.tile:hover {
  filter: brightness(1.13);
}

.tile:active {
  transform: scale(0.9);
}

.hint {
  position: fixed;
  z-index: 100;
  bottom: 2rem;
  left: 50%;
  width: max-content;
  max-width: 90vw;
  margin: 0;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9rem;
  line-height: 1.6;
  letter-spacing: 0.1em;
  text-align: center;
  text-transform: uppercase;
  pointer-events: none;
  transform: translateX(-50%);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 768px) {
  .header {
    justify-content: flex-start;
    gap: 1rem;
    padding: 1rem;
  }

  .back-link {
    width: 40px;
    height: 40px;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
  }

  .back-link span {
    display: none;
  }

  h1 {
    position: static;
    flex: 1;
    margin-left: 0.5rem;
    overflow: hidden;
    font-size: 0.8rem;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
    transform: none;
  }

  .hint {
    top: 5rem;
    bottom: auto;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    backdrop-filter: blur(4px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tile {
    transition-duration: 0.01ms;
  }
}
