/* Shared chrome for Tapdrop games (home link, challenge pill, share sheet). */
.td-home {
  position: absolute;
  z-index: 5;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  left: calc(env(safe-area-inset-left, 0px) + 10px);
  height: 44px;
  padding: 0 14px 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  color: #f4f2ff;
  font: 800 12px/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  letter-spacing: .16em;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  pointer-events: auto;
}
.td-home:focus-visible, .td-btn:focus-visible, .td-opt:focus-visible, .td-x:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
body[data-td="play"] .td-home, body[data-td="paused"] .td-home { width: 44px; padding: 0; justify-content: center; }
body[data-td="play"] .td-home span, body[data-td="paused"] .td-home span { display: none; }

.td-challenge {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: calc(env(safe-area-inset-top, 0px) + 64px);
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 210, 90, .14);
  border: 1px solid rgba(255, 210, 90, .5);
  color: #ffd25a;
  font: 700 12px/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  letter-spacing: .12em;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity .2s;
}
.td-challenge b { font-weight: 900; }
.td-challenge.beaten { background: rgba(80, 255, 170, .14); border-color: rgba(80, 255, 170, .6); color: #6dffb8; }
body[data-td="play"] .td-challenge, body[data-td="paused"] .td-challenge { opacity: 0; }
body[data-td="over"] .td-challenge { top: calc(env(safe-area-inset-top, 0px) + 18px); }

.td-actions {
  margin-top: 26px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  pointer-events: auto;
}
.td-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  color: #f4f2ff;
  font: 800 14px/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  letter-spacing: .04em;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s, background .2s;
}
.td-btn:active { transform: scale(.96); }
.td-primary { background: #f4f2ff; color: #0a0918; border-color: transparent; }

/* share sheet */
.td-sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  visibility: hidden;
  pointer-events: none;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  touch-action: manipulation;
}
.td-sheet.open { visibility: visible; pointer-events: auto; }
.td-backdrop { position: absolute; inset: 0; background: rgba(4, 3, 12, .7); opacity: 0; transition: opacity .25s; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.td-sheet.open .td-backdrop { opacity: 1; }
.td-card {
  position: relative;
  width: min(100%, 460px);
  max-height: 100%;
  overflow: auto;
  padding: 22px 18px calc(env(safe-area-inset-bottom, 0px) + 18px);
  border-radius: 24px 24px 0 0;
  background: #14122b;
  border: 1px solid rgba(255, 255, 255, .1);
  color: #f4f2ff;
  transform: translateY(100%);
  transition: transform .32s cubic-bezier(.2, .9, .3, 1);
}
.td-sheet.open .td-card { transform: none; }
@media (min-width: 640px) {
  .td-sheet { align-items: center; }
  .td-card { border-radius: 24px; padding-bottom: 20px; transform: translateY(24px) scale(.96); opacity: 0; transition: transform .25s, opacity .2s; }
  .td-sheet.open .td-card { opacity: 1; }
}
.td-x {
  position: absolute; top: 12px; right: 12px;
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: rgba(255, 255, 255, .08); color: #f4f2ff; cursor: pointer;
}
.td-kicker { font-size: 12px; font-weight: 900; letter-spacing: .22em; color: #ffd25a; padding-right: 48px; }
.td-preview { margin-top: 14px; border-radius: 14px; overflow: hidden; background: #0a0918; aspect-ratio: 1200 / 630; border: 1px solid rgba(255, 255, 255, .08); }
.td-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.td-sheet.no-preview .td-preview { display: none; }
.td-text { margin-top: 12px; font-size: 15px; line-height: 1.4; color: rgba(244, 242, 255, .8); }
.td-grid { margin-top: 16px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.td-opt {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 70px; padding: 8px 4px;
  border: 1px solid rgba(255, 255, 255, .1); border-radius: 14px;
  background: rgba(255, 255, 255, .05); color: #f4f2ff;
  font: 700 11px/1.1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  text-decoration: none; cursor: pointer; text-align: center;
  transition: transform .12s, background .2s;
}
.td-opt svg { width: 22px; height: 22px; }
.td-opt:active { transform: scale(.95); }
.td-opt:hover { background: rgba(255, 255, 255, .1); }
.td-li svg { color: #4aa3ff; }
.td-tg svg { color: #4fc3f7; }
.td-wa svg { color: #4be37c; }
.td-fb svg { color: #6b8cff; }
.td-native { background: #f4f2ff; color: #0a0918; border-color: transparent; }
.td-native:hover { background: #fff; }
@media (max-width: 359px) { .td-grid { grid-template-columns: repeat(3, 1fr); } }
@media (prefers-reduced-motion: reduce) { .td-card, .td-backdrop { transition: none; } }
