@font-face {
  font-family: ResolutionTitle;
  src: url("font/PWHappyChristmas.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: ResolutionText;
  src: url("font/ComicHelvetic_Medium.otf") format("opentype");
  font-display: swap;
}

:root {
  color-scheme: dark;
  --gold: #ffe9a3;
  --ink: #080b20;
  --panel: rgba(14, 19, 49, .72);
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--ink); }
body {
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  color: #fff;
  font-family: ResolutionText, system-ui, sans-serif;
  background: radial-gradient(ellipse at 50% 68%, rgba(46, 86, 171, .38) 0%, transparent 48%), radial-gradient(ellipse at 50% 38%, #252354 0%, #111735 48%, #070b20 100%);
}
.sky, .fireworks {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
.sky {
  z-index: 0;
  opacity: .92;
  background-image:
    radial-gradient(1px 1px at 8% 16%, #fff 99%, transparent),
    radial-gradient(1px 1px at 23% 72%, #dce8ff 99%, transparent),
    radial-gradient(1.5px 1.5px at 41% 27%, #fff 99%, transparent),
    radial-gradient(1px 1px at 58% 81%, #fff 99%, transparent),
    radial-gradient(1px 1px at 76% 18%, #dce8ff 99%, transparent),
    radial-gradient(1.5px 1.5px at 91% 57%, #fff 99%, transparent),
    radial-gradient(ellipse at 50% 100%, rgba(73, 76, 162, .2), transparent 58%),
    linear-gradient(158deg, transparent 26%, rgba(77, 105, 207, .08) 52%, rgba(82, 121, 223, .14) 68%, transparent 84%);
  background-size: 197px 181px, 251px 223px, 311px 277px, 227px 263px, 281px 199px, 337px 293px, 100% 100%, 100% 100%;
  animation: star-drift 100s linear infinite, star-twinkle 4s ease-in-out infinite alternate;
}
@keyframes star-drift { to { background-position: -197px 181px, -251px 223px, -311px 277px, -227px 263px, -281px 199px, -337px 293px, center, center; } }
@keyframes star-twinkle { from { opacity: .68; } to { opacity: 1; } }
.page {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100% - 40px, 1050px);
  min-height: 100svh;
  margin: 0 auto;
  padding: clamp(24px, 6vh, 64px) 0 20px;
}
.texttopper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2vw, 22px);
  width: 100%;
  text-align: center;
  text-shadow: 0 3px 18px rgba(0,0,0,.45);
}
.texttopperfont {
  margin: 0;
  color: var(--gold);
  font: clamp(2.15rem, 6vw, 5rem)/1.08 ResolutionTitle, Georgia, serif;
  background: linear-gradient(180deg, #fff5c9 5%, #ffc64c 55%, #e85d50 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.resolution-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: clamp(280px, 48vh, 490px);
  margin: clamp(24px, 5vh, 54px) 0 32px;
  padding: clamp(24px, 6vw, 68px);
  border: 1px solid rgba(255, 235, 177, .28);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(28, 33, 76, .74), var(--panel));
  box-shadow: 0 24px 90px rgba(0,0,0,.34), inset 0 1px rgba(255,255,255,.1);
  backdrop-filter: blur(8px);
  text-align: center;
}
.ornament { color: #ffe9a3; font-size: clamp(20px, 3vw, 34px); text-shadow: 0 0 20px rgba(255, 208, 104, .75); }
.textresolfont {
  max-width: 880px;
  margin: 16px 0;
  color: #fff;
  font: clamp(1.55rem, 3.4vw, 3.15rem)/1.3 ResolutionText, system-ui, sans-serif;
  text-wrap: balance;
  text-shadow: 0 3px 20px rgba(0,0,0,.55);
}
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; width: 100%; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 13px 24px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  color: #fff;
  font: 1.05rem/1.2 ResolutionText, system-ui, sans-serif;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 8px 25px rgba(0,0,0,.25);
  transition: transform .18s ease, filter .18s ease;
}
.button:hover { transform: translateY(-2px); filter: brightness(1.12); }
.button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.button-next { background: linear-gradient(135deg, #9d39dc, #5f39bd); }
.button-publish { background: linear-gradient(135deg, #e2a62e, #e46743); }
.bottombar { margin-top: auto; padding-top: 36px; color: rgba(255,255,255,.7); font-size: .9rem; }
.bottombar a { color: inherit; text-decoration: none; }
.fireworks { z-index: 0; }
@media (max-width: 600px) {
  .page { width: min(100% - 28px, 520px); min-height: 100svh; padding-top: max(30px, env(safe-area-inset-top)); padding-bottom: max(18px, env(safe-area-inset-bottom)); }
  .texttopper { gap: 8px; }
  .texttopperfont { font-size: clamp(2rem, 10vw, 3.2rem); }
  .resolution-card { min-height: 38svh; margin: 28px 0 24px; padding: 25px 20px; border-radius: 22px; }
  .textresolfont { font-size: clamp(1.45rem, 6.3vw, 2rem); line-height: 1.35; }
  .actions { display: grid; grid-template-columns: 1fr; width: min(100%, 360px); gap: 11px; }
  .button { width: 100%; min-height: 52px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.share-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(92vw, 560px);
  max-height: min(88svh, 760px);
  padding: 0;
  border: 1px solid rgba(255,235,177,.3);
  border-radius: 24px;
  color: #fff;
  background: #111735;
  box-shadow: 0 24px 90px rgba(0,0,0,.55);
}
.share-dialog[open] { display: block; }
.share-dialog::backdrop { background: rgba(2,5,18,.76); backdrop-filter: blur(5px); }
.share-shell { position: relative; padding: clamp(24px, 5vw, 38px); }
.share-shell h2 { margin: 0 40px 14px 0; color: var(--gold); font: 2rem/1.1 ResolutionTitle, Georgia, serif; }
.share-close { position: absolute; top: 14px; right: 16px; border: 0; color: #fff; background: transparent; font-size: 2rem; cursor: pointer; }
.share-caption, .share-resolution { color: rgba(255,255,255,.88); line-height: 1.45; }
.share-resolution { padding: 14px; border-radius: 12px; background: rgba(255,255,255,.07); }
.share-options { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin: 18px 0; }
.share-options .button { width: 100%; min-height: 48px; padding: 10px 12px; border-radius: 14px; background: #353c72; font-size: .98rem; cursor: pointer; }
.share-options .button:hover { background: #4b5597; }
.share-options button:disabled { opacity: .6; cursor: wait; }
.share-status { min-height: 4.5em; color: rgba(255,255,255,.74); font: .93rem/1.5 system-ui,sans-serif; }
.share-download { width: 100%; margin-top: 8px; background: linear-gradient(135deg, #9d39dc, #5f39bd); }
.share-download[hidden] { display: none; }
@media (min-width: 601px) {
  .share-dialog .share-options { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .share-dialog .share-options > .button { display: inline-flex !important; visibility: visible !important; opacity: 1 !important; }
}
@media (max-width: 420px) { .share-options { grid-template-columns: 1fr; } }
