:root {
  --score-color: green;
}

div.center-prose {
  max-width: 60vh;
  margin-inline: auto;
}

div.offscreen {
  position: fixed;
  left: -100px;
  top: -100px;
}

div.center-align {
  text-align: center;
}

img.logo {
  display: inline-block;
  width: 60vh;
  height: auto;
}

/***
 * Question
 */
.submit-and-answer {
  margin-block-start: 1.5em;
}

div.question.reveal label { 
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

label:has(input[type=radio]) {
    width: 100%;
    
    border-style: solid;
    border-color: var(--border);
    border-width: 1px;
    border-radius: var(--standard-border-radius);

    text-align: center;
    position: relative;

    margin-block: 0.5em;
    padding-block: 0.4em;
    font-size: 0.9em;
    font-weight: bold;
    box-sizing: border-box;
    cursor: pointer;
}

label:has(input[type=radio]):hover {
    border-color: var(--accent-hover);
    color: var(--accent-hover);
}

label:has(input[type=radio]:disabled):hover {
    border-color: var(--border);
    color: var(--text);
}

label:has(input[type=radio]:checked) {
    color: var(--accent-text);
    background-color: var(--accent);
}

label:has(input[type=radio].answer:checked) {
    background: green;
    color: white;
}

label:has(input[type=radio].answer) {
    border-color: green;
    color: green;
    border-width: 2px;
    padding-block: calc(0.4em - 1px);
}

label:has(input[type=radio].wrong:checked) {
    background: red;
    color: white;
    border-color: grey;
}

label i {
    position: absolute;
    left: 6px;
    display: none;
}

label:has(input[type=radio].wrong:checked) i,
label:has(input[type=radio].answer) i {
    display: inline-block;
}


input[type=radio] {
    visibility: hidden;
    height: 0;
    width: 0;
    padding: 0;
    margin: 0;
    margin-inline-start: -1px;
}

.hidden {
  display: none !important;
}

.vspacer {
  height: 2em;
}

h4 {
  margin-bottom: 0.8rem;
}

/**
 * Your score
 */
div.score-wrapper {
  text-align: center;
}

div.yourscore {
  margin-inline: auto;
  position: relative;
  text-align: left;

  width: 250px;
  height: 250px;
}

div.yourscore svg {
  position: absolute;

  width: 100%;
  height: 100%;
  z-index: -10;
}

div.yourscore svg path {
  stroke: #ccc;
}

div.yourscore svg path.score {
  stroke: var(--score-color);
}


div.yourscore .counter {
  position: absolute;
  font-size: 4em;

  top: calc(50% - 0.75em);
  left: 0;
  width: 100%;
  text-align: center;
  color: var(--score-color);

  z-index: 10;
}

div.post-score {
  margin-block-start: 2em;
}

div.rank {
  font-size: 1.5em;
  text-align: center;
}

/**
 * Page transition
 */
@view-transition {
  navigation: auto;
}

 
@keyframes move-out {
  from {
    transform: translateX(0%);
  }

  to {
    transform: translateX(-100%);
  }
}

@keyframes move-in {
  from {
    transform: translateX(100%);
  }

  to {
    transform: translateX(0%);
  }
}

@keyframes fade-out {
  from {
    opacity: 100%;
  }

  to {
    opacity: 0;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 100%;
  }
}


/* Apply the custom animation to the old and new page states */
::view-transition-old(root) {
  animation: 0.3s ease-in both move-out;
}

::view-transition-new(root) {
  animation: 0.3s ease-in both move-in;
}

:root.fade-transition::view-transition-old(root) {
  animation: 0.3s ease-in both fade-out;
}

:root.fade-transition::view-transition-new(root) {
  animation: 0.3s ease-in both fade-in;
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root) {
    animation: 0.3s ease-in both fade-out;
  }

  ::view-transition-new(root) {
    animation: 0.3s ease-in both fade-in;
  }
}
