/* Apple Design Shared Components & Spring Modals */

/* Floating Picture-in-Picture (PiP) Window */
.pip-window {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 320px;
  height: 240px;
  background: var(--glass-bg);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--glass-border-specular);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 999;
  cursor: grab;
  transform-origin: bottom right;
  transition: transform 280ms var(--spring-ease), opacity 240ms ease;
}

.pip-window:active {
  cursor: grabbing;
}

.pip-header {
  height: 36px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid var(--glass-border);
}

.pip-title {
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pip-actions {
  display: flex;
  gap: 6px;
}

.pip-action-btn {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-pill);
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pip-action-btn:hover { background: rgba(255, 255, 255, 0.25); }

.pip-content {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 8px;
}

/* Modal Overlay & Apple Bottom Sheets */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-sheet {
  background: rgba(24, 28, 40, 0.88);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  border: 1px solid var(--glass-border-specular);
  border-radius: var(--radius-xl);
  padding: 24px;
  width: min(90vw, 440px);
  box-shadow: var(--glass-shadow-lg);
  transform: scale(0.92) translateY(20px);
  transition: transform 320ms var(--spring-bounce);
}

.modal-overlay.active .modal-sheet {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.modal-close-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #a1a1a6;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* Pawn Promotion Picker Sheet */
.promotion-options {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 14px;
}

.promotion-item {
  width: 68px;
  height: 68px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.promotion-item:hover {
  background: rgba(10, 132, 255, 0.25);
  border-color: var(--apple-blue);
  transform: scale(1.06);
}

.promotion-item:active {
  transform: scale(0.96);
}

/* Gambit Hybrid Arena Styling */
.hybrid-stage {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 24px;
  background: radial-gradient(circle at 50% 50%, #151a28 0%, #080b12 100%);
  overflow-y: auto;
}

.hybrid-card {
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 22px;
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 480px;
}

.hybrid-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, rgba(255, 214, 10, 0.2), rgba(255, 159, 10, 0.2));
  border: 1px solid rgba(255, 214, 10, 0.4);
  color: #ffd60a;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

/* User Profile Pill in Header */
.user-profile-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.user-profile-pill:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: var(--glass-border-specular);
}

.user-profile-pill:active {
  transform: scale(0.95);
}

/* Auth Modal Styling */
.auth-segmented {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  padding: 3px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--glass-border);
  margin-bottom: 16px;
}

.auth-tab {
  flex: 1;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  color: #8e8e93;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.auth-tab.active {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.auth-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.auth-input-group label {
  font-size: 11px;
  font-weight: 600;
  color: #8e8e93;
  text-transform: uppercase;
}

.auth-input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 14px;
  transition: border-color var(--transition-fast);
}

.auth-input:focus {
  outline: none;
  border-color: var(--apple-blue);
  box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.3);
}

.auth-error-box {
  padding: 8px 12px;
  background: rgba(255, 69, 58, 0.15);
  border: 1px solid rgba(255, 69, 58, 0.3);
  border-radius: var(--radius-sm);
  color: #ff453a;
  font-size: 12px;
  margin-bottom: 12px;
  display: none;
}

/* Apple Buttons */
.apple-btn-primary {
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  background: var(--apple-blue);
  border: none;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(10, 132, 255, 0.35);
  transition: all var(--transition-fast);
}

.apple-btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.apple-btn-primary:active {
  transform: scale(0.96);
}

.apple-btn-secondary {
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  color: #f5f5f7;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.apple-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.16);
}

.apple-btn-secondary:active {
  transform: scale(0.96);
}

/* Toast Notifications */
.apple-toast {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(28, 33, 46, 0.9);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border-specular);
  border-radius: var(--radius-pill);
  padding: 8px 20px;
  box-shadow: var(--glass-shadow);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: all 300ms var(--spring-bounce);
}

.apple-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}
