/* block-overlay.css — HA-toggled curtain + bottom-right countdown widget.
 *
 * Curtain: 1–4 reason tiles in an auto-sized grid driven by [data-count].
 * Each tile = PCS symbol (yellow PCS bg intrinsic) + word label below.
 * The surround stays black so the yellow tiles read instantly.
 *
 * Countdown widget: small bottom-right ring + MM:SS label. Sits over the
 * playing video, with a translucent dark backdrop circle for visibility on
 * any video frame. Hidden whenever the curtain is up.
 */

.block-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #000;
  display: none;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  padding: 3vmin;
  box-sizing: border-box;
}

.block-overlay.on {
  display: grid;
  pointer-events: auto;
  gap: 3vmin;
  align-items: center;
  justify-items: center;
}

.block-overlay[data-count="1"] { grid-template-columns: 1fr;             grid-template-rows: 1fr; }
.block-overlay[data-count="2"] { grid-template-columns: 1fr 1fr;         grid-template-rows: 1fr; }
.block-overlay[data-count="3"] { grid-template-columns: 1fr 1fr 1fr;     grid-template-rows: 1fr; }
.block-overlay[data-count="4"] { grid-template-columns: 1fr 1fr;         grid-template-rows: 1fr 1fr; }

.block-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5vmin;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.block-tile .block-symbol {
  width: 100%;
  height: auto;
  max-height: 78%;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  pointer-events: none;
  -webkit-user-drag: none;
}

.block-tile .block-caption {
  color: #fff;
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
  font-weight: 700;
  text-transform: lowercase;
  letter-spacing: 0.02em;
  line-height: 1;
  font-size: clamp(1.5rem, 8vmin, 6rem);
}

.block-overlay[data-count="3"] .block-caption,
.block-overlay[data-count="4"] .block-caption { font-size: clamp(1.25rem, 5vmin, 4rem); }

body.blocked {
  overflow: hidden;
}

/* ---------------- countdown widget (bottom-right corner) ----------------
 * Layout: [PCS symbol | ring(+time inside)]. Symbol sits to the LEFT of the
 * timer so DV gets a preview of what's about to happen. The whole widget
 * is rendered at 50% opacity so it doesn't dominate the video underneath
 * while still being readable.
 */

.countdown-widget {
  position: fixed;
  right: 2.5vmin;
  bottom: 2.5vmin;
  display: none;
  align-items: center;
  gap: 1.5vmin;
  z-index: 99998;
  opacity: 0.65;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.countdown-widget.on { display: flex; }

.countdown-widget .countdown-symbol {
  width: 14vmin;
  height: 14vmin;
  min-width: 90px;
  min-height: 90px;
  max-width: 170px;
  max-height: 170px;
  object-fit: contain;
  -webkit-user-drag: none;
}

.countdown-widget .countdown-ringbox {
  position: relative;
  width: 18vmin;
  height: 18vmin;
  min-width: 130px;
  min-height: 130px;
  max-width: 220px;
  max-height: 220px;
}

.countdown-widget .countdown-backdrop {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.9);   /* opaque-ish so the 0.5 widget opacity nets a clear dark halo */
}

.countdown-widget .countdown-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.countdown-widget .countdown-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
  line-height: 1.1;
  padding: 18%;
  box-sizing: border-box;
}

.countdown-widget .countdown-label {
  font-size: clamp(0.6rem, 1.6vmin, 0.95rem);
  font-weight: 500;
  text-transform: lowercase;
  opacity: 0.95;
  margin-bottom: 0.2em;
}

.countdown-widget .countdown-time {
  font-size: clamp(1.4rem, 4.5vmin, 2.6rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
