html { scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }
body { margin: 0; background: #201e20; color: #faf5ed; font-family: "Trebuchet MS", system-ui, sans-serif; }
[hidden] { display: none !important; }
#unity-container {
  --view-height: 100vh;
  --top: env(safe-area-inset-top, 0px);
  --bottom: env(safe-area-inset-bottom, 0px);
  height: var(--view-height);
  box-sizing: border-box;
  padding: var(--top) env(safe-area-inset-right, 0px) var(--bottom) env(safe-area-inset-left, 0px);
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  background: #201e20;
}
@supports (height: 100dvh) { #unity-container { --view-height: 100dvh; } }
#game-frame {
  position: relative;
  width: min(100%, calc((var(--view-height) - var(--top) - var(--bottom)) * 16 / 9));
  aspect-ratio: 16 / 9;
  container-type: inline-size;
}
#unity-fullscreen-container, #unity-canvas, #unity-loading-container { position: absolute; inset: 0; width: 100%; height: 100%; }
#unity-canvas { display: block; touch-action: none; background: #231F20; }
#unity-loading-container {
  display: grid;
  place-items: center;
  color: #412b23;
  background-color: #27544d;
  background-image: radial-gradient(circle, #89aa94 0 1px, transparent 1.7px),
                    radial-gradient(circle, #669385 0 1.3px, transparent 2px);
  background-size: 3.1cqw 4.2cqw, 7.1cqw 6.4cqw;
  background-position: .8cqw 0, 2cqw 2cqw;
}
.postcard {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: center;
  grid-template-columns: 34% minmax(0, 1fr);
  gap: 4%;
  box-sizing: border-box;
  width: 91%;
  height: 83%;
  padding: 2% 5%;
  border: .7cqw solid transparent;
  border-radius: 1.35cqw;
  background: linear-gradient(#fff4d9, #fff0ce) padding-box,
              repeating-linear-gradient(45deg, #a63c31 0 1cqw, #ffedcc 1cqw 2cqw, #427262 2cqw 3cqw, #ffedcc 3cqw 4cqw) border-box;
  box-shadow: .65cqw .85cqw 0 #173d37;
}
.winter-scene { position: relative; width: 100%; height: 86%; }
.winter-scene img, .snowbank { position: absolute; }
.snowbank { left: 1%; right: 2%; bottom: 1%; height: 7%; background: #e2d0aa; border-radius: 50%; }
.fir-tree { left: 14%; bottom: 12%; width: 70%; height: 75%; }
.fir-pot { left: 39%; bottom: 3%; width: 21%; height: 13%; }
.fir-lights { left: 0%; bottom: 10.5%; width: 81%; height: 71%; }
.fir-star { left: 40%; top: 1%; width: 16%; height: 16%; transform: rotate(8deg); }
.little-cookie { right: 0; bottom: 3%; width: 26%; transform: rotate(8deg); }
.instructions { display: flex; flex-direction: column; align-items: flex-start; }
.lettering { position: relative; width: 60%; margin-bottom: .7cqw; }
.wordmark { width: 100%; display: block; }
.letter-cookie { position: absolute; width: 6.8%; left: 20%; top: -10%; }
h1 { font: bold clamp(15px, 3.05cqw, 62px)/1.06 Georgia, serif; margin: 0 0 1.1cqw; color: #533126; }
.instructions p { margin: 0; font-size: clamp(11px, 1.8cqw, 32px); line-height: 1.36; }
#language-tip { margin-top: 1cqw; color: #5c5343; }
.loading-state { width: 100%; display: grid; grid-template-columns: 1fr auto; align-items: end; gap: .45cqw; margin-top: 2.5cqw; font-size: clamp(10px, 1.45cqw, 23px); color: #2f584d; font-weight: bold; }
#percentage { font-variant-numeric: tabular-nums; }
progress { appearance: none; grid-column: 1 / -1; width: 100%; height: max(5px, .85cqw); border: 0; border-radius: 100px; overflow: hidden; background: #dfceb1; }
progress::-webkit-progress-bar { background: #dfceb1; }
progress::-webkit-progress-value { background: #a33e31; }
progress::-moz-progress-bar { background: #a33e31; }
#rotate-hint { display: none; }
@media (any-pointer: coarse) and (orientation: portrait) {
  #rotate-hint { display: block; position: absolute; top: 100%; width: 100%; margin: 1rem 0; text-align: center; }
}
@container (max-width: 530px) {
  .postcard { width: 95%; height: 91%; padding: 2% 4%; grid-template-columns: 27% minmax(0, 1fr); gap: 4%; }
  .winter-scene { height: 71%; }
  .lettering { width: 41%; }
  .loading-state { margin-top: 1.4cqw; }
}
@media (max-width: 600px) and (orientation: portrait) {
  #game-frame:has(#unity-loading-container:not([hidden])) { width: 100%; height: 100%; aspect-ratio: auto; }
  #game-frame:has(#unity-loading-container:not([hidden])) #rotate-hint { display: none; }
  .postcard { width: min(92%, 440px); height: min(92%, 630px); grid-template: minmax(0, 1fr) auto / 1fr; gap: 1rem; padding: 1.1rem 1.4rem 1.4rem; }
  .winter-scene { width: auto; height: 100%; max-width: 70%; aspect-ratio: .83; justify-self: center; }
  .lettering { width: min(56%, 165px); margin-bottom: .6rem; }
  h1 { font-size: clamp(22px, 6vw, 32px); margin-bottom: .5rem; }
  .instructions p { font-size: clamp(15px, 4vw, 18px); }
  #language-tip { margin-top: .5rem; }
  .loading-state { font-size: 14px; margin-top: 1.1rem; gap: .35rem; }
  progress { height: 7px; }
}
#unity-footer { position: absolute; top: 100%; width: 100%; }
#unity-build-title { float: right; }
#unity-fullscreen-button { border: 0; padding: 0; cursor: pointer; float: right; width: 38px; height: 38px; background: url("fullscreen-button.png") no-repeat center; }
@media (pointer: coarse) { #unity-footer { display: none; } }
#unity-container:fullscreen #unity-footer, #unity-container:-webkit-full-screen #unity-footer { display: none; }
#unity-warning { position: absolute; z-index: 2; top: 3%; left: 5%; right: 5%; max-height: 75%; overflow: auto; }
#unity-warning > div { background: #fff4d9; border: 2px solid #a33e31; padding: .6em 1em; color: #442d27; font: 1rem/1.4 system-ui, sans-serif; }
