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

    body {
      background-color: #0f0f0f;
      color: #f1f1f1;
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
      height: 100vh;
      width: 100vw;
      overflow: hidden;
      display: flex;
      align-items: center;
      justify-content: center;
      position: relative;
    }

    /* Floating UI Transitions */
    .top-badge,
    .bottom-bar,
    .active-video-title {
      transition: opacity 0.2s ease, visibility 0.2s ease;
    }

    body.ui-hidden .top-badge,
    body.ui-hidden .bottom-bar,
    body.ui-hidden .active-video-title,
    body.ui-hidden .header-controls-right {
      opacity: 0 !important;
      visibility: hidden !important;
      pointer-events: none !important;
    }

    /* Top Badges Shared Style */
    .top-badge {
      position: absolute;
      top: 15px;
      background-color: rgba(33, 33, 33, 0.85);
      backdrop-filter: blur(8px);
      color: #fff;
      border: 1px solid rgba(255, 255, 255, 0.15);
      border-radius: 8px;
      padding: 8px 16px;
      font-size: 0.95rem;
      font-weight: 600;
      letter-spacing: 0.05em;
      display: none;
      z-index: 10;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    }

    #fileNameBadge:not(:empty) {
      display: inline-flex; /* or block, matching your layout */
    }

    /* Upper Left: Video ID */
    .current-id-badge {
      left: 15px;
      cursor: pointer;
      align-items: center;
      gap: 6px;
      font-family: monospace;
      font-size: 0.9rem;
    }

    .current-id-badge:hover {
      background-color: rgba(45, 45, 45, 1);
      border-color: rgba(255, 255, 255, 0.3);
    }

    /* Top Center: File / Custom Name */
    .filename-badge {
      left: 50%;
      transform: translateX(-50%);
      pointer-events: none;
      max-width: 40%;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    /* Upper Right Controls Container */
    .header-controls-right {
      position: absolute;
      top: 15px;
      right: 15px;
      display: flex;
      align-items: center;
      gap: 12px;
      z-index: 10;
    }

    /* Counter Badge (Clickable to open playlist modal) */
    .counter-badge {
      position: static;
      cursor: pointer;
      pointer-events: auto;
      user-select: none;
      transition: background-color 0.2s, border-color 0.2s;
    }

    .counter-badge:hover {
      background-color: rgba(45, 45, 45, 1);
      border-color: rgba(255, 255, 255, 0.3);
    }

    /* Expand / Reduce Size Button */
    .expand-btn {
      position: static;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 8px 12px;
      line-height: 1;
      user-select: none;
    }

    .expand-btn:hover {
      background-color: rgba(45, 45, 45, 1);
      border-color: rgba(255, 255, 255, 0.3);
    }

    .expand-btn .material-symbols-outlined {
      font-size: 1.25rem;
      color: #fff;
    }

    /* Player Outer Wrapper & Active Title Above */
    .player-wrapper {
      width: 100%;
      max-width: 1100px;
      max-height: 100%;
      display: flex;
      flex-direction: column;
      align-items: center;
      position: relative;
      z-index: 2; /* Sits above the background ESC hint when resized */
      transition: max-width 0.25s ease;
      margin-top: -40px;
    }

    .player-wrapper.fs {
      max-width: 100% !important;
      margin-top: 0px !important;
    }
    
    .player-wrapper.fs .active-video-title {
      display: none !important;
    }

    .active-video-title {
      font-size: 1.1rem;
      font-weight: 500;
      color: rgba(255, 255, 255, 0.9);
      padding-bottom: 12px;
      text-align: center;
      max-width: 90%;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      display: none;
      letter-spacing: 0.02em;
    }

    /* Centered Video Container (16:9) */
    .player-container {
      width: 100%;
      aspect-ratio: 16 / 9;
      background-color: #000;
      border-radius: 12px;
      overflow: hidden;
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
      position: relative;
    }

    #yt-player {
      width: 100%;
      height: 100%;
      border: none;
    }

    .placeholder-msg {
      position: absolute;
      inset: 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 12px;
      color: #717171;
      font-size: 1.1rem;
      cursor: pointer;
      user-select: none;
      transition: color 0.2s, background-color 0.2s;
    }

    .placeholder-msg:hover {
      color: #bbb;
      background-color: rgba(255, 255, 255, 0.03);
    }

    /* Bottom Center ESC Hint */
    .esc-hint {
      position: absolute;
      bottom: 28px;
      left: 50%;
      transform: translateX(-50%);
      font-size: 0.8rem;
      letter-spacing: 0.05em;
      color: rgba(255, 255, 255, 0.22);
      user-select: none;
      pointer-events: auto; /* Allow clicking */
      cursor: pointer;
      white-space: nowrap;
      z-index: 1; /* Sits behind player-container */
      transition: color 0.2s ease;
    }

    .esc-hint:hover {
      color: rgba(255, 255, 255, 0.5);
    }

    /* Bottom Floating Action Bar */
    .bottom-bar {
      position: absolute;
      bottom: 15px;
      left: 15px;
      right: 15px;
      display: flex;
      justify-content: space-between;
      align-items: flex-end;
      pointer-events: none;
    }

    .bottom-bar > * {
      pointer-events: auto;
    }

    .file-input-wrapper input[type="file"] {
      display: none;
    }

    .btn-action {
      background-color: rgba(33, 33, 33, 0.85);
      backdrop-filter: blur(8px);
      color: #fff;
      border: 1px solid rgba(255, 255, 255, 0.15);
      border-radius: 8px;
      padding: 12px 20px;
      cursor: pointer;
      font-size: 0.95rem;
      font-weight: 500;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      transition: background-color 0.2s, border-color 0.2s, transform 0.1s;
    }

    .btn-action:hover {
      background-color: rgba(45, 45, 45, 1);
      border-color: rgba(255, 255, 255, 0.3);
    }

    .btn-action:active {
      transform: scale(0.98);
    }

    /* Lower Right Skip / Next Up Button */
    .btn-next {
      background-color: rgba(20, 20, 20, 0.9);
      backdrop-filter: blur(8px);
      border: 1px solid rgba(255, 255, 255, 0.15);
      border-radius: 8px;
      padding: 8px;
      cursor: pointer;
      display: none;
      align-items: center;
      gap: 12px;
      color: #fff;
      max-width: 380px;
      transition: background-color 0.2s, border-color 0.2s, transform 0.1s;
      z-index: 3;
    }

    .btn-next:hover {
      background-color: rgba(40, 40, 40, 1);
      border-color: rgba(255, 255, 255, 0.3);
    }

    .btn-next:active {
      transform: scale(0.98);
    }
    
    /* Bottom Right Actions Stack */
    .bottom-right-controls {
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 8px;
    }

    /* Small Previous Video Button */
    .btn-prev {
      background-color: rgba(20, 20, 20, 0.85);
      backdrop-filter: blur(8px);
      border: 1px solid rgba(255, 255, 255, 0.15);
      border-radius: 8px;
      padding: 6px 12px;
      cursor: pointer;
      display: none; /* Controlled via JS */
      align-items: center;
      gap: 6px;
      color: #aaa;
      font-size: 0.8rem;
      font-weight: 500;
      transition: background-color 0.2s, border-color 0.2s, color 0.2s, transform 0.1s;
      z-index: 3;
      user-select: none;
    }

    .btn-prev:hover {
      background-color: rgba(40, 40, 40, 1);
      border-color: rgba(255, 255, 255, 0.3);
      color: #fff;
    }

    .btn-prev:active {
      transform: scale(0.98);
    }

    .btn-prev .material-symbols-outlined {
      font-size: 1.15rem;
    }

    .thumb-wrapper {
      position: relative;
      width: 120px;
      height: 68px;
      border-radius: 6px;
      overflow: hidden;
      background-color: #000;
      flex-shrink: 0;
    }

    .thumb-wrapper img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }

    .next-info {
      text-align: left;
      padding-right: 8px;
      min-width: 0;
    }

    .next-info .label {
      font-size: 0.72rem;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: #aaa;
      margin-bottom: 2px;
    }

    .next-info .id-text {
      font-size: 0.85rem;
      font-weight: 500;
      color: #fff;
      line-height: 1.25;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
      word-break: break-word;
    }

    /* Modals & Dialogs */
    .modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.75);
      backdrop-filter: blur(6px);
      z-index: 100;
      display: none;
      align-items: center;
      justify-content: center;
    }

    .modal-card {
      background: #1a1a1a;
      border: 1px solid rgba(255, 255, 255, 0.15);
      border-radius: 12px;
      padding: 24px;
      width: 90%;
      max-width: 440px;
      box-shadow: 0 12px 36px rgba(0, 0, 0, 0.8);
      display: flex;
      flex-direction: column;
      gap: 16px;
    }

    .modal-card h3 {
      font-size: 1.15rem;
      font-weight: 600;
      color: #fff;
    }

    .modal-choice-btn {
      background: rgba(255, 255, 255, 0.07);
      border: 1px solid rgba(255, 255, 255, 0.12);
      color: #fff;
      padding: 14px 18px;
      border-radius: 8px;
      font-size: 0.95rem;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 12px;
      transition: background 0.2s, border-color 0.2s;
    }

    .modal-choice-btn:hover {
      background: rgba(255, 255, 255, 0.14);
      border-color: rgba(255, 255, 255, 0.25);
    }

    .modal-input, .modal-textarea {
      background: #0f0f0f;
      border: 1px solid rgba(255, 255, 255, 0.15);
      border-radius: 6px;
      padding: 10px 12px;
      color: #fff;
      font-family: inherit;
      font-size: 0.9rem;
      width: 100%;
    }

    .modal-input:focus, .modal-textarea:focus {
      outline: none;
      border-color: rgba(255, 255, 255, 0.4);
    }

    .modal-textarea {
      height: 140px;
      resize: vertical;
      font-family: monospace;
      font-size: 0.85rem;
    }

    .modal-actions {
      display: flex;
      justify-content: flex-end;
      gap: 10px;
      margin-top: 4px;
    }
    
    .modal-actions-between {
      display: flex;
      justify-content: space-between;
      align-items: center;
      width: 100%;
      margin-top: 4px;
    }

    .btn-link-action {
      color: #888;
      font-size: 0.85rem;
      text-decoration: none;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 6px 0;
      transition: color 0.2s;
    }

    .btn-link-action:hover {
      color: #fff;
      text-decoration: underline;
    }

    .btn-link-action .material-symbols-outlined {
      font-size: 1rem;
    }

    .btn-secondary {
      background: transparent;
      border: 1px solid rgba(255, 255, 255, 0.2);
      color: #aaa;
      padding: 8px 16px;
      border-radius: 6px;
      cursor: pointer;
      font-size: 0.9rem;
      transition: color 0.2s, border-color 0.2s;
    }

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

    .btn-primary {
      background: #fff;
      border: 1px solid #fff;
      color: #000;
      padding: 8px 18px;
      border-radius: 6px;
      cursor: pointer;
      font-weight: 600;
      font-size: 0.9rem;
      transition: background-color 0.2s;
    }

    .btn-primary:hover {
      background: #e0e0e0;
    }

    /* Playlist Manager Modal Card & Items */
    .playlist-modal-card {
      max-width: 620px;
      max-height: 85vh;
      display: flex;
      flex-direction: column;
    }

    .playlist-scroll-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
      overflow-y: auto;
      padding-right: 6px;
      max-height: 56vh;
    }

    .playlist-scroll-list::-webkit-scrollbar {
      width: 6px;
    }

    .playlist-scroll-list::-webkit-scrollbar-thumb {
      background: rgba(255, 255, 255, 0.2);
      border-radius: 3px;
    }

    .playlist-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 8px 10px;
      background: rgba(255, 255, 255, 0.04);
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 8px;
      cursor: pointer;
      user-select: none;
      transition: background-color 0.15s, border-color 0.15s, opacity 0.15s;
    }

    .playlist-item:hover:not(.current-video) {
      background: rgba(255, 255, 255, 0.1);
      border-color: rgba(255, 255, 255, 0.2);
    }

    /* Active Video styling: lighter background, non-clickable */
    .playlist-item.current-video {
      background: rgba(255, 255, 255, 0.22);
      border-color: rgba(255, 255, 255, 0.45);
      cursor: default;
    }

    .playlist-item.dragging {
      opacity: 0.35;
    }

    .playlist-item.drag-over {
      border-top: 2px solid #fff;
    }

    .drag-handle {
      color: rgba(255, 255, 255, 0.4);
      cursor: grab;
      display: flex;
      align-items: center;
      padding: 0 2px;
    }

    .drag-handle:hover {
      color: #fff;
    }

    .playlist-item-thumb {
      width: 86px;
      height: 48px;
      border-radius: 4px;
      overflow: hidden;
      background: #000;
      flex-shrink: 0;
    }

    .playlist-item-thumb img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }

    .playlist-item-details {
      flex: 1;
      min-width: 0;
    }

    .playlist-item-title {
      font-size: 0.88rem;
      font-weight: 500;
      color: #fff;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
      line-height: 1.25;
    }

    .playlist-item-id {
      font-size: 0.72rem;
      font-family: monospace;
      color: rgba(255, 255, 255, 0.5);
      margin-top: 2px;
    }

    .delete-item-btn {
      color: rgba(255, 255, 255, 0.35);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 4px;
      border-radius: 4px;
      transition: color 0.15s, background-color 0.15s;
    }

    .delete-item-btn:hover {
      color: #ff5c5c;
      background-color: rgba(255, 92, 92, 0.12);
    }

    .delete-item-btn .material-symbols-outlined {
      font-size: 1.15rem;
    }

    .modal-actions-spread {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: 6px;
    }