/* src/main/resources/static/css/layout.css */

.app {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 100dvh;
  padding: 16px;
  --play-width: min(calc((100dvh - 200px) * 5 / 7), 520px);
}
@media (max-width: 600px) { .app { padding: 10px; } }

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; max-width: var(--play-width, 480px);
  font-size: 12px; letter-spacing: 0.12em;
  color: var(--read-dim);
  margin-bottom: 12px;
}
.topbar .pulse {
  display: inline-block; width: 6px; height: 6px;
  background: var(--phosphor); border-radius: 50%;
  margin-right: 8px;
  box-shadow: 0 0 6px var(--phosphor);
}
.topbar .session { color: var(--read-dim); text-transform: lowercase; }
.topbar .stats { display: flex; gap: 10px; }
.topbar .best-pill { color: var(--goal); }
.topbar .mute-btn {
  background: none;
  border: none;
  color: var(--phosphor);
  font-family: inherit;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  margin-left: 4px;
  transition: opacity 150ms, color 150ms;
}
.topbar .mute-btn.muted {
  color: var(--read-dim);
  opacity: 0.5;
}
.topbar .mute-btn:focus-visible {
  outline: 1px dashed var(--phosphor);
  outline-offset: 2px;
}

.next-row {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; max-width: var(--play-width, 480px);
  margin-bottom: 8px;
  font-size: 11px; letter-spacing: 0.16em;
  color: var(--phosphor-dim);
}
.next-row .next-tile {
  width: calc(var(--tile-size, 60px) * 0.42);
  height: calc(var(--tile-size, 60px) * 0.42);
  min-width: 22px; min-height: 22px;
  border-radius: 50%;
  background: var(--hull);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: calc(var(--tile-size, 60px) * 0.18);
  letter-spacing: -0.04em;
}
.next-row .drops { color: var(--read-dim); }

.stage {
  position: relative;
  width: 100%;
  max-width: var(--play-width, 480px);
  aspect-ratio: 5 / 7;
  background: #060a0d;
  border: 1px solid var(--phosphor-faint);
  border-radius: 4px;
  box-shadow:
    inset 0 0 60px rgba(95,255,176,0.04),
    0 0 80px rgba(95,255,176,0.05);
  overflow: hidden;
}

.stage .corner {
  position: absolute; width: 14px; height: 14px;
  border: 1px solid var(--phosphor);
}
.stage .corner.tl { top: 0; left: 0; border-right: none; border-bottom: none; }
.stage .corner.tr { top: 0; right: 0; border-left: none; border-bottom: none; }
.stage .corner.bl { bottom: 0; left: 0; border-right: none; border-top: none; }
.stage .corner.br { bottom: 0; right: 0; border-left: none; border-top: none; }

.stage .lane-guides {
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(
    to right,
    transparent 0,
    transparent calc(20% - 1px),
    rgba(95,255,176,0.04) calc(20% - 1px),
    rgba(95,255,176,0.04) 20%
  );
  pointer-events: none;
}

.stage .danger-line {
  position: absolute;
  left: 0; right: 0;
  top: calc((1 + 1) * (100% / 7));
  height: 0;
  border-top: 2px dashed var(--crit);
  opacity: 0.65;
  pointer-events: none;
}
.stage .danger-line.warn {
  animation: dangerblink 0.45s steps(2) infinite;
  opacity: 0.95;
}
.stage .danger-line .label {
  position: absolute; right: 4px; top: -10px;
  font-size: 9px; letter-spacing: 0.2em; color: var(--crit);
}

.stage .drop-guide {
  position: absolute; top: 0; bottom: 0;
  width: 1px;
  border-left: 1px dashed var(--phosphor-faint);
  left: var(--active-col-x, 50%);
  transition: left 70ms ease-out;
  pointer-events: none;
}
.stage .drop-guide .marker {
  position: absolute; bottom: 0;
  width: 6px; height: 6px;
  background: var(--phosphor);
  box-shadow: 0 0 6px var(--phosphor);
  transform: translateX(-50%);
}

.controls {
  width: 100%; max-width: var(--play-width, 480px);
  display: flex; justify-content: space-between;
  font-size: 11px; letter-spacing: 0.12em; color: var(--read-dim);
  margin-top: 12px;
}
@media (max-width: 600px) {
  .controls .keyhints { display: none; }
}

.overlay {
  position: absolute; inset: 0;
  background: rgba(10,13,16,0.88);
  backdrop-filter: blur(2px);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 16px;
  animation: overlayin 400ms ease-out forwards;
}
.overlay.hidden { display: none; animation: none; }

.cta {
  background: transparent; color: var(--phosphor);
  border: 1px solid var(--phosphor);
  font-family: inherit; font-weight: 600;
  font-size: 13px; letter-spacing: 0.16em;
  padding: 10px 18px;
  cursor: pointer;
}
.cta.goal { color: var(--goal); border-color: var(--goal); }
.cta::after { content: '_'; margin-left: 6px; animation: blink 1.1s steps(1) infinite; }

.combo-text {
  position: absolute; left: 0; right: 0; top: 38%;
  text-align: center;
  color: var(--goal);
  font-weight: 800; font-size: 22px;
  letter-spacing: 0.12em;
  pointer-events: none;
  animation: combopop 800ms ease-out forwards;
}

.topbar .handle-block {
  display: flex; align-items: center; gap: 4px;
  color: var(--read-dim);
}
.topbar .handle-pill {
  font-size: 11px;
  letter-spacing: 0.06em;
  cursor: pointer;
}
.topbar .handle-edit-btn {
  background: none;
  border: none;
  color: var(--read-dim);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  padding: 0 2px;
  opacity: 0.6;
  transition: opacity 150ms, color 150ms;
}
.topbar .handle-edit-btn:hover { opacity: 1; color: var(--phosphor); }

.controls .footer-link {
  color: var(--phosphor);
  text-decoration: none;
  letter-spacing: 0.1em;
}
.controls .footer-link:hover { color: var(--read); }
