:root.playtime-locked,
:root.playtime-locked body {
  overflow: hidden !important;
  overscroll-behavior: none;
}

.playtime-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  background: rgba(28, 52, 82, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: playtime-fade-in 180ms ease-out;
}

.playtime-modal {
  width: min(100%, 460px);
  max-height: 100%;
  overflow: auto;
  box-sizing: border-box;
  padding: clamp(24px, 5vw, 38px);
  border: 3px solid rgba(255, 255, 255, 0.92);
  border-radius: 30px;
  outline: none;
  background: linear-gradient(160deg, #ffffff 0%, #eef9ff 100%);
  box-shadow: 0 24px 70px rgba(16, 39, 70, 0.34);
  color: #18324f;
  text-align: center;
  animation: playtime-rise-in 220ms ease-out;
}

.playtime-icon {
  margin-bottom: 8px;
  font-size: clamp(46px, 10vw, 68px);
  line-height: 1;
}

.playtime-modal h2 {
  margin: 10px 0 12px;
  color: #163b63;
  font-size: clamp(24px, 6vw, 34px);
  line-height: 1.2;
}

.playtime-modal p {
  margin: 0 auto;
  max-width: 34em;
  color: #4b647e;
  font-size: clamp(15px, 3.6vw, 18px);
  line-height: 1.65;
}

.playtime-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 26px;
}

.playtime-options button {
  min-height: 58px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, #1687d9, #4aaef1);
  box-shadow: 0 7px 0 #0a68af, 0 12px 22px rgba(22, 135, 217, 0.22);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: clamp(17px, 4vw, 20px);
  font-weight: 800;
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

.playtime-options button:last-child {
  background: linear-gradient(135deg, #23a774, #50c997);
  box-shadow: 0 7px 0 #168058, 0 12px 22px rgba(35, 167, 116, 0.22);
}

.playtime-options button:hover {
  filter: brightness(1.05);
  transform: translateY(-2px);
}

.playtime-options button:active {
  transform: translateY(5px);
  box-shadow: 0 2px 0 #0a68af, 0 5px 12px rgba(22, 135, 217, 0.2);
}

.playtime-options button:last-child:active {
  box-shadow: 0 2px 0 #168058, 0 5px 12px rgba(35, 167, 116, 0.2);
}

.playtime-options button:focus-visible {
  outline: 4px solid #ffbf2f;
  outline-offset: 4px;
}

.playtime-modal .playtime-note {
  margin-top: 22px;
  color: #708399;
  font-size: 14px;
}

.playtime-overlay[data-kind="expired"] .playtime-modal {
  border-color: #ffe09a;
  background: linear-gradient(160deg, #fffdf7 0%, #fff1cf 100%);
}

.playtime-overlay[data-kind="expired"] .playtime-modal p {
  font-size: clamp(17px, 4vw, 20px);
}

@keyframes playtime-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes playtime-rise-in {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-height: 520px) and (orientation: landscape) {
  .playtime-overlay {
    align-items: start;
    padding-block: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-bottom));
  }

  .playtime-modal {
    width: min(680px, 100%);
    padding: 16px 24px 20px;
  }

  .playtime-icon {
    display: none;
  }

  .playtime-modal h2 {
    margin-top: 0;
  }

  .playtime-options {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 16px;
  }

  .playtime-modal .playtime-note {
    margin-top: 14px;
  }
}

@media (max-width: 360px) {
  .playtime-options {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .playtime-overlay,
  .playtime-modal {
    animation: none;
  }

  .playtime-options button {
    transition: none;
  }
}
