/* Shared look for the trail pages: red, white and candy cane. */
:root {
  --red: #c8102e; --deep: #8e0b1f; --white: #fff; --cream: #fff4f0; --ink: #5a0614;
  --green: #1c7c44; --gold: #ffcf4d;
  --candy: repeating-linear-gradient(-45deg, var(--red) 0 12px, var(--white) 12px 24px);
}
html { background: var(--deep); }
body { margin: 0; min-height: 100vh; color: var(--white); font: 17px/1.5 Nunito, system-ui, sans-serif;
       background: radial-gradient(120% 70% at 50% 0%, #e0263f 0%, var(--red) 35%, var(--deep) 100%) fixed; }
.candy-band { height: 14px; background: var(--candy); box-shadow: 0 2px 6px #0004; }
#snow { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
#snow i { position: absolute; top: -12px; color: #fff; opacity: .85; animation: fall linear infinite; text-shadow: 0 0 4px #fff8; }
@keyframes fall { to { transform: translate(var(--drift), 105vh) rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { #snow { display: none; } .bar i { animation: none !important; } }
#intro { position: relative; z-index: 1; padding: 20px 16px 40px; max-width: 480px; margin: auto; }
header { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 6px 0 10px; text-align: center; }
header svg { flex: 0 0 auto; width: 44px; height: 88px; filter: drop-shadow(0 3px 3px #0005); }
h1 { font-family: 'Mountains of Christmas', cursive; font-size: 2.3em; line-height: 1.02; margin: 0; text-shadow: 0 3px 0 var(--deep), 0 6px 14px #0006; }
h1 small { display: block; font-size: .62em; letter-spacing: .02em; color: var(--cream); }
.lede { text-align: center; font-size: 1.05em; margin: 6px 4px 16px; }
.safety { background: var(--white); color: var(--ink); border-radius: 12px; padding: 10px 14px; font-size: .92em; border-left: 8px solid var(--green); }
button { padding: 14px 18px; margin: 6px 0; border: 0; border-radius: 12px; background: var(--white); color: var(--red); font: inherit; font-weight: 800; cursor: pointer; }
#start { display: block; width: 100%; padding: 6px; margin-top: 18px; background: var(--candy); border-radius: 18px; box-shadow: 0 6px 0 var(--deep), 0 10px 24px #0006; }
#start span { display: block; background: var(--white); color: var(--red); border-radius: 12px; padding: 16px; font-size: 1.2em; }
#start:active { transform: translateY(3px); box-shadow: 0 3px 0 var(--deep); }
#start:disabled { opacity: .7; }
.link { background: none; color: var(--cream); text-decoration: underline; padding: 6px 0; font-weight: 400; font-size: .9em; }
#message { text-align: center; font-weight: 700; }
#progress { font-family: 'Mountains of Christmas', cursive; font-size: 1.6em; margin: 22px 0 6px; text-align: center; text-shadow: 0 2px 0 var(--deep); }
.bar { height: 18px; background: var(--white); border-radius: 99px; padding: 3px; box-shadow: inset 0 2px 4px #0003; }
.bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--candy); background-size: 34px 34px; transition: width .6s; animation: stripes 1.2s linear infinite; }
@keyframes stripes { to { background-position: 34px 0; } }
#trail { list-style: none; padding: 0; margin: 16px 0; }
#trail li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; margin: 10px 0; border-radius: 14px; background: var(--white); color: var(--ink); box-shadow: 0 4px 0 #0002; }
#trail li .icon { font-size: 1.7em; line-height: 1; }
#trail li.found { background: var(--cream); border-left: 10px solid; border-image: var(--candy) 1; border-radius: 0 14px 14px 0; }
#trail li b { display: block; color: var(--red); }
#trail li small { color: var(--ink); opacity: .85; }
#hud { position: fixed; top: 0; left: 0; right: 0; z-index: 10; background: var(--red); padding: 10px 12px 12px; display: flex; align-items: center; gap: 10px; font-weight: 700; }
#hud::after { content: ''; position: absolute; left: 0; right: 0; bottom: -10px; height: 10px; background: var(--candy); }
#hud #status { flex: 1; }
#hud #count { background: var(--white); color: var(--red); font-weight: 800; border-radius: 99px; padding: 6px 12px; white-space: nowrap; }
#hud button { margin: 0; padding: 10px 14px; }
#ar { position: fixed; inset: 0; overflow: hidden; background: #000; }
#ar a-scene { position: absolute; inset: 0; width: 100%; height: 100%; }
#toast { position: fixed; left: 16px; right: 16px; bottom: 32px; z-index: 20; max-width: 440px; margin: auto; text-align: center; overflow: hidden;
         background: var(--white); color: var(--ink); border-radius: 18px; padding: 26px 16px 18px; box-shadow: 0 10px 40px #0008;
         transform: translateY(calc(100% + 80px)); visibility: hidden; transition: transform .4s cubic-bezier(.2,1.4,.4,1), visibility 0s .4s; }
#toast::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 12px; background: var(--candy); }
#toast.show { transform: none; visibility: visible; transition: transform .4s cubic-bezier(.2,1.4,.4,1); }
#toast .big { font-size: 2.4em; line-height: 1; }
#toast h2 { font-family: 'Mountains of Christmas', cursive; color: var(--red); margin: 6px 0 4px; font-size: 1.8em; line-height: 1.1; }
#toast p { margin: 4px 0 0; }
#toast.finale { background: radial-gradient(circle at 50% 0%, #e0263f, var(--deep)); color: var(--white); }
#toast.finale h2 { color: var(--white); }
[hidden] { display: none !important; }
.cluelink { display: block; text-align: center; margin: 14px 0 0; padding: 12px; border-radius: 12px; border: 2px dashed #fff9; color: var(--white); font-weight: 800; text-decoration: none; }
.cluelink:active { background: #ffffff1a; }
#zoom { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 15; display: flex; align-items: center; gap: 4px;
        background: var(--red); padding: 5px; border-radius: 99px; box-shadow: 0 0 0 4px var(--white), 0 8px 24px #0008; }
#zoom button { margin: 0; width: 54px; height: 54px; padding: 0; border-radius: 50%; font-size: 1.9em; line-height: 1; background: var(--white); color: var(--red); }
#zoom button:disabled { opacity: .45; }
#zoom span { min-width: 58px; text-align: center; font-weight: 800; font-size: 1.15em; color: var(--white); }
body.has-zoom #toast { bottom: 110px; }
/* Phone held sideways: keep the celebration card small and low so it doesn't hide the light */
@media (orientation: landscape) and (max-height: 540px) {
  #toast { max-width: 340px; bottom: 10px; padding: 18px 12px 10px; }
  #toast .big { font-size: 1.5em; }
  #toast h2 { font-size: 1.3em; margin: 2px 0; }
  #toast p { font-size: .9em; }
  body.has-zoom #toast { bottom: 10px; left: 16px; right: auto; margin: 0; }
  #zoom { left: auto; right: 16px; transform: none; bottom: 12px; }
}
#version { display: block; text-align: center; margin: 18px 0 0; font-size: .75em; opacity: .65; }
