@import url('https://fonts.googleapis.com/css2?family=Cal+Sans&family=Staatliches&display=swap');

:root {
  --header-bg: #ffbb62;
  --body-bg: #500834;
}

body {
  margin: 0;
  font-family: "Cal Sans", sans-serif;
  color: #2e2e2e;
  background-color: var(--body-bg);
  display: flex;
  flex-direction: column;
}

header {
  background-color: var(--header-bg);
  color: white;
  text-align: center;
  padding: 2rem 1rem;
  display: block;
  font-family: "Staatliches", sans-serif;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

header h1 {
  margin: 0;
  font-size: 2.5rem;
}

#resetAll {
  display: inline-block;
  width: auto !important;
  height: 40px !important;
  line-height: 20px;
  padding: 0 20px;
  margin: 10px auto;
  background-color: #FAA4BD;
  border: none;
  border-radius: 8px;
  font-family: "Staatliches", sans-serif;
  font-size: 1rem;
  cursor: pointer;
}

#resetAll:hover {
  background-color: #533B4D;
  color: white;
}

main {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
  max-width: 800px;
  margin: 0 auto 300px auto;
}

.timer-box {
  background-color: #fde9f3;
  padding: 2rem;
  border-radius: 20px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
  text-align: center;
  width: 300px;
  margin-bottom: 2rem;
}

#time-display {
  font-family: "Staatliches", sans-serif;
  font-size: 4rem;
  color: #F564A9;
  margin-bottom: 1.5rem;
  position: relative;
}

#millisecond-display {
  font-size: 1.5rem;
  color: grey;
  position: absolute;
  bottom: 0;
  right: -50px;
}

#custom-minutes {
  font-family: "Cal sans", sans-serif;
  width: 92%;
  padding: 0.6rem;
  margin: 0 auto 1rem;
  border: 2px solid #F564A9;
  border-radius: 10px;
  text-align: center;
  font-size: 1rem;
  display: block;
}

.buttons {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

button {
  font-family: "Staatliches", sans-serif;
  background-color: #FAA4BD;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 1rem;
  flex: 1;
  transition: background-color 0.3s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

button:hover {
  background-color: #F564A9;
  color: white;
}

.add-chapter-toggle {
  cursor: pointer;
  background-color: #FAA4BD;
  border-radius: 8px;
  width: 50px;
  height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
  margin-bottom: 1rem;
}

.add-chapter-toggle:hover {
  transform: scale(1.1);
}

.add-chapter-toggle img {
  width: 30px;
  height: 30px;
}

.add-icon {
  width: 40px;
  height: 40px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.add-icon:hover {
  transform: scale(1.3);
}

#addChapterSection {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  margin-bottom: 1rem;
}

#chapterInput {
  border: none;
  color: #FAE3C6;
  border-bottom: 2px solid #F564A9;
  background: transparent;
  padding: 0.5rem;
  font-family: "Cal Sans", sans-serif;
  font-size: 1rem;
  width: 200px;
  outline: none;
}

.round-button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: #F564A9;
  color: white;
  border: none;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.round-button:hover {
  background-color: #533B4D;
  transform: scale(1.1);
}

.chapter-lists-container {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  width: 100%;
  max-width: 800px;
  margin-top: 2rem;
}

.chapter-lists {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chapter-lists.unfinished h2 {
  color: #FAE3C6;
}

.chapter-lists h2 {
  font-family: "Staatliches", sans-serif;
  color: #FAE3C6;
  text-align: center;
  margin: 0;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #FAA4BD;
}

ol {
  list-style: decimal inside;
  padding: 0;
  margin: 0;
}

.chapter-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid #ddd;
}

.chapter-item span {
  flex-grow: 1;
  margin-right: 1rem;
  color: white;
}

.chapter-item .actions {
  display: flex;
  gap: 0.5rem;
}

.chapter-item button {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font-size: 1rem;
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.chapter-item .mark-done {
  color: #4CAF50;
}

.chapter-item .mark-done:hover {
  background-color: #e8f5e9;
}

.chapter-item .remove {
  color: #f44336;
}

.chapter-item .remove:hover {
  background-color: #ffebee;
}

.finished .chapter-item span {
  text-decoration: line-through;
  color: #888;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.message {
  -webkit-background-clip: text;
  background-clip: text;
  color: #c2a27c;
  text-align: center;
  margin-top: 1rem;
  animation: fadeIn 0.5s ease-in-out;
}

header h1,
.chapter-lists h2,
header p {
  text-shadow: 2px 2px 8px #533B4D, 0 0 2px #ffffff;
}

/* --- PIXEL GRID SECTION --- */
.pixel-section {
  background-color: #fde9f3;
  border-radius: 20px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
  padding: 1.5rem 2rem;
  margin-top: 2rem;
  margin-bottom: 2rem;
  margin-left: 80px;
  margin-right: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pixel-title {
  font-family: "Staatliches", sans-serif;
  color: #F564A9;
  font-size: 1.8rem;
  letter-spacing: 2px;
  margin: 0 0 1rem 0;
  text-shadow: none;
}

.pixel-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 14px;
}

.pixel-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  flex-shrink: 0;
}

.pixel-swatch:hover {
  transform: scale(1.2);
}

.pixel-swatch.active {
  border-color: #533B4D;
  transform: scale(1.2);
}

#pixel-eraser-btn,
#pixel-clear-btn {
  font-family: "Staatliches", sans-serif;
  font-size: 0.85rem;
  padding: 5px 12px;
  border-radius: 8px;
  border: none;
  background-color: #FAA4BD;
  cursor: pointer;
  flex: none;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

#pixel-eraser-btn:hover,
#pixel-clear-btn:hover {
  background-color: #F564A9;
  color: white;
}

#pixel-eraser-btn.active {
  background-color: #533B4D;
  color: white;
}

#pixel-grid {
  display: grid;
  grid-template-columns: repeat(16, 30px);
  grid-template-rows: repeat(16, 30px);
  gap: 1px;
  background-color: #FAA4BD;
  border: 3px solid #FAA4BD;
  border-radius: 6px;
  cursor: crosshair;
  user-select: none;
  -webkit-user-select: none;
  width: fit-content;
  flex-shrink: 0;
  flex-grow: 0;
}

#pixel-grid .pixel-cell {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  max-width: 30px;
  max-height: 30px;
  background-color: #fff9fc;
  box-sizing: border-box;
  flex: none;
}

/* --- COLOR PALETTE --- */
.color-palette-modern {
  background-color: #fde9f3;
  border-radius: 20px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
  margin-top: 2rem;
  width: auto;
  display: inline-block;
}

.color-palette-modern h3 {
  font-family: "Staatliches", sans-serif;
  color: #F564A9;
  margin: 0 0 1.5rem 0;
  font-size: 1.8rem;
  text-align: center;
  letter-spacing: 2px;
}

.picker-container {
  display: flex;
  gap: 2.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.picker-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.picker-wrapper h4 {
  font-family: "Staatliches", sans-serif;
  color: #533B4D;
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: bold;
}

.IroColorPicker {
  transition: transform 0.3s ease, filter 0.3s ease;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.15));
}

.IroColorPicker:hover {
  transform: scale(1.05);
}