:root {
  --bg-main: #0B0E17;
  --bg-card: #131A2B;
  --bg-card-hover: #19233A;
  --border-card: #202D49;
  
  --tier-starred: #FF5500;
  --tier-starred-glow: rgba(255, 85, 0, 0.4);
  --star-red: #FF1A4B;
  
  --tier-gold: #F59E0B;
  --tier-gold-glow: rgba(245, 158, 11, 0.4);
  
  --tier-purple: #9D4EDD;
  --tier-purple-glow: rgba(157, 78, 221, 0.4);
  
  --tier-blue: #00B4D8;
  --tier-blue-glow: rgba(0, 180, 216, 0.4);

  --text-main: #F1F5F9;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  --danger: #EF4444;
  --success: #10B981;

  --font-digital: 'Orbitron', monospace;
  --font-hud: 'Rajdhani', sans-serif;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

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

html, body {
  overflow-x: hidden;
}

body {
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 50% 0%, #17233D 0%, transparent 60%),
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 100% 100%, 32px 32px, 32px 32px;
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  padding: 16px;
  display: flex;
  justify-content: center;
}

.app-container {
  width: 100%;
  max-width: 820px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ==========================================================================
   Header
   ========================================================================== */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.badge-icon {
  font-size: 1.8rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1E293B, #0F172A);
  border: 1px solid #334155;
  border-radius: 10px;
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.05);
}

.app-title {
  font-family: var(--font-digital);
  font-size: 1.25rem;
  letter-spacing: 2px;
  font-weight: 800;
  color: #FFFFFF;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.app-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-hud);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.utility-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1E293B;
  border: 1px solid #334155;
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: 8px;
  font-family: var(--font-hud);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.utility-btn:hover:not(:disabled) {
  background: #2D3E5F;
  border-color: #475569;
}

.utility-btn.danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--danger);
  color: #FCA5A5;
}

.utility-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Tone Picker Group */
.tone-picker-group {
  display: inline-flex;
  align-items: center;
  background: #1E293B;
  border: 1px solid #334155;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.tone-picker-group:hover,
.tone-picker-group:focus-within {
  border-color: #475569;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.15);
}

.tone-select {
  background: transparent;
  border: none;
  color: var(--text-main);
  padding: 8px 10px;
  font-family: var(--font-hud);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 13px;
  padding-right: 26px;
}

.tone-select option {
  background: #0F172A;
  color: #F1F5F9;
  font-family: var(--font-hud);
  font-size: 0.9rem;
}

.tone-test-btn {
  width: auto !important;
  flex: 0 0 auto !important;
  border: none !important;
  border-left: 1px solid #334155 !important;
  border-radius: 0 !important;
  padding: 8px 10px !important;
  background: #1E293B !important;
  color: #F59E0B !important;
}

.tone-test-btn:hover:not(:disabled) {
  background: #2D3E5F !important;
  color: #FBBF24 !important;
}

/* Language Dropdown Group */
.lang-picker-group {
  position: relative;
  display: inline-flex;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #1E293B;
  border: 1px solid #334155;
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: 8px;
  font-family: var(--font-hud);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.lang-btn:hover {
  background: #2D3E5F;
  border-color: #38BDF8;
  color: #FFFFFF;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.lang-btn .dropdown-arrow {
  font-size: 0.72rem;
  color: #94A3B8;
  transition: transform 0.2s ease;
  pointer-events: none;
}

.lang-btn[aria-expanded="true"] .dropdown-arrow {
  transform: rotate(180deg);
  color: #38BDF8;
}

.lang-btn[aria-expanded="true"] {
  border-color: #38BDF8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

.lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 155px;
  background: #0F172A;
  border: 1px solid #38BDF8;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.75), 0 0 15px rgba(56, 189, 248, 0.25);
  z-index: 1000;
  overflow: hidden;
  padding: 4px;
}

.lang-menu.show {
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: langDropdownFade 0.15s ease-out;
}

@keyframes langDropdownFade {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #E2E8F0;
  font-family: var(--font-hud);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  width: 100%;
}

.lang-option:hover {
  background: #1E293B;
  color: #38BDF8;
}

.lang-option.active {
  background: rgba(56, 189, 248, 0.15);
  color: #38BDF8;
  font-weight: 700;
  border-left: 2px solid #38BDF8;
}

.lang-option .lang-flag {
  font-size: 1.1rem;
  line-height: 1;
}

.lang-option .lang-label {
  flex: 1;
}

.lang-option .lang-badge {
  font-size: 0.7rem;
  padding: 1px 5px;
  border-radius: 4px;
  background: #1E293B;
  color: #94A3B8;
  font-family: var(--font-digital);
}

.lang-option.active .lang-badge {
  background: rgba(56, 189, 248, 0.25);
  color: #38BDF8;
}

.lang-select-hidden {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

/* ==========================================================================
   Task Buttons Section (4 Primary Buttons)
   ========================================================================== */
.task-buttons-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.section-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-hud);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 0 4px;
}

.live-clock {
  font-family: var(--font-digital);
  color: #38BDF8;
  font-size: 0.85rem;
  letter-spacing: 1px;
}

.task-buttons-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 720px) {
  .task-buttons-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.task-btn {
  position: relative;
  background: var(--bg-card);
  border: 1.5px solid var(--border-card);
  border-radius: 12px;
  padding: 16px 12px;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.task-btn:hover {
  transform: translateY(-3px);
}

.task-btn:active {
  transform: translateY(0) scale(0.98);
}

.btn-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  z-index: 2;
  width: 100%;
}

.task-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.task-tier-name {
  font-family: var(--font-digital);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.task-subtext {
  font-family: var(--font-hud);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.task-duration-badge {
  font-family: var(--font-digital);
  font-size: 0.95rem;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  letter-spacing: 0.5px;
}

/* --- Tier 1: Shiny / Starred Legendary (Orange + Red Star) --- */
.task-btn.tier-starred {
  background: radial-gradient(circle at 50% 20%, rgba(255, 107, 0, 0.22), rgba(18, 24, 38, 0.95) 75%),
              linear-gradient(180deg, #1C151B 0%, #121826 100%);
  border-color: rgba(255, 90, 0, 0.6);
  box-shadow: 0 4px 16px rgba(255, 85, 0, 0.2);
}

.task-btn.tier-starred:hover {
  border-color: #FF6A00;
  box-shadow: 0 6px 24px rgba(255, 106, 0, 0.4), inset 0 0 15px rgba(255, 30, 68, 0.2);
}

.task-btn.tier-starred .task-tier-name {
  color: #FFA43B;
  text-shadow: 0 0 8px rgba(255, 107, 0, 0.6);
}

.task-star-badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle, #FF1E44 0%, #B90025 80%);
  border: 2px solid #FF8533;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 14px rgba(255, 30, 68, 0.7), inset 0 0 6px rgba(255, 255, 255, 0.5);
  color: #FFFFFF;
}

.star-icon {
  width: 24px;
  height: 24px;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.5));
}

.task-btn.tier-starred .task-duration-badge {
  color: #FFB347;
  border-color: rgba(255, 107, 0, 0.3);
}

/* --- Tier 2: Standard Legendary (Gold / Orange) --- */
.task-btn.tier-legendary {
  background: radial-gradient(circle at 50% 20%, rgba(245, 158, 11, 0.2), rgba(18, 24, 38, 0.95) 75%);
  border-color: rgba(245, 158, 11, 0.6);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.18);
}

.task-btn.tier-legendary:hover {
  border-color: #F59E0B;
  box-shadow: 0 6px 24px rgba(245, 158, 11, 0.35);
}

.task-btn.tier-legendary .task-tier-name {
  color: #FCD34D;
  text-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.gold-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle, #F59E0B, #B45309);
  border: 2px solid #FDE68A;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #FFFFFF;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.6);
}

.task-btn.tier-legendary .task-duration-badge {
  color: #FDE68A;
  border-color: rgba(245, 158, 11, 0.3);
}

/* --- Tier 3: Epic (Purple) --- */
.task-btn.tier-epic {
  background: radial-gradient(circle at 50% 20%, rgba(162, 56, 255, 0.2), rgba(18, 24, 38, 0.95) 75%);
  border-color: rgba(162, 56, 255, 0.6);
  box-shadow: 0 4px 16px rgba(162, 56, 255, 0.18);
}

.task-btn.tier-epic:hover {
  border-color: #C084FC;
  box-shadow: 0 6px 24px rgba(162, 56, 255, 0.35);
}

.task-btn.tier-epic .task-tier-name {
  color: #D8B4FE;
  text-shadow: 0 0 8px rgba(162, 56, 255, 0.5);
}

.purple-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle, #9333EA, #581C87);
  border: 2px solid #E9D5FF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #FFFFFF;
  box-shadow: 0 0 12px rgba(162, 56, 255, 0.6);
}

.task-btn.tier-epic .task-duration-badge {
  color: #E9D5FF;
  border-color: rgba(162, 56, 255, 0.3);
}

/* --- Tier 4: Rare (Blue) --- */
.task-btn.tier-rare {
  background: radial-gradient(circle at 50% 20%, rgba(0, 180, 216, 0.2), rgba(18, 24, 38, 0.95) 75%);
  border-color: rgba(0, 180, 216, 0.6);
  box-shadow: 0 4px 16px rgba(0, 180, 216, 0.18);
}

.task-btn.tier-rare:hover {
  border-color: #38BDF8;
  box-shadow: 0 6px 24px rgba(0, 180, 216, 0.35);
}

.task-btn.tier-rare .task-tier-name {
  color: #7DD3FC;
  text-shadow: 0 0 8px rgba(0, 180, 216, 0.5);
}

.blue-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle, #0284C7, #075985);
  border: 2px solid #BAE6FD;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #FFFFFF;
  box-shadow: 0 0 12px rgba(0, 180, 216, 0.6);
}

.task-btn.tier-rare .task-duration-badge {
  color: #BAE6FD;
  border-color: rgba(0, 180, 216, 0.3);
}

/* ==========================================================================
   Custom Op / Manual Timer Section
   ========================================================================== */
.custom-op-section {
  display: flex;
  flex-direction: column;
}

.custom-op-card {
  background: linear-gradient(135deg, rgba(13, 27, 42, 0.95), rgba(19, 32, 53, 0.95));
  border: 1px solid rgba(0, 240, 255, 0.35);
  box-shadow: 0 4px 20px rgba(0, 240, 255, 0.1);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.custom-op-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #00F0FF, #00B4D8, transparent);
}

.custom-op-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.custom-op-label-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.custom-op-icon {
  font-size: 1.1rem;
}

.custom-op-heading {
  font-family: var(--font-hud);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 1px;
  color: #00F0FF;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

.custom-op-hint {
  font-family: var(--font-digital);
  font-size: 0.72rem;
  color: var(--text-dim);
  background: rgba(0, 240, 255, 0.08);
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid rgba(0, 240, 255, 0.2);
}

.custom-op-interactive-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.custom-step-btn {
  background: #17243B;
  border: 1px solid #2C3E5D;
  color: #94A3B8;
  font-family: var(--font-hud);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.custom-step-btn:hover {
  background: #203150;
  border-color: #00F0FF;
  color: #FFF;
}

.custom-step-btn:active {
  transform: scale(0.96);
}

.custom-time-display-btn {
  flex: 1;
  background: radial-gradient(circle at 50% 50%, rgba(0, 240, 255, 0.12), rgba(11, 19, 34, 0.95) 80%);
  border: 1.5px solid #00F0FF;
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.2);
  transition: all 0.2s ease;
  user-select: none;
}

.custom-time-display-btn:hover {
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
  transform: translateY(-1px);
}

.custom-time-display-btn:active {
  transform: scale(0.98);
}

.custom-min-num {
  font-family: var(--font-digital);
  font-size: 1.6rem;
  font-weight: 700;
  color: #00F0FF;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.6);
  line-height: 1;
}

.custom-min-unit {
  font-family: var(--font-hud);
  font-size: 0.85rem;
  font-weight: 700;
  color: #94A3B8;
  letter-spacing: 0.5px;
}

.custom-add-pill {
  font-family: var(--font-hud);
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(0, 240, 255, 0.2);
  color: #00F0FF;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 4px;
}

.custom-reset-btn {
  background: #17243B;
  border: 1px solid #2C3E5D;
  color: #64748B;
  font-size: 1.1rem;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.custom-reset-btn:hover {
  background: #203150;
  color: #EF4444;
  border-color: #EF4444;
}

.custom-launch-btn {
  background: linear-gradient(135deg, #00B4D8, #0077B6);
  border: 1px solid #00F0FF;
  color: #FFFFFF;
  font-family: var(--font-hud);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 1px;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(0, 180, 216, 0.35);
  transition: all 0.2s ease;
  user-select: none;
}

.custom-launch-btn:hover {
  background: linear-gradient(135deg, #00F0FF, #0096C7);
  box-shadow: 0 6px 22px rgba(0, 240, 255, 0.5);
  transform: translateY(-1px);
}

.custom-launch-btn:active {
  transform: translateY(1px);
}

/* ==========================================================================
   Feed Section
   ========================================================================== */
.feed-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px;
}

.feed-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.feed-title {
  font-family: var(--font-hud);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-main);
}

.feed-counter {
  font-family: var(--font-digital);
  font-size: 0.75rem;
  background: #1E293B;
  color: #38BDF8;
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid #334155;
}

.text-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-hud);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease;
}

.text-btn:hover {
  color: var(--text-muted);
}

/* ==========================================================================
   Feed Cards
   ========================================================================== */
.timers-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 140px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
  background: rgba(19, 26, 43, 0.5);
  border: 2px dashed var(--border-card);
  border-radius: 14px;
  text-align: center;
  color: var(--text-dim);
}

.empty-icon {
  font-size: 2.2rem;
  margin-bottom: 12px;
  opacity: 0.7;
}

.empty-title {
  font-family: var(--font-digital);
  font-size: 0.95rem;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.empty-desc {
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* Card Styling */
.feed-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, border-color 0.2s ease;
  overflow: hidden;
}

.feed-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
}

.feed-card.tier-starred::before { background: linear-gradient(180deg, var(--star-red), var(--tier-starred)); }
.feed-card.tier-legendary::before { background: var(--tier-gold); }
.feed-card.tier-epic::before { background: var(--tier-purple); }
.feed-card.tier-rare::before { background: var(--tier-blue); }
.feed-card.tier-custom::before { background: #00F0FF; }

.feed-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-badge-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: bold;
}

.feed-card.tier-starred .card-badge-icon {
  background: #FF1E44;
  color: #FFF;
  box-shadow: 0 0 8px rgba(255, 30, 68, 0.6);
}
.feed-card.tier-legendary .card-badge-icon {
  background: #F59E0B;
  color: #000;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
}
.feed-card.tier-epic .card-badge-icon {
  background: #9D4EDD;
  color: #FFF;
  box-shadow: 0 0 8px rgba(157, 78, 221, 0.6);
}
.feed-card.tier-rare .card-badge-icon {
  background: #00B4D8;
  color: #000;
  box-shadow: 0 0 8px rgba(0, 180, 216, 0.6);
}
.feed-card.tier-custom .card-badge-icon {
  background: #00F0FF;
  color: #000;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
}

.card-tier-label {
  font-family: var(--font-hud);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-ready-time {
  font-family: var(--font-hud);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.card-delete-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.card-delete-btn:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.15);
}

/* Main Timer Center */
.card-main-content {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.countdown-digits {
  font-family: var(--font-digital);
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: 2px;
  line-height: 1;
}

.feed-card.tier-starred .countdown-digits { color: #FF9248; text-shadow: 0 0 10px rgba(255, 85, 0, 0.4); }
.feed-card.tier-legendary .countdown-digits { color: #FCD34D; text-shadow: 0 0 10px rgba(245, 158, 11, 0.4); }
.feed-card.tier-epic .countdown-digits { color: #D8B4FE; text-shadow: 0 0 10px rgba(157, 78, 221, 0.4); }
.feed-card.tier-rare .countdown-digits { color: #7DD3FC; text-shadow: 0 0 10px rgba(0, 180, 216, 0.4); }

.status-pill {
  font-family: var(--font-digital);
  font-size: 0.72rem;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Progress bar */
.card-progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: #0B0F19;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.card-progress-fill {
  height: 100%;
  width: 0%;
  transition: width 0.9s linear;
}

.feed-card.tier-starred .card-progress-fill { background: linear-gradient(90deg, #FF1E44, #FF6A00); }
.feed-card.tier-legendary .card-progress-fill { background: linear-gradient(90deg, #D97706, #F59E0B); }
.feed-card.tier-epic .card-progress-fill { background: linear-gradient(90deg, #7E22CE, #C084FC); }
.feed-card.tier-rare .card-progress-fill { background: linear-gradient(90deg, #0284C7, #38BDF8); }

/* Completed State */
.feed-card.completed {
  border-color: #10B981;
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.12) 0%, var(--bg-card) 100%);
  animation: pulseCard 2s infinite ease-in-out;
}

.feed-card.completed .countdown-digits {
  color: #34D399;
  text-shadow: 0 0 14px rgba(52, 211, 153, 0.7);
}

.feed-card.completed .status-pill {
  background: #065F46;
  color: #A7F3D0;
  border-color: #10B981;
  font-weight: 800;
  animation: pulsePill 1.2s infinite alternate;
}

.feed-card.completed .card-progress-fill {
  background: #10B981;
  width: 100% !important;
}

.collect-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #10B981;
  color: #064E3B;
  font-family: var(--font-hud);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.collect-btn:hover {
  background: #34D399;
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.6);
}

@keyframes pulseCard {
  0% { box-shadow: 0 0 8px rgba(16, 185, 129, 0.2); }
  50% { box-shadow: 0 0 20px rgba(16, 185, 129, 0.5); }
  100% { box-shadow: 0 0 8px rgba(16, 185, 129, 0.2); }
}

@keyframes pulsePill {
  from { transform: scale(1); }
  to { transform: scale(1.05); }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 15, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  animation: fadeIn 0.2s ease-out;
}

.modal-card {
  background: #131A2B;
  border: 1px solid #2A3B5C;
  border-radius: 16px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(56, 189, 248, 0.15);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #172238;
  border-bottom: 1px solid #233350;
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-icon {
  font-size: 1.3rem;
}

.modal-title {
  font-family: var(--font-digital);
  font-size: 0.95rem;
  letter-spacing: 1px;
  color: #F8FAFC;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s ease;
}

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

.modal-body {
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

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

/* Responsive Layout Enhancements */
@media (max-width: 768px) {
  .app-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px 16px;
  }
  .header-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }
  .header-actions > .lang-picker-group,
  .header-actions > .tone-picker-group,
  .header-actions > .utility-btn {
    width: 100%;
  }
  .lang-btn {
    width: 100%;
    justify-content: center;
  }
  .tone-picker-group {
    display: flex;
    width: 100%;
  }
  .tone-select {
    flex: 1;
    min-width: 0;
  }
  .task-buttons-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

@media (max-width: 540px) {
  body {
    padding: 8px 6px;
    padding-bottom: 110px !important;
  }
  .app-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px 12px;
  }
  .header-left {
    gap: 10px;
  }
  .badge-icon {
    width: 38px;
    height: 38px;
    font-size: 1.4rem;
    flex-shrink: 0;
  }
  .app-title {
    font-size: 1.05rem;
    letter-spacing: 1px;
    word-break: break-word;
  }
  .app-subtitle {
    font-size: 0.74rem;
  }
  .header-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }
  .header-actions > .lang-picker-group,
  .header-actions > .tone-picker-group,
  .header-actions > .utility-btn {
    width: 100%;
    margin: 0;
  }
  .header-actions > .utility-btn,
  .lang-btn {
    padding: 8px 6px;
    justify-content: center;
    font-size: 0.8rem;
    min-height: 38px;
  }
  .tone-picker-group {
    display: flex;
    min-height: 38px;
  }
  .tone-select {
    flex: 1;
    min-width: 0;
    padding: 6px 8px;
    font-size: 0.8rem;
    background-position: right 4px center;
    padding-right: 20px;
  }
  .tone-test-btn {
    padding: 6px 8px !important;
  }
  .lang-menu {
    min-width: 140px;
    max-width: 190px;
  }
  .task-buttons-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .task-btn {
    padding: 12px 8px;
  }
  .task-star-badge, .gold-icon, .purple-icon, .blue-icon {
    width: 38px;
    height: 38px;
  }
  .task-tier-name {
    font-size: 0.76rem;
  }
  .task-subtext {
    font-size: 0.7rem;
  }
  .task-duration-badge {
    font-size: 0.82rem;
    padding: 3px 8px;
  }
  .countdown-digits {
    font-size: 1.8rem;
    letter-spacing: 1px;
  }
  .feed-card {
    padding: 12px 14px;
  }
  .ad-subline {
    display: none;
  }
  .ad-action-btn {
    font-size: 0.75rem;
    padding: 4px 8px;
  }
  .ad-badge {
    font-size: 0.62rem;
    padding: 3px 6px;
  }
}

@media (max-width: 360px) {
  .app-title {
    font-size: 0.95rem;
    letter-spacing: 0.5px;
  }
  .utility-btn,
  .lang-btn {
    font-size: 0.74rem;
    padding: 6px 4px;
  }
  .btn-text {
    font-size: 0.74rem;
  }
  .tone-select {
    font-size: 0.74rem;
    padding: 6px 4px;
    padding-right: 16px;
  }
}

/* ==========================================================================
   Footer & Legal Disclaimer
   ========================================================================== */
.app-footer {
  margin-top: 10px;
  padding: 16px 12px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-disclaimer {
  font-size: 0.75rem;
  color: var(--text-dim);
  max-width: 600px;
  line-height: 1.4;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-link-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-hud);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 4px;
  transition: color 0.15s ease;
}

.footer-link-btn:hover {
  color: #38BDF8;
  text-decoration: underline;
}

.footer-sep {
  color: #334155;
  font-size: 0.8rem;
}

/* ==========================================================================
   Non-Invasive Bottom Sticky Ad Bar
   ========================================================================== */
body {
  padding-bottom: 120px !important;
}

.bottom-ad-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  display: flex;
  justify-content: center;
  padding: 6px 12px 10px;
  background: linear-gradient(180deg, rgba(11, 14, 23, 0.92) 0%, rgba(7, 9, 15, 0.98) 100%);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(56, 189, 248, 0.15);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.bottom-ad-bar.dismissed {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}

.ad-shell {
  width: 100%;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ad-meta-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px;
}

.ad-label {
  font-family: var(--font-hud);
  font-size: 0.65rem;
  letter-spacing: 1px;
  color: var(--text-dim);
  font-weight: 700;
}

.ad-close-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
  border-radius: 4px;
  transition: color 0.15s ease;
}

.ad-close-btn:hover {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.08);
}

.ad-slot {
  background: #101626;
  border: 1px solid #1E293B;
  border-radius: 10px;
  overflow: hidden;
  min-height: 52px;
  display: flex;
  align-items: center;
  transition: border-color 0.2s ease;
}

.ad-slot:hover {
  border-color: #38BDF8;
}

.ad-banner-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 14px;
  text-decoration: none;
  color: var(--text-main);
  gap: 12px;
}

.ad-badge {
  background: linear-gradient(135deg, #FF6A00, #FF1E44);
  color: #FFFFFF;
  font-family: var(--font-digital);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.ad-text-block {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ad-headline {
  font-family: var(--font-hud);
  font-size: 0.88rem;
  font-weight: 700;
  color: #F8FAFC;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ad-subline {
  font-size: 0.74rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ad-action-btn {
  background: #1E293B;
  border: 1px solid #38BDF8;
  color: #38BDF8;
  font-family: var(--font-hud);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 6px 12px;
  border-radius: 6px;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.ad-banner-link:hover .ad-action-btn {
  background: #38BDF8;
  color: #0B0E17;
}

/* ==========================================================================
   Legal Modal Styles
   ========================================================================== */
.legal-card {
  max-width: 580px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.legal-tab-nav {
  display: flex;
  background: #0F172A;
  border-bottom: 1px solid #233350;
}

.legal-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 10px 12px;
  font-family: var(--font-hud);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
}

.legal-tab:hover {
  color: #FFF;
  background: rgba(255, 255, 255, 0.03);
}

.legal-tab.active {
  color: #38BDF8;
  border-bottom-color: #38BDF8;
  background: rgba(56, 189, 248, 0.06);
}

.legal-body {
  padding: 20px;
  overflow-y: auto;
  text-align: left;
  align-items: flex-start;
  display: block;
}

.legal-tab-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 0.86rem;
  line-height: 1.55;
  color: #CBD5E1;
}

.legal-tab-content h4 {
  font-family: var(--font-digital);
  font-size: 1rem;
  color: #F8FAFC;
  letter-spacing: 0.5px;
}

.legal-tab-content h5 {
  font-family: var(--font-hud);
  font-size: 0.95rem;
  color: #38BDF8;
  margin-top: 6px;
}

.legal-tab-content a {
  color: #38BDF8;
  text-decoration: underline;
}

.legal-tab-content code {
  background: #0B0E17;
  padding: 2px 6px;
  border-radius: 4px;
  color: #FDE68A;
  font-size: 0.82rem;
}

.legal-subtext {
  font-size: 0.78rem;
  color: var(--text-dim);
}
