/* ---------- GLOBAL ---------- */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #020617;
  font-family: system-ui, -apple-system, BlinkMacSystemFont;
  display: flex;
  justify-content: center;
  align-items: center;
  color: rgba(255,255,255,0.95);
}

/* ---------- MAIN CARD ---------- */

.glass-card {
  width: 94%;
  max-width: 420px;
  padding: 22px;
  border-radius: 28px;
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow:
    0 30px 60px rgba(0,0,0,0.7),
    inset 0 1px 0 rgba(255,255,255,0.12);
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
}

/* ---------- TOP MENU ---------- */

.top-actions {
  display: flex;
  gap: 8px;
}

.menu {
  position: absolute;
  top: 72px;
  right: 24px;
  display: none;
  flex-direction: column;
  gap: 6px;

  background: rgb(2, 6, 23);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 14px;
  padding: 8px;
  z-index: 10;
}

.menu button {
  height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  border: none;
  color: white;
  text-align: left;
  padding: 0 12px;
}

.menu-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 4px;
}

.menu-item label {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
}

.menu-item input {
  width: 100%;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.06);
  color: white;
  padding: 0 10px;
}

/* ---------- BUTTON WIDTHS ---------- */

.row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

button.wide {
  flex: 4; /* 80% */
  height: 46px;
  border-radius: 16px
}

.row button:not(.wide) {
  flex: 1; /* 20% */
    height: 46px;
  border-radius: 16px
}

/* ---------- DOT GRID ---------- */

.dots {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 5px;
  padding: 20px 0;
  min-height: 120px;
}

/* empty dot */
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #020617;
  border: 1px solid rgba(255,255,255,0.18);
  position: relative;
}

/* specular highlight */
.dot::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 1px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
}

/* filled dot */
.dot.filled {
  background: #38bdf8;
  border-color: rgba(56,189,248,0.9);
}

.dot.filled::after {
  background: rgba(255,255,255,0.95);
}

/* ---------- SPARK ---------- */

.spark {
  position: absolute;
  width: 2px;
  height: 2px;
  background: rgba(180,230,255,1);
  border-radius: 50%;
  pointer-events: none;
  animation: spark 300ms ease-out forwards;
}

@keyframes spark {
  from {
    transform: translate(0,0) scale(1);
    opacity: 1;
  }
  to {
    transform: translate(var(--dx), var(--dy)) scale(0);
    opacity: 0;
  }
}

/* ---------- CONTROLS ---------- */

.controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
}

input {
  width: 80px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.05);
  color: white;
  padding: 8px;
}

.primary {
  width: 100%;
  height: 68px;
  border-radius: 22px;
  border: none;
  font-size: 30px;
  background: #e5f3ff;
  color: #020617;
}

.row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

button {
  flex: 1;
  height: 46px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.05);
  color: white;
}

.ghost {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
}

/* ---------- NOTES MODAL ---------- */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(2,6,23,0.85);
  backdrop-filter: blur(20px);
  display: none;          /* IMPORTANT */
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.modal.open {
  display: flex;
}

.modal-card {
  width: 90%;
  max-width: 360px;
  padding: 20px;
  border-radius: 22px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
}

.modal textarea {
  width: 100%;
  height: 120px;
  margin: 12px 0;
  border-radius: 14px;
  border: none;
  background: rgba(0,0,0,0.4);
  color: white;
  padding: 12px;
  resize: none;
}
