/* ========================= */
/* BASE THEME */
/* ========================= */
*{
  font-family: "Comfortaa", sans-serif;
}
body {
  -webkit-user-select: none; /* Safari */
  -ms-user-select: none;     /* IE/Edge old */
  user-select: none;         /* modern browsers */
}
:root {
  --bg-0: #0b0a10;
  --bg-1: #120f1a;
  --bg-2: #171321;

  --card: #171321;
  --card-hover: #201a2e;
  --border: #2a2238;

  --text: #e9e4f5;
  --text-dim: #b7b2c7;

  --accent: #a78bfa;
  --accent-soft: rgba(167, 139, 250, 0.2);
}

body {
  font-family: Arial, sans-serif;
  text-align: center;
  background: radial-gradient(circle at top, var(--bg-1), var(--bg-0));
  color: var(--text);
  margin: 0;
}

/* ========================= */
/* LAYOUT */
/* ========================= */

.screen {
  margin-top: 120px;
}

.hidden {
  display: none !important;
}

/* ========================= */
/* TYPOGRAPHY */
/* ========================= */

.title {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 18px;
  color: var(--text);
}

/* AI reframe */
.reframe {
  margin-top: 8px;
  color: var(--text-dim);
  font-size: 14px;
  min-height: 18px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

/* ========================= */
/* TASK GRID */
/* ========================= */

.task-grid {
  display: grid;
  grid-template-columns: repeat(4, 140px);
  justify-content: center;
  gap: 100px;
  margin: 40px auto;
}

/* TASK CARD */
.task-card {
  width: 140px;
  height: 140px;

  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;

  padding: 12px;

  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;

  cursor: pointer;
  transition: 0.2s ease;
  color: var(--text);
  font-size: 14px;
  line-height: 1.3;
}
.task-card span {
  display: block;
}
.task-card:active {
  transform: scale(0.97);
}
.task-card:hover {
  background: var(--card-hover);
  transform: translateY(-2px);
  border-color: var(--accent-soft);
}

/* CUSTOM CARD */
.custom-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.custom-card input {
  font-size: 12px;
  padding: 6px;

  background: #0f0d15;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  outline: none;
}

.small-start-btn {
  padding: 6px;
  font-size: 12px;

  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: #120d1a;
  cursor: pointer;
  font-weight: 600;
  transition: 0.15s ease;
}



.custom-card input:focus {
  border-color: var(--accent);
}

/* START BUTTON */

.small-start-btn:hover {
  background: #8b5cf6;
}

/* ========================= */
/* HOME CONTROLS */
/* ========================= */

.home-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;

  width: 320px;   /* match your task grid width */
  margin: 18px auto 0;
}

.icon-btn {
  background: transparent;
  border: none;
  font-size: 40px;
  font-weight: lighter;
  color: var(--text-dim);
  cursor: pointer;
}

.text-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
    min-width: 80px; /* prevents width jump when it appears */
  text-align: right;
}

/* ========================= */
/* HOLD SCREEN */
/* ========================= */

.hold-container {
  display: flex;
  flex-direction: column;
  align-items: center;

  margin-top: 40px;
  gap: 10px;
}

.hold-title {
  font-size: 26px;
  font-weight: 600;
  margin: 0;
}


 .hold-area {
  height: auto;
  display: flex;
  justify-content: center;
  align-items: center;

  margin-top: 20px;
  cursor: pointer;
}


.hold-task {
  font-size: 13px;
  color: #aaa;
  margin: 0;
}

.progress-container {
  width: 160px;
  height: 160px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.progress-ring {
  transform: rotate(-90deg);
}

.progress-ring-bg {
  fill: none;
  stroke: #2a2238;
  stroke-width: 6;
}

.progress-ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 6;
  stroke-linecap: round;

  stroke-dasharray: 440;
  stroke-dashoffset: 440;
}

/* ========================= */
/* TIMER */
/* ========================= */

.timer-bar-container {
  width: 65vw;
  max-width: 700px;
  height: 14px;

  background: #1a1624;
  margin: 30px auto;
  border-radius: 999px;
  overflow: hidden;
}

.timer-bar {
  height: 100%;
  width: 0%;

  background: linear-gradient(90deg, #a78bfa, #7c3aed);
  transition: width 0.2s linear;
}

.timer-controls {
  margin-top: 30px;
  display: flex;
  justify-content: center;
  gap: 12px;
}

.timer-controls button {
  background: #171321;
  border: 1px solid var(--border);
  color: var(--text);

  padding: 10px 18px;
  border-radius: 12px;

  font-size: 14px;
  cursor: pointer;

  transition: 0.2s ease;
}


.timer-controls button:hover {
  background: var(--card-hover);
  border-color: var(--accent);
}

#quit-btn:hover {
  border-color: #ef4444;
  color: #ef4444;
}

#pause-message {
  color:rgba(0, 0, 0, 0);
  font-size: 13px;

  opacity: 0;
  transform: translateY(4px);
  transition: 0.2s ease;

  margin-top: 10px;
}

.timer-controls:hover #pause-message {
  color: var(--text-dim);
  opacity: 1;
  transform: translateY(0);
}

.timer-display {
  display: flex;
  justify-content: center;
  align-items: center;

  margin-top: 40px;
}
#timer-countdown {
  font-size: 120px;
  font-weight: 700;
  letter-spacing: -2px;
  margin: 0;

  color: var(--text);
}

/* ========================= */
/* COMPLETION SCREEN */
/* ========================= */

.completion-item {
  opacity: 0;
  transform: translateY(10px);
}

.completion-item.show {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

#completion-screen {
  background: radial-gradient(circle at top, #151022, var(--bg-0));
}

/* history */
.completion-history {
  margin-top: 20px;
  color: var(--text-dim);
  font-size: 14px;
}

.completion-history h3 {
  margin-bottom: 8px;
}

/* ========================= */
/* OVERLAY */
/* ========================= */

#commit-overlay {
  position: fixed;
  inset: 0;
  background: #0b0a10;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

#commit-overlay h1 {
  font-size: 28px;
  margin-bottom: 10px;
}

#commit-overlay p {
  color: var(--text-dim);
  font-size: 14px;
}

/* ========================= */
/* ANIMATION */
/* ========================= */

.commit-pulse {
  animation: pulse 0.6s ease-in-out 1;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.04); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* ========================= */
/* FADE + SLIDE IN ANIMATION */
/* ========================= */

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* base hidden state BEFORE animation */
.anim-item {
  opacity: 0;
  transform: translateY(12px);
}

/* trigger animation */
.anim-play {
  animation: fadeSlideIn 0.4s ease-out forwards;
}

/* ========================= */
/* FADE IN (SOFT REVEAL) */
/* ========================= */

.fade-in {
  opacity: 0;
  transition: opacity 1s ease;
}

.fade-in.show {
  opacity: 1;
}


.left-controls,
.right-controls {
  display: flex;
  align-items: center;
  min-width: 60px; /* reserves space so layout never shifts */
}


.hold-hint {
  font-size: 12px;
  color: rgba(0, 0, 0, 0);
  margin-top: 12px;

  opacity: 0;
  transform: translateY(6px);
  transition: 0.25s ease;
}

/* show hint when user hovers hold area */
.hold-area:hover + .hold-hint {
  opacity: 1;
  transform: translateY(0);
  color: var(--text-dim);
}

/* ========================= */
/* COMPLETION REDESIGN */
/* ========================= */

.completion-layout {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;

  width: min(1000px, 90vw);
  margin: 0 auto;
  gap: 60px;
  padding-top: 40px;
}

/* LEFT SIDE */
.completion-left {
  flex: 1;
  text-align: left;
}

.completion-title {
  font-size: 34px;
  font-weight: 700;
  margin-bottom: 20px;
}

/* task box */
.completion-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;

  padding: 18px;
  margin-bottom: 20px;
}

.completion-main {
  font-size: 18px;
  font-weight: 600;
}

.completion-sub {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 6px;
}

/* button (fix ugly default look) */
.completion-button {
  background: var(--accent);
  border: none;
  color: #120d1a;

  padding: 12px 18px;
  border-radius: 12px;

  font-weight: 600;
  cursor: pointer;
  transition: 0.2s ease;
}

.completion-button:hover {
  transform: translateY(-2px);
  background: #8b5cf6;
}

/* RIGHT SIDE */
.completion-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* cards */
.completion-card {
  background: rgba(23, 19, 33, 0.7);
  border: 1px solid var(--border);
  border-radius: 16px;

  padding: 16px;
  text-align: left;
}

/* highlight phrase */
.completion-highlight {
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
}

/* session items */
#session-history p {
  margin: 6px 0;
  font-size: 13px;
  color: var(--text-dim);
}

.completion-item {
  opacity: 0;
  transform: translateY(14px);
}

.completion-item.show {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.completion-left,
.completion-right {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.completion-box,
.completion-card {
  margin: 0;
}

.screen {
  opacity: 1;
  transition: opacity 0.25s ease;
}

.task-card,
button,
.icon-btn,
.text-btn {
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.task-card:hover {
  transform: translateY(-1px);
}

.completion-title {
  font-size: 40px;
  letter-spacing: -1px;
}

.completion-sub,
.completion-card {
  color: var(--text-dim);
}



#done-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 10, 16, 0.95);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

#done-overlay h1 {
  font-size: 42px;
  margin-bottom: 20px;
}

#done-overlay button {
  background: var(--accent);
  border: none;
  padding: 12px 18px;
  border-radius: 12px;
  cursor: pointer;
}



#done-overlay {
  position: fixed;
  inset: 0;
  background: rgb(11, 10, 16);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;

  backdrop-filter: blur(10px);
}

/* container */
.done-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;

  animation: donePop 0.35s ease-out;
}

/* small badge */
.done-badge {
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--accent);

  padding: 6px 10px;
  border: 1px solid var(--accent-soft);
  border-radius: 999px;

  opacity: 0.9;
}

/* main text */
.done-title {
  font-size: 42px;
  font-weight: 700;
  margin: 0;
}

/* subtext */
.done-subtext {
  font-size: 14px;
  color: var(--text-dim);
  margin: 0;
}

/* button */
.done-button {
  margin-top: 10px;

  background: var(--accent);
  border: none;
  color: #120d1a;

  padding: 12px 18px;
  border-radius: 12px;

  font-weight: 600;
  cursor: pointer;

  transition: 0.2s ease;
}

.done-button:hover {
  transform: translateY(-2px);
  background: #8b5cf6;
}

/* animation */
@keyframes donePop {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.done-badge {
  box-shadow: 0 0 20px rgba(167, 139, 250, 0.15);
}