/* enCOЯE-inspired practice chrome (vanilla port of encore-frontend CTF board + modal) */

.practice-encore {
  --practice-surface: #0f0f0f;
  --practice-panel: #141414;
  --practice-card: rgba(28, 28, 28, 0.41);
  --practice-accent: #ed5f00;
  --practice-flame: #f26227;
  --practice-rise: #62d6ad;
  --practice-fall: #ff7779;
  min-height: 100vh;
  margin: 0;
  color: #fff;
  font-family: "Satoshi", sans-serif;
  background: #0f0f0f;
  overflow-x: hidden;
}

.practice-encore-glow {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 70% 42% at 12% 8%, rgba(237, 95, 0, 0.12), transparent 58%),
    radial-gradient(ellipse 55% 36% at 88% 18%, rgba(242, 98, 39, 0.06), transparent 62%),
    radial-gradient(ellipse 50% 30% at 50% 100%, rgba(237, 95, 0, 0.05), transparent 70%);
}

.practice-encore-main {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(96px, 10vw, 128px) clamp(20px, 5vw, 48px) 96px;
}

.practice-page-enter .practice-hub-header,
.practice-page-enter .practice-crumb,
.practice-page-enter .practice-kicker,
.practice-page-enter .practice-display,
.practice-page-enter .practice-lead {
  animation: practiceFadeUp 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.practice-page-enter .practice-lead {
  animation-delay: 0.06s;
}

.practice-page-enter .practice-callout,
.practice-page-enter .practice-hub-lanes {
  animation: practiceFadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.12s both;
}

.practice-page-enter .practice-lane-card {
  animation: practiceFadeUp 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: var(--practice-stagger, 0.16s);
}

@keyframes practiceFadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.practice-encore-brand {
  position: absolute;
  top: clamp(24px, 4vw, 40px);
  left: clamp(20px, 6vw, 120px);
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: #fff;
  text-decoration: none;
  font-family: "Satoshi-Black", sans-serif;
  letter-spacing: 0.04em;
  z-index: 2;
}

.practice-encore-brand img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.practice-encore-brand span .ya {
  color: var(--practice-accent);
}

.practice-crumb {
  margin: 0 0 1.25rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.4);
}

.practice-crumb a {
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
}

.practice-crumb a:hover {
  color: var(--practice-accent);
}

.practice-hub-header {
  max-width: 40rem;
}

.practice-section-label {
  margin: 0 0 1rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
}

.practice-hub-lanes {
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
}

.practice-kicker {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
}

.practice-display {
  margin: 0;
  font-family: "Satoshi-Black", sans-serif;
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.practice-lead {
  margin: 0.85rem 0 0;
  max-width: 34rem;
  font-size: 1rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.55);
}

.practice-lead a {
  color: var(--practice-accent);
  text-decoration: none;
}

.practice-lead a:hover {
  text-decoration: underline;
}

.practice-callout {
  margin: 1.25rem 0 0;
  max-width: 36rem;
  padding: 0.8rem 0.95rem;
  border-radius: 12px;
  border: 1px solid rgba(237, 95, 0, 0.28);
  background: rgba(237, 95, 0, 0.06);
  font-size: 0.88rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.72);
}

.practice-solved-line {
  margin: 1rem 0 0;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  color: rgba(255, 255, 255, 0.45);
}

.practice-lane-grid {
  margin-top: 0;
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 0.9rem;
}

@media (min-width: 720px) {
  .practice-lane-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.practice-lane-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 1.15rem 1.15rem 1.05rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--practice-card);
  color: #fff;
  text-decoration: none;
  transition:
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.3s ease,
    background-color 0.3s ease;
}

.practice-lane-card:hover {
  transform: translateY(-3px);
  border-color: rgba(237, 95, 0, 0.35);
  background: rgba(28, 28, 28, 0.55);
}

.practice-lane-card h2 {
  margin: 0.45rem 0 0.5rem;
  font-family: "Satoshi-Black", sans-serif;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.practice-lane-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9rem;
  line-height: 1.5;
  flex: 1;
}

.practice-lane-meta {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
}

.practice-lane-cta {
  margin-top: 1.1rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--practice-accent);
}

.practice-category {
  margin-top: clamp(3.5rem, 7vw, 6rem);
}

.practice-category + .practice-category {
  margin-top: clamp(3rem, 6vw, 5rem);
}

.practice-category-title {
  margin: 0;
  font-family: "Satoshi-Black", sans-serif;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.practice-challenge-grid {
  margin-top: 1.6rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.15rem;
}

@media (min-width: 640px) {
  .practice-challenge-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .practice-challenge-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  .practice-challenge-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.practice-challenge-card {
  appearance: none;
  display: flex;
  flex-direction: column;
  min-height: 168px;
  width: 100%;
  padding: 1rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--practice-card);
  color: #fff;
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition:
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.3s ease,
    background-color 0.3s ease;
}

.practice-challenge-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(28, 28, 28, 0.55);
}

.practice-challenge-card.is-solved {
  border-color: rgba(237, 95, 0, 0.45);
  background: rgba(237, 95, 0, 0.22);
}

.practice-challenge-top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.8rem;
  letter-spacing: -0.02em;
  color: rgba(255, 255, 255, 0.35);
}

.practice-challenge-card.is-solved .practice-challenge-top {
  color: rgba(255, 255, 255, 0.7);
}

.practice-challenge-title {
  margin: 0.75rem 0;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.15;
  padding: 0 0.25rem;
}

.practice-challenge-pts {
  text-align: center;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  color: rgba(255, 255, 255, 0.5);
}

.practice-challenge-card.is-locked {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.35);
}

.practice-challenge-card.is-locked:hover {
  transform: none;
  border-color: rgba(255, 255, 255, 0.08);
}

.practice-artifact-line {
  margin: 0.75rem 0 0;
}

.practice-artifact-link {
  color: var(--practice-accent);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
}

.practice-artifact-link:hover {
  text-decoration: underline;
}

.practice-levels-note {
  margin-top: 2rem;
}

.practice-drill-main {
  max-width: 720px;
}

.practice-drill-setup,
.practice-drill-question,
.practice-drill-end {
  margin-top: 1.5rem;
}

.practice-drill-meta,
.practice-drill-hint-line,
.practice-drill-progress-label {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.5;
}

.practice-drill-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.practice-drill-mode {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  border-radius: 999px;
  padding: 0.65rem 1.1rem;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.practice-drill-mode:hover:not(:disabled) {
  border-color: rgba(237, 95, 0, 0.5);
  background: rgba(237, 95, 0, 0.12);
}

.practice-drill-mode:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.practice-drill-progress {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.practice-drill-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--practice-accent), var(--practice-flame));
  transition: width 0.25s ease;
}

.practice-drill-prompt {
  margin: 0 0 1.25rem;
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.92);
}

.practice-drill-label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.practice-drill-input {
  width: 100%;
  margin-bottom: 0.85rem;
}

.practice-drill-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-top: 0.25rem;
}

.practice-drill-next-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.7rem 1.1rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  text-decoration: none;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.practice-drill-next-btn:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.28);
}

.practice-drill-next-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.practice-drill-score {
  margin: 0 0 1.25rem;
  font-family: "Satoshi-Black", sans-serif;
  font-size: clamp(2rem, 5vw, 2.8rem);
  letter-spacing: -0.03em;
}

.practice-drill-miss-list {
  margin: 0 0 1.5rem;
  padding-left: 1.2rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.55;
}

.practice-drill-miss-list li + li {
  margin-top: 0.45rem;
}

.practice-challenge-card.is-solved .practice-challenge-pts {
  color: rgba(255, 255, 255, 0.8);
}

.practice-note {
  margin-top: 3rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.4);
}

.practice-note a {
  color: var(--practice-accent);
  text-decoration: none;
}

.practice-note a:hover {
  text-decoration: underline;
}

.practice-loading {
  margin-top: 3rem;
  color: rgba(255, 255, 255, 0.45);
}

/* Modal */
.practice-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 2rem 1rem;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(10px);
  animation: practiceBackdropEnter 0.35s ease both;
}

.practice-modal {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 780px;
  min-height: min(540px, calc(100vh - 32px));
  margin: auto;
  padding: 44px clamp(28px, 5vw, 58px) 46px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #141414;
  box-shadow:
    0 48px 120px rgba(0, 0, 0, 0.72),
    0 0 90px -36px rgba(237, 95, 0, 0.4);
  animation: practiceModalEnter 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
  overflow: hidden;
}

.practice-modal::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(237, 95, 0, 0.7), transparent);
}

.practice-modal::after {
  content: "";
  pointer-events: none;
  position: absolute;
  top: -6rem;
  left: 50%;
  width: 70%;
  height: 12rem;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(237, 95, 0, 0.15);
  filter: blur(64px);
}

.practice-modal-close {
  position: absolute;
  top: 30px;
  right: 28px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

.practice-modal-close:hover {
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.practice-modal-meta {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding-right: 3rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.practice-modal-meta .cat {
  color: var(--practice-accent);
}

.practice-modal-meta .diff {
  color: rgba(255, 255, 255, 0.45);
}

.practice-modal-meta .dot {
  color: rgba(255, 255, 255, 0.2);
}

.practice-solved-pill {
  border-radius: 999px;
  border: 1px solid rgba(237, 95, 0, 0.4);
  background: rgba(237, 95, 0, 0.15);
  padding: 0.25rem 0.65rem;
  color: var(--practice-accent);
  font-size: 0.62rem;
}

.practice-modal-title {
  position: relative;
  margin: 0.75rem 0 0;
  max-width: 620px;
  padding-right: 2rem;
  font-family: "Satoshi-Black", sans-serif;
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 0.94;
  letter-spacing: -0.055em;
}

.practice-modal-pts {
  position: relative;
  margin: 0.75rem 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
}

.practice-modal-pts strong {
  color: var(--practice-accent);
  font-weight: 700;
}

.practice-modal-prompt {
  position: relative;
  margin: 2rem 0 0;
  max-height: 190px;
  overflow-y: auto;
  padding: 1rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(23, 23, 23, 0.8);
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.95rem;
  line-height: 1.55;
  white-space: pre-wrap;
  scrollbar-width: none;
}

.practice-modal-prompt::-webkit-scrollbar {
  display: none;
}

.practice-modal-form {
  position: relative;
  margin-top: auto;
  padding-top: 2rem;
}

.practice-modal-row {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}

@media (max-width: 520px) {
  .practice-modal-row {
    flex-direction: column;
  }
}

.practice-modal-input {
  flex: 1;
  min-width: 0;
  height: 48px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #0f0f0f;
  color: #fff;
  padding: 0 17px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  outline: none;
}

.practice-modal-input:focus {
  border-color: var(--practice-accent);
}

.practice-modal-submit {
  height: 48px;
  min-width: 128px;
  border: none;
  border-radius: 10px;
  background: var(--practice-accent);
  color: #fff;
  font-family: "Satoshi", sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  padding: 0 22px;
}

.practice-modal-submit:hover:not(:disabled) {
  background: #ff6a08;
}

.practice-modal-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.practice-hint-btn {
  margin-top: 0.75rem;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
  cursor: pointer;
}

.practice-hint-btn:hover {
  border-color: rgba(237, 95, 0, 0.4);
  color: #fff;
}

.practice-hint {
  margin: 0.75rem 0 0;
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.9rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.65);
}

.practice-verdict {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 10px 13px;
  background: rgba(23, 23, 23, 0.92);
}

.practice-verdict-icon {
  display: flex;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.95rem;
}

.practice-verdict-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.practice-verdict-msg {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.62);
}

.practice-verdict.is-checking {
  color: #f26000;
}

.practice-verdict.is-ok {
  border-color: rgba(98, 214, 173, 0.28);
  color: var(--practice-rise);
}

.practice-verdict.is-bad {
  border-color: rgba(255, 119, 121, 0.24);
  color: var(--practice-fall);
}

.practice-verdict-scan {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 34%;
  height: 2px;
  background: #f26000;
  box-shadow: 0 0 12px rgba(242, 96, 0, 0.75);
  animation: practiceScan 1.1s ease-in-out infinite;
}

@keyframes practiceBackdropEnter {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes practiceModalEnter {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes practiceScan {
  0% {
    transform: translateX(-20%);
    opacity: 0.4;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translateX(280%);
    opacity: 0.4;
  }
}

.practice-choices {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 1rem 0 0;
}

.practice-choice {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.92rem;
}

.practice-choice:has(input:checked) {
  border-color: rgba(237, 95, 0, 0.55);
  background: rgba(237, 95, 0, 0.1);
}
