:root {
  --bg-a: #0b1f2a;
  --bg-b: #112f25;
  --card: rgba(255, 255, 255, 0.14);
  --card-strong: rgba(255, 255, 255, 0.22);
  --line: rgba(255, 255, 255, 0.28);
  --txt: #f8fffd;
  --muted: #c7e3d8;
  --mint: #6be5c8;
  --gold: #ffd36e;
  --coral: #ff8b71;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Space Grotesk", sans-serif;
  color: var(--txt);
  background: radial-gradient(circle at 20% 20%, #1f4d52 0%, var(--bg-a) 40%),
    linear-gradient(130deg, var(--bg-a), var(--bg-b));
}

body {
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255, 211, 110, 0.3), transparent 70%);
  opacity: 0;
  pointer-events: none;
  z-index: 999;
  transition: opacity 100ms ease;
}

body.pot-flash::before {
  animation: screen-flash 2500ms ease-out;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(36px);
  opacity: 0.6;
  pointer-events: none;
  z-index: 0;
}

.orb-a {
  width: 28rem;
  height: 28rem;
  background: rgba(107, 229, 200, 0.35);
  top: -7rem;
  right: -5rem;
  animation: drift 16s ease-in-out infinite alternate;
}

.orb-b {
  width: 22rem;
  height: 22rem;
  background: rgba(255, 139, 113, 0.3);
  bottom: -6rem;
  left: -4rem;
  animation: drift 20s ease-in-out infinite alternate-reverse;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at center, black 35%, transparent 90%);
  z-index: 0;
  pointer-events: none;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1100px, 94vw);
  margin: 2rem auto 3rem;
  display: grid;
  gap: 1.2rem;
}

.glass {
  background: linear-gradient(160deg, var(--card-strong), var(--card));
  border: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(135%);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}

.panel {
  border-radius: 1.15rem;
  padding: 1.15rem;
}

.header-panel {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.eyebrow {
  margin: 0;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--muted);
}

h1,
h2 {
  margin: 0.15rem 0 0;
  font-family: "Syne", sans-serif;
}

h1 {
  font-size: clamp(1.4rem, 2.2vw, 2.2rem);
}

/* Rainbow gradient title */
.rainbow-title {
  background: linear-gradient(135deg, #ff6b6b, #ffa500, #ffd700, #4ade80, #60a5fa, #a78bfa);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: rainbow-shift 3s ease infinite;
  font-weight: 800;
  text-shadow: none;
}

.time-block {
  text-align: right;
  display: flex;
  gap: 2rem;
  align-items: center;
}

.time-item {
  display: flex;
  flex-direction: column;
}

.time-label {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.time-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gold);
}

.countdown-value {
  color: var(--mint);
  font-family: "Syne", sans-serif;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.metric {
  display: grid;
  gap: 0.6rem;
  position: relative;
  overflow: hidden;
}

.metric.pot-shake {
  animation: shake 1800ms ease;
}

.pot-particle {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 10;
}

.pot-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border: 3px solid var(--gold);
  border-radius: 1.15rem;
  opacity: 0;
  pointer-events: none;
  z-index: 5;
}

.pot-ring.active {
  animation: ring-expand 3s ease-out forwards;
}

.metric-label {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metric-value {
  font-family: "Syne", sans-serif;
  font-size: clamp(1.4rem, 2vw, 2.1rem);
  line-height: 1;
  position: relative;
  transition: transform 200ms ease;
}

/* Always-on dramatic rainbow animation for pot value */
#pot-value {
  animation: pot-idle-glow 2.67s ease-in-out infinite;
}

.metric-value.pot-pulse {
  animation: pot-explosion 3.6s cubic-bezier(0.17, 0.84, 0.32, 1.22);
  text-shadow:
    0 0 20px rgba(255, 211, 110, 0.8),
    0 0 40px rgba(255, 211, 110, 0.5),
    0 0 60px rgba(255, 211, 110, 0.3);
}

.metric-sub {
  font-size: 1rem;
}

.metric-bar {
  width: 100%;
  height: 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  overflow: hidden;
}

.metric-fill {
  width: 6%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint), var(--gold));
  transition: width 1200ms cubic-bezier(0.17, 0.84, 0.32, 1.22);
  box-shadow: 0 0 20px rgba(107, 229, 200, 0.5);
}

.metric-fill.fill-pulse {
  animation: fill-glow 3s ease-out;
}

.feed-panel {
  min-height: 340px;
}

.feed-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.pill {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.feed-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

.feed-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.8rem;
  padding: 0.7rem;
  background: rgba(255, 255, 255, 0.06);
  animation: rise 420ms ease;
}

.feed-dot {
  width: 0.64rem;
  height: 0.64rem;
  border-radius: 999px;
  background: var(--mint);
  box-shadow: 0 0 0 7px rgba(107, 229, 200, 0.13);
}

.feed-main {
  font-size: 0.95rem;
}

.feed-meta {
  font-size: 0.74rem;
  color: var(--muted);
}

.feed-pot {
  font-family: "Syne", sans-serif;
  font-size: 0.92rem;
}

.splash-root {
  position: fixed;
  right: 1rem;
  top: 1rem;
  z-index: 9;
  width: min(370px, 92vw);
  display: grid;
  gap: 0.7rem;
}

.splash-card {
  padding: 0.9rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.08));
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.24);
  transform-origin: top right;
  animation: pop-in 450ms cubic-bezier(0.17, 0.84, 0.32, 1.22);
}

.splash-title {
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.splash-name {
  display: block;
  margin-top: 0.28rem;
  font-family: "Syne", sans-serif;
  font-size: 1.04rem;
}

.splash-ticket {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.84rem;
  color: var(--gold);
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* CTA Button */
.cta-button {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 1.2rem 2.5rem;
  font-family: "Syne", sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #ff6b6b, #ffa500, #ffd700, #4ade80, #60a5fa, #a78bfa);
  background-size: 300% 300%;
  border: none;
  border-radius: 50px;
  box-shadow: 0 8px 32px rgba(255, 107, 107, 0.4);
  cursor: pointer;
  z-index: 100;
  animation: rainbow-shift 3s ease infinite, pulse-cta 2s ease-in-out infinite;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cta-button:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 48px rgba(255, 107, 107, 0.6);
}

.cta-button:active {
  transform: scale(0.98);
}

@keyframes rainbow-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes pulse-cta {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade-in 0.3s ease;
}

.modal-overlay.hidden {
  display: none;
}

.purchase-step.hidden {
  display: none;
}

.modal-content {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.85));
  backdrop-filter: blur(20px);
  border-radius: 1.5rem;
  padding: 2rem;
  width: min(500px, 90vw);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
  animation: slide-up 0.4s cubic-bezier(0.17, 0.84, 0.32, 1.22);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-title {
  font-family: "Syne", sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: #1a1a1a;
}

.modal-close {
  background: none;
  border: none;
  font-size: 2rem;
  color: #666;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s ease;
}

.modal-close:hover {
  background: rgba(0, 0, 0, 0.1);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.form-input {
  width: 100%;
  padding: 0.9rem;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.75rem;
  font-size: 1rem;
  font-family: "Space Grotesk", sans-serif;
  background: rgba(255, 255, 255, 0.8);
  transition: border-color 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: #60a5fa;
}

.form-checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.form-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.form-submit {
  width: 100%;
  padding: 1rem;
  font-family: "Syne", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #4ade80, #60a5fa);
  border: none;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 16px rgba(74, 222, 128, 0.3);
}

.form-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(74, 222, 128, 0.4);
}

.form-submit:active {
  transform: translateY(0);
}

.form-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.payment-info {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 165, 0, 0.2));
  border: 2px solid rgba(255, 215, 0, 0.5);
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.payment-info-title {
  font-family: "Syne", sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 1rem;
}

.payment-detail {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 0.5rem;
}

.payment-detail-label {
  font-weight: 600;
  color: #666;
}

.payment-detail-value {
  font-family: "Syne", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a1a1a;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

@keyframes drift {
  from {
    transform: translateY(-10px) translateX(-12px);
  }
  to {
    transform: translateY(12px) translateX(12px);
  }
}

/* Always-on rainbow animation - 1.5x faster with rainbow colors */
@keyframes pot-idle-glow {
  0% {
    transform: scale(1);
    color: #ff6b6b;
    text-shadow:
      0 0 15px rgba(255, 107, 107, 0.6),
      0 0 30px rgba(255, 107, 107, 0.4);
  }
  16.67% {
    transform: scale(1.05);
    color: #ffa500;
    text-shadow:
      0 0 20px rgba(255, 165, 0, 0.7),
      0 0 40px rgba(255, 165, 0, 0.5);
  }
  33.33% {
    transform: scale(1);
    color: #ffd700;
    text-shadow:
      0 0 15px rgba(255, 215, 0, 0.6),
      0 0 30px rgba(255, 215, 0, 0.4);
  }
  50% {
    transform: scale(1.05);
    color: #4ade80;
    text-shadow:
      0 0 20px rgba(74, 222, 128, 0.7),
      0 0 40px rgba(74, 222, 128, 0.5);
  }
  66.67% {
    transform: scale(1);
    color: #60a5fa;
    text-shadow:
      0 0 15px rgba(96, 165, 250, 0.6),
      0 0 30px rgba(96, 165, 250, 0.4);
  }
  83.33% {
    transform: scale(1.05);
    color: #a78bfa;
    text-shadow:
      0 0 20px rgba(167, 139, 250, 0.7),
      0 0 40px rgba(167, 139, 250, 0.5);
  }
  100% {
    transform: scale(1);
    color: #ff6b6b;
    text-shadow:
      0 0 15px rgba(255, 107, 107, 0.6),
      0 0 30px rgba(255, 107, 107, 0.4);
  }
}

@keyframes pot-explosion {
  0% {
    transform: scale(1);
  }
  15% {
    transform: scale(1.25) rotate(-2deg);
  }
  30% {
    transform: scale(0.95) rotate(1deg);
  }
  45% {
    transform: scale(1.15) rotate(-1deg);
  }
  60% {
    transform: scale(0.98) rotate(0.5deg);
  }
  75% {
    transform: scale(1.05) rotate(-0.3deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-4px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(4px);
  }
}

@keyframes ring-expand {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.8);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.8);
  }
}

@keyframes particle-burst {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--tx), var(--ty)) scale(0);
  }
}

@keyframes screen-flash {
  0% {
    opacity: 0;
  }
  10% {
    opacity: 0.6;
  }
  100% {
    opacity: 0;
  }
}

@keyframes fill-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(107, 229, 200, 0.5);
  }
  50% {
    box-shadow:
      0 0 40px rgba(107, 229, 200, 0.9),
      0 0 60px rgba(255, 211, 110, 0.6),
      0 0 80px rgba(255, 211, 110, 0.3);
  }
}

/* Mobile Responsive Styles */
@media (max-width: 920px) {
  .metrics {
    grid-template-columns: 1fr;
  }

  .header-panel {
    flex-direction: column;
    align-items: flex-start;
  }

  .time-block {
    text-align: left;
    width: 100%;
    justify-content: space-between;
  }

  .time-item:first-child {
    text-align: left;
  }

  .time-item:last-child {
    text-align: right;
  }
}

@media (max-width: 768px) {
  /* Adjust shell padding for mobile */
  .shell {
    width: 96vw;
    margin: 1rem auto 2rem;
    gap: 1rem;
  }

  /* Reduce panel padding */
  .panel {
    padding: 1rem;
    border-radius: 1rem;
  }

  /* Smaller headings */
  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.2rem;
  }

  /* Stack metrics vertically */
  .metrics {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  /* Adjust metric values */
  .metric-value {
    font-size: 1.6rem;
  }

  /* Smaller feed items */
  .feed-item {
    padding: 0.6rem;
    gap: 0.5rem;
  }

  .feed-main {
    font-size: 0.85rem;
  }

  .feed-meta {
    font-size: 0.7rem;
  }

  .feed-pot {
    font-size: 0.85rem;
  }

  /* Adjust CTA button for mobile */
  .cta-button {
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
    width: calc(100% - 2rem);
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    text-align: center;
  }

  /* Adjust splash notifications */
  .splash-root {
    right: 0.5rem;
    top: 0.5rem;
    width: calc(100vw - 1rem);
  }

  .splash-card {
    padding: 0.8rem;
  }

  .splash-name {
    font-size: 0.95rem;
  }

  .splash-ticket {
    font-size: 0.78rem;
  }

  /* Modal adjustments */
  .modal-content {
    width: 95vw;
    padding: 1.5rem;
    border-radius: 1.25rem;
  }

  .modal-title {
    font-size: 1.4rem;
  }

  .form-input {
    padding: 0.75rem;
    font-size: 0.95rem;
  }

  .form-submit {
    padding: 0.9rem;
    font-size: 1rem;
  }

  .payment-info {
    padding: 1rem;
  }

  .payment-info-title {
    font-size: 1.1rem;
  }

  .payment-detail {
    padding: 0.6rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }

  .payment-detail-value {
    font-size: 1rem;
  }

  /* Reduce background orb sizes */
  .orb-a {
    width: 18rem;
    height: 18rem;
  }

  .orb-b {
    width: 14rem;
    height: 14rem;
  }
}

@media (max-width: 480px) {
  /* Extra small screens */
  .shell {
    width: 98vw;
    margin: 0.5rem auto 1.5rem;
  }

  h1 {
    font-size: 1.3rem;
  }

  .metric-value {
    font-size: 1.4rem;
  }

  .cta-button {
    padding: 0.9rem 1.2rem;
    font-size: 1rem;
  }

  .modal-content {
    padding: 1.25rem;
  }

  .modal-title {
    font-size: 1.2rem;
  }

  .form-group {
    margin-bottom: 1rem;
  }

  .payment-detail-label,
  .payment-detail-value {
    font-size: 0.9rem;
  }
}
