/* Piano Tiles — Playnesta original (MIT). Lanes, tiles, buttons. */
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}
body {
  background: radial-gradient(circle at 50% 18%, #23282f, #14171c 70%);
  color: #f2f4f8;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: calc(var(--pn-vh, 1vh) * 100);
  max-width: 560px;
  margin: 0 auto;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  gap: 8px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.brand {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.brand small {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.65;
  margin-left: 6px;
  text-transform: lowercase;
}
.meta {
  display: flex;
  gap: 10px;
}
.meta span {
  font-size: 14px;
  opacity: 0.9;
}
.stagewrap {
  flex: 1;
  display: flex;
  align-items: stretch;
  justify-content: center;
  min-height: 0;
}
.stage {
  position: relative;
  width: 100%;
  max-width: 420px;
  min-height: 300px;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid #3b414b;
  background: #f4f1ea;
  touch-action: none;
}
.lanes {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.lane {
  border-right: 1px solid rgba(20, 23, 28, 0.25);
}
.lane:last-child {
  border-right: none;
}
.tiles {
  position: absolute;
  inset: 0;
}
.tile {
  position: absolute;
  background: #191c21;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}
.tile.tapped {
  background: #b8935a;
  opacity: 0.85;
}
.flash {
  position: absolute;
  inset: 0;
  background: #c2233a;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease-out;
}
.flash.on {
  opacity: 0.45;
}
.msg {
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  min-height: 24px;
}
.controls {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.btn {
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  min-height: 44px;
  min-width: 44px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid #59606d;
  background: #2b3038;
  color: #f2f4f8;
  cursor: pointer;
}
.btn.primary {
  background: #59606d;
  color: #fff;
  border-color: #8b93a3;
}
.btn:active {
  transform: scale(0.97);
}
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 15, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 10;
}
.overlay.hidden {
  display: none;
}
.panel {
  background: #23282f;
  border: 1px solid #59606d;
  border-radius: 16px;
  padding: 18px;
  max-width: 420px;
  width: 100%;
  max-height: 86vh;
  overflow: auto;
}
.panel h2 {
  margin: 0 0 10px;
  font-size: 20px;
}
.panel p {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.5;
}
.panel-wide {
  max-width: 520px;
}
.rules-list {
  margin: 0 0 14px;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.55;
}
.rules-list li {
  margin-bottom: 8px;
}
