/* ---------------------------------------------------------------
   Save the Date — arcade shell
   The canvas renders at 480x270 and is scaled up with nearest-neighbour
   so the pixel art stays crunchy at any screen size.
----------------------------------------------------------------*/

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #0d0812;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

#stage {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 50% 40%, #2a1b3d 0%, #150e1f 55%, #0d0812 100%);
}

#game {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  display: block;
  width: 100%;
  height: auto;
  max-width: 100vw;
  max-height: 100vh;
  aspect-ratio: 16 / 9;
  background: #6ec0ff;
  box-shadow: 0 0 0 2px #000, 0 0 60px rgba(255, 120, 190, .18);
}

/* --- Overlays ------------------------------------------------- */

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  padding: 16px;
  animation: fadeIn .45s ease both;
}
.overlay[hidden] { display: none; }

@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }

/* --- Title ---------------------------------------------------- */

#title {
  background:
    linear-gradient(rgba(10, 6, 18, .82), rgba(10, 6, 18, .93));
  text-align: center;
  color: #fff;
}

.title-inner { max-width: 90%; }

.kicker {
  color: #ffb3d9;
  font-size: clamp(9px, 2.4vw, 13px);
  letter-spacing: .3em;
  text-transform: uppercase;
  margin: 0 0 10px;
}

.logo {
  margin: 0;
  line-height: .92;
  font-size: clamp(34px, 11vw, 82px);
  font-weight: 900;
  letter-spacing: .04em;
  color: #ffe27a;
  text-shadow:
    0 4px 0 #d4763a,
    0 8px 0 #7c2d12,
    0 10px 24px rgba(0, 0, 0, .6);
}
.logo span { color: #ff7bb0; text-shadow: 0 4px 0 #b02a63, 0 8px 0 #6b0f36, 0 10px 24px rgba(0,0,0,.6); }

.mission {
  margin: 18px 0 22px;
  color: #cfc6dd;
  font-size: clamp(10px, 2.8vw, 14px);
  letter-spacing: .08em;
}

.big-btn {
  font: inherit;
  font-weight: 700;
  font-size: clamp(13px, 3.4vw, 18px);
  letter-spacing: .18em;
  color: #1a1024;
  background: #ffe27a;
  border: 0;
  border-bottom: 5px solid #b8862c;
  border-radius: 4px;
  padding: 14px 30px;
  cursor: pointer;
  animation: blink 1.1s steps(2) infinite;
}
.big-btn:active { transform: translateY(3px); border-bottom-width: 2px; }
@keyframes blink { 50% { opacity: .55 } }

.hint {
  margin: 20px 0 0;
  color: #8a80a0;
  font-size: clamp(9px, 2.4vw, 12px);
  line-height: 1.7;
}

/* --- Skip / mute ---------------------------------------------- */

#skipBtn, #muteBtn {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  z-index: 30;
  font: inherit;
  font-size: 11px;
  letter-spacing: .12em;
  color: #d8d2e6;
  background: rgba(12, 8, 20, .62);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  padding: 7px 13px;
  cursor: pointer;
  backdrop-filter: blur(4px);
}
#skipBtn { right: max(10px, env(safe-area-inset-right)); }
#muteBtn { right: calc(max(10px, env(safe-area-inset-right)) + 78px); padding: 7px 11px; }
#skipBtn:hover, #muteBtn:hover { background: rgba(255, 255, 255, .16); color: #fff; }
#muteBtn.off { opacity: .45; text-decoration: line-through; }

/* --- Touch controls ------------------------------------------- */

#touch {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 25;
  display: flex;
  justify-content: space-between;
  padding: 0 max(12px, env(safe-area-inset-left)) max(14px, env(safe-area-inset-bottom))
              max(12px, env(safe-area-inset-right));
  pointer-events: none;
}
#touch[hidden] { display: none; }

.pad { display: flex; gap: 10px; align-items: flex-end; }

.tbtn {
  pointer-events: auto;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .3);
  background: rgba(20, 14, 30, .5);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
  user-select: none;
  cursor: pointer;
}
.tbtn.act { background: rgba(255, 123, 176, .28); border-color: rgba(255, 180, 210, .5); }
.tbtn.held { background: rgba(255, 226, 122, .55); transform: scale(.93); }

/* --- Reveal --------------------------------------------------- */

#reveal {
  background: linear-gradient(160deg, #fdf7f0 0%, #f7e9ef 100%);
  overflow-y: auto;
}

.reveal-card {
  text-align: center;
  color: #3a2f33;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  padding: 28px 20px;
  max-width: 520px;
  animation: rise .8s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(22px) } to { opacity: 1; transform: none } }

.save {
  font-family: ui-monospace, monospace;
  letter-spacing: .42em;
  font-size: clamp(9px, 2.6vw, 12px);
  color: #b08a5e;
  margin: 0 0 14px;
  text-indent: .42em;
}

.names {
  margin: 0;
  font-size: clamp(30px, 8.5vw, 52px);
  font-weight: 400;
  line-height: 1.15;
  color: #2b2226;
}

.rule {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px auto;
  max-width: 260px;
  color: #d98aa8;
}
.rule::before, .rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, #dcc2ad, transparent);
}

.date  { margin: 0; font-size: clamp(17px, 4.6vw, 24px); letter-spacing: .02em; }
.time  { margin: 6px 0 20px; font-size: clamp(12px, 3.2vw, 15px); color: #7d6b72; font-style: italic; }
.venue { margin: 0; font-size: clamp(15px, 4vw, 20px); font-weight: 600; }
.addr  { margin: 4px 0 0; font-size: clamp(12px, 3.2vw, 15px); color: #7d6b72; }
.note  { margin: 22px auto 0; font-size: clamp(11px, 3vw, 13px); color: #90808a; font-style: italic; max-width: 34ch; line-height: 1.6; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 26px;
}

.btn {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: .1em;
  text-decoration: none;
  color: #6b5560;
  border: 1px solid #dcc7d1;
  border-radius: 999px;
  padding: 10px 18px;
  transition: all .18s;
}
.btn:hover { background: #fff; border-color: #b98aa0; color: #3a2f33; }
.btn.primary { background: #3a2f33; color: #fdf7f0; border-color: #3a2f33; }
.btn.primary:hover { background: #5a4a50; color: #fff; }
.btn[hidden] { display: none; }

.replay {
  margin-top: 24px;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: .1em;
  background: none;
  border: 0;
  color: #b3a2ab;
  cursor: pointer;
  padding: 6px;
}
.replay:hover { color: #6b5560; }

/* Landscape phones: keep the reveal readable without cramping */
@media (max-height: 430px) {
  .reveal-card { padding: 16px; }
  .rule { margin: 10px auto; }
  .note { margin-top: 12px; }
  .actions { margin-top: 14px; }
  .tbtn { width: 48px; height: 48px; font-size: 17px; }
}
