:root {
  --ink: #3f4770;
  --muted: #737a97;
  --line: #e2e1ee;

  --pink: #f7a9cf;
  --peach: #f7bd8e;
  --yellow: #f6dc7f;
  --mint: #9fdcc1;
  --blue: #9ecbef;
  --lavender: #b9a0ed;
  --purple: #8e66df;

  --card: rgba(255,255,255,.89);
  --shadow: 0 18px 40px rgba(88, 85, 132, .11);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Avenir Next", Avenir, "Trebuchet MS", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 2% 62%, rgba(159,220,193,.32), transparent 19%),
    radial-gradient(circle at 97% 72%, rgba(247,189,142,.28), transparent 20%),
    radial-gradient(circle at 22% 5%, rgba(247,169,207,.18), transparent 18%),
    radial-gradient(circle at 80% 10%, rgba(158,203,239,.18), transparent 18%),
    linear-gradient(180deg, #fffdfd 0%, #fff9fd 55%, #fbfdff 100%);
  overflow-x: hidden;
}

button,
select,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1380px, calc(100% - 34px));
  margin: 0 auto;
  padding: 24px 0 34px;
}

/* ---------- BRAND ---------- */

.brand-header {
  min-height: 142px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 26px;
  align-items: center;
  margin-bottom: 12px;
}

.brand-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

.brand-copy {
  text-align: center;
}

.brand-copy h1 {
  margin: 0;
  font-size: clamp(3.2rem, 7vw, 6.4rem);
  line-height: .9;
  letter-spacing: -.05em;
  font-weight: 900;
  background: linear-gradient(
    90deg,
    #ed74ab 0%,
    #f6a06f 20%,
    #f6c957 38%,
    #8fd6bc 57%,
    #83c5ea 75%,
    #9d7de3 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-copy p {
  margin: 10px 0 0;
  font-size: clamp(1rem, 2vw, 1.55rem);
  color: #4b5277;
  font-weight: 650;
  letter-spacing: .01em;
}

.mini-note,
.teacher-note,
.doodle,
.mini-growth-note {
  font-family: "Comic Sans MS", "Bradley Hand", cursive;
}

.mini-note {
  justify-self: start;
  font-size: 1rem;
  line-height: 1.45;
  transform: rotate(-3deg);
}

.teacher-note {
  justify-self: end;
  padding: 14px 24px;
  text-align: center;
  font-size: 1.12rem;
  line-height: 1.45;
  transform: rotate(-2deg);
  background: rgba(181, 229, 199, .34);
  border-radius: 48% 52% 44% 56% / 55% 42% 58% 45%;
}

/* ---------- CSS RAINBOW ---------- */

.rainbow {
  position: relative;
  width: 150px;
  height: 94px;
  flex: 0 0 auto;
}

.arc {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  border-style: solid;
  border-bottom: 0;
  border-radius: 100px 100px 0 0;
}

.arc1 {
  width: 146px;
  height: 86px;
  border-width: 13px;
  border-color: #f290bb;
}

.arc2 {
  width: 118px;
  height: 70px;
  border-width: 12px;
  border-color: #f7b49a;
}

.arc3 {
  width: 91px;
  height: 55px;
  border-width: 11px;
  border-color: #f5dc91;
}

.arc4 {
  width: 65px;
  height: 40px;
  border-width: 10px;
  border-color: #a9dcc3;
}

.arc5 {
  width: 40px;
  height: 25px;
  border-width: 9px;
  border-color: #9bc9eb;
}

.rainbow-heart {
  position: absolute;
  left: 50%;
  bottom: 1px;
  transform: translateX(-50%);
  color: #8fc2e6;
  font-size: 1.15rem;
}

/* ---------- COMMON CARDS ---------- */

.setup-card,
.display-card,
.stations-card {
  background: var(--card);
  border: 1px solid rgba(223, 221, 237, .95);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.setup-card {
  border-radius: 26px;
  padding: 21px 28px;
  margin-bottom: 18px;
}

.setup-grid {
  display: grid;
  grid-template-columns: 1.05fr 1.15fr 1.15fr .9fr .9fr;
  gap: 24px;
  align-items: end;
}

.setup-grid label {
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-weight: 750;
  font-size: .98rem;
}

select {
  width: 100%;
  border: 1px solid #d8d7e7;
  border-radius: 10px;
  padding: 12px 14px;
  background: rgba(255,255,255,.92);
  color: var(--ink);
  min-height: 46px;
}

.toggle-row {
  min-height: 78px;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0;
}

.toggle-row input {
  appearance: none;
  -webkit-appearance: none;
  width: 58px;
  height: 32px;
  border-radius: 999px;
  background: #dedbea;
  position: relative;
  transition: .2s ease;
  cursor: pointer;
  margin: 0;
}

.toggle-row input::after {
  content: "";
  position: absolute;
  width: 26px;
  height: 26px;
  top: 3px;
  left: 4px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 7px rgba(70,70,90,.18);
  transition: .2s ease;
}

.toggle-row input:checked {
  background: linear-gradient(90deg, #ad8dea, #8b66da);
}

.toggle-row input:checked::after {
  transform: translateX(24px);
}

/* ---------- TIMER ---------- */

.display-card {
  position: relative;
  overflow: hidden;
  border-radius: 30px;
  min-height: 455px;
  margin-bottom: 18px;
  padding: 34px 40px 28px;
  display: grid;
  place-items: center;
}

.timer-content {
  width: min(850px, 78%);
  text-align: center;
  position: relative;
  z-index: 2;
}

.round-label {
  display: inline-block;
  margin: 0 0 16px;
  padding: 8px 24px;
  border-radius: 999px;
  background: #e9defd;
  color: #51447d;
  font-size: 1rem;
  font-weight: 850;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.current-station-wrap {
  margin-top: 0;
}

.small-label {
  display: block;
  margin-bottom: 6px;
  color: #666c90;
  font-size: .95rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .18em;
}

.current-station-wrap h2 {
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 4.8rem);
  line-height: 1;
  color: #525879;
  font-family: "Comic Sans MS", "Bradley Hand", cursive;
  font-weight: 700;
}

.timer {
  margin: 16px 0 20px;
  font-size: clamp(5.8rem, 13vw, 10.8rem);
  line-height: .9;
  letter-spacing: -.055em;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #9c75e5 0%, #7d59d0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 0 rgba(123, 87, 200, .08));
}

.progress-track {
  width: min(820px, 100%);
  height: 22px;
  margin: 0 auto 22px;
  overflow: hidden;
  background: #eeeaf5;
  border-radius: 999px;
  box-shadow: inset 0 1px 4px rgba(74,70,105,.08);
}

.progress-bar {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    #f39ac4,
    #f7b68f,
    #f5da85,
    #9edcc0,
    #91c9ea,
    #b49ce9
  );
  transition: width .4s linear;
}

.controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
}

.primary-btn,
.secondary-btn {
  border-radius: 999px;
  padding: 13px 25px;
  min-width: 145px;
  font-weight: 800;
  font-size: 1rem;
  transition: transform .15s ease, box-shadow .15s ease;
}

.primary-btn {
  border: 0;
  color: white;
  background: linear-gradient(180deg, #a57be8, #8d61da);
  box-shadow: 0 8px 18px rgba(140, 98, 215, .25);
}

.secondary-btn {
  color: #3f466d;
  background: white;
  border: 1px solid #d7d6e5;
  box-shadow: 0 4px 12px rgba(75, 74, 105, .05);
}

button:hover {
  transform: translateY(-2px);
}

.status-text {
  min-height: 1.4em;
  margin: 16px 0 0;
  color: var(--muted);
  font-weight: 650;
}

.doodle {
  position: absolute;
  left: 50px;
  top: 95px;
  font-size: 1.45rem;
  line-height: 1.25;
  color: #4b5277;
  transform: rotate(-9deg);
}

.sparkles {
  position: absolute;
  right: 48px;
  top: 92px;
  font-size: 2.5rem;
  line-height: 1.1;
  color: #f09ac5;
}

.mini-growth-note {
  position: absolute;
  right: 54px;
  bottom: 38px;
  color: #4d5477;
  font-size: 1.15rem;
  line-height: 1.1;
  text-align: center;
  transform: rotate(-8deg);
}

/* ---------- STATIONS ---------- */

.stations-card {
  border-radius: 28px;
  padding: 24px 26px 26px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 17px;
}

.eyebrow {
  margin: 0 0 3px;
  color: #8a68c7;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .18em;
}

.section-heading h3 {
  margin: 0;
  font-family: "Comic Sans MS", "Bradley Hand", cursive;
  font-size: 2rem;
  line-height: 1;
}

.section-subtitle,
.save-note {
  margin: 7px 0 0;
  color: var(--muted);
}

.save-note {
  text-align: right;
}

.stations-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 20px;
}

.station-row {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 15px;
}

.station-row:nth-child(6n+1) {
  background: #fde4f0;
  border-color: #f8cee0;
}

.station-row:nth-child(6n+2) {
  background: #ffeadf;
  border-color: #f8d6c0;
}

.station-row:nth-child(6n+3) {
  background: #fff2cf;
  border-color: #f4dfaa;
}

.station-row:nth-child(6n+4) {
  background: #ddf5e8;
  border-color: #c7ead7;
}

.station-row:nth-child(6n+5) {
  background: #e2f1fb;
  border-color: #cce4f5;
}

.station-row:nth-child(6n+6) {
  background: #eee8fb;
  border-color: #ddd1f5;
}

.station-row.active {
  outline: 3px solid rgba(142, 102, 223, .22);
  box-shadow: 0 0 0 4px rgba(255,255,255,.65);
}

.station-number {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border-radius: 50%;
  color: #445;
  background: rgba(255,255,255,.65);
  font-size: 1.15rem;
  font-weight: 850;
  border: 1px solid rgba(255,255,255,.8);
}

.station-row:nth-child(6n+1) .station-number {
  background: #f58ab8;
  color: white;
}

.station-row:nth-child(6n+2) .station-number {
  background: #f6ab72;
  color: white;
}

.station-row:nth-child(6n+3) .station-number {
  background: #efc54e;
  color: white;
}

.station-row:nth-child(6n+4) .station-number {
  background: #72c99f;
  color: white;
}

.station-row:nth-child(6n+5) .station-number {
  background: #76b8e6;
  color: white;
}

.station-row:nth-child(6n+6) .station-number {
  background: #9d7ee1;
  color: white;
}

.station-name-input {
  width: 100%;
  min-height: 43px;
  padding: 8px 15px;
  border: 1px solid rgba(193, 191, 211, .65);
  border-radius: 9px;
  outline: none;
  background: rgba(255,255,255,.84);
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 700;
}

.station-name-input:focus {
  border-color: #a588df;
  box-shadow: 0 0 0 3px rgba(165, 136, 223, .18);
}

footer {
  padding: 20px 0 4px;
  text-align: center;
  color: #8a8eaa;
  font-size: .9rem;
}

/* ---------- FULL SCREEN ---------- */

body.fullscreen-mode .app-shell {
  width: min(1500px, calc(100% - 30px));
}

body.fullscreen-mode .brand-header,
body.fullscreen-mode .setup-card,
body.fullscreen-mode .stations-card,
body.fullscreen-mode footer {
  display: none;
}

body.fullscreen-mode .display-card {
  min-height: calc(100vh - 30px);
  margin: 15px 0;
}

/* ---------- TABLET ---------- */

@media (max-width: 1050px) {
  .brand-header {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 8px;
  }

  .mini-note,
  .teacher-note {
    display: none;
  }

  .brand-center {
    gap: 18px;
  }

  .setup-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .timer-content {
    width: min(900px, 92%);
  }

  .doodle,
  .sparkles,
  .mini-growth-note {
    opacity: .35;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 16px, 1380px);
    padding-top: 12px;
  }

  .brand-center {
    flex-direction: column;
    gap: 4px;
  }

  .rainbow {
    transform: scale(.82);
    margin-bottom: -8px;
  }

  .brand-copy h1 {
    font-size: clamp(3rem, 17vw, 5rem);
  }

  .setup-grid,
  .stations-list {
    grid-template-columns: 1fr;
  }

  .display-card {
    min-height: 430px;
    padding: 30px 14px 24px;
  }

  .timer-content {
    width: 100%;
  }

  .timer {
    font-size: clamp(5rem, 24vw, 8rem);
  }

  .controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .controls button {
    min-width: 0;
    width: 100%;
  }

  .doodle,
  .sparkles,
  .mini-growth-note {
    display: none;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .save-note {
    text-align: left;
  }
}
