/* ===== TRIGGERS PAGE ===== */

/* Keyboard */
.keyboard-section { background: var(--surface); }

.keyboard-display {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  min-height: 80px;
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--text);
  letter-spacing: 0.03em;
  line-height: 1.5;
  word-break: break-word;
  cursor: text;
  position: relative;
  outline: none;
  transition: border-color var(--transition);
}
.keyboard-display:focus,
.keyboard-display.focused {
  border-color: rgba(139, 124, 248, 0.45);
  box-shadow: 0 0 20px rgba(139, 124, 248, 0.1);
}

.keyboard-cursor {
  display: inline-block;
  color: var(--accent);
  animation: blink 1s step-end infinite;
  font-weight: 300;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.keyboard-hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.6rem;
  letter-spacing: 0.04em;
  text-align: center;
}

/* Bubble grid */
.bubble-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 6px;
}

.bubble {
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%,
    rgba(92, 232, 212, 0.8),
    rgba(92, 232, 212, 0.25) 60%,
    rgba(92, 232, 212, 0.05));
  border: 1px solid rgba(92, 232, 212, 0.3);
  cursor: pointer;
  transition: transform 0.1s, opacity 0.15s;
  position: relative;
  overflow: hidden;
}
.bubble::after {
  content: '';
  position: absolute;
  top: 18%; left: 22%;
  width: 28%; height: 16%;
  background: rgba(255,255,255,0.55);
  border-radius: 50%;
  transform: rotate(-30deg);
}

.bubble:hover { transform: scale(1.08); }
.bubble.popped {
  background: var(--surface2);
  border-color: rgba(255,255,255,0.04);
  cursor: default;
  transform: scale(0.85);
  opacity: 0.25;
}
.bubble.popped::after { display: none; }

/* Scratch grid */
.scratch-section { background: var(--surface); }

.scratch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.scratch-surface {
  aspect-ratio: 4/3;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.5rem;
  cursor: crosshair;
  user-select: none;
  -webkit-user-select: none;
  position: relative;
  overflow: hidden;
  transition: border-color 0.15s;
}
.scratch-surface:hover { border-color: rgba(139, 124, 248, 0.35); }
.scratch-surface.scratching { border-color: var(--accent); }

.scratch-surface .icon { font-size: 2.2rem; pointer-events: none; }
.scratch-surface .label {
  font-size: 0.78rem;
  color: var(--muted);
  pointer-events: none;
  letter-spacing: 0.05em;
}

.scratch-surface .scratch-ripple {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(139, 124, 248, 0.6);
  animation: scratch-expand 0.4s ease forwards;
  pointer-events: none;
}

@keyframes scratch-expand {
  from { width: 0;   height: 0;   opacity: 0.7; transform: translate(-50%, -50%) scale(0); }
  to   { width: 60px; height: 60px; opacity: 0;  transform: translate(-50%, -50%) scale(1); }
}

/* Bowl grid */
.bowl-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
}

.bowl {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  position: relative;
}

.bowl__circle {
  width: 80px; height: 80px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.03em;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.bowl__circle::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(139,124,248,0.05), transparent);
  transition: background 0.2s;
}

.bowl:hover .bowl__circle {
  box-shadow: 0 0 30px rgba(139, 124, 248, 0.35);
  transform: scale(1.05);
}
.bowl.ringing .bowl__circle {
  animation: bowl-ring 0.6s ease;
}
@keyframes bowl-ring {
  0%   { box-shadow: 0 0 0   rgba(139,124,248,0);   transform: scale(1); }
  20%  { box-shadow: 0 0 40px rgba(139,124,248,0.6); transform: scale(1.1); }
  100% { box-shadow: 0 0 0   rgba(139,124,248,0);   transform: scale(1); }
}

.bowl__label {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.bowl__freq {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--accent);
}

/* Whisper section */
.whisper-section { background: var(--surface); }

.whisper-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.whisper-textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 1.1rem;
  line-height: 1.7;
  resize: vertical;
  min-height: 80px;
}
.whisper-textarea::placeholder { color: var(--muted); }

.whisper-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.whisper-setting {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
  min-width: 140px;
}
.whisper-setting label {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  letter-spacing: 0.04em;
}
.whisper-setting span {
  font-size: 0.78rem;
  color: var(--accent);
  min-width: 30px;
}

.whisper-actions {
  display: flex;
  gap: 0.75rem;
}

.whisper-words {
  min-height: 28px;
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--accent);
  font-style: italic;
  letter-spacing: 0.05em;
  transition: opacity 0.3s;
}

/* Responsive */
@media (max-width: 600px) {
  .bubble-grid { grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); gap: 4px; }
  .scratch-grid { grid-template-columns: 1fr 1fr; }
  .bowl { flex-basis: calc(50% - 1rem); }
  .whisper-controls { flex-direction: column; }
}
