* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg1: #130f40;
  --bg2: #0f172a;
  --pink: #ff4d8d;
  --orange: #ff8a00;
  --red: #ff3131;
  --gold: #fbbf24;
  --coin-dark: #d97706;
  --white: #ffffff;
  --glass: rgba(255, 255, 255, 0.16);
  --glass-border: rgba(255, 255, 255, 0.38);
}

body {
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--white);
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 77, 141, 0.45), transparent 28%),
    radial-gradient(circle at 85% 10%, rgba(251, 191, 36, 0.38), transparent 26%),
    radial-gradient(circle at 50% 90%, rgba(37, 99, 235, 0.35), transparent 35%),
    linear-gradient(145deg, var(--bg1), var(--bg2));
}

.app {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.hero,
.history-card {
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 30px;
  background: rgba(15, 23, 42, 0.72);
  box-shadow: 0 25px 70px rgba(0,0,0,0.35);
  backdrop-filter: blur(14px);
}

.hero {
  padding: 22px;
  text-align: center;
  overflow: hidden;
  position: relative;
}

.hero:before {
  content: "";
  position: absolute;
  inset: -80px;
  background: conic-gradient(from 90deg, transparent, rgba(255,255,255,0.08), transparent, rgba(251,191,36,0.12), transparent);
  animation: spinGlow 12s linear infinite;
  pointer-events: none;
}

.title-row,
.jar-stage,
.badge,
.name-row,
.add-btn,
.message,
.quick-stats,
.actions {
  position: relative;
  z-index: 2;
}

.name-row,
.jar-pick-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
}

.jar-pick-row {
  position: relative;
  z-index: 2;
  margin: 6px 0 4px;
}

.name-row label,
.jar-pick-row label {
  color: #fde68a;
  font-weight: 900;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.8px;
}

.select-wrap {
  position: relative;
  width: min(420px, 100%);
}

.select-wrap:after {
  content: "";
  position: absolute;
  top: 50%;
  right: 22px;
  width: 12px;
  height: 12px;
  margin-top: -8px;
  border-right: 3px solid var(--gold);
  border-bottom: 3px solid var(--gold);
  transform: rotate(45deg);
  pointer-events: none;
}

.name-input {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 100%;
  padding: 16px 46px 16px 20px;
  border-radius: 18px;
  border: 1px solid rgba(251,191,36,0.45);
  background: rgba(251,191,36,0.12);
  color: var(--white);
  font-family: inherit;
  font-size: 18px;
  font-weight: 900;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0,0,0,0.22);
  transition: background 160ms ease, border-color 160ms ease, transform 120ms ease;
}

.name-input:hover {
  background: rgba(251,191,36,0.2);
}

.name-input:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(251,191,36,0.22);
}

.name-input:active {
  transform: translateY(1px);
}

.name-input option {
  color: #111;
  background: #fff;
  font-weight: 700;
}

.title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 8px;
}

.logo {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  font-size: 38px;
  border-radius: 22px;
  background: linear-gradient(145deg, var(--orange), var(--red));
  box-shadow: 0 8px 0 #8f1d1d;
}

h1 {
  font-size: clamp(38px, 8vw, 72px);
  line-height: 0.95;
  letter-spacing: -2px;
  text-align: left;
}

p {
  color: rgba(255,255,255,0.82);
  font-size: 18px;
  text-align: left;
}

.jar-stage {
  height: 360px;
  display: grid;
  place-items: center;
  margin: 10px 0 0;
}

.coin-drop-area {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.falling-coin {
  position: absolute;
  left: 50%;
  top: 0;
  width: 44px;
  height: 44px;
  margin-left: -22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff7ad, var(--gold) 45%, var(--coin-dark));
  border: 3px solid #92400e;
  box-shadow: 0 8px 18px rgba(0,0,0,0.25);
  animation: dropCoin 650ms ease-in forwards;
}

.falling-coin:after {
  content: "R5";
  color: #78350f;
  font-weight: 900;
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.jar {
  width: 245px;
  height: 315px;
  position: relative;
  filter: drop-shadow(0 25px 25px rgba(0,0,0,0.35));
}

.jar.wobble {
  animation: jarWobble 460ms ease;
}

.jar-neck {
  width: 116px;
  height: 46px;
  margin: 0 auto;
  border: 5px solid var(--glass-border);
  border-bottom: 0;
  border-radius: 24px 24px 6px 6px;
  background: var(--glass);
}

.jar-body {
  height: 245px;
  border: 6px solid var(--glass-border);
  border-radius: 38px 38px 58px 58px;
  background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0.05));
  position: relative;
  overflow: hidden;
}

.shine {
  position: absolute;
  top: 22px;
  left: 26px;
  width: 32px;
  height: 135px;
  border-radius: 999px;
  background: rgba(255,255,255,0.28);
  transform: rotate(12deg);
}

.jar-total {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  text-shadow: 0 4px 12px rgba(0,0,0,0.55);
  z-index: 3;
}

.jar-total span {
  font-size: 52px;
  font-weight: 950;
}

.jar-total small {
  color: rgba(255,255,255,0.82);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.coin-pile {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 14px;
  transition: height 300ms ease;
}

.coin {
  position: absolute;
  width: 34px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(#ffe58a, var(--gold), var(--coin-dark));
  border: 2px solid #92400e;
  box-shadow: 0 4px 0 #92400e;
}

.jar-base {
  width: 180px;
  height: 18px;
  margin: -4px auto 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.28);
}

.badge {
  display: inline-flex;
  margin: 4px auto 14px;
  padding: 11px 16px;
  border-radius: 999px;
  background: rgba(251,191,36,0.16);
  border: 1px solid rgba(251,191,36,0.45);
  color: #fde68a;
  font-weight: 900;
}

.add-btn {
  width: min(420px, 100%);
  min-height: 78px;
  border: 0;
  border-radius: 24px;
  background: linear-gradient(145deg, var(--red), var(--orange));
  color: white;
  font-size: 28px;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 10px 0 #8f1d1d, 0 18px 35px rgba(239,68,68,0.35);
  text-transform: uppercase;
}

.add-btn:active {
  transform: translateY(7px);
  box-shadow: 0 3px 0 #8f1d1d, 0 12px 20px rgba(239,68,68,0.25);
}

.message {
  min-height: 28px;
  margin: 17px 0;
  text-align: center;
  color: #fff7ad;
  font-size: 18px;
  font-weight: 800;
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 11px;
  margin-top: 14px;
}

.quick-stats div {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 18px;
  padding: 14px 8px;
}

.quick-stats span {
  display: block;
  font-size: 27px;
  font-weight: 950;
}

.quick-stats small {
  display: block;
  color: rgba(255,255,255,0.72);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.7px;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.actions button {
  flex: 1;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.12);
  color: white;
  border-radius: 16px;
  padding: 13px;
  font-weight: 900;
  cursor: pointer;
}

.actions button:hover {
  background: rgba(255,255,255,0.2);
}

.history-card {
  margin-top: 18px;
  padding: 20px;
}

h2 {
  font-size: 28px;
  margin-bottom: 12px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 13px;
  border-bottom: 1px solid rgba(255,255,255,0.13);
  text-align: left;
}

th {
  color: #fde68a;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 1px;
}

td {
  color: rgba(255,255,255,0.92);
  font-weight: 800;
}

.empty {
  text-align: center;
  color: rgba(255,255,255,0.65);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(8, 11, 25, 0.72);
  backdrop-filter: blur(6px);
}

.modal.hidden {
  display: none;
}

.modal-card {
  width: min(640px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  padding: 22px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 26px;
  background: rgba(15, 23, 42, 0.96);
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-head h2 {
  margin: 0;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.1);
  color: var(--white);
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}

.icon-btn:hover {
  background: rgba(255,255,255,0.2);
}

.add-entry {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(251,191,36,0.35);
  background: rgba(251,191,36,0.08);
  margin-bottom: 18px;
}

.add-entry-label {
  display: block;
  color: #fde68a;
  font-weight: 900;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.8px;
  margin-bottom: 10px;
}

.add-entry-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.entry-date,
.mini-select,
.mini-input {
  color-scheme: dark;
  padding: 11px 13px;
  border-radius: 13px;
  border: 1px solid rgba(255,255,255,0.24);
  background: rgba(255,255,255,0.1);
  color: var(--white);
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.mini-input {
  cursor: text;
}

.mini-input::placeholder {
  color: rgba(255,255,255,0.5);
  font-weight: 700;
}

.entry-date:focus,
.mini-select:focus,
.mini-input:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(255,255,255,0.16);
}

.reporters-list {
  margin-bottom: 12px;
}

.reporter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}

.reporter-row .mini-input {
  flex: 1 1 auto;
  min-width: 0;
}

.add-entry-row .mini-input {
  flex: 1 1 160px;
}

.add-entry-row .entry-date {
  flex: 1 1 130px;
}

.add-entry-row .mini-select {
  flex: 2 1 160px;
}

.create-btn {
  flex: 1 1 90px;
  border: 0;
  border-radius: 13px;
  padding: 11px 16px;
  background: linear-gradient(145deg, var(--red), var(--orange));
  color: white;
  font-weight: 900;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 6px 0 #8f1d1d;
}

.create-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #8f1d1d;
}

.manage-empty {
  text-align: center;
  color: rgba(255,255,255,0.65);
  padding: 18px 0;
}

.manage-day {
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 18px;
  padding: 12px;
  margin-bottom: 12px;
  background: rgba(255,255,255,0.04);
}

.manage-day-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  color: #fde68a;
  font-weight: 900;
  font-size: 14px;
}

.manage-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.manage-entry .entry-date {
  flex: 1 1 130px;
  min-width: 0;
}

.manage-entry .mini-select {
  flex: 2 1 150px;
  min-width: 0;
}

.entry-del {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  border: 1px solid rgba(255,49,49,0.45);
  background: rgba(255,49,49,0.15);
  color: #fecaca;
  font-size: 17px;
  cursor: pointer;
}

.entry-del:hover {
  background: rgba(255,49,49,0.3);
}

#passwordModal {
  z-index: 60;
}

.pw-card {
  width: min(400px, 100%);
}

.pw-text {
  text-align: center;
  color: rgba(255,255,255,0.82);
  margin-bottom: 16px;
}

.pw-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pw-input {
  width: 100%;
  text-align: center;
  font-size: 17px;
}

.pw-error {
  min-height: 18px;
  margin: 0;
  text-align: center;
  color: #fecaca;
  font-size: 14px;
  font-weight: 800;
}

.pw-actions {
  display: flex;
  gap: 10px;
}

.pw-actions .create-btn {
  flex: 1;
}

.pw-cancel {
  flex: 1;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.12);
  color: var(--white);
  border-radius: 13px;
  padding: 11px 16px;
  font-weight: 900;
  font-size: 15px;
  cursor: pointer;
}

.pw-cancel:hover {
  background: rgba(255,255,255,0.2);
}

@keyframes dropCoin {
  0% {
    transform: translateY(-20px) rotateY(0deg);
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  100% {
    transform: translateY(232px) rotateY(720deg);
    opacity: 0;
  }
}

@keyframes jarWobble {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-4deg); }
  45% { transform: rotate(3deg); }
  70% { transform: rotate(-2deg); }
}

@keyframes spinGlow {
  to { transform: rotate(360deg); }
}

@media (max-width: 700px) {
  .app {
    padding: 12px;
  }

  .hero {
    padding: 17px;
    border-radius: 24px;
  }

  .title-row {
    justify-content: flex-start;
  }

  .logo {
    width: 56px;
    height: 56px;
    font-size: 31px;
  }

  .jar-stage {
    height: 330px;
  }

  .jar {
    transform: scale(0.9);
  }

  .quick-stats {
    grid-template-columns: 1fr;
  }

  .actions {
    flex-direction: column;
  }

  p {
    font-size: 16px;
  }
}
