/**
 * whackdad.css - Whack-a-Dad game styles
 */

body {
    min-height: 100dvh;
    background: linear-gradient(135deg, #8B4513 0%, #D2691E 100%);
    padding: 15px;
    overflow: hidden;
    position: relative;
}

.header {
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
    z-index: 201;
}

h1 {
    font-size: 1.8rem;
}

.header-buttons {
    display: flex;
    gap: 10px;
}

.back-btn {
    font-size: 1rem;
}

.back-btn:hover, .back-btn:active {
    color: #8B4513;
}

.stats-row {
    justify-content: center;
    margin-bottom: 15px;
    position: relative;
    z-index: 10;
}

.stat-box {
    min-width: 80px;
}

.stat-box span {
    display: block;
    font-size: 1.6rem;
}

.stat-box.warning {
    animation: idleWarning 0.5s ease infinite;
}

@keyframes idleWarning {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,0,0,0); background: rgba(255,0,0,0.4); }
    50% { box-shadow: 0 0 20px 10px rgba(255,0,0,0.5); background: rgba(255,0,0,0.6); }
}

.lives {
    font-size: 1.4rem !important;
    letter-spacing: 3px;
}

.game-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    max-width: 350px;
    width: 100%;
}

.hole {
    aspect-ratio: 1;
    background: radial-gradient(ellipse at center, #3d2817 0%, #2a1a0f 60%, #1a100a 100%);
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 10px 30px rgba(0,0,0,0.8), 0 5px 15px rgba(0,0,0,0.4);
    cursor: pointer;
}

.hole::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    width: 80%;
    height: 20%;
    background: linear-gradient(to bottom, rgba(139,69,19,0.6), transparent);
    border-radius: 50% 50% 0 0;
}

.target {
    position: absolute;
    bottom: -100%;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    transition: bottom 0.1s ease-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.target.visible {
    bottom: 10%;
    animation: popUp 0.15s ease-out;
}

@keyframes popUp {
    0% { bottom: -100%; }
    100% { bottom: 10%; }
}

.target.hiding {
    animation: popDown 0.1s ease-in forwards;
}

@keyframes popDown {
    0% { bottom: 10%; }
    100% { bottom: -100%; }
}

.target img {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    border: 4px solid white;
    object-fit: cover;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.target.cat {
    font-size: 60px;
    line-height: 1;
}

.target.hit {
    animation: dadHit 0.3s ease forwards;
}

@keyframes dadHit {
    0% { transform: translateX(-50%) scale(1) rotate(0); }
    25% { transform: translateX(-50%) scale(0.8) rotate(-15deg); }
    50% { transform: translateX(-50%) scale(1.1) rotate(10deg); }
    100% { transform: translateX(-50%) scale(1) rotate(0); }
}

.target.cat-hit {
    animation: catScratch 0.5s ease forwards;
}

@keyframes catScratch {
    0%, 100% { transform: translateX(-50%) scale(1); }
    20% { transform: translateX(-40%) scale(1.2) rotate(-10deg); }
    40% { transform: translateX(-60%) scale(1.2) rotate(10deg); }
    60% { transform: translateX(-45%) scale(1.1) rotate(-5deg); }
    80% { transform: translateX(-55%) scale(1.1) rotate(5deg); }
}

/* Golden Dad - gold glow and sparkle */
.target.golden img {
    border-color: gold !important;
    box-shadow: 0 0 15px gold, 0 0 30px rgba(255, 215, 0, 0.6), 0 4px 15px rgba(0,0,0,0.5);
    animation: goldenSparkle 0.4s ease infinite alternate;
}

@keyframes goldenSparkle {
    0% { box-shadow: 0 0 15px gold, 0 0 30px rgba(255, 215, 0, 0.4); }
    100% { box-shadow: 0 0 25px gold, 0 0 45px rgba(255, 215, 0, 0.8); }
}

/* Baby Dad - smaller size */
.target.baby {
    width: 50px !important;
    height: 50px !important;
}

.target.baby img {
    width: 45px !important;
    height: 45px !important;
}

/* Sleepy Dad - grayscale with ZZZ */
.target.sleepy img {
    filter: grayscale(60%) brightness(0.85);
}

.target.sleepy::after {
    content: '\1F4A4';
    position: absolute;
    top: -5px;
    right: -10px;
    font-size: 1.4rem;
    animation: zzzFloat 1.5s ease-in-out infinite;
    z-index: 10;
}

@keyframes zzzFloat {
    0%, 100% { transform: translateY(0) scale(1); opacity: 0.8; }
    50% { transform: translateY(-8px) scale(1.1); opacity: 1; }
}

/* Giant Dad Boss */
.giant-dad-container {
    position: absolute;
    width: calc(66.66% + 15px);
    height: calc(66.66% + 15px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 25;
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.3s, transform 0.3s;
}

.giant-dad-container.visible {
    opacity: 1;
    transform: scale(1);
}

.giant-dad-container img {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 6px solid #ff4444;
    box-shadow: 0 0 30px rgba(255, 68, 68, 0.6), 0 8px 25px rgba(0,0,0,0.5);
    object-fit: cover;
}

.giant-dad-container .boss-badge {
    position: absolute;
    top: 5px;
    right: 15%;
    background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.giant-dad-container .hits-remaining {
    position: absolute;
    bottom: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: #ffd700;
    padding: 6px 16px;
    border-radius: 15px;
    font-weight: bold;
    font-size: 0.9rem;
}

.giant-dad-container.boss-hit {
    animation: bossShake 0.3s ease;
}

@keyframes bossShake {
    0%, 100% { transform: scale(1) rotate(0); }
    25% { transform: scale(0.95) rotate(-5deg); }
    50% { transform: scale(1.05) rotate(5deg); }
    75% { transform: scale(0.98) rotate(-2deg); }
}

.giant-dad-container.boss-defeated {
    animation: bossDefeat 0.5s ease forwards;
}

@keyframes bossDefeat {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2) rotate(10deg); opacity: 0.8; }
    100% { transform: scale(0) rotate(-20deg); opacity: 0; }
}

/* Scratch overlay */
.scratch-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,0,0,0.3);
    pointer-events: none;
    z-index: 100;
    animation: scratchFlash 0.5s ease;
}

@keyframes scratchFlash {
    0%, 100% { opacity: 0; }
    20%, 40%, 60% { opacity: 1; }
    30%, 50%, 70% { opacity: 0.5; }
}

.scratch-marks {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 8rem;
    pointer-events: none;
    z-index: 101;
    animation: scratchAppear 0.5s ease forwards;
}

@keyframes scratchAppear {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); }
}

/* Overlays */
.overlay {
    z-index: 200;
}

.overlay h2 {
    margin-bottom: 10px;
    text-align: center;
}

.overlay .subtitle {
    color: #ffd700;
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.overlay .final-score {
    font-size: 4rem;
    color: #ffd700;
    font-weight: bold;
    margin-bottom: 10px;
}

.overlay p {
    margin-bottom: 25px;
}

.overlay .play-btn {
    padding: 18px 50px;
    margin: 5px;
}

.overlay .play-btn.secondary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Floating text effects */
.hit-text {
    position: fixed;
    font-size: 2.5rem;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 3px 3px 0 #8B4513;
    pointer-events: none;
    animation: hitTextPop 0.6s ease-out forwards;
    z-index: 100;
}

@keyframes hitTextPop {
    0% { transform: scale(0) rotate(-20deg); opacity: 1; }
    50% { transform: scale(1.3) rotate(10deg); opacity: 1; }
    100% { transform: scale(1) translateY(-50px); opacity: 0; }
}

.combo-text {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 4px 4px 0 #8B4513;
    pointer-events: none;
    animation: comboAppear 1s ease forwards;
    z-index: 150;
    text-align: center;
    white-space: nowrap;
}

/* Speech bubble */
.speech-bubble {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 15px 25px;
    border-radius: 20px;
    font-weight: bold;
    color: #8B4513;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    animation: speechPop 0.3s ease;
    z-index: 50;
    max-width: 90%;
    text-align: center;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    border: 15px solid transparent;
    border-top-color: white;
}

/* Combo multiplier colors */
.stat-box.mult-2x {
    background: rgba(255, 215, 0, 0.4);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.stat-box.mult-3x {
    background: rgba(255, 140, 0, 0.5);
    box-shadow: 0 0 15px rgba(255, 140, 0, 0.6);
    animation: multPulse 0.5s ease infinite;
}

.stat-box.mult-4x {
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.5), rgba(255, 215, 0, 0.5));
    box-shadow: 0 0 20px rgba(255, 100, 0, 0.7);
    animation: multPulse 0.3s ease infinite;
}

@keyframes multPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Speed bonus text */
.hit-text.speed-bonus {
    color: #00ffff;
    text-shadow: 3px 3px 0 #006666;
    font-size: 1.8rem;
}

/* Frenzy mode golden glow */
body.frenzy-active::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    box-shadow: inset 0 0 100px 30px rgba(255, 215, 0, 0.4);
    animation: frenzyGlow 0.5s ease infinite alternate;
    z-index: 9999;
}

@keyframes frenzyGlow {
    0% { box-shadow: inset 0 0 80px 20px rgba(255, 215, 0, 0.3); }
    100% { box-shadow: inset 0 0 120px 40px rgba(255, 215, 0, 0.5); }
}

/* Mom target styling */
.target.mom {
    font-size: 60px;
    line-height: 1;
}

/* Mom lecture bubble */
.speech-bubble.mom-lecture {
    background: #ffb6c1;
    color: #8b0000;
}

.speech-bubble.mom-lecture::after {
    border-top-color: #ffb6c1;
}

/* Golden hammer cursor effect */
body.golden-hammer {
    cursor: crosshair;
}

body.golden-hammer::before {
    content: '\1F528';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 5rem;
    opacity: 0.3;
    pointer-events: none;
    animation: goldenPulse 0.5s ease infinite;
    z-index: 9998;
    filter: sepia(1) saturate(5) hue-rotate(10deg);
}

@keyframes goldenPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.3; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.5; }
}

/* Hammer Time disco effect */
body.hammer-time {
    animation: discoHue 0.2s linear infinite;
}

body.hammer-time::before {
    content: '\1F528\1F57A\1F483\1F528';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    pointer-events: none;
    z-index: 9999;
    animation: discoSpin 0.5s linear infinite;
}

@keyframes discoHue {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

@keyframes discoSpin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Disco screen edge glow */
body.hammer-time::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    box-shadow: inset 0 0 100px 50px rgba(255, 0, 255, 0.4);
    animation: discoGlow 0.3s ease infinite alternate;
    z-index: 9997;
}

@keyframes discoGlow {
    0% { box-shadow: inset 0 0 80px 40px rgba(255, 0, 0, 0.4); }
    33% { box-shadow: inset 0 0 80px 40px rgba(0, 255, 0, 0.4); }
    66% { box-shadow: inset 0 0 80px 40px rgba(0, 0, 255, 0.4); }
    100% { box-shadow: inset 0 0 80px 40px rgba(255, 0, 255, 0.4); }
}

@media (max-width: 400px) {
    h1 { font-size: 1.4rem; }
    .game-grid { gap: 10px; max-width: 280px; }
    .target { width: 65px; height: 65px; }
    .target img { width: 60px; height: 60px; }
    .target.cat { font-size: 50px; }
    .stat-box { padding: 6px 12px; min-width: 60px; }
    .stat-box span { font-size: 1.3rem; }
}
