:root {
  --color-bg: #238f51;
  --color-card: #ffffff;
  --color-primary: #238f51;
  --color-accent: #fec126;
  --color-danger: #f05d4d;
  --color-text: #1a1a3a;
  --color-muted: #6f7280;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.home-screen {
  width: min(100%, 430px);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 56px;
  padding: 44px 28px;
}

.app-title {
  margin: 0;
  color: #ffffff;
  font-size: clamp(1.5rem, 6vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-align: center;
}

.menu-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.menu-button,
.settings-button {
  display: grid;
  place-items: center;
  border-radius: 28px;
  background: var(--color-card);
}

.menu-button {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.menu-button {
  text-decoration: none;
  color: inherit;
}

.app-icon {
  font-size: clamp(3rem, 12vw, 4rem);
  font-variation-settings: 'FILL' 0;
}

.menu-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.menu-button:first-child {
  background: #ffffff;
}

.menu-button:nth-child(2) {
  background: #ffffff;
}

.settings-button {
  width: auto;
  height: auto;
  background: transparent;
  color: #ffffff;
}

.settings-icon {
  font-size: 2.2rem;
}

.menu-button:active,
.settings-button:active {
  transform: scale(0.94);
}

.temporary-screen {
  width: min(100%, 430px);
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  display: grid;
  place-items: center;
  padding: 40px 24px;
}

.back-button {
  position: absolute;
  top: 24px;
  left: 24px;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--color-card);
  color: var(--color-text);
  font-size: 2rem;
  font-weight: 800;
  transition: transform 160ms ease;
}

.back-button:active {
  transform: scale(0.94);
}

.temporary-icon {
  font-size: clamp(7rem, 36vw, 12rem);
  line-height: 1;
}

.temporary-label {
  position: absolute;
  bottom: 40px;
  margin: 0;
  color: var(--color-muted);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.quiz-read-screen {
  width: min(100%, 430px);
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 40px;
  padding: 88px 24px 40px;
}

.tv-wrapper {
  position: relative;
  width: 100%;
  padding-top: 44px;
}

.tv-antenna-left,
.tv-antenna-right {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 4px;
  height: 52px;
  border-radius: 999px;
  background: #ffffff;
  transform-origin: bottom center;
}

.tv-antenna-left {
  transform: translateX(-50%) rotate(-34deg);
}

.tv-antenna-right {
  transform: translateX(-50%) rotate(34deg);
}

.tv-screen {
  position: relative;
  min-height: 230px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 12px solid #ffffff;
  border-radius: 44px;
  background: #ffffff;
}

.tv-header {
  display: none;
}

.tv-content {
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 180px;
  background: #ffffff;
  color: #333333;
  font-size: clamp(5rem, 28vw, 8rem);
  font-weight: 900;
  line-height: 1;
}

@property --countdown-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 360deg;
}

.countdown-stage {
  position: relative;
  width: min(54vw, 168px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.countdown-ring {
  --countdown-angle: 360deg;
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    #333333 var(--countdown-angle),
    transparent 0deg
  );
  mask: radial-gradient(
    farthest-side,
    transparent calc(100% - 10px),
    #000 calc(100% - 9px)
  );
  -webkit-mask: radial-gradient(
    farthest-side,
    transparent calc(100% - 10px),
    #000 calc(100% - 9px)
  );
}

.countdown-ring.is-counting {
  animation: countdownRing 850ms linear both;
}

.countdown-number {
  position: relative;
  z-index: 1;
  color: #333333;
  font-size: clamp(5rem, 28vw, 8rem);
  font-weight: 900;
  line-height: 1;
}

.tv-content.is-counting .countdown-number {
  animation: none;
}

.tv-content.is-ready .countdown-ring {
  display: none;
}

@keyframes countdownRing {
  from {
    --countdown-angle: 0deg;
  }

  to {
    --countdown-angle: 360deg;
  }
}


.answer-area {
  width: 100%;
  display: flex;
  gap: 12px;
}

.answer-area input {
  flex: 1;
  height: 64px;
  border: 0;
  border-radius: 22px;
  background: #ffffff;
  color: var(--color-text);
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.08em;
  outline: none;
}

.answer-area input::placeholder {
  color: color-mix(in srgb, var(--color-text) 35%, white);
}

.answer-button {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: #ffffff;
  color: #333333;
  font-size: 2.4rem;
  font-weight: 900;
}

.answer-button .material-symbols-outlined {
  font-size: 2.7rem;
  font-variation-settings: 'FILL' 0, 'wght' 700;
}

.answer-button:active {
  transform: scale(0.94);
}

@media (max-width: 360px) {
  .home-screen {
    gap: 44px;
    padding-inline: 20px;
  }

  .menu-grid {
    gap: 18px;
  }

  .back-button {
    top: 18px;
    left: 18px;
    width: 48px;
    height: 48px;
    font-size: 1.7rem;
  }

  .quiz-read-screen {
    gap: 32px;
    padding-inline: 18px;
  }

  .tv-screen {
    min-height: 210px;
    border-width: 10px;
    border-radius: 38px;
  }

  .tv-content {
    min-height: 160px;
  }

  .countdown-stage {
    width: min(54vw, 148px);
  }

  .countdown-ring {
    mask: radial-gradient(
      farthest-side,
      transparent calc(100% - 8px),
      #000 calc(100% - 7px)
    );
    -webkit-mask: radial-gradient(
      farthest-side,
      transparent calc(100% - 8px),
      #000 calc(100% - 7px)
    );
  }

  .answer-area input {
    height: 58px;
    border-radius: 20px;
    font-size: 1.2rem;
  }

  .answer-button {
    width: 58px;
    height: 58px;
    border-radius: 20px;
    font-size: 2.1rem;
  }

  .answer-button .material-symbols-outlined {
    font-size: 2.4rem;
  }
}