/* UX Pass #7 — pressure definition surface + mobile breathing room */

/* Player cards should glow, not get guillotined by the sticky score strip. */
.scorebar {
  overflow: visible;
}

/* Keep the challenge within the available viewport and allow short-screen scrolling. */
.definition-modal-v2.dt-live-definition {
  width: min(680px, calc(100vw - 20px));
  height: auto;
  min-height: 0;
  max-height: calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow-y: auto;
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: start;
  gap: 8px;
  padding: 16px;
}

.definition-modal-v2.dt-live-definition .definition-head {
  margin: 0;
  align-items: center;
}

.definition-modal-v2.dt-live-definition .definition-head h2 {
  margin-top: 1px;
  font-size: clamp(1.8rem, 7vw, 2.4rem);
  line-height: .98;
}

.definition-modal-v2.dt-live-definition .pos-pill {
  margin-top: 4px;
  padding: 3px 7px;
}

.definition-modal-v2.dt-live-definition .timer {
  position: relative;
  min-width: 78px;
  padding: 7px 8px;
  font-size: clamp(1.7rem, 7vw, 2rem);
  line-height: 1;
}

.timer.dt-time-added {
  animation: dtTimerRescue .34s ease;
}

.timer.dt-time-added::after {
  content: "+5";
  position: absolute;
  left: 50%;
  top: -16px;
  transform: translateX(-50%);
  color: #83f3eb;
  font-size: .64rem;
  font-weight: 950;
  letter-spacing: .03em;
  animation: dtTimerBump .55s ease both;
}

@keyframes dtTimerRescue {
  0% { transform: scale(1); }
  45% { transform: scale(1.08); box-shadow: 0 0 20px rgba(82,230,219,.28); }
  100% { transform: scale(1); }
}

@keyframes dtTimerBump {
  from { opacity: 0; transform: translate(-50%, 4px); }
  35% { opacity: 1; }
  to { opacity: 0; transform: translate(-50%, -9px); }
}

.definition-extension-panel.dt-live-spend {
  margin: 0;
  padding: 6px;
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(22,48,50,.72), rgba(23,29,31,.94));
}

.dt-live-resource-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.dt-live-resource {
  min-width: 0;
  min-height: 48px;
  padding: 7px 9px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "icon action"
    "icon available";
  column-gap: 7px;
  align-items: center;
  text-align: left;
  border: 1px solid #347478;
  background: #173c42;
  color: #d8fbf8;
  transition: border-color .16s ease, box-shadow .16s ease, filter .16s ease, transform .1s ease, opacity .16s ease;
}

.dt-live-resource .dt-resource-icon {
  grid-area: icon;
  font-size: 1.05rem;
}

.dt-live-resource strong {
  grid-area: action;
  min-width: 0;
  font-size: .84rem;
  line-height: 1.05;
}

.dt-live-resource small {
  grid-area: available;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #9fc8c5;
  font-size: .61rem;
  font-weight: 750;
}

.dt-live-resource.point {
  border-color: #776c2e;
  background: rgba(87,75,23,.3);
  color: #f1df76;
}

.dt-live-resource.point small {
  color: #c7bd83;
}

/* Usable rescue choices should read immediately as tappable, just like the
   active-player card. The glow is intentionally static so it attracts the eye
   without competing with the countdown timer. */
.dt-live-resource.time.dt-resource-ready {
  border-color: #72e7e2;
  background: linear-gradient(145deg, rgba(20,101,104,.78), rgba(20,65,73,.94));
  box-shadow: 0 0 0 1px rgba(114,231,226,.18), 0 0 18px rgba(70,220,214,.2), inset 0 1px rgba(255,255,255,.07);
  filter: brightness(1.08);
}

.dt-live-resource.point.dt-resource-ready {
  border-color: #d2ef68;
  background: linear-gradient(145deg, rgba(104,94,27,.52), rgba(60,56,27,.72));
  box-shadow: 0 0 0 1px rgba(210,239,104,.2), 0 0 20px rgba(185,224,70,.2), inset 0 1px rgba(255,255,255,.07);
  filter: brightness(1.1);
}

.dt-live-resource.dt-resource-ready:active {
  transform: scale(.985);
}

.dt-live-resource:disabled {
  opacity: .36;
  box-shadow: none;
  filter: grayscale(.35);
}

.dt-live-extension-status {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 5px;
  color: #8fa2a2;
  font-size: .58rem;
  line-height: 1.15;
}

.dt-live-extension-status strong {
  color: #bfe8e4;
  white-space: nowrap;
}

/* Answer cards should fit their words, not divide the entire viewport into
   four giant slabs. Long choices can grow; short choices stay compact. */
.definition-modal-v2.dt-live-definition .definition-options {
  min-height: 0;
  height: auto;
  display: grid;
  grid-template-rows: repeat(4, minmax(58px, max-content));
  align-content: start;
  gap: 7px;
  overflow: hidden;
}

.definition-modal-v2.dt-live-definition .definition-option {
  min-height: 58px;
  height: auto;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  font-size: clamp(.78rem, 2.9vw, 1rem);
  line-height: 1.22;
  border-radius: 11px;
}

.definition-modal-v2.dt-live-definition .definition-option.dt-long {
  font-size: clamp(.72rem, 2.6vw, .9rem);
  line-height: 1.17;
}

.definition-modal-v2.dt-live-definition .definition-option.dt-very-long {
  font-size: clamp(.66rem, 2.35vw, .82rem);
  line-height: 1.12;
}

.dt-how-to-play {
  margin-left: 8px;
}

@media (max-width: 620px) {
  .scorebar {
    top: 8px;
    margin-top: 8px;
  }

  .player-card-v2.active {
    transform: none;
  }

  .modal:has(.definition-modal-v2.dt-live-definition) {
    padding: max(6px, env(safe-area-inset-top)) 6px max(6px, env(safe-area-inset-bottom));
  }

  .definition-modal-v2.dt-live-definition {
    width: 100%;
    height: auto;
    max-height: calc(100dvh - 12px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    padding: 11px;
    gap: 6px;
    border-radius: 16px;
  }

  .definition-modal-v2.dt-live-definition .definition-head {
    gap: 8px;
  }

  .definition-modal-v2.dt-live-definition .definition-head .eyebrow {
    font-size: .58rem;
  }

  .definition-modal-v2.dt-live-definition .definition-head h2 {
    font-size: clamp(1.65rem, 9vw, 2.05rem);
  }

  .definition-modal-v2.dt-live-definition .timer {
    min-width: 70px;
    font-size: 1.72rem;
  }

  .definition-extension-panel.dt-live-spend {
    padding: 5px;
  }

  .dt-live-resource {
    min-height: 44px;
    padding: 5px 7px;
    column-gap: 5px;
  }

  .dt-live-resource strong {
    font-size: .76rem;
  }

  .dt-live-resource small {
    font-size: .55rem;
  }

  .dt-live-extension-status {
    margin-top: 4px;
    font-size: .54rem;
  }

  .definition-modal-v2.dt-live-definition .definition-options {
    grid-template-rows: repeat(4, minmax(54px, max-content));
    gap: 6px;
  }

  .definition-modal-v2.dt-live-definition .definition-option {
    min-height: 54px;
    padding: 8px 10px;
  }
}

@media (max-height: 680px) {
  .definition-modal-v2.dt-live-definition {
    padding: 8px;
    gap: 4px;
  }

  .definition-modal-v2.dt-live-definition .definition-head h2 {
    font-size: 1.55rem;
  }

  .definition-modal-v2.dt-live-definition .pos-pill {
    display: none;
  }

  .dt-live-resource {
    min-height: 39px;
  }

  .dt-live-extension-status {
    display: none;
  }

  .definition-modal-v2.dt-live-definition .definition-options {
    grid-template-rows: repeat(4, minmax(46px, max-content));
    gap: 4px;
  }

  .definition-modal-v2.dt-live-definition .definition-option {
    min-height: 46px;
  }
}
