/* =========================
   GAME: PAINT COVER
========================= */

.paint-game {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  font-family: "Fredoka", Arial, sans-serif;
  color: #000;
  overflow: hidden;
}

.paint-main-area {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.paint-top-panel {
  flex: 0 0 auto;
  background: #bff1ea;
  border: 7px solid #000;
  border-radius: 24px;
  padding: 14px 18px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 8px 8px 0 rgba(0,0,0,0.25);
}

.paint-top-panel h3 {
  margin: 0;
  font-size: 30px;
  font-weight: 900;
}

.paint-top-panel p {
  margin: 4px 0 0;
  font-size: 17px;
  font-weight: 800;
}

.paint-timer-box {
  width: 95px;
  height: 70px;
  background: #d3ff00;
  border: 6px solid #000;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 900;
  box-shadow: 5px 5px 0 rgba(0,0,0,0.25);
}

.paint-stage {
  flex: 1;
  min-height: 0;
  position: relative;
  background: #99ddf3;
  border: 8px solid #000;
  border-radius: 28px;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  box-shadow: 10px 10px 0 rgba(0,0,0,0.25);
}

#paint-target-img {
  position: absolute;
  left: 50%;
  top: 50%;
  max-width: 72%;
  max-height: 72%;
  transform: translate(-50%, -50%);
  object-fit: contain;
  z-index: 1;
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}

.paint-splat-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.paint-splat {
  position: absolute;
  border-radius: 48% 52% 42% 58% / 58% 40% 60% 42%;
  opacity: 0.98;
  filter: saturate(1.15);
}

.paint-splat::before,
.paint-splat::after {
  content: "";
  position: absolute;
  background: inherit;
  border-radius: 50%;
}

.paint-splat::before {
  width: 38%;
  height: 34%;
  left: -18%;
  top: 24%;
}

.paint-splat::after {
  width: 30%;
  height: 44%;
  right: -14%;
  bottom: 8%;
}

.paint-start-cover {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: rgba(255, 233, 255, 0.88);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 20px;
}

.paint-start-cover h2 {
  margin: 0;
  font-size: 44px;
  font-weight: 900;
}

.paint-start-cover p {
  margin: 8px 0 18px;
  font-size: 22px;
  font-weight: 800;
}

.paint-start-cover button {
  background: #23d8ff;
  min-width: 160px;
  font-size: 24px;
}

.paint-side-panel {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.paint-preview-card,
.paint-score-card {
  background: #bff1ea;
  border: 7px solid #000;
  border-radius: 24px;
  padding: 16px;
  box-shadow: 8px 8px 0 rgba(0,0,0,0.25);
}

.paint-preview-image {
  height: 160px;
  background: #fff;
  border: 6px solid #000;
  border-radius: 20px;
  display: grid;
  place-items: center;
  overflow: hidden;
  margin-bottom: 12px;
}

.paint-preview-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  -webkit-user-drag: none;
  user-select: none;
}

.paint-word-name {
  background: #d3ff00;
  border: 5px solid #000;
  border-radius: 16px;
  padding: 10px;
  text-align: center;
  font-size: 26px;
  font-weight: 900;
  margin-bottom: 10px;
}

.paint-preview-card p {
  font-size: 17px;
  font-weight: 800;
  margin: 0;
}

.paint-score-card h3 {
  margin: 0 0 10px;
  font-size: 26px;
}

#paint-coverage {
  background: #fff;
  border: 5px solid #000;
  border-radius: 16px;
  padding: 14px;
  text-align: center;
  font-size: 34px;
  font-weight: 900;
  margin-bottom: 10px;
}

#paint-result {
  font-size: 19px;
  font-weight: 900;
  text-align: center;
}

#paint-restart-btn {
  background: #ff9b42;
  width: 100%;
  font-size: 20px;
  margin-top: auto;
}

.paint-error-box {
  max-width: 560px;
  margin: 80px auto;
  background: #fff0a8;
  border: 7px solid #000;
  border-radius: 26px;
  padding: 28px;
  text-align: center;
  font-family: "Fredoka", Arial, sans-serif;
  box-shadow: 8px 8px 0 rgba(0,0,0,0.25);
}

.paint-error-box h2 {
  font-size: 36px;
  margin-top: 0;
}

.paint-error-box p {
  font-size: 22px;
  font-weight: 800;
}

@media (max-width: 900px) {
  .paint-game {
    grid-template-columns: 1fr;
  }

  .paint-side-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  #paint-restart-btn {
    grid-column: 1 / -1;
  }
}

@media (max-width: 600px) {
  .paint-top-panel {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .paint-side-panel {
    grid-template-columns: 1fr;
  }

  .paint-start-cover h2 {
    font-size: 32px;
  }
}

/* =========================
   PAINT TIME SLIDER
========================= */

.paint-time-control {
  background: #fff;
  border: 6px solid #000;
  border-radius: 18px;
  padding: 14px;
  width: min(360px, 90%);
  margin: 0 auto 18px;
  box-shadow: 6px 6px 0 rgba(0,0,0,0.25);
}

.paint-time-control label {
  display: block;
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 10px;
}

.paint-time-control input[type="range"] {
  width: 100%;
  accent-color: #ff4fd8;
}

.paint-time-control,
.paint-time-control *,
#paint-seconds-slider,
#paint-seconds-slider-retry {
  pointer-events: auto;
  touch-action: auto;
}

.paint-time-control input[type="range"] {
  cursor: pointer;
}