/* Maid Cafe Tactics — Main Styles */

@import url('https://fonts.googleapis.com/css2?family=Black+Ops+One&family=Pacifico&family=Nunito:wght@400;600;700&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --pink-light: #ffe4f0;
  --pink-mid: #f9a8d4;
  --pink-deep: #ec4899;
  --purple: #c084fc;
  --cream: #fff7f0;
  --text-dark: #3b1a2a;
  --text-mid: #7e3a55;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, var(--pink-light) 0%, var(--cream) 50%, #e0f2fe 100%);
  font-family: 'Nunito', sans-serif;
  color: var(--text-dark);
  overflow-x: clip;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Ctext y='20' font-size='20'%3E🌸%3C/text%3E%3C/svg%3E") 12 12, auto;
}

/* ── Petal canvas ── */
#petal-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* ── Layout ── */
.container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 2rem;
  text-align: center;
}

/* ── Header crown/logo ── */
.crown {
  font-size: 4rem;
  animation: float 3s ease-in-out infinite;
  filter: drop-shadow(0 4px 8px rgba(236, 72, 153, 0.4));
  margin-bottom: 0.5rem;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-12px); }
}

/* ── Main title ── */
h1 {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
  margin-bottom: 0.75rem;
  gap: 0;
  position: relative;
  overflow: visible;
}

.title-maid-cafe {
  font-family: 'Pacifico', cursive;
  font-size: clamp(3rem, 9vw, 6.5rem);
  background: linear-gradient(90deg, var(--pink-deep), var(--purple), var(--pink-deep));
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 4s linear infinite;
  display: block;
  padding: 0.05em 0.6em 0.1em 0.2em;
}

@keyframes shimmer {
  to { background-position: 200% center; }
}

@keyframes maid-cafe-enter {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.title-tactics {
  font-family: 'Black Ops One', cursive;
  font-size: clamp(2.3rem, 6.9vw, 4.85rem);
  color: #1e2d0e;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow:
    2px 2px 0 #3d5a1a,
    4px 4px 0 rgba(0, 0, 0, 0.3);
  display: block;
  align-self: flex-end;
  margin-top: calc(-0.2em + 3px);
  margin-right: calc(-1rem - 30px);
  transform: rotate(-8deg);
  transform-origin: left center;
  animation: tactics-slam 0.45s cubic-bezier(0.15, 0, 0.35, 1.3) 1.15s both;
}

@keyframes tactics-slam {
  0% {
    opacity: 0;
    transform: rotate(-8deg) scale(2.2) translateY(-20px);
    letter-spacing: 0.3em;
    text-shadow: none;
  }
  100% {
    opacity: 1;
    transform: rotate(-8deg) scale(0.92) translateY(5px);
    letter-spacing: 0.03em;
    text-shadow:
      2px 2px 0 #3d5a1a,
      4px 4px 0 rgba(0, 0, 0, 0.3);
  }
}

@keyframes tactics-settle {
  0%   { transform: rotate(-8deg) scale(0.92) translateY(5px);  letter-spacing: 0.03em; }
  55%  { transform: rotate(-8deg) scale(1.02) translateY(-1px); letter-spacing: 0.07em; }
  100% { transform: rotate(-8deg) scale(1)    translateY(0);    letter-spacing: 0.06em; }
}

/* ── Subtitle / typing display ── */
.subtitle {
  font-size: clamp(1rem, 3vw, 1.4rem);
  color: var(--text-mid);
  font-weight: 600;
  min-height: 2em;
  margin-bottom: 0.5rem;
}

.cursor {
  display: inline-block;
  width: 3px;
  height: 1.1em;
  background: var(--pink-deep);
  margin-left: 2px;
  vertical-align: middle;
  animation: blink 0.8s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ── Card wrapper with flanking JP text ── */
.card-wrapper {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 2rem;
  width: 100%;
  justify-content: center;
}

.jp-text {
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-family: 'Hiragino Sans', 'Yu Gothic', 'Meiryo', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--text-mid);
  opacity: 0.55;
  flex-shrink: 0;
  user-select: none;
}

/* ── Card ── */
.card {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 2px solid rgba(249, 168, 212, 0.6);
  border-radius: 24px;
  padding: 2rem 2.5rem;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(236, 72, 153, 0.15);
}

.card p {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-mid);
}

/* ── Magic button ── */
.btn-magic {
  position: relative;
  padding: 0.85rem 2.2rem;
  font-family: 'Nunito', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--pink-deep), var(--purple));
  border: none;
  border-radius: 50px;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 20px rgba(236, 72, 153, 0.45);
}

.btn-magic:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 8px 28px rgba(236, 72, 153, 0.55);
}

.btn-magic:active {
  transform: translateY(0) scale(0.97);
}

.btn-magic::after {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, #fff 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
  border-radius: inherit;
}

.btn-magic:hover::after {
  opacity: 0.12;
}

/* ── Burst hearts from button ── */
.heart-burst {
  position: fixed;
  pointer-events: none;
  font-size: 1.4rem;
  z-index: 100;
  animation: burst 1s ease-out forwards;
}

@keyframes burst {
  0%   { transform: translate(0, 0) scale(1);   opacity: 1; }
  100% { transform: translate(var(--tx), var(--ty)) scale(0.3); opacity: 0; }
}

/* ── Footer ── */
footer {
  position: relative;
  z-index: 1;
  padding: 1rem;
  font-size: 0.85rem;
  color: var(--text-mid);
  opacity: 0.7;
}

footer a {
  color: var(--text-mid);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s;
}

footer a:hover {
  color: var(--pink-deep);
}

/* ── Canvas glitch on TACTICS slam ── */
@keyframes canvas-glitch {
  0%   { transform: translate(0,0);      filter: none; }
  12%  { transform: translate(-4px, 2px); filter: hue-rotate(90deg) saturate(4) brightness(1.3); }
  24%  { transform: translate(4px,-3px); filter: hue-rotate(200deg) invert(0.25) saturate(3); }
  36%  { transform: translate(-3px, 3px); filter: hue-rotate(320deg) saturate(5) brightness(0.8); }
  48%  { transform: translate(3px,-2px); filter: hue-rotate(140deg) invert(0.15) brightness(1.4); }
  60%  { transform: translate(-2px, 2px); filter: hue-rotate(60deg) saturate(3); }
  72%  { transform: translate(2px,-1px); filter: hue-rotate(20deg) brightness(1.2); }
  84%  { transform: translate(-1px, 1px); filter: saturate(1.5); }
  100% { transform: translate(0,0);      filter: none; }
}

.canvas-glitch {
  animation: canvas-glitch 0.38s steps(1) forwards;
}

/* ── TACTICS slam debris (JS-injected) ── */
.slam-particle {
  position: fixed;
  pointer-events: none;
  z-index: 50;
  border-radius: 30%;
  animation: slam-particle-fly var(--dur) ease-out forwards;
}

@keyframes slam-particle-fly {
  0%   { transform: translate(0, 0) scale(1) rotate(0deg); opacity: 0.85; }
  100% { transform: translate(var(--tx), var(--ty)) scale(0) rotate(var(--rot)); opacity: 0; }
}

@keyframes crown-glitch {
  0%   { filter: hue-rotate(90deg)  saturate(5)  brightness(1.5);            transform: translateY(0) translate(-4px, 3px); }
  14%  { filter: hue-rotate(200deg) invert(0.35) saturate(4);                transform: translateY(0) translate(4px, -3px); }
  28%  { filter: hue-rotate(300deg) saturate(5)  brightness(0.7);            transform: translateY(0) translate(-3px, 4px); }
  42%  { filter: hue-rotate(150deg) invert(0.25) brightness(1.6);            transform: translateY(0) translate(3px, -2px); }
  57%  { filter: hue-rotate(60deg)  saturate(3);                             transform: translateY(0) translate(-2px, 2px); }
  71%  { filter: hue-rotate(20deg)  brightness(1.3);                         transform: translateY(0) translate(1px, -1px); }
  85%  { filter: hue-rotate(10deg)  saturate(1.5);                           transform: translateY(0) translate(-1px, 1px); }
  100% { filter: none;                                                        transform: translateY(0) translate(0, 0); }
}

@keyframes glitch-red-flash {
  0%   { opacity: 0; }
  10%  { opacity: 1;   background: rgba(200, 20, 20, 0.35); }
  25%  { opacity: 0.7; background: rgba(180, 0,  0,  0.28); }
  40%  { opacity: 1;   background: rgba(220, 30, 30, 0.4);  }
  55%  { opacity: 0.6; background: rgba(190, 10, 10, 0.3);  }
  70%  { opacity: 0.4; background: rgba(200, 20, 20, 0.2);  }
  85%  { opacity: 0.2; }
  100% { opacity: 0; }
}

.crown-glitching {
  animation: float 3s ease-in-out infinite, crown-glitch 0.38s steps(1) forwards !important;
}

.glitch-red-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  animation: glitch-red-flash 0.38s steps(1) forwards;
}

@keyframes slam-shake {
  0%, 100% { transform: translate(0, 0); }
  20%       { transform: translate(-5px, 3px); }
  40%       { transform: translate(5px, -3px); }
  60%       { transform: translate(-3px, 2px); }
  80%       { transform: translate(2px, -1px); }
}

/* ── Sparkle trail (JS-injected) ── */
.sparkle {
  position: fixed;
  pointer-events: none;
  z-index: 200;
  border-radius: 50%;
  animation: sparkle-fade 0.7s ease-out forwards;
}

@keyframes sparkle-fade {
  0%   { transform: scale(1) translateY(0);   opacity: 0.9; }
  100% { transform: scale(0) translateY(-20px); opacity: 0; }
}
