:root {
  --mad-red: #E53935;
  --mad-yellow: #F9A825;
  --mad-blue: #1E88E5;
  --paper: #FDF6E3;
  --ink: #1A1A1A;
  --purple: #8B5CF6;
  --green: #43A047;
  --pink: #E91E63;
  --orange: #FF9800;
}

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

body {
  font-family: 'Comic Neue', cursive;
  background: var(--paper);
  background-image: 
    radial-gradient(circle at 20% 80%, rgba(233, 30, 99, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(33, 150, 243, 0.05) 0%, transparent 50%),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23000000' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: env(safe-area-inset-top);
}

/* =====================================================
   RESPONSIVE CONTAINER
   ===================================================== */
.app-container {
  max-width: 100%;
  margin: 0 auto;
}

/* Desktop: centered with max-width */
@media (min-width: 768px) {
  .app-container {
    max-width: 1200px;
    padding: 0 20px;
  }
  
  body {
    padding: 20px;
  }
}

/* =====================================================
   HEADER
   ===================================================== */
.header {
  background: var(--paper);
  text-align: center;
  padding: 15px 10px;
  border-bottom: 4px solid var(--ink);
}

.header h1 {
  font-family: 'Bangers', cursive;
  font-size: 2rem;
  color: var(--mad-red);
  text-shadow: 3px 3px 0 var(--mad-yellow), 4px 4px 0 var(--ink);
  transform: rotate(-1deg);
  margin: 0;
}

.header .subtitle {
  font-family: 'Special Elite', monospace;
  font-size: 0.8rem;
  color: var(--ink);
  margin-top: 3px;
}

.mascot {
  font-size: 2.2rem;
  display: inline-block;
  animation: wobble 2s infinite;
}

@keyframes wobble {
  0%, 100% { transform: rotate(-8deg); }
  50% { transform: rotate(8deg); }
}

@media (min-width: 768px) {
  .header {
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 4px solid var(--ink);
    box-shadow: 5px 5px 0 var(--ink);
  }
  
  .header h1 {
    font-size: 3rem;
  }
  
  .mascot {
    font-size: 3rem;
  }
}

/* =====================================================
   BANNER
   ===================================================== */
.banner {
  background: var(--mad-red);
  color: white;
  padding: 10px 15px;
  text-align: center;
  font-family: 'Bangers', cursive;
  font-size: 1rem;
  border: 3px solid var(--ink);
  border-top: none;
  box-shadow: 0 4px 0 var(--ink);
  margin: 0 10px 15px;
  transform: rotate(-0.5deg);
}

@media (min-width: 768px) {
  .banner {
    font-size: 1.3rem;
    padding: 15px 20px;
    margin: 0 0 20px;
    border-top: 3px solid var(--ink);
    border-radius: 8px;
  }
}

/* =====================================================
   DESKTOP GRID LAYOUT
   ===================================================== */
@media (min-width: 768px) {
  .desktop-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
  }
  
  .desktop-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  
  .desktop-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
}

/* =====================================================
   CARDS (Base)
   ===================================================== */
.card {
  background: white;
  border: 3px solid var(--ink);
  border-radius: 8px;
  padding: 15px;
  margin: 10px;
  box-shadow: 5px 5px 0 var(--ink);
}

.card h2 {
  font-family: 'Bangers', cursive;
  font-size: 1.4rem;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 3px solid var(--mad-yellow);
  color: var(--ink);
}

@media (min-width: 768px) {
  .card {
    margin: 0;
    padding: 20px;
  }
  
  .card h2 {
    font-size: 1.6rem;
  }
}

/* =====================================================
   SCOREBOARD
   ===================================================== */
.scoreboard {
  background: white;
  border: 3px solid var(--ink);
  border-radius: 8px;
  padding: 15px;
  margin: 10px;
  box-shadow: 5px 5px 0 var(--ink);
}

.scoreboard h2 {
  font-family: 'Bangers', cursive;
  font-size: 1.4rem;
  text-align: center;
  margin-bottom: 15px;
  color: var(--mad-red);
  text-shadow: 2px 2px 0 var(--mad-yellow);
}

.score-display {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.score-box {
  text-align: center;
  padding: 12px 8px;
  border: 3px dashed var(--ink);
  border-radius: 8px;
  background: #f8f8f8;
}

.score-box.current {
  border: 4px solid var(--purple);
  border-style: solid;
  background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
  transform: scale(1.02) rotate(-1deg);
}

.score-box.target {
  border-color: var(--mad-red);
  border-style: solid;
}

.score-label {
  font-family: 'Special Elite', monospace;
  font-size: 0.7rem;
  color: #666;
  text-transform: uppercase;
}

.score-value {
  font-family: 'Bangers', cursive;
  font-size: 2rem;
  color: var(--ink);
}

.score-box.current .score-value { color: var(--purple); }
.score-box.target .score-value { color: var(--mad-red); }

@media (min-width: 768px) {
  .scoreboard {
    margin: 0;
    padding: 25px;
  }
  
  .score-display {
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
  }
  
  .score-value {
    font-size: 2.8rem;
  }
  
  .score-box {
    padding: 20px 15px;
  }
}

/* =====================================================
   STATUS
   ===================================================== */
.status {
  text-align: center;
  padding: 10px;
  margin-top: 12px;
  font-family: 'Bangers', cursive;
  font-size: 1.1rem;
  border-radius: 6px;
  border: 3px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}

.status.ahead { background: #c8e6c9; color: #2e7d32; }
.status.behind { background: #ffcdd2; color: #c62828; }
.status.close { background: #fff9c4; color: #f57f17; }

@media (min-width: 768px) {
  .status {
    font-size: 1.4rem;
    padding: 15px;
  }
}

/* =====================================================
   STATS MINI GRID
   ===================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.stat-mini {
  text-align: center;
  padding: 8px 4px;
  background: #f8f8f8;
  border-radius: 6px;
  border: 2px solid #ddd;
}

.stat-mini .emoji { font-size: 1.2rem; display: block; }
.stat-mini .value { font-family: 'Bangers', cursive; font-size: 1.3rem; color: var(--mad-blue); }
.stat-mini .label { font-size: 0.6rem; color: #666; text-transform: uppercase; }

@media (min-width: 768px) {
  .stat-mini {
    padding: 12px 8px;
  }
  
  .stat-mini .value {
    font-size: 1.6rem;
  }
  
  .stat-mini .label {
    font-size: 0.7rem;
  }
}

/* =====================================================
   BIG THREE
   ===================================================== */
.big-three {
  background: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 8px;
  padding: 15px;
  margin: 10px;
  box-shadow: 5px 5px 0 var(--purple);
  transform: rotate(-0.5deg);
}

.big-three-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px solid var(--mad-yellow);
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.big-three-header h2 {
  font-family: 'Bangers', cursive;
  font-size: 1.5rem;
  color: var(--mad-yellow);
  text-shadow: 2px 2px 0 var(--mad-red);
  margin: 0;
  border: none;
  padding: 0;
}

.big-three-subtitle {
  font-family: 'Special Elite', monospace;
  font-size: 0.65rem;
  color: #888;
}

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

.big-three-item {
  background: #2a2a2a;
  border-radius: 8px;
  padding: 12px;
  position: relative;
  border-left: 4px solid var(--mad-yellow);
}

.big-three-item.rank-1 { border-left-color: gold; }
.big-three-item.rank-2 { border-left-color: silver; }
.big-three-item.rank-3 { border-left-color: #cd7f32; }

.big-three-item.done {
  background: #1e3a1e;
  opacity: 0.85;
}

.big-three-item .rank {
  position: absolute;
  top: -8px;
  left: 10px;
  font-family: 'Bangers', cursive;
  font-size: 0.8rem;
  padding: 2px 10px;
  border-radius: 8px;
  color: var(--ink);
}

.big-three-item.rank-1 .rank { background: gold; }
.big-three-item.rank-2 .rank { background: silver; }
.big-three-item.rank-3 .rank { background: #cd7f32; }

.big-three-item .task-name {
  color: white;
  font-family: 'Bangers', cursive;
  font-size: 1rem;
  margin-top: 6px;
}

.big-three-item.done .task-name { text-decoration: line-through; }

.big-three-item .task-why {
  color: #aaa;
  font-size: 0.75rem;
  margin-top: 5px;
  font-family: 'Comic Neue', cursive;
}

.big-three-item .task-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  align-items: center;
}

.big-three-item .task-time {
  color: #888;
  font-size: 0.7rem;
  font-family: 'Special Elite', monospace;
}

.big-three-item .task-points {
  color: var(--mad-yellow);
  font-family: 'Bangers', cursive;
  font-size: 1rem;
}

.big-three-item.done::after {
  content: '✅';
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  font-size: 1.2rem;
}

.big-three-footer {
  text-align: center;
  margin-top: 12px;
  font-family: 'Special Elite', monospace;
  font-size: 0.7rem;
  color: #888;
}

@media (min-width: 768px) {
  .big-three {
    margin: 0;
    padding: 20px;
  }
  
  .big-three-header h2 {
    font-size: 1.8rem;
  }
  
  .big-three-subtitle {
    font-size: 0.8rem;
  }
  
  .big-three-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
  }
  
  .big-three-item {
    padding: 15px;
  }
  
  .big-three-item .task-name {
    font-size: 1.1rem;
  }
}

/* =====================================================
   BLOCKERS
   ===================================================== */
.blocker-item {
  background: #fff3e0;
  border: 2px solid var(--orange);
  border-left: 5px solid var(--orange);
  border-radius: 0 8px 8px 0;
  padding: 12px;
  margin-bottom: 10px;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.1);
}

.blocker-task {
  font-family: 'Bangers', cursive;
  font-size: 1rem;
  color: #e65100;
}

.blocker-waiting {
  font-size: 0.85rem;
  color: #666;
  margin-top: 5px;
}

.blocker-context {
  font-size: 0.75rem;
  color: #999;
  margin-top: 4px;
  font-family: 'Special Elite', monospace;
}

/* =====================================================
   CATEGORY TABS
   ===================================================== */
.category-tabs {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  padding: 12px 10px;
  background: white;
  border-bottom: 3px solid var(--ink);
  -webkit-overflow-scrolling: touch;
}

.category-tabs::-webkit-scrollbar { display: none; }

.tab {
  padding: 8px 14px;
  border-radius: 20px;
  background: #f0f0f0;
  border: 2px solid transparent;
  font-size: 0.85rem;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Comic Neue', cursive;
  font-weight: 700;
}

.tab.active {
  background: var(--mad-blue);
  color: white;
  border-color: var(--ink);
}

@media (min-width: 768px) {
  .category-tabs {
    padding: 15px;
    border-radius: 8px 8px 0 0;
    border: 3px solid var(--ink);
    border-bottom: none;
  }
}

/* =====================================================
   TASK CATEGORIES & ITEMS
   ===================================================== */
.category-section {
  margin: 10px;
  margin-top: 0;
}

.category-header {
  font-family: 'Bangers', cursive;
  font-size: 1.1rem;
  padding: 8px 12px;
  border-radius: 8px 8px 0 0;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 3px solid var(--ink);
  border-bottom: none;
}

.category-points {
  font-size: 0.85rem;
  background: rgba(255,255,255,0.3);
  padding: 2px 10px;
  border-radius: 10px;
}

.task-list {
  background: white;
  border: 3px solid var(--ink);
  border-top: none;
  border-radius: 0 0 8px 8px;
}

.task-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 2px dashed #ddd;
  gap: 10px;
}

.task-item:last-child { border-bottom: none; }

.task-item.done {
  background: #e8f5e9;
  text-decoration: line-through;
  opacity: 0.75;
}

.task-status { font-size: 1.1rem; }
.task-info { flex: 1; min-width: 0; }
.task-name { font-size: 0.9rem; word-wrap: break-word; }

.task-project {
  font-size: 0.65rem;
  background: #e0e0e0;
  padding: 2px 8px;
  border-radius: 10px;
  display: inline-block;
  margin-top: 3px;
  font-family: 'Special Elite', monospace;
}

.task-points {
  font-family: 'Bangers', cursive;
  color: var(--purple);
  font-size: 1rem;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .category-section {
    margin: 0;
    margin-bottom: 15px;
  }
  
  .task-item {
    padding: 12px 15px;
  }
}

/* =====================================================
   HEATMAP
   ===================================================== */
.heatmap-container {
  overflow-x: auto;
  padding: 10px 0;
  -webkit-overflow-scrolling: touch;
}

.heatmap {
  display: flex;
  gap: 3px;
  min-width: max-content;
}

.heatmap-week {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.heatmap-day {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: #ebedf0;
  border: 1px solid rgba(0,0,0,0.05);
}

.heatmap-day.future { background: transparent; border: 1px dashed #ccc; }
.heatmap-day.level-0 { background: #ebedf0; }
.heatmap-day.level-1 { background: #d4b8ff; }
.heatmap-day.level-2 { background: #b388ff; }
.heatmap-day.level-3 { background: #8B5CF6; }
.heatmap-day.level-4 { background: #6d28d9; }
.heatmap-day.won { box-shadow: inset 0 0 0 2px gold; }

.heatmap-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 12px;
  font-size: 0.7rem;
  color: #666;
  font-family: 'Special Elite', monospace;
}

.legend-box {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

.legend-box.level-0 { background: #ebedf0; }
.legend-box.level-1 { background: #d4b8ff; }
.legend-box.level-2 { background: #b388ff; }
.legend-box.level-3 { background: #8B5CF6; }
.legend-box.level-4 { background: #6d28d9; }

.streak-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 15px;
}

.streak-card {
  background: white;
  border: 3px solid var(--ink);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  box-shadow: 3px 3px 0 var(--ink);
}

.streak-card-value {
  font-family: 'Bangers', cursive;
  font-size: 1.8rem;
  color: var(--purple);
}

.streak-card-label {
  font-size: 0.7rem;
  color: #666;
  font-family: 'Special Elite', monospace;
  text-transform: uppercase;
}

@media (min-width: 768px) {
  .heatmap-day {
    width: 14px;
    height: 14px;
  }
  
  .streak-cards {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* =====================================================
   HISTORY LIST
   ===================================================== */
.history-item {
  display: flex;
  align-items: center;
  padding: 10px;
  background: #f8f8f8;
  border-radius: 8px;
  margin-bottom: 8px;
  border: 2px solid #eee;
}

.history-date {
  font-family: 'Special Elite', monospace;
  font-size: 0.75rem;
  color: #666;
  width: 70px;
  flex-shrink: 0;
}

.history-score {
  font-family: 'Bangers', cursive;
  font-size: 1.2rem;
  color: var(--purple);
  width: 50px;
  flex-shrink: 0;
}

.history-bar {
  flex: 1;
  height: 8px;
  background: #eee;
  border-radius: 4px;
  overflow: hidden;
  margin: 0 10px;
}

.history-bar-fill {
  height: 100%;
  background: var(--purple);
  border-radius: 4px;
}

.history-result {
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* =====================================================
   LOGBOOK
   ===================================================== */
.search-box {
  width: 100%;
  padding: 12px 15px;
  font-size: 1rem;
  border: 3px solid var(--ink);
  border-radius: 8px;
  margin-bottom: 15px;
  font-family: 'Comic Neue', cursive;
  box-shadow: 3px 3px 0 var(--ink);
}

.search-box:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 3px 3px 0 var(--purple);
}

.project-section {
  background: white;
  border: 3px solid var(--ink);
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: 4px 4px 0 var(--ink);
}

.project-header {
  padding: 12px 15px;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  border-bottom: 3px solid var(--ink);
}

.project-header h3 {
  font-family: 'Bangers', cursive;
  font-size: 1.15rem;
  margin: 0;
}

.project-status-badge {
  font-size: 0.7rem;
  padding: 3px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.3);
  font-family: 'Special Elite', monospace;
}

.project-content {
  padding: 12px 15px;
  display: none;
  background: #fafafa;
}

.project-content.open { display: block; }

.log-section { margin-bottom: 12px; }

.log-section-title {
  font-family: 'Bangers', cursive;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--ink);
}

.log-item {
  font-size: 0.85rem;
  padding: 6px 0 6px 15px;
  border-left: 3px solid #ddd;
  margin-left: 5px;
  margin-bottom: 4px;
}

.log-item.done { border-color: var(--green); background: #e8f5e9; }
.log-item.in-progress { border-color: var(--mad-blue); background: #e3f2fd; }
.log-item.pending { border-color: var(--orange); background: #fff3e0; }
.log-item.blocked { border-color: var(--mad-red); background: #ffebee; }

/* =====================================================
   DATES & FOLLOW-UPS
   ===================================================== */
.date-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: white;
  border: 2px solid var(--ink);
  border-radius: 8px;
  margin-bottom: 8px;
  box-shadow: 3px 3px 0 var(--ink);
}

.date-badge {
  background: var(--mad-red);
  color: white;
  padding: 8px;
  border-radius: 8px;
  text-align: center;
  min-width: 50px;
  border: 2px solid var(--ink);
  flex-shrink: 0;
}

.date-month {
  font-size: 0.6rem;
  text-transform: uppercase;
  font-family: 'Special Elite', monospace;
}

.date-day {
  font-family: 'Bangers', cursive;
  font-size: 1.4rem;
  line-height: 1;
}

.date-info { flex: 1; min-width: 0; }
.date-name { font-weight: bold; font-size: 0.9rem; word-wrap: break-word; }
.date-type { 
  font-size: 0.7rem; 
  color: #666; 
  text-transform: capitalize;
  font-family: 'Special Elite', monospace;
}

.date-countdown {
  font-family: 'Bangers', cursive;
  font-size: 1rem;
  color: var(--mad-red);
  flex-shrink: 0;
}

.date-item.urgent {
  border-color: var(--mad-red);
  box-shadow: 3px 3px 0 var(--mad-red);
}

.date-item.urgent .date-countdown {
  background: var(--mad-red);
  color: white;
  padding: 4px 10px;
  border-radius: 8px;
}

.followup-item {
  background: white;
  border: 2px solid var(--pink);
  border-left: 5px solid var(--pink);
  border-radius: 0 8px 8px 0;
  padding: 12px;
  margin-bottom: 10px;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.1);
}

.followup-person {
  font-family: 'Bangers', cursive;
  font-size: 1rem;
  color: var(--pink);
}

.followup-subject {
  margin: 4px 0;
  font-size: 0.9rem;
}

.followup-due {
  font-size: 0.75rem;
  color: #666;
  font-family: 'Special Elite', monospace;
}

/* =====================================================
   BOTTOM NAV (Mobile Only)
   ===================================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 3px solid var(--ink);
  display: flex;
  justify-content: space-around;
  padding: 6px 0;
  padding-bottom: calc(6px + env(safe-area-inset-bottom));
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 0.6rem;
  color: #666;
  text-decoration: none;
  padding: 4px 8px;
  font-family: 'Special Elite', monospace;
  text-transform: uppercase;
}

.nav-item.active {
  color: var(--mad-red);
}

.nav-item.active .nav-icon {
  transform: scale(1.2) rotate(-5deg);
}

.nav-icon {
  font-size: 1.4rem;
  transition: transform 0.2s;
}

/* Desktop: Top nav instead of bottom */
@media (min-width: 768px) {
  .bottom-nav {
    position: static;
    border-top: none;
    border: 3px solid var(--ink);
    border-radius: 8px;
    margin-bottom: 20px;
    padding: 10px;
    box-shadow: 5px 5px 0 var(--ink);
    justify-content: center;
    gap: 20px;
  }
  
  .nav-item {
    flex-direction: row;
    gap: 8px;
    font-size: 0.8rem;
    padding: 8px 16px;
    border-radius: 20px;
    transition: background 0.2s;
  }
  
  .nav-item:hover {
    background: #f0f0f0;
  }
  
  .nav-item.active {
    background: var(--mad-red);
    color: white;
  }
  
  .nav-item.active .nav-icon {
    transform: none;
  }
  
  .nav-icon {
    font-size: 1.2rem;
  }
}

/* =====================================================
   VIEWS
   ===================================================== */
.view { 
  display: none; 
  padding-bottom: 70px; 
}

.view.active { display: block; }

@media (min-width: 768px) {
  .view {
    padding-bottom: 20px;
  }
}

/* =====================================================
   SECTION & EMPTY STATE
   ===================================================== */
.section {
  padding: 0 10px 15px;
}

.section-title {
  font-family: 'Bangers', cursive;
  font-size: 1.3rem;
  color: var(--mad-red);
  margin-bottom: 10px;
  padding-bottom: 5px;
  border-bottom: 3px solid var(--mad-yellow);
  text-shadow: 1px 1px 0 var(--mad-yellow);
}

.empty-state {
  text-align: center;
  padding: 20px;
  color: #666;
  font-family: 'Special Elite', monospace;
  border: 2px dashed #ccc;
  border-radius: 8px;
  background: #fafafa;
}

@media (min-width: 768px) {
  .section {
    padding: 0;
  }
}

/* =====================================================
   FOOTER
   ===================================================== */
.footer {
  text-align: center;
  padding: 15px;
  margin: 10px;
  border-top: 3px dashed #ccc;
}

.footer .catchphrase {
  font-family: 'Bangers', cursive;
  font-size: 1.1rem;
  color: var(--mad-red);
  text-shadow: 1px 1px 0 var(--mad-yellow);
}

.footer .credit {
  font-family: 'Special Elite', monospace;
  font-size: 0.7rem;
  color: #888;
  margin-top: 5px;
}

@media (min-width: 768px) {
  .footer {
    margin: 20px 0 0;
  }
  
  .footer .catchphrase {
    font-size: 1.4rem;
  }
}

/* =====================================================
   FLOATING ACTION BUTTON (FAB)
   ===================================================== */
.fab {
  position: fixed;
  bottom: calc(70px + env(safe-area-inset-bottom) + 20px);
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--mad-red) 0%, #C62828 100%);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  color: white;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  z-index: 100;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fab:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}

.fab:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}

.fab.open {
  transform: rotate(45deg);
}

.fab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* =====================================================
   SMART TASK CHAT MODAL
   ===================================================== */
.chat-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.chat-modal.open {
  pointer-events: auto;
  opacity: 1;
}

.chat-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.chat-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 80vh;
  background: var(--paper);
  border-radius: 20px 20px 0 0;
  border: 3px solid var(--ink);
  border-bottom: none;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-modal.open .chat-container {
  transform: translateY(0);
}

@media (min-width: 768px) {
  .chat-container {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    max-width: 500px;
    width: 90%;
    max-height: 70vh;
    border-radius: 20px;
    border-bottom: 3px solid var(--ink);
  }
  
  .chat-modal.open .chat-container {
    transform: translate(-50%, -50%) scale(1);
  }
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--mad-red) 0%, #C62828 100%);
  color: white;
  border-bottom: 3px solid var(--ink);
}

.chat-title {
  font-family: 'Bangers', cursive;
  font-size: 24px;
  letter-spacing: 2px;
}

.chat-close {
  background: none;
  border: none;
  color: white;
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 32px;
  height: 32px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 200px;
  max-height: 50vh;
}

.chat-message {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 16px;
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}

.chat-message.bot {
  align-self: flex-start;
  background: white;
}

.chat-message.user {
  align-self: flex-end;
  background: var(--mad-yellow);
}

.chat-message.success {
  background: #E8F5E9;
  border-color: var(--green);
}

.message-content {
  font-size: 16px;
  line-height: 1.4;
}

.message-hint {
  font-size: 12px;
  color: #666;
  margin-top: 4px;
  font-style: italic;
}

.message-points {
  font-family: 'Bangers', cursive;
  font-size: 20px;
  color: var(--mad-red);
  margin-top: 8px;
}

.chat-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 12px 16px;
}

.quick-reply {
  padding: 8px 14px;
  background: white;
  border: 2px solid var(--ink);
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 2px 2px 0 var(--ink);
}

.quick-reply:hover {
  background: var(--mad-yellow);
  transform: translate(-1px, -1px);
}

.quick-reply:active {
  transform: translate(1px, 1px);
  box-shadow: 0 0 0 var(--ink);
}

.chat-input-container {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  border-top: 2px solid var(--ink);
  background: white;
}

.chat-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--ink);
  border-radius: 20px;
  font-size: 16px;
  font-family: 'Comic Neue', cursive;
  background: var(--paper);
}

.chat-input:focus {
  outline: none;
  border-color: var(--mad-red);
}

.chat-send {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--mad-red);
  border: 2px solid var(--ink);
  color: white;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink);
  transition: all 0.2s;
}

.chat-send:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--ink);
}

.chat-send:active {
  transform: translate(1px, 1px);
  box-shadow: 0 0 0 var(--ink);
}

/* Points potential indicator */
.points-potential {
  display: inline-block;
  background: linear-gradient(135deg, var(--mad-yellow) 0%, var(--orange) 100%);
  padding: 4px 10px;
  border-radius: 12px;
  border: 2px solid var(--ink);
  font-family: 'Bangers', cursive;
  font-size: 14px;
  margin-top: 8px;
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 8px;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: var(--ink);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-8px); }
}

/* =====================================================
   INLINE TASK COMPLETION
   ===================================================== */

.task-check {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  font-size: 24px;
  cursor: default;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.task-check.clickable {
  cursor: pointer;
  transition: transform 0.2s;
}

.task-check.clickable:hover {
  transform: scale(1.2);
}

.task-check.clickable:active {
  transform: scale(0.9);
}

.task-item.completing {
  opacity: 0.6;
  pointer-events: none;
}

.task-stakes {
  display: block;
  font-size: 12px;
  color: var(--mad-red);
  margin-top: 2px;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: white;
  border: 2px solid var(--ink);
  border-radius: 8px;
  margin-bottom: 8px;
  box-shadow: 2px 2px 0 var(--ink);
  transition: all 0.2s;
}

.task-item:hover {
  transform: translateX(2px);
}

.task-item.done {
  opacity: 0.6;
  background: #f5f5f5;
}

.task-item.done .task-name {
  text-decoration: line-through;
}

.task-info {
  flex: 1;
  min-width: 0;
}

.task-name {
  font-weight: bold;
  word-wrap: break-word;
}

.task-project {
  display: inline-block;
  font-size: 12px;
  color: #666;
  background: #eee;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 4px;
}

.task-points {
  font-family: 'Bangers', cursive;
  font-size: 16px;
  color: var(--mad-red);
  white-space: nowrap;
}

/* =====================================================
   MICRO-INTERACTIONS — Emotional Depth
   ===================================================== */

/* Button press states - feel the click */
button, .task-check.clickable {
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

button:active, .task-check.clickable:active {
  transform: scale(0.95) !important;
}

/* Task checkbox animation on completion */
.task-check.completing {
  animation: checkComplete 0.4s ease-out forwards;
}

@keyframes checkComplete {
  0% { transform: scale(1); }
  30% { transform: scale(0.8); }
  60% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* Task item completion animation */
.task-item.just-completed {
  animation: taskDone 0.5s ease-out forwards;
}

@keyframes taskDone {
  0% { background: white; }
  30% { background: #E8F5E9; transform: scale(1.02); }
  100% { background: #f5f5f5; transform: scale(1); opacity: 0.6; }
}

/* Focus button anticipation */
.focus-btn {
  position: relative;
  overflow: hidden;
}

.focus-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0);
  transition: background 0.2s ease;
}

.focus-btn:hover::after {
  background: rgba(255, 255, 255, 0.1);
}

.focus-btn:active {
  transform: translate(2px, 2px) scale(0.98) !important;
}

/* FAB press state */
.fab:active {
  transform: scale(0.9) rotate(45deg) !important;
}

/* Quick reply hover warmth */
.quick-reply {
  transition: all 0.15s ease;
}

.quick-reply:hover {
  background: var(--mad-yellow);
  transform: translateY(-2px);
  box-shadow: 3px 3px 0 var(--ink);
}

/* Snooze option press */
.snooze-option:active {
  transform: translateX(8px) scale(0.98);
  background: var(--mad-yellow);
}

/* Celebration continue button pulse */
.celebration-continue {
  animation: pulse-subtle 2s ease-in-out infinite;
}

@keyframes pulse-subtle {
  0%, 100% { box-shadow: 4px 4px 0 var(--ink); }
  50% { box-shadow: 6px 6px 0 var(--ink), 0 0 20px rgba(249, 168, 37, 0.3); }
}

/* Score number animations */
.score-value {
  transition: transform 0.3s ease, color 0.3s ease;
}

.score-value.changed {
  animation: scoreChange 0.5s ease-out;
}

@keyframes scoreChange {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); color: var(--green); }
  100% { transform: scale(1); }
}

/* =====================================================
   WEIGHT BREAKDOWN TAGS
   ===================================================== */

.weight-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.weight-tag {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: bold;
}

.weight-tag.type {
  background: #E3F2FD;
  color: var(--mad-blue);
}

.weight-tag.who {
  background: #F3E5F5;
  color: #7B1FA2;
}

.weight-tag.dread {
  background: #FFEBEE;
  color: var(--mad-red);
}

.weight-tag.snoozed {
  background: #FFF3E0;
  color: var(--orange);
}

/* High-weight task indicator */
.task-item[data-task-points] {
  position: relative;
}

.task-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 8px 0 0 8px;
  background: #ccc;
}

/* Color code by difficulty/weight */
.task-item[data-task-difficulty="quick"]::before {
  background: var(--green);
}

.task-item[data-task-difficulty="medium"]::before {
  background: var(--mad-blue);
}

.task-item[data-task-difficulty="hard"]::before {
  background: var(--orange);
}

.task-item[data-task-difficulty="boss"]::before {
  background: var(--mad-red);
  width: 6px;
}
