/* (C) 2025 Stardust Softworks) */
:root {
    --bg: #0f172a;        /* slate-900 */
    --card: #111827;      /* gray-900 */
    --text: #e5e7eb;      /* gray-200 */
    --muted: #94a3b8;     /* slate-400 */
    --accent: #6366f1;    /* indigo-500 */
    --accent-2: #22d3ee;  /* cyan-400 */
    --danger: #ef4444;    /* red-500 */
    --ring: rgba(99, 102, 241, 0.35);
  }
  
  * { box-sizing: border-box; }
  
  html, body {
    height: 100%;
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, "Helvetica Neue", Arial, "Apple Color Emoji";
    background: radial-gradient(1200px 800px at 20% -10%, rgba(34,211,238,0.15), transparent 50%),
                radial-gradient(900px 600px at 120% 10%, rgba(99,102,241,0.15), transparent 50%),
                var(--bg);
    color: var(--text);
  }
  
  body {
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* distribute space between elements */
    align-items: center;
    margin: 0;
    padding: 0;
    height: 100%; 
  }

  h1 {
    margin: 0 0 16px;
    font-weight: 700;
    letter-spacing: 0.3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }

  h2 {
    margin: 0 0 16px;
    font-weight: 200;
    letter-spacing: 0.3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }

  .secondary-container {
    display: flex;
    flex-direction: column;
    align-items: center; 
    justify-content: flex-end; 
    margin-top: 0; 
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); 
    height: 100%; 
}

.secondary-container img {
  width: 540px; 
  height: auto; 
}

.secondary-container p {
  margin: 0 0 16px;
  font-weight: 500;
  letter-spacing: 0.3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.secondary-container h2 {
  margin: 0 0 16px;
  font-weight: 500;
  letter-spacing: 0.3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
  
  .container {
    width: min(720px, 92vw);
    background: color-mix(in oklab, var(--card) 92%, black 8%);
    border: 1px solid rgba(148,163,184,0.15);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(2,6,23,0.6), inset 0 1px 0 rgba(255,255,255,0.03);
  }

  .controls {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    margin-bottom: 16px;
  }
  
  #itemInput {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(148,163,184,0.25);
    background: #0b1220;
    color: var(--text);
    outline: none;
    transition: border-color 160ms, box-shadow 160ms;
  }
  
  #itemInput:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--ring);
  }
  
  #addButton {
    padding: 12px 16px;
    border: 1px solid rgba(148,163,184,0.25);
    border-radius: 10px;
    background: linear-gradient(180deg, #1f2937, #111827);
    color: var(--text);
    cursor: pointer;
    font-weight: 600;
    transition: transform 80ms, filter 160ms, border-color 160ms;
  }
  
  #addButton:hover { filter: brightness(1.1); }
  #addButton:active { transform: translateY(1px); }

  #itemList {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
  }
  
  #itemList li {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #0b1220;
    border: 1px solid rgba(148,163,184,0.18);
    border-radius: 12px;
    transition: background 160ms, border-color 160ms, transform 80ms;
  }
  
  #itemList li:hover {
    background: #0d1526;
    border-color: rgba(148,163,184,0.35);
  }
  
  #itemList li.completed {
    color: var(--muted);
    text-decoration: line-through;
    opacity: 0.85;
  }
  
  #itemList li button {
    place-self: center end;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(148,163,184,0.25);
    background: #1f2937;
    color: var(--danger);
    cursor: pointer;
    font-weight: 700;
    line-height: 1;
    transition: background 120ms, transform 80ms, filter 160ms, border-color 160ms;
  }
  
  #itemList li button:hover {
    background: #111827;
    filter: brightness(1.1);
  }
  
  #itemList li button:active {
    transform: translateY(1px);
  }

  @media (max-width: 568px) {
    html, body {
      font-size: 14px; 
    }
    body {
      flex-direction: column;
      justify-content: flex-start; 
      min-height: 100vh; 
    }

    .container {
      width: 90%; 
      padding: 10px; 
    }
  
    .secondary-container {
      width: 100%; 
      padding: 10px; 
      min-height: 50vh; 
    }
  
    .secondary-container img {
      width: 350px; 
    }
  
    h1 {
      font-size: 24px; 
    }
  
    h2 {
      font-size: 18px; 
    }
  
    .secondary-container p {
      font-size: 12px; 
    }
  }

  @media (prefers-reduced-motion: no-preference) {
    #itemList li { transition: transform 120ms, background 160ms, border-color 160ms; }
    #itemList li:active { transform: scale(0.997); }
  }

  @media (prefers-color-scheme: light) {
    :root {
      --bg: #f8fafc;
      --card: #ffffff;
      --text: #0f172a;
      --muted: #475569;
    }
    #itemInput, #itemList li { background: #ffffff; }
    #addButton { background: linear-gradient(180deg, #f3f4f6, #e5e7eb); color: #111827; }
  }
  