/* The website's Practice (templates/practice.html, static/js/practice.js):
   the app's Practice screens, in the site's colors, with the live's blue
   where the app has it (Start, the live's banner, Done). No pills: small
   corners only. */
.practice-body { --practice-live: #1877F2; --practice-live-dark: #1466d1; background: var(--color-parchment); }
/* What the page hides stays hidden, whatever its display. */
.practice-body [hidden] { display: none !important; }
.practice-page { margin: 0 auto; max-width: 1200px; padding: 0 0 48px; }
.practice-screen { margin: 0 auto; max-width: 640px; padding: 20px 16px 0; }
.practice-screen h1 { color: var(--color-charcoal); font-family: 'Lora', serif; font-size: 1.6rem; margin: 6px 0 18px; }
.practice-signed-out { text-align: center; padding-top: 64px; }

.practice-primary,
.practice-secondary {
  align-items: center;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 700;
  gap: 6px;
  justify-content: center;
  padding: 12px 18px;
}
.practice-primary { background: var(--color-forest-main); border: 1px solid var(--color-forest-main); color: white; }
.practice-primary:hover:not(:disabled) { background: var(--color-forest-deep); }
.practice-primary.practice-live { background: var(--practice-live); border-color: var(--practice-live); }
.practice-primary.practice-live:hover:not(:disabled) { background: var(--practice-live-dark); }
.practice-primary:disabled { cursor: default; opacity: 0.5; }
.practice-secondary { background: white; border: 1px solid var(--color-border); color: var(--color-forest-main); }
.practice-secondary:hover { background: var(--color-bg-hover); }

.practice-bottom { margin-top: 8px; padding: 12px 0 0; }
.practice-bottom .practice-primary { width: 100%; }
.practice-error { color: var(--color-error); margin: 0 0 8px; min-height: 0; }
.practice-error:empty { display: none; }

.practice-icon-button {
  align-items: center;
  background: none;
  border: 0;
  border-radius: 6px;
  color: var(--color-stone);
  cursor: pointer;
  display: inline-flex;
  flex: none;
  height: 36px;
  justify-content: center;
  padding: 0;
  width: 36px;
}
.practice-icon-button:hover:not(:disabled) { background: var(--color-bg-subtle); color: var(--color-charcoal); }
.practice-icon-button:disabled { cursor: default; opacity: 0.35; }
.practice-icon-button .material-icons { font-size: 20px; }
.practice-icon-space { flex: none; width: 36px; }

.practice-text-button {
  align-items: center;
  background: none;
  border: 0;
  border-radius: 6px;
  color: var(--color-forest-main);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 600;
  gap: 4px;
  padding: 8px 10px;
  text-decoration: none;
}
.practice-text-button:hover { background: var(--color-bg-subtle); }
.practice-text-button .material-icons { font-size: 20px; }

.practice-loading,
.practice-failed { color: var(--color-stone); padding: 32px 0; text-align: center; }
.practice-failed p { margin: 0 0 6px; }

/* A song's kind: lyrics for a vocal song, a fiddle for a tune. */
.practice-kind { color: var(--color-forest-main); flex: none; font-size: 22px; }
.practice-kind-fiddle {
  background: currentColor;
  display: inline-block;
  height: 22px;
  -webkit-mask: url('/static/images/instruments/icons/fiddle.png') center / contain no-repeat;
  mask: url('/static/images/instruments/icons/fiddle.png') center / contain no-repeat;
  width: 22px;
}

/* Setup */
.practice-question { margin-bottom: 24px; }
.practice-question-title { color: var(--color-charcoal); font-size: 1rem; font-weight: 700; margin: 0 0 8px; }
.practice-panel {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  list-style: none;
  margin: 0;
  overflow: hidden;
  padding: 0;
}
.practice-heat {
  align-items: center;
  background: white;
  border: 0;
  border-top: 1px solid var(--color-border-subtle);
  color: var(--color-text-primary);
  cursor: pointer;
  display: flex;
  font: inherit;
  gap: 12px;
  padding: 14px 14px 14px 12px;
  text-align: left;
  width: 100%;
}
.practice-heat:first-child { border-top: 0; }
.practice-heat:hover { background: var(--color-bg-hover); }
.practice-heat.is-chosen { font-weight: 700; }
.practice-flames { display: inline-flex; flex: none; }
.practice-flame { color: var(--color-sand); font-size: 18px; }
.practice-heat-label { flex: 1; }
.practice-heat-check { color: transparent; font-size: 20px; }
.practice-heat.is-chosen .practice-heat-check { color: var(--color-forest-main); }
.practice-saves { display: flex; justify-content: space-evenly; padding: 4px 0; }
.practice-save {
  align-items: center;
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  height: 46px;
  justify-content: center;
  padding: 0;
  width: 46px;
}
.practice-save:hover { background: var(--color-bg-hover); }
.practice-save[aria-pressed="false"] svg { fill: var(--color-sand); }

.practice-segmented {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  display: flex;
  overflow: hidden;
}
.practice-segment {
  align-items: center;
  background: white;
  border: 0;
  border-left: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  cursor: pointer;
  display: inline-flex;
  flex: 1;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  gap: 6px;
  justify-content: center;
  min-height: 42px;
  padding: 8px 6px;
}
.practice-segment:first-child { border-left: 0; }
.practice-segment .material-icons { font-size: 18px; }
.practice-segment[aria-checked="true"] { background: var(--color-forest-main); color: white; }

/* The routine */
.practice-routine-head { align-items: center; display: flex; gap: 6px; margin: 0 0 12px -8px; }
.practice-routine-head h1 { flex: 1; margin: 0; }
.practice-block { margin-bottom: 22px; }
.practice-block-head { align-items: center; display: flex; gap: 8px; margin-bottom: 8px; }
.practice-block-head h2 { color: var(--color-charcoal); flex: 1; font-size: 1.15rem; margin: 0; }
.practice-minutes { color: var(--color-stone); flex: none; font-variant-numeric: tabular-nums; font-weight: 700; }

.practice-place {
  align-items: center;
  background: white;
  border-top: 1px solid var(--color-border-subtle);
  display: flex;
  gap: 2px;
  min-height: 56px;
  padding: 4px 4px 4px 0;
  position: relative;
}
.practice-place:first-child { border-top: 0; }
.practice-place.is-dragging { box-shadow: 0 6px 18px rgba(43, 37, 32, 0.18); z-index: 2; }
.practice-place .practice-minutes { font-weight: 600; margin: 0 6px 0 8px; }
.practice-handle {
  align-self: stretch;
  background: none;
  border: 0;
  color: var(--color-stone-light);
  cursor: grab;
  flex: none;
  padding: 0;
  touch-action: none;
  width: 36px;
}
.practice-handle:active { cursor: grabbing; }
.practice-handle-space { flex: none; width: 36px; }
.practice-place-main {
  align-items: center;
  background: none;
  border: 0;
  border-radius: 6px;
  color: inherit;
  cursor: pointer;
  display: flex;
  flex: 1;
  font: inherit;
  gap: 10px;
  min-width: 0;
  padding: 6px 4px;
  text-align: left;
  text-decoration: none;
}
.practice-place-main:hover .practice-place-title { text-decoration: underline; }
.practice-place-main.is-add { color: var(--color-forest-main); }
.practice-place-main.is-add .practice-place-title { color: var(--color-forest-main); }
.practice-place-words { display: flex; flex-direction: column; min-width: 0; }
.practice-place-title { color: var(--color-charcoal); font-weight: 700; }
.practice-place-reason {
  color: var(--color-stone);
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.practice-try-card {
  align-items: center;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  grid-template-columns: 40px 1fr 40px;
  padding: 6px 4px;
}
.practice-try-demo { min-width: 0; }
.practice-try-row { align-items: center; display: flex; gap: 8px; grid-column: 1 / -1; padding: 0 8px; }
.practice-try-row .practice-kind { color: var(--color-stone); font-size: 20px; }
.practice-try-row .practice-kind-fiddle { height: 20px; width: 20px; }
.practice-spacer { flex: 1; }
.practice-demo {
  aspect-ratio: 16 / 9;
  background: #111;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  display: block;
  overflow: hidden;
  padding: 0;
  position: relative;
  width: 100%;
}
.practice-demo img { height: 100%; object-fit: cover; width: 100%; }
.practice-demo-play {
  background: rgba(0, 0, 0, 0.6);
  border-radius: 8px;
  color: white;
  font-size: 34px;
  left: 50%;
  padding: 6px 10px;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
}
.practice-demo-frame { aspect-ratio: 16 / 9; border: 0; border-radius: 6px; display: block; width: 100%; }

/* The practice, live */
.practice-run { max-width: none; padding: 0; }
.practice-live-bar { background: var(--practice-live); color: white; position: sticky; top: 0; z-index: 30; }
.practice-banner { align-items: center; display: flex; gap: 4px; margin: 0 auto; max-width: 1200px; padding: 8px 8px 6px; }
.practice-banner-side { display: flex; flex: none; justify-content: flex-end; width: 44px; }
.practice-banner-middle { flex: 1; min-width: 0; position: relative; text-align: center; }
.practice-run .practice-song-title {
  color: white;
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.practice-follow {
  align-items: center;
  background: none;
  border: 0;
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  gap: 4px;
  max-width: 100%;
  padding: 2px 4px;
}
.practice-follow:hover { background: rgba(255, 255, 255, 0.14); }
.practice-follow .material-icons { font-size: 13px; }
.practice-follow .material-icons:last-child { font-size: 17px; }
.practice-privacy-menu {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(43, 37, 32, 0.2);
  left: 50%;
  min-width: 180px;
  padding: 4px;
  position: absolute;
  top: 100%;
  transform: translateX(-50%);
  z-index: 40;
}
.practice-privacy-choice {
  align-items: center;
  background: none;
  border: 0;
  border-radius: 6px;
  color: var(--color-text-primary);
  cursor: pointer;
  display: flex;
  font: inherit;
  gap: 10px;
  padding: 10px 12px;
  width: 100%;
}
.practice-privacy-choice:hover { background: var(--color-bg-hover); }
.practice-privacy-choice[aria-checked="true"] { color: var(--color-forest-main); font-weight: 700; }
.practice-privacy-choice .material-icons { font-size: 18px; }
.practice-bookmark { color: white; }
.practice-bookmark:hover:not(:disabled) { background: rgba(255, 255, 255, 0.14); color: white; }
.practice-bookmark:disabled { opacity: 1; }
.practice-bookmark .material-icons { font-size: 24px; }
/* Saved, the bookmark picked, on white so its color shows on the bar. */
.practice-bookmark.is-saved, .practice-bookmark.is-saved:hover { background: white; }

.practice-actions { display: flex; gap: 8px; margin: 0 auto; max-width: 1200px; padding: 0 12px 8px; }
.practice-action {
  align-items: center;
  background: rgba(255, 255, 255, 0.16);
  border: 0;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  display: inline-flex;
  flex: 1;
  font: inherit;
  font-weight: 700;
  gap: 6px;
  justify-content: center;
  padding: 9px 8px;
}
.practice-action:hover:not(:disabled) { background: rgba(255, 255, 255, 0.26); }
.practice-action:disabled { cursor: default; opacity: 0.45; }
.practice-action .material-icons { font-size: 20px; }

.practice-strip {
  align-items: center;
  color: rgba(255, 255, 255, 0.8);
  display: flex;
  font-size: 0.82rem;
  font-weight: 600;
  gap: 6px;
  margin: 0 auto;
  max-width: 1200px;
  padding: 0 16px 8px;
  position: relative;
}
.practice-strip-icon { font-size: 16px; }
.practice-clock { font-variant-numeric: tabular-nums; }
.practice-strip .practice-clock:last-child { margin-left: auto; }
.practice-nudge {
  color: white;
  font-weight: 700;
  margin-left: 4px;
  min-width: 0;
  opacity: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.practice-strip.is-done .practice-strip-icon { color: white; }
.practice-strip.is-done .practice-nudge { opacity: 1; }
.practice-strip.is-cheering .practice-nudge { animation: practice-nudge 1.6s ease both; }
.practice-sparkles { display: none; gap: 10px; left: 110px; pointer-events: none; position: absolute; }
.practice-sparkles .material-icons { color: white; font-size: 16px; }
.practice-sparkles .material-icons:nth-child(3n + 2) { color: var(--color-amber-main); font-size: 12px; }
.practice-strip.is-cheering .practice-sparkles { display: inline-flex; animation: practice-sparkles-fade 1.6s ease both; }
.practice-strip.is-cheering .practice-sparkles .material-icons { animation: practice-sparkle 1.6s ease both; }
.practice-strip.is-cheering .practice-sparkles .material-icons:nth-child(2) { animation-delay: 0.1s; }
.practice-strip.is-cheering .practice-sparkles .material-icons:nth-child(3) { animation-delay: 0.2s; }
.practice-strip.is-cheering .practice-sparkles .material-icons:nth-child(4) { animation-delay: 0.3s; }
.practice-strip.is-cheering .practice-sparkles .material-icons:nth-child(5) { animation-delay: 0.4s; }
.practice-strip.is-cheering .practice-sparkles .material-icons:nth-child(6) { animation-delay: 0.5s; }
.practice-strip.is-cheering .practice-strip-icon { animation: practice-pop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.practice-live-bar:has(.practice-strip.is-cheering) { animation: practice-flash 1s ease-out; }
@keyframes practice-nudge { 0%, 74% { opacity: 0; } 100% { opacity: 1; } }
@keyframes practice-sparkles-fade { 0%, 60% { opacity: 1; } 85%, 100% { opacity: 0; } }
@keyframes practice-sparkle {
  0% { transform: scale(0); }
  25% { transform: scale(1.15) translateY(-4px); }
  45% { transform: scale(1) translateY(0); }
  100% { transform: scale(1); }
}
@keyframes practice-pop { 0% { transform: scale(0.6); } 100% { transform: scale(1); } }
@keyframes practice-flash { 0% { background: var(--practice-live); } 25% { background: #5f9df6; } 100% { background: var(--practice-live); } }

.practice-song-view { margin: 0 auto; }
.practice-song-empty { color: var(--color-stone); padding: 32px 16px; text-align: center; }

/* The summary, over everything */
.practice-summary {
  background: white;
  inset: 0;
  overflow: auto;
  position: fixed;
  z-index: 1000;
}
.practice-summary-inner {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  max-width: 560px;
  min-height: 100%;
  padding: 28px 20px 16px;
  text-align: center;
}
.practice-summary-icon { color: var(--practice-live); font-size: 64px; }
.practice-summary.is-short .practice-summary-icon { color: var(--color-stone-light); }
.practice-summary.is-cheering .practice-summary-icon { animation: practice-cheer 1.1s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.practice-summary.is-short.is-cheering .practice-summary-icon { animation: practice-drop 0.6s linear both; }
@keyframes practice-cheer { 0% { transform: scale(0); } 100% { transform: scale(1); } }
@keyframes practice-drop {
  0% { transform: translateY(-160px); }
  36% { transform: translateY(0); }
  54% { transform: translateY(-40px); }
  73% { transform: translateY(0); }
  86% { transform: translateY(-10px); }
  100% { transform: translateY(0); }
}
.practice-summary h1 { color: var(--color-charcoal); font-family: 'Lora', serif; font-size: 1.7rem; margin: 10px 0 18px; }
.practice-summary-lead { color: var(--color-stone); margin: 0; }
.practice-summary-total {
  color: var(--practice-live);
  font-size: 2.75rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 20px;
}
.practice-summary.is-short .practice-summary-total { color: var(--color-stone-light); }
.practice-summary-songs {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  flex: 0 1 auto;
  list-style: none;
  margin: 0 0 16px;
  overflow: auto;
  padding: 0;
  text-align: left;
}
.practice-summary-songs li { align-items: center; border-top: 1px solid var(--color-border); display: flex; gap: 12px; padding: 12px 14px; }
.practice-summary-songs li:first-child { border-top: 0; }
.practice-summary-song { flex: 1; min-width: 0; }
.practice-summary-time { color: var(--color-stone); font-variant-numeric: tabular-nums; font-weight: 700; }
.practice-summary-buttons { display: grid; gap: 8px; grid-template-columns: 1fr 1fr 1fr; margin-top: auto; }
.practice-summary-buttons button { padding: 14px 6px; white-space: nowrap; }
.practice-confetti { height: 100%; inset: 0; pointer-events: none; position: fixed; width: 100%; }
body.has-practice-summary { overflow: hidden; }

.practice-grass { height: 100vh; inset: 0; pointer-events: none; position: fixed; width: 100vw; z-index: 2000; }

/* Windows: Add a song, a song to try's chart, a question */
.practice-dialog {
  border: 0;
  border-radius: 10px;
  box-shadow: 0 20px 50px rgba(43, 37, 32, 0.28);
  color: var(--color-text-primary);
  max-height: 86vh;
  max-width: min(560px, calc(100vw - 32px));
  padding: 16px;
  width: 100%;
}
.practice-dialog::backdrop { background: rgba(43, 37, 32, 0.45); }
.practice-dialog-head { align-items: center; display: flex; gap: 8px; margin-bottom: 10px; }
.practice-dialog-head h2 { flex: 1; font-size: 1.15rem; margin: 0; }
.practice-search {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-sizing: border-box;
  font: inherit;
  margin-bottom: 8px;
  padding: 10px 12px;
  width: 100%;
}
.practice-picker-list { list-style: none; margin: 0; max-height: 56vh; overflow: auto; padding: 0; }
.practice-picker-song {
  align-items: center;
  background: none;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  font: inherit;
  gap: 10px;
  padding: 10px 8px;
  text-align: left;
  width: 100%;
}
.practice-picker-song:hover:not(:disabled) { background: var(--color-bg-hover); }
.practice-picker-song:disabled { cursor: default; opacity: 0.5; }
.practice-picker-title { flex: 1; font-weight: 600; }
.practice-picker-meta { color: var(--color-stone); font-size: 0.82rem; }
.practice-picker-bookmark { display: inline-flex; flex: none; }
.practice-picker-none { color: var(--color-stone); padding: 16px 8px; }
.practice-chart { max-width: min(980px, calc(100vw - 32px)); }
.practice-chart-body { padding: 0; }
.practice-ask { max-width: min(420px, calc(100vw - 32px)); }
.practice-ask h2 { font-size: 1.1rem; margin: 4px 0 10px; }
.practice-ask-message { color: var(--color-text-secondary); margin: 0 0 8px; white-space: pre-line; }
.practice-ask-buttons { display: flex; gap: 6px; justify-content: flex-end; margin-top: 8px; }
.practice-ask-yes { gap: 8px; }
.practice-ask-choices { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 4px 0 6px; }
.practice-ask-choice-row { display: flex; gap: 4px; justify-content: space-between; width: 100%; }
.practice-ask-choice { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; padding: 0;
  border: 1px solid transparent; border-radius: 8px; background: none; cursor: pointer; }
.practice-ask-choice:hover, .practice-ask-choice:focus-visible { border-color: var(--detail-rule, #d9cdb8); background: #f7f3ea; outline: none; }
.practice-ask-yes.is-danger { color: var(--color-error); }

.practice-note {
  background: var(--color-charcoal);
  border-radius: 8px;
  bottom: 20px;
  color: white;
  left: 50%;
  margin: 0;
  max-width: calc(100vw - 32px);
  padding: 10px 14px;
  position: fixed;
  transform: translateX(-50%);
  z-index: 1500;
}

@media (max-width: 640px) {
  .practice-screen { padding-top: 14px; }
  .practice-segment { font-size: 0.85rem; }
  .practice-summary-buttons button { font-size: 0.9rem; }
  .practice-sparkles { left: 90px; }
}

@media (prefers-reduced-motion: reduce) {
  .practice-strip.is-cheering .practice-sparkles,
  .practice-summary.is-cheering .practice-summary-icon,
  .practice-live-bar:has(.practice-strip.is-cheering) { animation: none; }
}

/* A reward rung up over the summary sits above its buttons, clear of the cheer. */
body.has-practice-summary .tip-ring-up { bottom: 96px; top: auto; }
