/* Practice demo — strict port of BubType panel-practice.css (dark, no card plate). */

.practice-demo {
  --practice-bg: transparent;
  --practice-ink: #f5f5f5;
  --practice-muted: #9a9aa3;
  --practice-theme: #ff4d6d;
  --practice-hover: rgba(255, 255, 255, 0.06);
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 380px;
  overflow: visible;
  background: var(--practice-bg);
  color: var(--practice-ink);
  user-select: none;
  outline: none;
}

.practice-demo-nav {
  flex: none;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 6px 4px 6px 0;
}

.practice-demo-nav-left,
.practice-demo-nav-center,
.practice-demo-nav-right {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.practice-demo-nav-left {
  justify-self: start;
}

.practice-demo-nav-center {
  justify-self: center;
}

.practice-demo-nav-right {
  justify-self: end;
  flex-shrink: 0;
}

.practice-demo-tools {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.practice-demo-tool {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--practice-muted);
  font-size: 13px;
  box-shadow: none;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.practice-demo-tool:hover {
  color: var(--practice-ink);
  background: transparent;
}

.practice-demo-tool.on {
  color: var(--practice-theme);
  background: transparent;
}

.practice-demo-tool.on:hover {
  color: var(--practice-theme);
}

.practice-demo-tool svg,
.practice-demo-tool i,
.practice-demo-xy-nav i,
.practice-demo-speak i {
  width: 1em;
  font-size: 13px;
  line-height: 1;
  pointer-events: none;
}

.practice-demo-speak i {
  font-size: 15px;
}

.practice-demo-xy-nav i {
  font-size: 11px;
}

.practice-demo-rate {
  width: auto;
  min-width: 36px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.practice-demo-meta {
  margin: 0;
  flex-shrink: 0;
  padding: 4px 2px;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--practice-muted);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  line-height: 1.2;
}

.practice-demo-meta:hover {
  color: var(--practice-ink);
}

.practice-demo-xy-nav {
  flex-shrink: 0;
  width: 22px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--practice-muted);
  font-size: 11px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.practice-demo-xy-nav:hover {
  color: var(--practice-ink);
}

.practice-demo-scene {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  justify-items: center;
  align-content: center;
  padding: 24px 24px 28px;
}

.practice-demo-sparks {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.practice-demo-combo-slot {
  position: absolute;
  top: 12px;
  right: 20px;
  z-index: 2;
  pointer-events: none;
  transform: scale(0.85);
  transform-origin: top right;
}

.practice-demo-combo-slot[hidden] {
  display: none !important;
}

.practice-demo-card {
  align-self: center;
  display: grid;
  justify-items: center;
  gap: 14px;
  width: min(900px, 100%);
  text-align: center;
  z-index: 2;
}

.practice-demo-word-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  max-width: 100%;
}

.practice-demo-line {
  margin: 0;
  font-size: clamp(32px, 4.6vw, 52px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
  color: var(--practice-ink);
  transition: transform 75ms ease-out;
}

.practice-demo-ch {
  position: relative;
  display: inline-block;
  line-height: 1;
  vertical-align: baseline;
  color: color-mix(in srgb, var(--practice-theme) 38%, transparent);
}

.practice-demo-ch.typed {
  background-image: linear-gradient(
    105deg,
    #ffe8ed 0%,
    #ff4d6d 28%,
    #ff3355 55%,
    #ffc2ce 78%,
    #ff4d6d 100%
  );
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: practice-ink-flow 7s ease-in-out infinite;
}

.practice-demo-ch.bad {
  color: #c44747 !important;
  -webkit-text-fill-color: #c44747;
  background-image: none;
  animation: none;
}

.practice-demo-ch.fresh {
  filter: drop-shadow(0 0 8px color-mix(in srgb, #ff4d6d 55%, transparent));
}

@keyframes practice-ink-flow {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.practice-demo .miss-flash {
  display: inline;
  font-weight: 700;
  color: #c44747;
  animation: practice-miss-pop 0.32s ease-out;
}

.practice-demo-word {
  display: inline;
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  outline: none;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
}

.practice-demo-word:focus,
.practice-demo-word:focus-visible,
.practice-demo-word:active {
  outline: none;
  background: none;
  box-shadow: none;
}

.practice-demo-caret {
  position: absolute;
  left: 0;
  top: 0.06em;
  bottom: 0.06em;
  width: 2px;
  height: auto;
  margin: 0;
  background: var(--practice-theme);
  border-radius: 1px;
  animation: practice-demo-blink 1s steps(1) infinite;
  pointer-events: none;
}

.practice-demo-end-caret {
  position: relative;
  display: inline-block;
  width: 0.12em;
  height: 1em;
  vertical-align: baseline;
  line-height: 1;
}

.practice-demo-end-caret .practice-demo-caret {
  left: 0;
  top: 0.06em;
  bottom: 0.06em;
}

.practice-demo.rejected .practice-demo-caret {
  background: #ef4444;
}

.practice-demo-speak {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--practice-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.practice-demo-speak:hover {
  background: var(--practice-hover);
  color: var(--practice-ink);
}

.practice-demo-ipa {
  margin: 2px 0 0;
  font-size: 14px;
  font-weight: 400;
  color: var(--practice-muted);
  letter-spacing: 0.01em;
}

.practice-demo-gloss {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  color: color-mix(in srgb, var(--practice-ink) 78%, var(--practice-muted));
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(560px, 86%);
}

.practice-demo-lookup {
  position: absolute;
  z-index: 12;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  width: min(300px, calc(100% - 48px));
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.practice-demo-lookup[hidden] {
  display: none !important;
}

.practice-demo-status {
  margin: 0;
  padding: 0 16px 8px;
  font-size: 12px;
  color: var(--practice-muted);
  text-align: center;
  min-height: 1.4em;
}

.practice-demo-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

@keyframes practice-demo-blink {
  50% {
    opacity: 0;
  }
}

@keyframes practice-miss-pop {
  0% {
    opacity: 0;
    transform: translateY(0.12em);
  }
  18% {
    opacity: 1;
    transform: translateY(0);
  }
  70% {
    opacity: 1;
  }
  100% {
    opacity: 0.35;
  }
}

@media (prefers-reduced-motion: reduce) {
  .practice-demo-ch.typed {
    animation: none;
    background-image: none;
    color: var(--practice-theme);
    -webkit-text-fill-color: var(--practice-theme);
  }
}

@media (max-width: 760px) {
  .practice-demo {
    min-height: 320px;
  }
  .practice-demo-scene {
    padding: 16px 8px 24px;
  }
  .practice-demo-line {
    font-size: clamp(22px, 6.2vw, 32px);
  }
  .practice-demo-combo-slot {
    transform: scale(0.7);
    right: 8px;
    top: 4px;
  }
}
