:root {
  --ice-50: #f0f9ff;
  --ice-100: #e0f2fe;
  --ice-200: #bae6fd;
  --ice-300: #7dd3fc;
  --ocean-400: #38bdf8;
  --ocean-500: #0ea5e9;
  --ocean-600: #0284c7;
  --deep-700: #1e3a5f;
  --deep-800: #172e4a;
  --deep-900: #0f1d2f;
  --snow: #f8fbff;
  --floe: #ffffff;
  --teal-400: #2dd4bf;
  --teal-500: #14b8a6;
  --primary: var(--deep-800);
  --primary-contrast: #ffffff;
}

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

html {
  font-size: 112%;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: 'DM Sans', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* === OCEAN BACKGROUND === */
.ocean-bg {
  min-height: 100vh;
  background: linear-gradient(180deg, #e0f2fe 0%, #bae6fd 30%, #7dd3fc 60%, #38bdf8 100%);
  position: relative;
  overflow: hidden;
}

.ocean-bg::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 35%;
  background: linear-gradient(180deg, transparent 0%, rgba(14, 165, 233, 0.3) 50%, rgba(2, 132, 199, 0.5) 100%);
  pointer-events: none;
}

/* Waves */
.wave {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 200%;
  height: 120px;
  opacity: 0.15;
}
.wave-1 { animation: drift 8s ease-in-out infinite; }
.wave-2 { animation: drift 11s ease-in-out infinite reverse; bottom: 10px; opacity: 0.1; }

@keyframes drift {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-15%); }
}

/* Snowflakes */
.snowflake {
  position: absolute;
  background: white;
  border-radius: 50%;
  opacity: 0;
  animation: snow-fall linear infinite;
}
@keyframes snow-fall {
  0%   { opacity: 0; transform: translateY(-20px) rotate(0deg); }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.4; }
  100% { opacity: 0; transform: translateY(100vh) rotate(360deg); }
}

/* === LAYOUT === */
.app-container {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px 80px;
  min-height: 100vh;
}

/* === LOGO === */
.logo-area {
  text-align: center;
  margin-bottom: 16px;
}
.logo-text {
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-weight: 700;
  font-size: 2.4rem;
  color: var(--deep-800);
  letter-spacing: -0.5px;
}
.logo-text span { color: var(--ocean-500); }
.logo-link,
.logo-link:visited,
.logo-link:hover,
.logo-link:active {
  color: inherit;
  text-decoration: none;
}
.logo-link {
  display: inline-block;
  cursor: pointer;
}
.tagline {
  font-size: 0.95rem;
  color: var(--deep-700);
  opacity: 0.75;
  margin-top: 4px;
  font-weight: 500;
}

/* === CARD === */
.ice-card {
  background: var(--floe);
  border-radius: 24px;
  padding: 40px 36px;
  max-width: 560px;
  width: 100%;
  box-shadow:
    0 4px 24px rgba(15, 29, 47, 0.08),
    0 1px 3px rgba(15, 29, 47, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  position: relative;
  border: 1px solid rgba(186, 230, 253, 0.5);
}
.ice-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--ocean-400), var(--teal-400), var(--ocean-400));
  border-radius: 24px 24px 0 0;
}

/* === SEAL MASCOT === */
.seal-mascot {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
  position: relative;
}
.seal-mascot svg {
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
  width: auto;
  height: auto;
  max-width: 100%;
  transform: scale(1.2);
  transform-origin: center top;
  margin-bottom: 16px;
}

/* === TEXTAREA === */
.prediction-input {
  width: 100%;
  min-height: 120px;
  padding: 16px;
  border: 2px solid var(--ice-200);
  border-radius: 16px;
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
  font-size: 0.95rem;
  color: var(--deep-800);
  background: var(--ice-50);
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.prediction-input::placeholder {
  color: var(--ocean-400);
  opacity: 0.7;
}
.prediction-input:focus {
  border-color: var(--ocean-400);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.15);
  background: white;
}

.input-footer {
  text-align: right;
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--ocean-500);
  opacity: 0.6;
}

/* === TIME SECTION === */
.time-section { margin-top: 20px; }
.time-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--deep-700);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.time-label svg { opacity: 0.5; }

.quick-times {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.quick-time-btn {
  padding: 8px 16px;
  border: 2px solid var(--ice-200);
  border-radius: 12px;
  background: var(--ice-50);
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--deep-700);
  cursor: pointer;
  transition: all 0.2s;
  width: auto;
}
.quick-time-btn:hover {
  border-color: var(--ocean-400);
  background: var(--ice-100);
}
.quick-time-btn.active {
  border-color: var(--ocean-500);
  background: var(--ocean-500);
  color: white;
}

.custom-time {
  display: flex;
  align-items: center;
  gap: 8px;
}
.custom-time input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border: 2px solid var(--ice-200);
  border-radius: 12px;
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
  font-size: 0.9rem;
  color: var(--deep-800);
  background: var(--ice-50);
  outline: none;
  transition: border-color 0.2s;
  text-align: left;
  width: 100%;
}
.custom-time input:focus {
  border-color: var(--ocean-400);
}
.picker-btn {
  flex-shrink: 0;
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  border: 2px solid var(--ice-200);
  background: var(--ice-50);
  color: var(--deep-700);
  border-radius: 12px;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.picker-btn:hover {
  border-color: var(--ocean-400);
  background: var(--ice-100);
}

.timezone-hint {
  font-size: 0.78rem;
  color: var(--deep-700);
  opacity: 0.55;
  margin-top: 8px;
  text-align: left;
}

/* === SEAL BUTTON === */
.seal-btn {
  width: 100%;
  padding: 16px;
  margin-top: 24px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--deep-800), var(--deep-700));
  color: white;
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.seal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 29, 47, 0.25);
}
.seal-btn:active { transform: translateY(0); }
.seal-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.seal-btn svg { transition: transform 0.3s; }
.seal-btn:hover:not(:disabled) svg { transform: rotate(-10deg) scale(1.1); }

/* === LINK OUTPUT === */
.link-output {
  margin-top: 20px;
  padding: 16px;
  background: linear-gradient(135deg, var(--ice-50), var(--ice-100));
  border: 2px solid var(--ice-200);
  border-radius: 16px;
  text-align: center;
  animation: pop-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes pop-in {
  0%   { opacity: 0; transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1); }
}
.link-output-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ocean-600);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.link {
  font-size: 0.85rem;
  color: var(--ocean-600);
  word-break: break-all;
  text-decoration: underline;
  overflow-wrap: anywhere;
  text-align: center;
}
.copy-btn {
  margin-top: 10px;
  padding: 10px 24px;
  border: 2px solid var(--ocean-400);
  border-radius: 12px;
  background: white;
  color: var(--ocean-600);
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
}
.copy-btn:hover {
  background: var(--ocean-500);
  color: white;
  border-color: var(--ocean-500);
}

/* === STATUS BADGES === */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  border-radius: 50px;
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  margin: 0 auto 16px;
}
.status-badge.sealed {
  background: var(--ice-100);
  color: var(--deep-700);
  border: 2px solid var(--ice-200);
}
.status-badge.revealed {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: #065f46;
  border: 2px solid #6ee7b7;
}

/* === COUNTDOWN === */
.countdown-area {
  text-align: center;
  margin-top: 16px;
  margin-bottom: 8px;
}
.countdown-label {
  font-size: 0.85rem;
  color: var(--deep-700);
  opacity: 0.6;
  margin-bottom: 4px;
}
.countdown-time {
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--deep-800);
  letter-spacing: 1px;
}
.countdown-time strong { font-weight: inherit; }
.reveal-date {
  font-size: 0.82rem;
  color: var(--deep-700);
  opacity: 0.5;
  margin-top: 8px;
}

/* === REFRESH BUTTON === */
.refresh-btn {
  width: 100%;
  margin-top: 20px;
  padding: 14px;
  border: 2px solid var(--ice-200);
  border-radius: 14px;
  background: var(--ice-50);
  color: var(--deep-700);
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}
.refresh-btn:hover {
  border-color: var(--ocean-400);
  background: var(--ice-100);
}

/* === SLEEPING Z'S === */
.zzz {
  position: absolute;
  top: 30px;
  right: 60px;
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-weight: 700;
  color: var(--ocean-400);
  font-size: 1rem;
  opacity: 0;
  animation: float-z 2.5s ease-in-out infinite;
  pointer-events: none;
}
.zzz:nth-child(2) { animation-delay: 0.8s; right: 45px; top: 20px; font-size: 0.9rem; }
.zzz:nth-child(3) { animation-delay: 1.6s; right: 30px; top: 10px; font-size: 0.7rem; }

@keyframes float-z {
  0%   { opacity: 0; transform: translateY(0) scale(0.8); }
  30%  { opacity: 0.6; }
  100% { opacity: 0; transform: translateY(-30px) scale(1.1); }
}

/* === BREATHING SEAL === */
@keyframes breathe {
  0%, 100% { transform: scaleY(1); }
  50%       { transform: scaleY(1.03); }
}
.sleeping-seal {
  animation: breathe 3s ease-in-out infinite;
  transform-origin: bottom center;
}

/* === CLAPPING SEAL === */
@keyframes clap-flipper {
  0%, 100% { transform: rotate(0deg); }
  25%       { transform: rotate(-15deg); }
  75%       { transform: rotate(15deg); }
}
.clapping .flipper-left {
  animation: clap-flipper 0.5s ease-in-out infinite;
  transform-origin: 70% 50%;
}
.clapping .flipper-right {
  animation: clap-flipper 0.5s ease-in-out infinite reverse;
  transform-origin: 30% 50%;
}

/* === REVEALED CONTENT === */
.revealed-content {
  margin-top: 20px;
  padding: 20px;
  background: var(--ice-50);
  border: 2px solid var(--ice-200);
  border-radius: 16px;
  font-size: 1rem;
  color: var(--deep-800);
  line-height: 1.6;
  text-align: center;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
}
.opened-date {
  font-size: 0.82rem;
  color: var(--deep-700);
  opacity: 0.5;
  margin-top: 16px;
  text-align: center;
}

/* === COMMITMENT TOGGLE === */
.commitment {
  margin-top: 12px;
  text-align: center;
}
.commitment-toggle {
  font-size: 0.78rem;
  color: var(--ocean-500);
  cursor: pointer;
  border: none;
  background: none;
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.2s;
  width: auto;
}
.commitment-toggle:hover { background: var(--ice-100); }
.commitment-hash {
  font-size: 0.7rem;
  color: var(--deep-700);
  opacity: 0.4;
  word-break: break-all;
  margin-top: 6px;
  font-family: monospace;
  display: none;
}
.commitment-hash.show { display: block; }

/* === META / MISC === */
.meta {
  margin: 0;
  color: var(--deep-700);
  opacity: 0.65;
  text-align: center;
  font-size: 0.9rem;
}
#note-loading { padding: 20px 0; font-size: 1rem; }

#empty-view {
  display: grid;
  gap: 12px;
  padding: 12px 0;
}
#empty-view .link { font-size: 0.9rem; }

/* === TOAST === */
.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  background: var(--deep-800);
  color: white;
  border-radius: 999px;
  padding: 10px 20px;
  box-shadow: 0 4px 20px rgba(15, 29, 47, 0.25);
  max-width: calc(100vw - 32px);
  text-align: center;
  z-index: 100;
  font-size: 0.9rem;
  font-weight: 500;
}

/* === HIDDEN === */
.hidden { display: none !important; }

/* === FLATPICKR OVERRIDES === */
.flatpickr-calendar {
  border: 1px solid var(--ice-200) !important;
  border-radius: 16px !important;
  box-shadow: 0 18px 40px rgba(15, 29, 47, 0.14) !important;
  overflow: hidden;
  font-family: 'DM Sans', 'Segoe UI', sans-serif !important;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) !important;
  margin-top: 10px;
  z-index: 30;
}
.flatpickr-months {
  background: var(--deep-800) !important;
}
.flatpickr-months .flatpickr-month,
.flatpickr-current-month,
.flatpickr-current-month .numInputWrapper,
.flatpickr-current-month .flatpickr-monthDropdown-months {
  color: white !important;
  fill: white !important;
  background: var(--deep-800) !important;
}
.flatpickr-months .flatpickr-prev-month svg,
.flatpickr-months .flatpickr-next-month svg { fill: white !important; }
.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg { fill: var(--ocean-400) !important; }
.flatpickr-weekdays { background: var(--ice-100) !important; }
.flatpickr-weekday { color: var(--deep-700) !important; font-weight: 600 !important; }
.flatpickr-days { background: white !important; }
.flatpickr-day { color: var(--deep-800) !important; }
.flatpickr-day:hover { background: var(--ice-100) !important; border-color: var(--ice-200) !important; }
.flatpickr-day.today { border-color: var(--ocean-400) !important; }
.flatpickr-day.selected,
.flatpickr-day.selected:hover {
  background: var(--ocean-500) !important;
  border-color: var(--ocean-500) !important;
  color: white !important;
}
.flatpickr-day.disabled,
.flatpickr-day.flatpickr-disabled { opacity: 0.3 !important; }
.flatpickr-time {
  background: white !important;
  border-top: 1px solid var(--ice-200) !important;
}
.flatpickr-time input { color: var(--deep-800) !important; font-family: 'DM Sans', 'Segoe UI', sans-serif !important; }
.flatpickr-time input:hover,
.flatpickr-time input:focus {
  background: var(--ice-50) !important;
  color: var(--deep-800) !important;
}
.flatpickr-calendar.open,
.flatpickr-calendar.inline { animation: none !important; }

/* === RESPONSIVE === */
@media (max-width: 600px) {
  html { font-size: 100%; }
  .app-container { padding: 24px 16px 60px; }
  .ice-card { padding: 28px 20px; border-radius: 20px; max-width: 100%; }
  .logo-text { font-size: 2rem; }
  .countdown-time { font-size: 1.8rem; }
  .quick-times { gap: 6px; }
  .quick-time-btn { padding: 7px 12px; font-size: 0.82rem; }
  .seal-mascot svg { transform: scale(1); margin-bottom: 0; }
}
