* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: #080808;
  color: #eee;
  font-family: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  overflow: hidden;
}

#field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

header {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: center;
  padding: 18px 16px;
  pointer-events: none;
}

.meta, .hint {
  max-width: calc(100vw - 32px);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.8;
}

.meta { font-variant-numeric: tabular-nums; }

/* Hint pill with the credit tab hanging under it, one surface cut to shape by a clip-path from main.js */
.caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-radius: 999px;
  opacity: 0.8;
}
.caption .hint {
  background: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  opacity: 1;
}
.credit {
  font-size: 11px;
  padding: 0 14px 8px;
  color: rgba(238, 238, 238, 0.55);
  text-decoration: none;
  pointer-events: auto;
  transition: color 0.15s;
}
.credit:hover, .credit:focus-visible { color: #fff; }
.credit:focus-visible { outline: none; text-decoration: underline; }

.stage {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

main {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

button {
  pointer-events: auto;
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

button:focus-visible { outline: 2px solid #fff; outline-offset: 6px; }

/* ---------- Liquid glass button ---------- */
:root { --energy: 0; }

.glass {
  position: relative;
  width: 187px;
  height: 68px;
  border-radius: 100px;
  display: grid;
  place-items: center;
  isolation: isolate;
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.35),
    0 12px 32px rgba(0, 0, 0, 0.45),
    0 0 calc(24px + var(--energy) * 80px) calc(var(--energy) * 10px) rgba(255, 255, 255, calc(var(--energy) * 0.25));
  transition: transform 0.18s cubic-bezier(0.3, 1.6, 0.5, 1);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* Refracted copy of the pattern behind the button (drawn in main.js) */
.glass-lens {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  filter: saturate(1.4);
}

.glass-tint {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(45% 60% at 50% 50%, rgba(0, 0, 0, 0.35), transparent 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02) 50%, rgba(255, 255, 255, 0.05));
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.6),
    inset 0 -1px 1px rgba(255, 255, 255, 0.2),
    inset 0 0 14px rgba(255, 255, 255, 0.08),
    inset 0 -10px 18px rgba(0, 0, 0, 0.25);
}

/* Specular edge: bright where light hits (top-left, bottom-right), faint elsewhere */
.glass-tint::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.06) 35%, rgba(255, 255, 255, 0.06) 65%, rgba(255, 255, 255, 0.45));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}

.glass-label {
  position: relative;
  font: 500 18px/24px "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: -0.3px;
  text-transform: capitalize;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.6);
}

.glass:hover { transform: scale(1.03); }
.glass:active, .glass.is-pressed { transform: scale(0.96); transition-duration: 0.08s; }
.glass.is-held { transform: scale(0.94); transition-duration: 0.3s; }
.glass.is-held .glass-label { animation: held 1.2s ease-in-out infinite; }

@keyframes held {
  50% { opacity: 0.55; }
}

/* ---------- FX readout (follows the cursor while dragging) ---------- */
.fx-readout {
  position: fixed;
  left: 0;
  top: 0;
  margin: 18px 0 0 18px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.6);
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(6px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}
.fx-readout.is-visible { opacity: 1; }
