:root {
  --navy: #071426;
  --navy-soft: #0d2038;
  --blue: #163352;
  --cream: #f8f1df;
  --cream-soft: #fffaf0;
  --white: #ffffff;
  --gold: #d9ae54;
  --gold-bright: #f3cf7a;
  --gold-muted: rgba(217, 174, 84, 0.26);
  --ink: #152034;
  --muted: #6f7583;
  --line: rgba(217, 174, 84, 0.24);
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.26);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--cream);
  background: var(--navy);
  font-family: "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.64;
}

[hidden] {
  display: none !important;
}

.page-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 8%, rgba(243, 207, 122, 0.19), transparent 28%),
    radial-gradient(circle at 82% 18%, rgba(243, 207, 122, 0.13), transparent 24%),
    linear-gradient(145deg, #071426 0%, #0b1b31 44%, #0a1425 100%);
}

.background-pattern {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.24;
  background-image:
    linear-gradient(30deg, rgba(255, 255, 255, 0.06) 12%, transparent 12.5%, transparent 87%, rgba(255, 255, 255, 0.06) 87.5%, rgba(255, 255, 255, 0.06)),
    linear-gradient(150deg, rgba(255, 255, 255, 0.06) 12%, transparent 12.5%, transparent 87%, rgba(255, 255, 255, 0.06) 87.5%, rgba(255, 255, 255, 0.06)),
    linear-gradient(30deg, rgba(217, 174, 84, 0.1) 12%, transparent 12.5%, transparent 87%, rgba(217, 174, 84, 0.1) 87.5%, rgba(217, 174, 84, 0.1)),
    linear-gradient(150deg, rgba(217, 174, 84, 0.1) 12%, transparent 12.5%, transparent 87%, rgba(217, 174, 84, 0.1) 87.5%, rgba(217, 174, 84, 0.1));
  background-position: 0 0, 0 0, 32px 56px, 32px 56px;
  background-size: 64px 112px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 78%);
}

.site-header {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 22px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--cream);
  text-decoration: none;
}

.brand-symbol {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(217, 174, 84, 0.52);
  border-radius: 14px;
  color: var(--gold-bright);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 26px rgba(217, 174, 84, 0.16);
}

.brand-eyebrow,
.brand-name {
  display: block;
  line-height: 1.2;
}

.brand-eyebrow {
  color: rgba(248, 241, 223, 0.68);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.brand-name {
  margin-top: 3px;
  font-size: 1.08rem;
  font-weight: 800;
}

.header-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid rgba(217, 174, 84, 0.38);
  border-radius: 999px;
  color: var(--cream);
  background: rgba(255, 255, 255, 0.05);
  text-decoration: none;
  font-weight: 700;
  transition: background 180ms ease, transform 180ms ease;
}

.header-link:hover {
  transform: translateY(-1px);
  background: rgba(217, 174, 84, 0.12);
}

.hero-section {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 620px;
  padding: 84px 18px 122px;
}

.hero-glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(12px);
  pointer-events: none;
}

.hero-glow-one {
  top: 110px;
  right: 12%;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(243, 207, 122, 0.22), transparent 68%);
}

.hero-glow-two {
  bottom: 84px;
  left: 14%;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.09), transparent 66%);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(860px, 100%);
  text-align: center;
  animation: fadeUp 720ms ease both;
}

.small-label {
  margin: 0 0 12px;
  color: var(--gold-bright);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-content h1 {
  margin: 0;
  font-size: clamp(4.3rem, 10vw, 8.6rem);
  line-height: 0.95;
  font-weight: 900;
  color: var(--cream-soft);
  text-shadow: 0 18px 42px rgba(0, 0, 0, 0.26);
}

.hero-subtitle {
  margin: 14px 0 0;
  color: var(--gold-bright);
  font-size: clamp(1.8rem, 4vw, 3.6rem);
  font-weight: 850;
}

.hero-line {
  margin: 22px auto 0;
  max-width: 680px;
  color: rgba(255, 250, 240, 0.9);
  font-size: clamp(1.05rem, 2vw, 1.42rem);
  line-height: 1.55;
}

.hero-message {
  max-width: 780px;
  margin: 20px auto 0;
  color: rgba(255, 250, 240, 0.72);
  font-size: 1.05rem;
  line-height: 1.8;
}

.hero-message span {
  display: block;
  color: rgba(255, 250, 240, 0.9);
}

.progress-section {
  position: relative;
  z-index: 3;
  width: min(1080px, calc(100% - 36px));
  margin: -74px auto 0;
}

.progress-card,
.goal-card,
.admin-shell {
  border: 1px solid rgba(217, 174, 84, 0.42);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 241, 223, 0.96)),
    var(--cream-soft);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.progress-card {
  position: relative;
  overflow: hidden;
  padding: clamp(26px, 4vw, 48px);
}

.progress-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 7px;
  background: linear-gradient(90deg, transparent, var(--gold), var(--gold-bright), transparent);
}

.card-topline,
.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-weight: 800;
}

.status-badge {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 5px 14px;
  border: 1px solid rgba(217, 174, 84, 0.42);
  border-radius: 999px;
  color: var(--blue);
  background: #fff7df;
  font-size: 0.88rem;
}

.status-badge.complete {
  color: #6f4a06;
  background: #fff0bf;
}

.count-lockup {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: clamp(10px, 2vw, 20px);
  margin: 18px 0 12px;
  direction: ltr;
}

.count-lockup strong {
  color: var(--gold);
  font-size: clamp(5.3rem, 14vw, 11rem);
  line-height: 0.86;
  font-weight: 950;
  text-shadow: 0 14px 34px rgba(217, 174, 84, 0.18);
}

.count-lockup span,
.count-lockup em {
  color: var(--blue);
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-style: normal;
  font-weight: 850;
}

.count-lockup b {
  color: var(--ink);
  font-size: clamp(1.1rem, 2.4vw, 1.7rem);
  font-weight: 850;
}

.remaining-line {
  margin: 0;
  color: var(--blue);
  text-align: center;
  font-size: clamp(1.2rem, 3vw, 1.85rem);
  font-weight: 850;
}

.progress-meta {
  margin-top: 34px;
  font-size: 0.95rem;
}

.progress-bar {
  height: 16px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(22, 51, 82, 0.12);
}

.progress-bar span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--gold), var(--gold-bright));
  transition: width 650ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.section-wrap {
  position: relative;
  z-index: 2;
  width: min(1080px, calc(100% - 36px));
  margin: 82px auto 0;
}

.section-heading {
  text-align: center;
}

.section-heading h2,
.goal-card h2,
.admin-intro h2 {
  margin: 0;
  color: var(--cream-soft);
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.1;
}

.section-heading p:not(.small-label) {
  margin: 12px 0 0;
  color: rgba(255, 250, 240, 0.7);
  font-size: 1.05rem;
}

.timer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 28px;
}

.time-box {
  min-height: 144px;
  display: grid;
  place-items: center;
  padding: 20px 12px;
  border: 1px solid rgba(217, 174, 84, 0.3);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(12px);
}

.time-box strong {
  color: var(--cream-soft);
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  line-height: 1;
}

.time-box span {
  color: var(--gold-bright);
  font-size: 0.92rem;
  font-weight: 800;
  text-transform: uppercase;
}

.milestone-row {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-top: 30px;
}

.milestone {
  position: relative;
  min-height: 116px;
  padding: 18px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  color: rgba(255, 250, 240, 0.68);
  background: rgba(255, 255, 255, 0.06);
  text-align: center;
  transition: transform 200ms ease, border-color 200ms ease, background 200ms ease;
}

.milestone.active {
  color: var(--cream-soft);
  border-color: rgba(217, 174, 84, 0.72);
  background: linear-gradient(180deg, rgba(217, 174, 84, 0.2), rgba(255, 255, 255, 0.07));
  transform: translateY(-2px);
}

.milestone strong {
  display: block;
  color: inherit;
  font-size: 1.7rem;
}

.milestone span {
  display: block;
  margin-top: 8px;
  font-weight: 800;
}

.goal-card {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 5vw, 54px);
  text-align: center;
}

.public-chasanim-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.public-chasan-card {
  min-height: 96px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 18px;
  border: 1px solid rgba(217, 174, 84, 0.3);
  border-radius: 20px;
  color: var(--cream-soft);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.14);
}

.public-chasan-card strong {
  font-size: 1.25rem;
}

.public-chasan-card span {
  color: rgba(255, 250, 240, 0.68);
  line-height: 1.5;
}

.goal-card .small-label {
  color: #9f7521;
}

.goal-card h2,
.admin-intro h2 {
  color: var(--ink);
}

.goal-card p:not(.small-label) {
  max-width: 620px;
  margin: 16px auto 0;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.75;
}

.gold-line {
  display: block;
  width: 90px;
  height: 4px;
  margin: 0 auto 20px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
}

.admin-section {
  margin-bottom: 80px;
}

.admin-shell {
  display: grid;
  gap: 24px;
  padding: clamp(24px, 4vw, 36px);
  background: rgba(255, 250, 240, 0.94);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
}

.admin-intro {
  display: grid;
  gap: 8px;
}

.admin-intro .small-label,
.admin-panel .small-label {
  color: #9f7521;
}

.admin-note {
  max-width: 560px;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.unlock-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 240px);
  gap: 12px;
  align-items: end;
}

.unlock-form .form-message {
  grid-column: 1 / -1;
}

.admin-form,
.settings-form,
.add-admin-form,
.add-chasan-form {
  display: grid;
  gap: 12px;
}

.admin-form label,
.settings-form label,
.add-admin-form label,
.add-chasan-form label {
  color: var(--ink);
  font-weight: 850;
}

.admin-form input,
.settings-form input,
.settings-form textarea,
.add-admin-form input,
.add-chasan-form input {
  width: 100%;
  min-height: 52px;
  border: 1px solid rgba(21, 32, 52, 0.18);
  border-radius: 14px;
  padding: 10px 14px;
  color: var(--ink);
  background: var(--white);
  outline: none;
}

.settings-form textarea {
  min-height: 88px;
  resize: vertical;
}

.admin-form input:focus,
.settings-form input:focus,
.settings-form textarea:focus,
.add-admin-form input:focus,
.add-chasan-form input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(217, 174, 84, 0.18);
}

.admin-dashboard {
  display: grid;
  gap: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(21, 32, 52, 0.12);
}

.admin-dashboard-head,
.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-dashboard-head h3,
.admin-panel h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.28rem;
}

.admin-dashboard-head .small-label {
  margin-bottom: 4px;
}

.admin-panel {
  border: 1px solid rgba(21, 32, 52, 0.1);
  border-radius: 20px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 12px 32px rgba(21, 32, 52, 0.06);
}

.panel-title-row p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.panel-title-row strong {
  min-width: max-content;
  color: var(--gold);
  font-size: 1.55rem;
}

.count-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.add-button {
  min-height: 54px;
  border: 0;
  border-radius: 14px;
  color: var(--navy);
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
  font-weight: 900;
  box-shadow: 0 14px 32px rgba(217, 174, 84, 0.28);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.remove-button,
.ghost-button {
  min-height: 54px;
  border-radius: 14px;
  font-weight: 900;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.remove-button {
  border: 1px solid rgba(21, 32, 52, 0.18);
  color: var(--cream-soft);
  background: linear-gradient(135deg, var(--blue), var(--navy-soft));
}

.ghost-button {
  border: 1px solid rgba(21, 32, 52, 0.16);
  color: var(--blue);
  background: rgba(255, 255, 255, 0.74);
  padding: 0 18px;
}

.add-button:hover:not(:disabled),
.remove-button:hover:not(:disabled),
.ghost-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.add-button:hover:not(:disabled) {
  box-shadow: 0 18px 42px rgba(217, 174, 84, 0.36);
}

.remove-button:hover:not(:disabled) {
  background: linear-gradient(135deg, #214569, var(--navy-soft));
}

.settings-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 16px;
}

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

.settings-subhead {
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid rgba(21, 32, 52, 0.12);
}

.settings-subhead h4 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 1rem;
}

.settings-subhead p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.wide-field,
.wide-button {
  grid-column: 1 / -1;
}

.add-admin-form,
.add-chasan-form {
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(140px, 180px);
  align-items: end;
  margin-top: 16px;
}

.add-admin-form .form-message,
.add-chasan-form .form-message {
  grid-column: 1 / -1;
}

.admin-list,
.log-list,
.chasanim-admin-list {
  list-style: none;
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
}

.admin-list li,
.log-list li,
.chasanim-admin-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 56px;
  padding: 12px 14px;
  border: 1px solid rgba(21, 32, 52, 0.1);
  border-radius: 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
}

.admin-list strong,
.log-list strong,
.chasanim-admin-list strong {
  display: block;
}

.admin-list span,
.log-list span,
.chasanim-admin-list span {
  color: var(--muted);
  font-size: 0.88rem;
  text-align: left;
}

.list-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mini-remove-button {
  min-height: 34px;
  border: 1px solid rgba(21, 32, 52, 0.16);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--cream-soft);
  background: var(--blue);
  font-size: 0.82rem;
  font-weight: 850;
}

.permission-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-weight: 750;
}

.form-message {
  min-height: 24px;
  margin: 0;
  color: #8f1f2d;
  font-weight: 800;
}

.form-message.success {
  color: #27603c;
}

.celebration-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 30;
}

.confetti {
  position: absolute;
  top: -20px;
  width: 8px;
  height: 18px;
  border-radius: 6px;
  background: var(--gold-bright);
  opacity: 0;
  animation: confettiFall 1350ms ease-out forwards;
}

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

@keyframes confettiFall {
  0% {
    opacity: 0;
    transform: translateY(0) rotate(0deg);
  }
  12% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(92vh) rotate(320deg);
  }
}

@media (max-width: 840px) {
  .site-header {
    width: min(100% - 28px, 1180px);
  }

  .hero-section {
    min-height: 560px;
    padding-top: 56px;
  }

  .timer-grid,
  .milestone-row,
  .public-chasanim-list {
    grid-template-columns: 1fr;
  }

  .progress-section,
  .section-wrap {
    width: min(100% - 28px, 1080px);
  }

  .unlock-form,
  .settings-form,
  .wording-fields,
  .add-admin-form,
  .add-chasan-form,
  .count-actions {
    grid-template-columns: 1fr;
  }

  .admin-dashboard-head,
  .panel-title-row,
  .admin-list li,
  .chasanim-admin-list li,
  .log-list li {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .site-header {
    align-items: flex-start;
    gap: 12px;
  }

  .brand {
    gap: 10px;
  }

  .brand-symbol {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .brand-name {
    font-size: 0.94rem;
  }

  .header-link {
    min-height: 38px;
    padding: 0 13px;
  }

  .hero-section {
    min-height: 540px;
    padding-bottom: 104px;
  }

  .hero-content h1 {
    font-size: clamp(3.35rem, 18vw, 5rem);
  }

  .hero-subtitle {
    font-size: clamp(1.42rem, 9vw, 2.2rem);
  }

  .hero-message {
    font-size: 0.96rem;
  }

  .progress-section {
    margin-top: -58px;
  }

  .count-lockup {
    flex-wrap: wrap;
  }

  .count-lockup b {
    width: 100%;
    text-align: center;
  }

  .card-topline,
  .progress-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .time-box {
    min-height: 116px;
  }

  .section-wrap {
    margin-top: 58px;
  }

  .admin-shell,
  .admin-panel {
    border-radius: 20px;
    padding: 18px;
  }

  .site-header {
    direction: ltr;
  }

  .brand {
    direction: rtl;
  }
}
