:root {
  --pink: #ff8ab5;
  --pink-dark: #e85a8a;
  --ink: #4a3040;
  --muted: #7a5a6a;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  touch-action: none;
}

html,
body {
  margin: 0;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  font-family: "Jua", system-ui, sans-serif;
  background: linear-gradient(160deg, #ffd6e8 0%, #ffe8f0 40%, #fff0f5 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}

.app {
  position: relative;
  width: min(100vw, calc(100dvh * 0.609));
  height: min(100dvh, calc(100vw / 0.609));
  max-width: 420px;
  border-radius: 22px;
  overflow: hidden;
  box-shadow:
    0 20px 50px rgba(200, 100, 140, 0.35),
    inset 0 0 0 3px rgba(255, 255, 255, 0.6);
  background: linear-gradient(180deg, #fff5f8, #ffe4ec);
}

canvas#game {
  display: block;
  width: 100%;
  height: 100%;
}

.hud {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
  z-index: 3;
}

.panel {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(8px);
  border-radius: 16px;
  padding: 8px 14px;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 14px;
  min-width: 96px;
  box-shadow: 0 4px 12px rgba(255, 150, 180, 0.2);
}

.panel.right {
  align-items: center;
  min-width: 72px;
  padding: 6px 10px;
}

.panel b {
  font-size: 18px;
  color: var(--pink-dark);
}

#preview {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
}

.danger-label {
  position: absolute;
  top: 88px;
  right: 14px;
  font-size: 11px;
  color: rgba(220, 80, 100, 0.7);
  pointer-events: none;
  z-index: 2;
  letter-spacing: 0.05em;
}

.control-help {
  position: absolute;
  left: 50%;
  bottom: 12px;
  z-index: 3;
  width: max-content;
  max-width: calc(100% - 28px);
  transform: translateX(-50%);
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(200, 100, 140, 0.14);
}

.control-help b {
  color: var(--pink-dark);
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at 50% 15%, rgba(255, 255, 255, 0.7), transparent 55%),
    linear-gradient(180deg, rgba(255, 220, 230, 0.96), rgba(255, 240, 245, 0.98));
}

.overlay.hidden {
  display: none;
}

.badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--pink), #ff6b9d);
  color: #fff;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  margin-bottom: 8px;
  letter-spacing: 0.08em;
}

.badge.soft {
  background: linear-gradient(135deg, #6fd6b0, #4ec99a);
}

.title-thumb {
  border-radius: 24px;
  margin-bottom: 8px;
  box-shadow: 0 8px 0 rgba(200, 100, 140, 0.25);
}

h1 {
  margin: 0;
  font-family: "Bagel Fat One", "Jua", cursive;
  font-weight: 400;
  font-size: clamp(30px, 8vw, 42px);
  color: var(--pink-dark);
  text-shadow: 0 3px 0 #fff;
}

.overlay p {
  margin: 8px 0 14px;
  color: var(--muted);
  line-height: 1.5;
}

.title-controls {
  display: grid;
  gap: 5px;
  margin: -2px 0 14px;
  padding: 9px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--muted);
  font-size: 13px;
}

.icons {
  font-size: 26px;
  letter-spacing: 4px;
  margin-bottom: 16px;
}

.btn {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 13px 34px;
  font: inherit;
  font-size: 18px;
  color: #fff;
  background: linear-gradient(180deg, #ff9ec0, var(--pink));
  box-shadow: 0 7px 0 var(--pink-dark);
  cursor: pointer;
}

.btn:active {
  transform: translateY(3px);
  box-shadow: 0 4px 0 var(--pink-dark);
}

.home {
  margin-top: 12px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}
