/* ================================================
   TETHER DROP — tether-style.css
   Cyberpunk dark-mode · Minimalist game shell
   ================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0a0a0f;
  font-family: 'Orbitron', 'Courier New', monospace;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

/* ── CENTERING WRAPPER CONTAINER (Arcade Cabinet display box) ── */
.game-container {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 480px; /* Capped layout width on desktop for vertical aspect ratio */
  margin: 0 auto;
  background: #0a0a0f;
  box-shadow: 
    0 0 40px rgba(0, 245, 255, 0.05),
    -1px 0 0 rgba(0, 245, 255, 0.08),
    1px 0 0 rgba(0, 245, 255, 0.08);
  overflow: hidden; /* Restricts HUD elements within border bounds */
}

/* ── CANVAS: fills display box ── */
#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #0a0a0f;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: crosshair;
}

/* ── TOP NAV BAR ── */
.tether-nav {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 52px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  background: linear-gradient(to bottom, rgba(10, 10, 15, 0.95) 60%, rgba(10, 10, 15, 0));
  border-bottom: 1px solid rgba(0, 245, 255, 0.05);
  z-index: 30;
  pointer-events: none; /* Let clicks fall through to the canvas underneath, except on links */
}

.tether-back-link {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: rgba(0, 245, 255, 0.7);
  border: 1px solid rgba(0, 245, 255, 0.15);
  background: rgba(0, 245, 255, 0.03);
  padding: 6px 12px;
  border-radius: 6px;
  pointer-events: auto; /* Re-enable pointer events for the link */
  transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
  text-shadow: 0 0 6px rgba(0, 245, 255, 0.2);
}

.tether-back-link i {
  font-size: 14px;
}

.tether-back-link:hover, .tether-back-link:active {
  color: #00f5ff;
  border-color: rgba(0, 245, 255, 0.4);
  background: rgba(0, 245, 255, 0.08);
  box-shadow: 0 0 12px rgba(0, 245, 255, 0.15);
  transform: translateX(-2px);
}

.tether-nav-level {
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: #00f5ff;
  background: rgba(0, 245, 255, 0.08);
  border: 1px solid rgba(0, 245, 255, 0.25);
  padding: 2px 7px;
  border-radius: 4px;
  text-shadow: 0 0 6px rgba(0, 245, 255, 0.5);
  box-shadow: 0 0 8px rgba(0, 245, 255, 0.1);
  pointer-events: none;
}

.tether-nav-title {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 2.5px;
  color: rgba(255, 255, 255, 0.2);
  text-transform: uppercase;
}

/* ── HUD OVERLAY: absolute positioned relative to .game-container wrapper ── */
#hud {
  position: absolute;
  top: 60px; /* Shifted down to accommodate the top nav bar */
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: calc(100% - 24px); /* Constrained width so blocks never crop margins */
  display: flex;
  justify-content: space-around; /* Spaced symmetrically inside play bounds */
  pointer-events: none;
  z-index: 20;
}

.hud-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 9px 12px 11px; /* Slightly thin horizontal padding to fit four blocks */
  min-width: 82px;
  background: rgba(0, 245, 255, 0.035);
  border: 1px solid rgba(0, 245, 255, 0.11);
  border-radius: 11px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.hud-label {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 3px;
  color: rgba(0, 245, 255, 0.42);
  text-transform: uppercase;
}

#scoreDisplay {
  font-size: 25px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #00f5ff;
  text-shadow:
    0 0 10px rgba(0, 245, 255, 0.9),
    0 0 26px rgba(0, 245, 255, 0.35);
  min-width: 44px;
  text-align: center;
  line-height: 1.1;
}

/* BEST score block — purple accent */
.hud-best {
  background: rgba(168, 85, 247, 0.035);
  border-color: rgba(168, 85, 247, 0.11);
}

.hud-best .hud-label {
  color: rgba(168, 85, 247, 0.48);
}

#bestDisplay {
  font-size: 25px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #a855f7;
  text-shadow:
    0 0 10px rgba(168, 85, 247, 0.9),
    0 0 26px rgba(168, 85, 247, 0.35);
  min-width: 44px;
  text-align: center;
  line-height: 1.1;
}

/* BOUNCE adjust block — amber/yellow accent */
.hud-bounce {
  background: rgba(245, 158, 11, 0.035);
  border-color: rgba(245, 158, 11, 0.11);
  transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.hud-bounce:hover, .hud-bounce:active {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.22);
  transform: scale(1.05);
}

.hud-bounce .hud-label {
  color: rgba(245, 158, 11, 0.48);
}

#bounceDisplay {
  font-size: 25px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #f59e0b;
  text-shadow:
    0 0 10px rgba(245, 158, 11, 0.9),
    0 0 26px rgba(245, 158, 11, 0.35);
  min-width: 44px;
  text-align: center;
  line-height: 1.1;
}

/* ── MOBILE HUD RESPONSIVE SCALING ── */
@media (max-width: 440px) {
  #hud {
    gap: 10px;
    top: 54px; /* Adjusted to prevent overlapping the top navigation bar */
  }
  .hud-block {
    flex: 1;
    min-width: 0;
    padding: 6px 2px 8px;
    gap: 2px;
    border-radius: 8px;
  }
  .hud-label {
    font-size: 7px;
    letter-spacing: 1.5px;
  }
  #scoreDisplay, #bestDisplay, #bounceDisplay {
    font-size: 18px;
    min-width: 32px;
  }
}

/* ── PROFILE BLOCK & MODAL STYLES ── */
.hud-profile {
  background: rgba(0, 245, 255, 0.035);
  border-color: rgba(0, 245, 255, 0.11);
  transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.hud-profile:hover, .hud-profile:active {
  background: rgba(0, 245, 255, 0.08);
  border-color: rgba(0, 245, 255, 0.22);
  transform: scale(1.05);
}

.hud-profile .hud-label {
  color: rgba(0, 245, 255, 0.48);
}

#profileDisplay {
  font-size: 25px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #00f5ff;
  text-shadow:
    0 0 10px rgba(0, 245, 255, 0.9),
    0 0 26px rgba(0, 245, 255, 0.35);
  min-width: 44px;
  text-align: center;
  line-height: 1.1;
}

@media (max-width: 440px) {
  #profileDisplay {
    font-size: 18px;
    min-width: 32px;
  }
}

/* Modal overlays & dialog */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

.modal-card {
  width: 90%;
  max-width: 380px;
  background: rgba(16, 18, 30, 0.96);
  border: 1px solid rgba(0, 245, 255, 0.15);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 
    0 0 35px rgba(0, 245, 255, 0.05),
    0 20px 50px rgba(0, 0, 0, 0.6);
  animation: slideUp 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0, 245, 255, 0.08);
  padding-bottom: 12px;
  margin-bottom: 20px;
}

.modal-header h2 {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #00f5ff;
  text-shadow: 0 0 8px rgba(0, 245, 255, 0.4);
}

.close-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s ease;
}

.close-btn:hover {
  color: #ff2d78;
}

.modal-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-desc {
  font-size: 10.5px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 8px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: rgba(0, 245, 255, 0.5);
}

.form-group input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(0, 245, 255, 0.15);
  border-radius: 8px;
  padding: 10px 14px;
  color: #ffffff;
  font-family: inherit;
  font-size: 12px;
  outline: none;
  transition: border-color 0.15s ease;
}

.form-group input:focus {
  border-color: #00f5ff;
  box-shadow: 0 0 8px rgba(0, 245, 255, 0.15);
}

.auth-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.btn-primary, .btn-secondary, .btn-danger, .btn-link {
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 11px 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
  outline: none;
  text-align: center;
}

.btn-primary {
  flex: 1;
  background: #00f5ff;
  border: 1px solid #00f5ff;
  color: #0a0a0f;
  box-shadow: 0 0 12px rgba(0, 245, 255, 0.2);
}

.btn-primary:hover {
  background: #7fffff;
  border-color: #7fffff;
  transform: translateY(-1px);
}

.btn-secondary {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.btn-danger {
  width: 100%;
  background: rgba(255, 45, 120, 0.05);
  border: 1px solid rgba(255, 45, 120, 0.2);
  color: #ff2d78;
}

.btn-danger:hover {
  background: rgba(255, 45, 120, 0.12);
  border-color: rgba(255, 45, 120, 0.35);
  transform: translateY(-1px);
}

.btn-link {
  background: none;
  border: none;
  color: rgba(0, 245, 255, 0.6);
  padding: 0;
  text-decoration: underline;
  cursor: pointer;
}

.btn-link:hover {
  color: #00f5ff;
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  font-size: 8px;
  color: rgba(255, 255, 255, 0.2);
  letter-spacing: 1.5px;
}

.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-divider:not(:empty)::before {
  margin-right: .5em;
}

.auth-divider:not(:empty)::after {
  margin-left: .5em;
}

/* User Info Box */
.user-info {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 14px 18px;
}

.avatar-icon {
  font-size: 32px;
  color: #00f5ff;
  text-shadow: 0 0 10px rgba(0, 245, 255, 0.3);
}

.username-title {
  font-size: 13px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 1px;
}

.account-type {
  font-size: 7.5px;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 2px;
}

.stats-sync-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(0, 245, 255, 0.015);
  border: 1px solid rgba(0, 245, 255, 0.08);
  border-radius: 12px;
  padding: 16px 20px;
}

.stat-sync-row {
  display: flex;
  justify-content: space-between;
  font-size: 9.5px;
  letter-spacing: 1.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.6);
}

.neon-cyan {
  color: #00f5ff;
  text-shadow: 0 0 8px rgba(0, 245, 255, 0.3);
}

.neon-purple {
  color: #a855f7;
  text-shadow: 0 0 8px rgba(168, 85, 247, 0.3);
}

/* TOAST ALERTS */
.tether-toast-container {
  position: fixed;
  top: 100px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  z-index: 120;
}

.tether-toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  background: rgba(16, 18, 30, 0.94);
  border: 1px solid rgba(0, 245, 255, 0.2);
  border-radius: 8px;
  backdrop-filter: blur(12px);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.5px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

.tether-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.tether-toast.success {
  border-color: rgba(0, 245, 255, 0.4);
  color: #00f5ff;
  text-shadow: 0 0 6px rgba(0,245,255,0.4);
}

.tether-toast.error {
  border-color: rgba(255, 45, 120, 0.4);
  color: #ff2d78;
  text-shadow: 0 0 6px rgba(255,45,120,0.4);
}

/* Keyframes */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

