@import url("https://fonts.googleapis.com/css2?family=Fredoka:wght@400;600;700&display=swap");
body {
  padding: 0;
  margin: 0;
}

#full-area {
  width: 100%;
  height: 100vh;
  background: #000;
  position: absolute;
  overflow: hidden;
  user-select: none;
}

#game-area {
  position: absolute;
  width: 1280px;
  height: 720px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(1);
}

#full-area #voice-through-categories {
  --category-ink: #183d43;
  position: absolute;
  inset: 0;
  z-index: 1050;
  box-sizing: border-box;
  overflow-y: auto;
  padding: 32px 32px 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--category-ink);
  font-family: "Fredoka", sans-serif;
  letter-spacing: 0;
}
#full-area #voice-through-categories[hidden] {
  display: none;
}
#full-area .category-selection-content {
  width: 100%;
  max-width: 1056px;
  margin-block: auto;
}
#full-area .category-selection-heading {
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
  position: relative;
  top: -20px;
}
#full-area .category-selection-heading p {
  display: none;
}
#full-area .category-selection-heading h1 {
  margin: 0;
  padding: 12px 42px;
  border-radius: 999px;
  background: linear-gradient(180deg, #63308f, #52217a);
  box-shadow: 0 0 0 5px #fa387a, 0 14px 24px rgba(40, 10, 60, 0.4);
  color: #fff4cf;
  font-size: 40px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: none;
}
#full-area .category-selection-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 26px;
}
#full-area .category-option {
  --category-accent: #2f8f4e;
  --category-fill-top: #4dbb72;
  --category-btn-top: #43ab63;
  --category-btn-shadow: #1e6737;
  --category-tint: #eaf6ec;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 22px 18px 24px;
  border: 0;
  border-radius: 26px;
  background: linear-gradient(180deg, #ffffff 0%, #f2f6fb 100%);
  color: #3d1560;
  font-family: inherit;
  letter-spacing: 0;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 0 0 6px var(--category-accent), 0 20px 30px rgba(40, 10, 60, 0.34);
  transition: transform 180ms ease-out;
}
#full-area .category-option:hover:not(:disabled) {
  transform: translateY(-3px);
}
#full-area .category-option:focus-visible {
  outline: 4px solid var(--category-accent);
  outline-offset: 8px;
}
#full-area .category-option:disabled {
  cursor: default;
}
#full-area .category-option--animals {
  --category-accent: #d9832a;
  --category-fill-top: #f0a24d;
  --category-btn-top: #eb9a3f;
  --category-btn-shadow: #a35d15;
  --category-tint: #fbf0e2;
}
#full-area .category-option--household {
  --category-accent: #2a72b8;
  --category-fill-top: #4b94d8;
  --category-btn-top: #3d86cc;
  --category-btn-shadow: #1a5288;
  --category-tint: #e6f0fa;
}
#full-area .category-option--professions {
  --category-accent: #fa387a;
  --category-fill-top: #ff6b9d;
  --category-btn-top: #ff5a93;
  --category-btn-shadow: #b81b52;
  --category-tint: #fdeaf1;
}
#full-area .category-option-icon {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 132px;
  height: 132px;
  padding: 10px;
  border-radius: 50%;
  background: var(--category-tint);
  box-shadow: inset 0 0 0 4px var(--category-accent);
}
#full-area .category-option-icon img {
  width: 112px;
  height: 112px;
  object-fit: contain;
}
#full-area .category-option-name {
  font-size: 27px;
  line-height: 1.15;
  font-weight: 700;
  color: #3d1560;
}
#full-area .category-option--household .category-option-name {
  font-size: 24px;
  white-space: nowrap;
}
#full-area .category-option-bar {
  display: block;
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: #e3e8ef;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.14);
  overflow: hidden;
}
#full-area .category-option-bar-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--category-fill-top), var(--category-accent));
  transition: width 240ms ease-out;
}
#full-area .category-option-status {
  font-size: 16px;
  line-height: 1.2;
  font-weight: 600;
  color: #6a5b7d;
}
#full-area .category-option-play {
  display: grid;
  place-items: center;
  margin-top: 2px;
  padding: 12px 46px;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--category-btn-top), var(--category-accent));
  box-shadow: 0 5px 0 var(--category-btn-shadow), inset 0 0 0 3px rgba(255, 255, 255, 0.28);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
}
@media (prefers-reduced-motion: reduce) {
  #full-area .category-option {
    transition: none;
  }
}
@media (max-width: 900px) {
  #full-area .category-selection-content {
    max-width: 620px;
  }
  #full-area .category-selection-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }
  #full-area .category-option {
    padding: 16px 14px 18px;
    gap: 10px;
    border-radius: 22px;
  }
  #full-area .category-option-icon {
    width: 108px;
    height: 108px;
  }
  #full-area .category-option-icon img {
    width: 90px;
    height: 90px;
  }
  #full-area .category-option-name,
#full-area .category-option--household .category-option-name {
    font-size: 22px;
  }
  #full-area .category-option-play {
    padding: 10px 34px;
    font-size: 20px;
  }
}
@media (max-width: 480px) {
  #full-area #voice-through-categories {
    padding: 90px 16px 100px;
  }
  #full-area .category-selection-heading {
    margin-bottom: 22px;
  }
  #full-area .category-selection-heading h1 {
    padding: 9px 24px;
    font-size: 26px;
    box-shadow: 0 0 0 4px #fa387a, 0 10px 18px rgba(40, 10, 60, 0.4);
  }
  #full-area .category-selection-grid {
    gap: 12px;
  }
  #full-area .category-option {
    padding: 12px 10px 14px;
    gap: 8px;
    border-radius: 18px;
    box-shadow: 0 0 0 4px var(--category-accent), 0 12px 20px rgba(40, 10, 60, 0.34);
  }
  #full-area .category-option-icon {
    width: 84px;
    height: 84px;
    padding: 7px;
  }
  #full-area .category-option-icon img {
    width: 70px;
    height: 70px;
  }
  #full-area .category-option-name,
#full-area .category-option--household .category-option-name {
    font-size: 18px;
  }
  #full-area .category-option-bar {
    height: 11px;
  }
  #full-area .category-option-status {
    font-size: 14px;
  }
  #full-area .category-option-play {
    padding: 9px 26px;
    font-size: 17px;
  }
}

.overrideResize {
  transform: translate(-50%, -50%) scale(1) !important;
}

#home-section {
  width: 1280px;
  height: 720px;
  position: absolute;
  z-index: 40;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

#home-right {
  position: absolute;
  left: 50%;
  top: 45%;
  transform: translate(-50%, -50%);
  display: flex;
  justify-content: center;
  align-items: center;
}

#logo {
  height: 350px;
  max-width: 1100px;
  object-fit: contain;
  justify-content: center;
  display: flex;
  animation: logoAnim 1.3s infinite;
}

#gameContainer {
  width: 1280px;
  height: 720px;
  position: absolute;
  overflow: hidden;
  margin: 0 auto;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 9;
}

#renderCanvas {
  position: relative;
  width: 100%;
  height: 100%;
  touch-action: none;
  display: block;
  z-index: 20;
  background: transparent !important;
}

.game-ui {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px;
  opacity: 0;
  transition: opacity 250ms ease-out;
}

.game-ui.is-live {
  opacity: 1;
}

.hud-box {
  box-sizing: border-box;
  width: 220px;
  height: 80px;
  border: 3px solid #ffd23f;
  border-radius: 18px;
  background: #3a1152;
  opacity: 0.95;
  box-shadow: 2px 4px 8px rgba(0, 0, 0, 0.6);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hud-box__header {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 34px;
  border-radius: 17px;
  border: 2px solid #ffeeb0;
  background: #cc2525;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.hud-box__label {
  color: #fff;
  font-size: 20px;
  font-family: "Fredoka", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 700;
  margin-top: 2px;
}

.hud-box__value {
  color: #fff;
  font-size: 42px;
  font-family: "Fredoka", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 700;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
  margin-top: 22px;
}

.hud-box__value-total {
  font-size: 0.5em;
}

.hud-box--timer {
  transform: scale(0);
}

.hud-box--timer .hud-box__header {
  background: #1f8f3d;
  border-color: #cdf5d8;
}

#timer {
  font-variant-numeric: tabular-nums;
}

#end-section {
  width: 1280px;
  height: 720px;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 999999999 !important;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: #00000044;
  backdrop-filter: blur(3px);
}

.content {
  position: absolute;
  width: 1280px;
  height: 720px;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px 20px;
  transform: scale(0);
}

.end-modal-image {
  position: relative;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 560px;
  height: 437px;
  padding-top: 104px;
  padding-bottom: 52px;
  margin-top: 25px;
  transform: scale(1.12);
  z-index: 1;
  background: url("/media/games/voice-through/images/panel.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

#end-title {
  position: absolute;
  top: 43px;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 340px;
  color: #4a0d6b;
  font-family: Fredoka;
  font-weight: bold;
  font-size: 40px;
  line-height: 1;
  white-space: nowrap;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.45);
  z-index: 3;
}

#full-area .end-category {
  position: absolute;
  top: 76px;
  left: 40px;
  right: 40px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2px 12px;
  color: #fff4cf;
  font-family: Fredoka;
  line-height: 1.2;
  letter-spacing: 0;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.6);
}

#full-area #voice-through-end-category {
  font-size: 22px;
  font-weight: 600;
}

#full-area #voice-through-end-progress {
  font-size: 16px;
}

#end-score {
  position: relative;
  top: -6px;
  display: flex;
  gap: 54px;
  align-items: flex-start;
  justify-content: center;
  color: white;
  font-family: Fredoka;
  font-weight: bold;
  margin-top: 0;
  text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.6);
}

.end-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.end-stat__label {
  font-size: 24px;
  letter-spacing: 2px;
  color: #ffd23f;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.end-stat__value {
  font-size: 72px;
  line-height: 1;
  text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.6);
}

.end-btns {
  background: none;
  border: none;
  box-shadow: none;
  width: 80%;
  margin-left: 10px;
  margin-top: 10px;
  max-width: 400px;
  text-align: center;
  display: flex;
  gap: 15px;
  flex-direction: column;
  align-items: center;
  z-index: 2;
}

.end-btns img {
  cursor: pointer;
  transition: all 0.3s;
  width: 300px;
  height: auto;
}

.end-btns span {
  position: absolute;
  color: white;
  font-family: Fredoka;
  font-weight: bold;
  font-size: 38px;
  margin-top: 5px;
  text-transform: uppercase;
  text-shadow: 0 2px 0 #0f7a00, 0 4px 0 #0b5f00, 0 6px 6px rgba(0, 0, 0, 0.35);
}

#endGameBtn {
  text-align: center;
  display: flex;
  justify-content: center;
  cursor: pointer;
}

@media (max-width: 600px) {
  #gameContainer {
    width: 800px;
    height: 1180px;
    margin: 0;
    padding: 0;
    overflow: hidden;
  }

  #home-section {
    width: 800px;
    height: 1180px;
  }

  #logo {
    height: 300px;
    max-width: 700px;
    margin-top: 0;
  }

  #end-section {
    width: 800px;
    height: 1180px;
    z-index: 999999999999;
  }

  .content {
    width: 800px;
    height: 1180px;
  }

  .end-modal-image {
    margin-top: 0;
  }
}
