/* Variables */
:root {
  --primary: #d51675;
  --primary-dark: #b00f5f;
  --secondary: #6c757d;
  --success: #28a745;
  --danger: #dc3545;
  --bg-light: #f8f9fa;
  --text-main: #212529;
  --text-muted: #6c757d;
  --radius: 12px;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  --font-ui: "Segoe UI", system-ui, sans-serif;
}

[v-cloak] {
  opacity: 0;
}

/* Wrapper */
.qx-wrapper {
  min-height: 500px;

  border-radius: var(--radius);
  /*
    box-shadow: var(--shadow);
    */
  background: rgba(255, 224, 195, 0.3);
  padding: 30px;
  position: relative;
  overflow: hidden;
  margin-bottom: 1.5em;
}

/* Transitions */
.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.2s ease;
}
.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}
.slide-up-enter-active {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.slide-up-enter-from {
  opacity: 0;
  transform: translateY(20px);
}

/* Buttons */
.qx-btn {
  border: none;
  padding: 12px 24px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.98rem;
  text-align: center;
  cursor: pointer;
  transition: 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}
.qx-btn svg {
  width: 1.6rem;
  height: 1.6rem;
}
.qx-btn-primary {
  background: var(--primary);
  color: white;
}
.qx-btn-primary:hover {
  background: var(--primary-dark);
}
.qx-btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.qx-btn-secondary {
  background: var(--secondary);
  color: white;
}
.qx-btn-success {
  background: var(--success);
  color: white;
}
.qx-btn-sm {
  font-size: 0.9rem;
  padding: 8px 16px;
}
.qx-btn-lg {
  font-size: 1.5rem;
}
.qx-btn-pulse {
  animation: qx-pulse 2s infinite;
}
.qx-btn-pulse-success {
  animation: qx-pulse-success 2s infinite;
}
.qx-btn-primary:hover,
.qx-btn-pulse:hover,
.qx-btn-success:hover {
  color: #fff !important;
}

.qx-link-muted {
  color: var(--text-muted);
  font-size: 0.9em;
  text-decoration: underline;
}

/* Loader */
.qx-loader {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.9);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qx-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #eee;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: qx-spin 0.8s linear infinite;
}

/* Common Text/Image */
.qx-main-title {
  font-weight: 900;
  font-size: 2rem;
  color: var(--primary);
  text-align: center;
  margin-bottom: 1.2rem;
}
.qx-description {
  text-align: center;
  font-size: 1.15rem;
  color: #444;
  line-height: 1.31;
  text-wrap: balance;
  margin-bottom: 2rem;
}
.qx-instructions {
  font-size: 1.15rem;
}
.qx-img-fluid {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  aspect-ratio: 16/9;
  object-fit: cover;
}
.qx-rounded {
  border-radius: 8px;
}
.qx-shadow-sm {
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Start View */
.qx-attachments-grid {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
  margin: 20px 0;
}
.qx-contest-info {
  background: #fff8e1;
  color: #856404;
  padding: 12px;
  border-radius: 8px;
  text-align: center;
  margin: 20px 0;
  border: 1px solid #ffeeba;
}
.qx-actions {
  text-align: center;
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Question View */
.qx-status-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 25px;
}
.qx-progress-track {
  height: 6px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.2rem;
}
.qx-progress-fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.4s ease;
}
.qx-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}
.qx-timer-badge {
  padding: 5px 10px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  color: var(--text-main);
  display: flex;
  font-size: 0.88em;
  align-items: center;
  gap: 5px;
}
.qx-timer-badge span {
  font-weight: 400;
  min-width: 5ch;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.qx-timer-badge span b {
  font-weight: 600;
}

.qx-timer-urgent {
  background: #ffe3e3;
  color: var(--danger);
  animation: qx-pulse-red 1s infinite;
}
.qx-question-title {
  text-align: center;
  font-weight: bold;
  margin-bottom: 20px;
  font-size: 1.3rem;
  color: #333;
}
.qx-question-content .qx-attachments-grid {
  margin-top: -5px;
  margin-bottom: 25px;
}

/* Answers */
.qx-answers-grid {
  margin-top: 0.3rem;
  display: grid;
  gap: 15px;
  grid-template-columns: 1fr;
}
@media (min-width: 600px) {
  .qx-answers-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.qx-answer-card {
  background: #fff;
  /*border: 2px solid #e9ecef;*/
  border: 2px solid rgba(255, 224, 195, 0.8);
  border-radius: 10px;
  padding: 15px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 60px;
}
@media (hover: hover) {
  .qx-answer-card:hover:not(:disabled) {
    border-color: var(--primary);
    background: #fff5f9;
  }
}
.qx-answer-card.qx-selected {
  border-color: var(--primary);
  background: #fff0f6;
  /* Removed font-weight change to prevent height jump */
}
.qx-answer-card.qx-is-correct {
  background: #d4edda;
  border-color: #c3e6cb;
  color: #155724;
}
.qx-answer-card.qx-is-wrong {
  background: #f8d7da;
  border-color: #f5c6cb;
  color: #721c24;
}
.qx-answer-card.qx-dimmed {
  opacity: 0.8;
}
.qx-answer-card:disabled {
  cursor: default;
}
.qx-answer-card:has(.qx-audio-wrapper) {
  text-align: center;
}
.qx-answer-card *:not(:last-child):not(.qx-spinner-sm):not(.qx-img-fluid) {
  margin-bottom: 0.785rem;
}

.qx-ans-body {
  flex: 1;
}
.qx-ans-text {
  font-weight: 600;
  display: block;
}
.qx-mini-att img {
  border-radius: 4px;
}
.qx-feedback-icon {
  font-weight: bold;
  font-size: 0.8rem;
  text-transform: uppercase;
  margin-left: 10px;
}

.qx-spinner-sm {
  position: absolute;
  right: 15px;
  top: 50%;
  margin-top: -10px;
  width: 20px;
  height: 20px;
  border: 2px solid #ccc;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: qx-spin 0.8s linear infinite;
}

/* Feedback Notification */
.qx-feedback-notification {
  background: #fff;
  border: 2px solid;
  border-left: 7px solid transparent;
  padding: 15px 15px 21px 15px;
  margin: 15px 0px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.55);
  display: flex;
  gap: 15px;
  align-items: flex-start;
  font-size: 1rem;
  position: relative;
  overflow: hidden;
}
.qx-feedback-notification.qx-is-success {
  border-color: #c3e6cb;
  background: #f0fff4;
}

.qx-feedback-notification.qx-is-success strong {
  color: #155724;
}

.qx-feedback-notification.qx-is-error {
  border-color: #f5c6cb;
  background: #fff5f5;
}

.qx-feedback-notification.qx-is-error strong {
  color: #721c24;
}

.qx-fb-funfact {
  margin-top: 0.3rem;
  display: flex;
  gap: 0.6em;
  align-items: center;
  font-size: 0.95rem;
  opacity: 0.8;
}
.qx-fb-funfact svg {
  width: 1.1rem;
  height: 1.1rem;
}

.qx-fb-icon {
  font-size: 1.5rem;
}


.qx-auto-advance-bar {
  position: absolute;
  border-radius: 8px;
  left: 12px;
  bottom: 10px;
  margin-right: 5px;
  height: 5px;
  background: rgba(0, 0, 0, 0.05);

  width: 0;
  animation: qx-expand 3s linear forwards;
}


/* Result */
.qx-result-card {
  text-align: center;
  padding: 5px 20px;
}
.qx-result-label {
  font-size: 1.3rem;
  margin: 12px 0px;

  font-weight: 700;
}
.qx-score-ring {
  width: 160px;
  margin: 0 auto 30px;
}
.qx-circular-chart {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  max-height: 250px;
  background: #fff;
  border-radius: 50%;
  padding: 6px;
  box-shadow: 3px 3px 25px rgba(0, 0, 0, 0.06);
}
.qx-circle-bg {
  fill: none;
  stroke: rgba(0, 0, 0, 0.1);
  stroke-width: 3.8;
}
.qx-circle-fg {
  fill: none;
  stroke: var(--primary);
  stroke-width: 2.8;
  stroke-linecap: round;
  animation: qx-progress 1s ease-out forwards;
}
.qx-percentage {
  fill: #666;
  font-family: sans-serif;
  font-weight: bold;
  font-size: 0.5em;
  text-anchor: middle;
}
.qx-result-title {
  font-size: 1.9rem;
  font-weight: 800;
  margin-top: 7px;
  color: var(--text-main);
  line-height: 1.2;
}
.qx-result-desc {
  font-size: 1.2rem;
  color: #555;
  line-height: 1.6;
  margin-top: 15px;
  margin-bottom: 30px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}
.qx-actions-row {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin: 10px 0 10px;
  font-size: 0.85em;
}
.qx-actions-row .qx-btn:hover {
  color: inherit;
}
.qx-contest-cta {
  background: #e8f5e9;
  padding: 20px;
  border-radius: 8px;
  margin-top: 30px;
  border: 1px solid #c8e6c9;
  text-align: center;
}
.qx-contest-card h4 {
  font-size: 1.4rem;
  margin-bottom: 8px;
}

/* Result Stats */
.qx-result-stats {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin: 30px 0;
}
.qx-stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
  padding: 10px;
  border-radius: 8px;
  background: #f8f9fa;
  border: 1px solid #eee;
}
.qx-stat-box.qx-stat-correct {
  border-color: #c3e6cb;
  background: #f0fff4;
  color: #155724;
}
.qx-stat-box.qx-stat-wrong {
  border-color: #f5c6cb;
  background: #fff5f5;
  color: #721c24;
}
.qx-stat-box.qx-stat-time {
  border-color: #b8daff;
  background: #f0f7ff;
  color: #004085;
}
.qx-stat-box .qx-stat-val {
  font-size: 1.5rem;
  font-weight: bold;
  line-height: 1;
  margin-bottom: 4px;
}
.qx-stat-box .qx-stat-lbl {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.8;
}

/* Audio Player */
.qx-audio-wrapper {
  display: inline-flex;
  background: #fff;
  border-radius: 9px;
  align-items: center;
}
.qx-audio-wrapper::before {
  font-size: 0.9em;
  font-weight: 500;
  opacity: 0.5;
  content: "Posłuchaj";
  padding: 0px 0.756rem;
  display: inline-block;
}
.qx-btn-audio {
  width: 44px;
  height: 44px;
  border-radius: 9px;
  background: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}
.qx-btn-audio:hover {
  transform: scale(1.1);
  background: var(--primary-dark);
}
.qx-btn-audio.qx-playing {
  background: #333;
}

/* Error Overlay */
.qx-error-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.7);
   backdrop-filter: blur(19px);

  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
}

/* Media Author */
.qx-media-wrapper {
  position: relative;
  display: inline-block;
  max-width: 100%;
}
.qx-img-author {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 0.75rem;
  padding: 0.375rem 0.576rem;
  border-radius: 4px;
  pointer-events: none;
  backdrop-filter: blur(2px);
  z-index: 2;
  line-height: 1;
  opacity: 0.8;
}
.qx-author-sm {
  font-size: 0.55rem;
  padding: 1px 4px;
  bottom: 2px;
  right: 2px;
}

.qx-att-item {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Animations */
@keyframes qx-spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes qx-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(213, 22, 117, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(213, 22, 117, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(213, 22, 117, 0);
  }
}
@keyframes qx-pulse-success {
  0% {
    box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
  }
}

@keyframes qx-pulse-red {
  0% {
    color: var(--danger);
    opacity: 0.2;

  }
  50% {
    color: #ff6b6b;
    opacity: 1;
  }
  100% {
    color: var(--danger);
    opacity: 0.2;

  }
}
@keyframes qx-expand {
  to {
    width: 100%;
  }
}
@keyframes qx-progress {
  0% {
    stroke-dasharray: 0 100;
  }
}

/* Mobile Optimizations */
@media (max-width: 966px) {
  .qx-wrapper {
    padding: 20px 15px;
    min-height: auto;
  }

  /* Typography Scales */
  .qx-main-title,
  .qx-result-title {
    font-size: 1.23rem;
    margin-bottom: 0.8rem;
  }
  .qx-description,
  .qx-instructions,
  .qx-result-desc {
    font-size: 1rem;
    line-height: 1.32;
  }
  .qx-question-title {
    font-size: 1.08rem;
  }



  /* Layout Adjustments */
  .qx-actions .qx-btn,
  .qx-actions-row .qx-btn,
  .qx-contest-card .qx-btn {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 10px 16px;
    font-size: 1rem;
  }
  .qx-actions-row {
    margin: 10px 0px;
    flex-direction: column;
    gap: 12px;
  }

  .qx-feedback-notification {
    padding: 9px 9px 19px 9px;
  }

  /* Stats & Results */
  .qx-result-stats {
    gap: 8px;
    flex-wrap: nowrap;
    margin: 20px 0 10px;
  }
  .qx-stat-box {
    min-width: 0;
    flex: 1;
    padding: 8px 4px;
  }
  .qx-stat-val {
    font-size: 1.15rem;
    margin-bottom: 2px;
  }
  .qx-stat-lbl {
    font-size: 0.6rem;
    letter-spacing: 0;
  }

  .qx-result-card {
    padding: 0px;
  }
  .qx-score-ring {
    width: 110px;
    margin-bottom: 15px;
  }
  .qx-result-label {
    font-size: 0.85rem;
    margin-bottom: 8px;
  }
  .qx-result-title {
    margin-top: 12px;
    line-height: 1.3;
  }
  .qx-result-desc {
    margin-top: 10px;
    margin-bottom: 20px;
    padding: 0 5px;
  }

  .qx-answers-grid {
    gap: 11px;
  }

  /* Contest */
  .qx-contest-cta {
    padding: 15px;
    margin-top: 20px;
  }
  .qx-contest-card h4 {
    font-size: 1.2rem;
  }
  .qx-contest-card .qx-btn {
    margin-top: 10px;
    display: block;
  }

  /* Answers */
  .qx-answer-card {
    padding: 12px;
    min-height: 54px;
  }
  .qx-ans-text {
    font-size: 0.9rem;
  }

  /* Misc */
  .qx-status-bar {
    margin-bottom: 30px;
  }
  .qx-timer-badge {
    font-size: 0.85rem;
    padding: 3px 8px;
  }
  .qx-score-ring {
    width: 100px;
  }

  .qx-feedback-notification {
    font-size: .9rem;
  }
  .qx-fb-funfact {
    font-size: .78rem;
  }
}

.qx-element-lead {
    font-size: .94em;
    opacity: .8;
}

.qx-cover-badge {
    font-size: .9rem !important;
    padding: .2rem .2rem .2rem .6rem !important;
    position: absolute;
    font-weight: 600;
    bottom: 9px;
    right: 9px;
    gap: 6px;
}

.qx-wrapper .form-control {
    border: 2px solid rgba(255, 224, 195, 1);
}

.qx-cf-image {
  text-align: center;
}

.qx-cf-image img {
    max-width: 400px;
    width: 100%;
    margin: auto;
}

.qx-primary-color {
    color: var(--primary);
}

.qx-fs-xl {
    font-size: 1.5rem;
}
.qx-fs-lg {
    font-size: 1.3rem;
}
.qx-fs-md {
    font-size: 1.1rem;
}

.qx-fs-xs {
    font-size: 0.9rem;
}

.qx-app-layer {
  margin: 20px;
  background: rgba(255,255,255, 0.5);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0px 0px 55px rgba(0,0,0,0.04);
}

.qx-app-layer .qx-header,
.qx-app-layer .qx-form {
  padding: 35px;
}

.qx-app-layer .qx-header {
  background: #fff;
  box-shadow: 0px 0px 55px rgba(0,0,0,0.04);
}

.qx-app-layer .qx-form {
}

@media (max-width: 768px) {
  .qx-wrapper-cf {
    padding: 11px;
  }
  .qx-app-layer {
    margin: 0px;
  }
  .qx-app-layer .qx-header,
  .qx-app-layer .qx-form {
    padding: 18px;
  }

}