/* ==========================================================================
   Toast Notification & Action Undo Pill (Subtle, Non-Intrusive Bottom Pill)
   ========================================================================== */

.toast-pill {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 14px) scale(0.96);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 32px);
  padding: 8px 8px 8px 16px;
  border-radius: var(--r-pill);
  background: rgba(22, 24, 31, 0.96);
  backdrop-filter: var(--glass-blur-md);
  -webkit-backdrop-filter: var(--glass-blur-md);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.85),
    inset 0 1px 0.5px rgba(255, 255, 255, 0.22);
  color: #F5F5F7;
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 1200;
  transition: opacity 0.22s var(--ease-apple), transform 0.22s var(--ease-apple), visibility 0.22s;
}

.toast-pill.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0) scale(1);
}

#toast-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toast-undo-btn {
  background: rgba(var(--accent-rgb), 0.22);
  border: 1px solid rgba(var(--accent-light-rgb), 0.48);
  color: var(--accent-light);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  min-height: 30px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.16s var(--ease-apple), color 0.16s var(--ease-apple), transform 0.14s var(--ease-apple);
}

.toast-undo-btn:hover {
  background: rgba(var(--accent-rgb), 0.36);
  color: #FFFFFF;
}

.toast-undo-btn:active {
  transform: scale(0.95);
}

@media (max-width: 920px), (max-width: 1100px) and (max-height: 520px) {
  .toast-pill {
    bottom: calc(var(--dock-total-h, 58px) + 12px);
  }
}

/* "Add to Home Screen" (app.js initInstallHint): phones in a browser tab only. Collapsed it is a
   slim bar lying exactly over the stats row (whose bottom edge is the tab bar + 12 px), so the
   timer, the scramble and +2 / DNF stay clear; "How?" unfolds the steps upwards. */
.install-hint {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(var(--dock-total-h, 72px) + 12px);
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 8px 8px 8px 12px;
  border-radius: 18px;
  background: rgba(20, 22, 28, 0.96);
  backdrop-filter: var(--glass-blur-md);
  -webkit-backdrop-filter: var(--glass-blur-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.8),
    inset 0 1px 0.5px rgba(255, 255, 255, 0.18);
  color: var(--text-primary);
  font-family: var(--font-sans);
  z-index: 690;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 0.28s var(--ease-apple), transform 0.32s var(--ease-apple);
}

.install-hint.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.install-hint-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--accent-light);
}

.install-hint-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.install-hint-body strong {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.install-hint-body p {
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.install-hint-body .install-hint-note {
  color: var(--text-tertiary);
}

.install-hint-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 5px;
}

.install-hint-btn {
  min-height: 32px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.16s var(--ease-apple), transform 0.14s var(--ease-apple);
}

.install-hint-btn.primary {
  background: rgba(var(--accent-rgb), 0.22);
  border-color: rgba(var(--accent-light-rgb), 0.45);
  color: var(--accent-light);
}

.install-hint-btn:active {
  transform: scale(0.95);
}

.install-hint-short {
  flex: 1;
  min-width: 0;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.install-hint > .install-hint-btn {
  flex-shrink: 0;
}

.install-hint-close {
  flex-shrink: 0;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-tertiary);
  cursor: pointer;
}

/* ~44 pt touch area around the small close button */
.install-hint-close::after {
  content: '';
  position: absolute;
  inset: -7px;
}

.install-hint.expanded {
  align-items: flex-start;
  gap: 12px;
  padding: 14px 14px 12px;
  border-radius: 22px;
}
