/* ==========================================================================
   AniStream Modern Dark Theme & 2D Spatial Navigation Styles
   ========================================================================== */

:root {
  --bg-dark: #0e0e13;
  --bg-card: #181822;
  --bg-card-hover: #222230;
  --bg-input: #1f1f2c;
  --accent-red: #e50914;
  --accent-glow: #00d2ff;
  --accent-green: #2ecc71;
  --text-main: #ffffff;
  --text-muted: #8e8ea6;
  --border-color: #272738;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-family);
  overflow-x: hidden;
  min-height: 100vh;
  line-height: 1.5;
}

/* ==========================================================================
   Focus & Spatial Navigation Styles (Minimalist & Calm)
   ========================================================================== */
*:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.4);
  outline-offset: 2px;
}

.tv-focus {
  outline: 2px solid rgba(255, 255, 255, 0.4) !important;
  outline-offset: 2px !important;
  z-index: 10 !important;
}

/* ==========================================================================
   App Header
   ========================================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: rgba(14, 14, 19, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}

.logo {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.5px;
  cursor: pointer;
  user-select: none;
}

.logo-accent {
  color: var(--accent-red);
}

.header-center {
  flex: 1;
  max-width: 460px;
  margin: 0 20px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 0 14px;
  transition: border-color 0.2s ease;
}

.search-box:focus-within {
  border-color: rgba(255, 255, 255, 0.3);
}

.header-right {
  display: flex;
  align-items: center;
}

.profile-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #14141c;
  padding: 3px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-btn {
  background: #1a1a24;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 5px 12px;
  transition: all 0.2s ease;
  user-select: none;
  line-height: 1.4;
}

.profile-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.profile-btn.active {
  background: #2a2a3c;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
  font-weight: 600;
}

.search-icon {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  margin-right: 10px;
}

.search-box input {
  width: 100%;
  padding: 10px 0;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 15px;
  outline: none;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.clear-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */
.main-content {
  padding: 24px 28px 80px 28px;
  max-width: 1600px;
  margin: 0 auto;
}

.shelf-section {
  margin-bottom: 36px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-main);
}

.shelf-icon {
  width: 20px;
  height: 20px;
  color: var(--accent-red);
}

.shelf-icon-green {
  color: var(--accent-green);
}

/* ==========================================================================
   Empty Dashboard State
   ========================================================================== */
.empty-dashboard {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 70px 24px;
  max-width: 620px;
  margin: 40px auto;
  background: rgba(24, 24, 34, 0.45);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.empty-icon {
  font-size: 54px;
  margin-bottom: 16px;
  line-height: 1;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.4));
}

.empty-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 10px;
}

.empty-desc {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 480px;
}

/* ==========================================================================
   Cards: Carousel & Grid
   ========================================================================== */
.cards-carousel {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.cards-carousel::-webkit-scrollbar {
  height: 6px;
}
.cards-carousel::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 18px;
}

/* Anime Card */
.anime-card {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  user-select: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
}

.cards-carousel .anime-card,
.cards-grid .anime-card,
.continue-card,
.completed-card {
  width: 170px;
  min-width: 170px;
  max-width: 170px;
  aspect-ratio: 2 / 3;
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

@media (hover: hover) {
  .anime-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
  }
}

.card-poster-wrap {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 0;
  background: #14141c;
  overflow: hidden;
}

.card-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #14141c;
  transition: opacity 0.3s ease;
}

.card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(14, 14, 19, 0.85);
  backdrop-filter: blur(4px);
  padding: 3px 7px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.card-badge-next {
  color: #ffd700;
  border-color: rgba(255, 215, 0, 0.4);
  background: rgba(14, 14, 19, 0.9);
}

.card-badge-completed {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(16, 32, 22, 0.9);
  backdrop-filter: blur(4px);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-green);
  border: 1px solid rgba(46, 204, 113, 0.45);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.card-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
}

.card-progress-fill {
  height: 100%;
  background: var(--accent-red);
}

.card-info {
  padding: 10px 12px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-main);
}

.card-sub {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* Continue Watching Card Specifics */
.continue-card {
  flex-shrink: 0;
}

/* Completed Card Specifics */
.completed-card {
  flex-shrink: 0;
  opacity: 0.94;
}

.completed-card:hover,
.completed-card.tv-focus {
  opacity: 1;
}

.continue-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.anime-card:hover .continue-play-overlay,
.anime-card.tv-focus .continue-play-overlay {
  opacity: 1;
}

.play-circle {
  width: 44px;
  height: 44px;
  background: var(--accent-red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 14px rgba(229, 9, 20, 0.8);
}

.play-circle svg {
  width: 20px;
  height: 20px;
  color: #fff;
  margin-left: 2px;
}

/* ==========================================================================
   Series Detail Modal
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-container {
  position: relative;
  width: 100%;
  max-width: 900px;
  max-height: calc(100vh - 48px);
  margin: 0 auto;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
}

/* Fire TV & Silk Browser Visible Scrollbar */
.modal-container::-webkit-scrollbar {
  width: 10px;
}

.modal-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 5px;
}

.modal-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.35);
  border-radius: 5px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.modal-container::-webkit-scrollbar-thumb:hover {
  background: #e50914;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  color: var(--text-main);
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.series-hero {
  display: flex;
  gap: 24px;
  padding: 28px;
  background: linear-gradient(180deg, #222230 0%, var(--bg-card) 100%);
  border-bottom: 1px solid var(--border-color);
}

.series-hero-cover {
  width: 150px;
  height: 220px;
  object-fit: cover;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  flex-shrink: 0;
}

.series-hero-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.series-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 10px;
  line-height: 1.2;
}

.series-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 18px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent-red);
  color: #fff;
  box-shadow: 0 4px 15px rgba(229, 9, 20, 0.4);
}

/* Season Tabs */
.tabs-container {
  padding: 14px 28px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.15);
}

.season-tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
}

.tab-pill {
  padding: 8px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.tab-pill.active {
  background: var(--accent-red);
  border-color: var(--accent-red);
  color: #fff;
}

/* Episodes List */
.episodes-container {
  padding: 20px 28px;
  flex: 1;
}

.episodes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.episode-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.episode-item:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.1);
}

.ep-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.ep-num {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 36px;
}

.ep-titles {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ep-title-main {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-main);
}

.ep-title-sub {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ep-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.badge-watched {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: rgba(46, 204, 113, 0.15);
  border: 1px solid rgba(46, 204, 113, 0.4);
  color: var(--accent-green);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
}

.badge-lang {
  padding: 3px 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: var(--text-muted);
}

.ep-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
}

.ep-progress-fill {
  height: 100%;
  background: var(--accent-red);
}

/* ==========================================================================
   Fullscreen Video Player Overlay
   ========================================================================== */
.player-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
}

#video-element {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.player-controls {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 32px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.75) 0%, transparent 20%, transparent 80%, rgba(0, 0, 0, 0.85) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.player-controls.active {
  opacity: 1;
  pointer-events: auto;
}

.player-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.player-btn {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.player-btn svg {
  width: 22px;
  height: 22px;
}

.player-titles {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.player-series-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.player-ep-title {
  font-size: 13px;
  color: var(--text-muted);
}

.lang-select {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

/* Spinner */
.player-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.spinner {
  width: 54px;
  height: 54px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent-red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Bottom Controls */
.progress-container {
  width: 100%;
  margin-bottom: 12px;
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent-red);
  width: 0%;
  border-radius: 4px;
  transition: width 0.1s linear;
}

.player-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.controls-left,
.controls-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.time-display {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  font-variant-numeric: tabular-nums;
  margin-left: 6px;
}

/* ==========================================================================
   Toast Notification
   ========================================================================== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 20, 26, 0.95);
  border: 1px solid var(--accent-red);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  z-index: 2000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  animation: fadeInOut 3s forwards;
}

@keyframes fadeInOut {
  0% { opacity: 0; transform: translate(-50%, 15px); }
  10% { opacity: 1; transform: translate(-50%, 0); }
  85% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, 15px); }
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 768px) {
  .app-header {
    padding: 10px 14px;
    gap: 8px;
  }
  .logo {
    font-size: 20px;
  }
  .header-center {
    margin: 0 6px;
    max-width: none;
  }
  .search-box {
    padding: 0 10px;
  }
  .search-box input {
    font-size: 13px;
    padding: 8px 0;
  }
  .profile-switch {
    gap: 4px;
    padding: 2px;
  }
  .profile-btn {
    padding: 4px 8px;
    font-size: 11px;
  }
  .main-content {
    padding: 14px 12px 60px 12px;
  }
  .shelf-section {
    margin-bottom: 24px;
  }
  .section-title {
    font-size: 17px;
    margin-bottom: 12px;
  }
  .series-hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 16px;
  }
  .series-hero-cover {
    width: 120px;
    height: 180px;
  }
  .episodes-container {
    padding: 16px;
  }
  .player-controls {
    padding: 16px;
  }
  .cards-carousel {
    gap: 10px !important;
    padding-bottom: 6px;
  }
  .cards-carousel .anime-card,
  .continue-card,
  .completed-card {
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
  }
  .cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(115px, 1fr)) !important;
    gap: 10px !important;
  }
  .cards-grid .anime-card {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
  }
  .card-title {
    font-size: 12px !important;
  }
  .card-sub {
    font-size: 10px !important;
  }
  .card-badge,
  .card-badge-completed,
  .card-badge-next {
    font-size: 9px !important;
    padding: 2px 5px !important;
  }
}

@media (hover: none) {
  .anime-card:hover {
    transform: none !important;
    box-shadow: none !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
  }
  *:focus,
  *:focus-visible,
  .tv-focus {
    outline: none !important;
    box-shadow: none !important;
    transform: none !important;
  }
}


/* ==========================================================================
   Netflix Profile Gate
   ========================================================================== */
.profile-gate {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: #0e0e13;
  align-items: center;
  justify-content: center;
}

html.needs-profile-gate .profile-gate {
  display: flex !important;
}

.profile-gate-content {
  text-align: center;
  padding: 20px;
}

.profile-gate-title {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 32px;
  letter-spacing: -0.5px;
}

.profile-gate-cards {
  display: flex;
  gap: 32px;
  justify-content: center;
  align-items: center;
}

.profile-gate-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s ease;
  outline: none;
}

.profile-gate-avatar {
  width: 100px;
  height: 100px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  font-weight: 700;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.12);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.avatar-kadir {
  background: linear-gradient(135deg, #1e3c72, #2a5298);
}

.avatar-gizem {
  background: linear-gradient(135deg, #871a3c, #b33939);
}

.profile-gate-card:hover .profile-gate-avatar,
.profile-gate-card.tv-focus .profile-gate-avatar {
  border-color: rgba(255, 255, 255, 0.6) !important;
  transform: translateY(-3px) !important;
}

.profile-gate-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.profile-gate-card:hover .profile-gate-name,
.profile-gate-card.tv-focus .profile-gate-name {
  color: #fff !important;
}

@media (max-width: 768px) {
  .profile-gate-avatar {
    width: 80px;
    height: 80px;
    font-size: 28px;
  }
  .profile-gate-title {
    font-size: 22px;
  }
  .profile-gate-cards {
    gap: 20px;
  }
}


/* ==========================================================================
   TV PIN Gate Styles
   ========================================================================== */
.pin-gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(16, 16, 21, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.pin-card {
  background: rgba(26, 26, 36, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 36px 40px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  animation: pinFadeIn 0.3s ease-out;
}

@keyframes pinFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.pin-logo {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.pin-title {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}

.pin-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}

.pin-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.pin-dot.filled {
  background: #3b82f6;
  border-color: #3b82f6;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.6);
  transform: scale(1.15);
}

.pin-error {
  min-height: 22px;
  font-size: 13px;
  font-weight: 600;
  color: #ef4444;
  margin-bottom: 16px;
  transition: opacity 0.2s ease;
}

.pin-card.shake {
  animation: pinShake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes pinShake {
  10%, 90% { transform: translate3d(-2px, 0, 0); }
  20%, 80% { transform: translate3d(4px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
  40%, 60% { transform: translate3d(6px, 0, 0); }
}

.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  justify-items: center;
}

.pin-btn {
  width: 68px;
  height: 60px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 22px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.pin-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.pin-btn:active {
  transform: scale(0.95);
  background: #3b82f6;
  border-color: #3b82f6;
}

.pin-btn.tv-focus,
.pin-btn:focus-visible {
  outline: none;
  background: rgba(59, 130, 246, 0.3) !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5), 0 0 15px rgba(59, 130, 246, 0.4) !important;
  transform: scale(1.08) !important;
}

.pin-btn-action {
  font-size: 18px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
}

.pin-btn-submit {
  color: #3b82f6;
  font-weight: 700;
}
