html {
  font-size: 87.5%;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  background: #f0f0f0;
  color: #333;
  line-height: 1.6;
  padding: 0.5rem;
}

header {
  text-align: center;
  margin-bottom: 1rem;
}

header h1 a {
  color: inherit;
  text-decoration: none;
}

header h1 a:hover {
  opacity: 0.7;
}

.assessment-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0.5rem;
  z-index: 100;
  background: #fff;
  padding: 0.25rem 0.3rem;
  margin: 0 auto 0.5rem;
  max-width: 800px;
  border: 1px solid #000;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgb(0 0 0 / 10%);
}

.assessment-item {
  font-weight: bold;
  font-size: 0.8rem;
}

.summary {
  max-width: 800px;
  margin: 0 auto 0.5rem;
  background: #fff;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgb(0 0 0 / 10%);
}

body > h2 {
  max-width: 1200px;
  margin: 1rem auto 0.5rem;
  padding: 0 0.75rem;
}

.summary h2 {
  margin-bottom: 0.5rem;
}

.assessment {
  font-weight: bold;
}

.assessment.unknown {
  color: #888;
}

.assessment.beginner {
  color: #ef4444;
}

.assessment.novice {
  color: #f97316;
}

.assessment.learner {
  color: #f59e0b;
}

.assessment.developing {
  color: #eab308;
}

.assessment.intermediate {
  color: #84cc16;
}

.assessment.competent {
  color: #22c55e;
}

.assessment.proficient {
  color: #10b981;
}

.assessment.advanced {
  color: #14b8a6;
}

.assessment.expert {
  color: #06b6d4;
}

.assessment.master {
  color: #8b5cf6;
}

#shotList {
  list-style: none;
  font-size: 0.85rem;
}

@media (width >= 600px) {
  #shotList {
    columns: 2;
    column-gap: 8rem;
  }
}

#shotList li {
  display: flex;
  justify-content: space-between;
  padding: 0.2rem 0;
  border-bottom: 1px solid #eee;
  break-inside: avoid;
}

#shotList a {
  color: inherit;
  text-decoration: none;
}

#shotList a:hover {
  text-decoration: underline;
}

.status-unknown {
  color: #888;
}

.status-pass {
  color: #22c55e;
}

.status-fail {
  color: #ef4444;
}

.question-block {
  max-width: 1200px;
  margin: 0 auto 0.75rem;
  background: #fff;
  padding: 0.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgb(0 0 0 / 10%);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  scroll-margin-top: 4rem;
}

@media (width >= 768px) {
  .question-block {
    flex-direction: row;
    align-items: flex-start;
  }

  .question-text {
    flex: 1;
  }

  .question-diagram {
    flex: 2;
  }
}

.question-diagram svg.billiards-table {
  width: 100%;
  height: auto;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
}

/* SVG Diagram Style Overrides */
.manual-line {
  opacity: 0.5;
}

.fine-stroke {
  stroke-dasharray: 0.06 0.03;
}

.play-btn {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.375rem 0.75rem;
  background-color: #2563eb;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.play-btn:hover {
  background-color: #1d4ed8;
}

@keyframes ring-expand-green {
  0% {
    box-shadow: 0 0 0 0 rgb(34 197 94 / 80%);
    color: inherit;
  }

  50% {
    color: #16a34a;
  }

  100% {
    box-shadow: 0 0 0 20px rgb(34 197 94 / 0%);
    color: inherit;
  }
}

@keyframes ring-expand-red {
  0% {
    box-shadow: 0 0 0 0 rgb(239 68 68 / 80%);
    color: inherit;
  }

  50% {
    color: #dc2626;
  }

  100% {
    box-shadow: 0 0 0 20px rgb(239 68 68 / 0%);
    color: inherit;
  }
}

.q-stats.updated.q-pass {
  animation: ring-expand-green 2s ease-out 2;
}

.q-stats.updated.q-fail {
  animation: ring-expand-red 2s ease-out 2;
}

.reset-btn {
  padding: 0.25rem 0.5rem;
  background-color: #ef4444;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  margin-left: 0.25rem;
}

.reset-btn:hover {
  background-color: #dc2626;
}

.lobby-btn {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background-color: #2563eb;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
}

.lobby-btn:hover {
  background-color: #1d4ed8;
}

/* Iframe overlay */
#gameOverlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgb(0 0 0 / 80%);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

#gameOverlay.active {
  display: flex;
}

.iframe-container {
  width: 80%;
  height: 80%;
  background: #000;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
}

.iframe-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #fff;
  color: #000;
  border: none;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 4px;
  font-weight: bold;
}
