:root {
  --bg: #f3e7d3;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: Inter, Segoe UI, system-ui, -apple-system, sans-serif;
  background: var(--bg);
}

.app {
  width: 100vw;
  min-height: 100dvh;
  margin: 0;
  padding: max(6px, env(safe-area-inset-top)) max(6px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
}

.card {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

h1,
h2,
p {
  margin: 0;
}

.hud,
.meta-row {
  display: none;
}

.btn,
.status,
.pill {
  display: none;
}

#nextLevelBtn {
  display: none;
}

#nextLevelBtn:disabled {
  opacity: 0.55;
  cursor: default;
}

.game-card {
  padding: 0;
  flex: 1;
  min-height: 0;
  position: relative;
}

#gameRoot {
  width: 100%;
  height: 100%;
  min-height: 0;
}

#gameRoot canvas {
  display: block;
  margin: 0 auto;
  border-radius: 0;
  border: 0;
}

.result-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 10, 7, 0.52);
  z-index: 20;
  padding: 16px;
}

.result-overlay[hidden] {
  display: none !important;
}

.result-popup {
  width: min(92vw, 420px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.result-image {
  width: min(84vw, 360px);
  height: auto;
  display: block;
  position: relative;
  z-index: 2;
}

.result-banner-wrap {
  position: relative;
  width: 110%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -52px;
  z-index: 3;
}

.result-banner {
  width: 100%;
  height: auto;
  display: block;
}

.result-title {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fredoka', sans-serif;
  font-weight: 900;
  font-size: clamp(52px, 8vw, 72px);
  color: #ffffff;
  text-transform: uppercase;
  font-variant: small-caps;
  -webkit-text-stroke: 2px rgba(0, 0, 0, 0.25);
  text-shadow:
    0 3px 6px rgba(0, 0, 0, 0.35),
    0 1px 0 rgba(0, 0, 0, 0.2);
  letter-spacing: 2px;
  pointer-events: none;
  user-select: none;
}

.result-btn-row {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  justify-content: center;
  z-index: 3;
}

.result-btn {
  position: relative;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease;
}

.result-btn:hover {
  transform: scale(1.06);
}

.result-btn:active {
  transform: scale(0.96);
}

.result-btn-bg {
  width: min(38vw, 180px);
  height: auto;
  display: block;
}

.result-btn-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: clamp(36px, 5vw, 46px);
  color: #ffffff;
  -webkit-text-stroke: 1px rgba(0, 0, 0, 0.18);
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.3),
    0 1px 0 rgba(0, 0, 0, 0.15);
  letter-spacing: 1px;
  pointer-events: none;
  user-select: none;
  padding-bottom: 4px;
}