/* ATOM Christmas Village prototype: layout and UI over the canvas world */
:root {
  --navy: #0b1033;
  --glass: rgba(16, 26, 110, .82);
  --lime: #abff35;
  --pink: #ff4f9a;
  --text: #fff;
  --f-ui: 'Noto Sans Myanmar', 'Outfit', system-ui, sans-serif;
  --f-num: 'Outfit', 'Noto Sans Myanmar', system-ui, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: #05071c; color: var(--text); font-family: var(--f-ui);
  display: grid; place-items: center; overflow: hidden;
  -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
}
.frame {
  position: relative; overflow: hidden; background: var(--navy);
  width: 100vw; height: 100vh; height: 100dvh;
}
@media (min-aspect-ratio: 10/16) {
  /* computers and tablets: a 9:16 phone-shaped frame */
  .frame { width: min(100vw, calc(100dvh * 9 / 16)); border-radius: 18px; box-shadow: 0 0 60px rgba(80, 120, 255, .25); }
}
#world { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: block; touch-action: none; }
[hidden] { display: none !important; }

/* HUD */
.hud { position: absolute; top: 0; left: 0; right: 0; padding: calc(10px + var(--safe-t)) 10px 0; pointer-events: none; }
.minimap { width: 76px; height: 76px; border-radius: 50%; border: 2px solid rgba(171, 255, 53, .7); background: rgba(5, 8, 40, .7); }
.hud-right { position: absolute; top: calc(10px + var(--safe-t)); right: 10px; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.pill { font-family: var(--f-num); font-weight: 800; font-size: 16px; padding: 4px 12px; border-radius: 999px; background: var(--glass); border: 2px solid rgba(140, 210, 255, .45); }
.pill-tree { border-color: rgba(171, 255, 53, .6); }
.pill.bump { animation: bump .35s ease; }
@keyframes bump { 50% { transform: scale(1.18); } }
.goal { margin: 8px auto 0; max-width: 330px; text-align: center; font-size: 13px; font-weight: 600; line-height: 1.7; padding: 4px 12px; border-radius: 12px; background: rgba(5, 8, 40, .62); }

/* joystick */
.stick { position: absolute; width: 110px; height: 110px; margin: -55px 0 0 -55px; border-radius: 50%; background: rgba(255, 255, 255, .1); border: 2px solid rgba(255, 255, 255, .35); pointer-events: none; }
.stick i { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%; background: rgba(255, 255, 255, .85); box-shadow: 0 4px 12px rgba(0, 0, 0, .4); }

/* buttons */
.btn { font-family: var(--f-ui); font-weight: 700; font-size: 16px; line-height: 1.6; color: #fff; border: 0; border-radius: 16px; padding: 10px 20px; cursor: pointer; touch-action: manipulation; }
.btn-go { background: linear-gradient(180deg, #ff7ab8, var(--pink) 55%, #d81f72); box-shadow: 0 5px 0 #8e1149, 0 10px 20px rgba(0, 0, 0, .35); }
.btn-go:active { transform: translateY(3px); box-shadow: 0 2px 0 #8e1149; }
.btn-ghost { background: rgba(10, 22, 120, .9); box-shadow: inset 0 0 0 2px rgba(140, 210, 255, .55); }
.action {
  position: absolute; right: 16px; bottom: calc(26px + var(--safe-b)); min-width: 120px;
  font-family: var(--f-ui); font-weight: 800; font-size: 16px; line-height: 1.6; color: #23300a;
  padding: 12px 18px; border: 0; border-radius: 999px; background: var(--lime);
  box-shadow: 0 5px 0 #5d8a12, 0 0 24px rgba(171, 255, 53, .55); animation: pulse 1.4s ease-in-out infinite; touch-action: manipulation;
}
@keyframes pulse { 50% { transform: scale(1.06); } }

/* panel */
.panel {
  position: absolute; left: 10px; right: 10px; bottom: calc(14px + var(--safe-b)); padding: 14px 16px 12px;
  border-radius: 20px; background: var(--glass); border: 2px solid rgba(140, 210, 255, .45);
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, .7); display: flex; flex-direction: column; gap: 8px;
}
.panel-who { margin: 0; font-size: 13px; font-weight: 800; color: var(--lime); }
.panel-text { margin: 0; text-wrap: pretty; font-size: 15px; font-weight: 600; line-height: 1.8; }
.panel-choices { display: flex; flex-direction: column; gap: 8px; }
.panel-choices:empty { display: none; }
.panel-choices .btn { text-align: left; font-size: 15px; }
.panel > .btn-ghost { align-self: flex-end; padding: 6px 16px; font-size: 14px; }

.toast { position: absolute; left: 50%; top: 32%; transform: translateX(-50%); padding: 8px 16px; border-radius: 14px; background: rgba(5, 8, 40, .82); font-size: 14px; font-weight: 700; width: max-content; max-width: calc(100% - 24px); white-space: normal; text-align: center; line-height: 1.7; pointer-events: none; animation: toast 1.8s ease forwards; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, 8px); } 15%, 75% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }

/* title and finish */
.screen { position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: grid; place-items: center; padding: 20px; overflow-y: auto; background: radial-gradient(ellipse at 50% 40%, rgba(11, 16, 51, .35), rgba(5, 7, 28, .88)); }
.title-card { width: min(340px, 100%); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.kicker { margin: 0; font-family: var(--f-num); font-size: 13px; font-weight: 800; color: #23300a; background: var(--lime); padding: 2px 14px; border-radius: 999px; }
h1 { margin: 6px 0 0; font-size: 30px; font-weight: 800; line-height: 1.6; text-shadow: 0 3px 0 rgba(4, 6, 70, .6), 0 0 24px rgba(255, 220, 140, .45); }
.end-h { font-size: min(21px, 5.4vw); }
.sub { margin: 0; font-family: var(--f-num); font-weight: 700; color: rgba(255, 255, 255, .75); }
.choose { margin: 14px 0 0; font-size: 14px; font-weight: 600; }
.cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; }
.cat { padding: 6px 4px 2px; border-radius: 16px; border: 2px solid rgba(140, 210, 255, .35); background: rgba(10, 22, 120, .7); cursor: pointer; }
.cat img { width: 100%; height: 72px; object-fit: contain; display: block; }
.cat[aria-pressed=true] { border-color: var(--lime); box-shadow: 0 0 18px rgba(171, 255, 53, .5); background: rgba(40, 60, 160, .9); }
#btn-start { margin-top: 14px; min-width: 200px; font-size: 18px; }
.proto { margin: 10px 0 0; font-family: var(--f-num); font-size: 11px; color: rgba(255, 255, 255, .5); }
.end-img { width: min(260px, 70%); border-radius: 14px; margin-top: 6px; box-shadow: 0 12px 30px rgba(0, 0, 0, .5); }
.tags { margin: 4px 0 0; font-family: var(--f-num); font-weight: 700; font-size: 14px; color: var(--lime); }
.end-actions { display: flex; flex-direction: column; gap: 10px; width: 100%; margin-top: 6px; }
