* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    touch-action: manipulation;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.swipe-guard {
    position: fixed;
    top: 0; left: 0;
    width: 30px;
    height: 100%;
    z-index: 9999;
}

body {
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #e8d5f5, #f5e6d3, #d5f0e8);
    min-height: 100%;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(255,255,255,0.3);
    backdrop-filter: blur(5px);
    z-index: 100;
}

.back-btn, .fullscreen-btn {
    font-size: 28px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    min-width: 48px;
    min-height: 48px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

h1 {
    font-size: 24px;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    text-align: center;
    flex: 1;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.score {
    font-size: 22px;
    font-weight: 900;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    background: rgba(0,0,0,0.15);
    padding: 4px 12px;
    border-radius: 20px;
    min-width: 40px;
    text-align: center;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    gap: 30px;
}

.shape-display {
    text-align: center;
}

.shape-question {
    font-size: 22px;
    font-weight: 700;
    color: #555;
    margin-bottom: 16px;
}

.shape-item {
    width: 160px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    animation: shapeFloat 3s ease-in-out infinite;
    filter: drop-shadow(4px 4px 8px rgba(0,0,0,0.2));
}

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

.shape-item svg {
    width: 140px;
    height: 140px;
}

.holes {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.hole {
    width: 110px;
    height: 110px;
    border-radius: 20px;
    border: 4px dashed rgba(0,0,0,0.2);
    background: rgba(255,255,255,0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
    user-select: none;
    backdrop-filter: blur(3px);
}

.hole:active {
    transform: scale(0.92);
}

.hole.correct {
    animation: correctPop 0.5s ease;
    background: rgba(100, 255, 100, 0.4);
    border-color: rgba(0, 180, 0, 0.5);
}

@keyframes correctPop {
    0% { transform: scale(1); }
    30% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.hole.wrong {
    animation: wrongShake 0.4s ease;
    background: rgba(255, 100, 100, 0.3);
    border-color: rgba(255, 0, 0, 0.3);
}

@keyframes wrongShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
}

.hole svg {
    width: 60px;
    height: 60px;
}

.hole-label {
    font-size: 16px;
    font-weight: 700;
    color: #555;
    margin-top: 4px;
}

.confetti-container {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 300;
}

.confetti-piece {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    animation: confettiFall 2s ease-in forwards;
}

@keyframes confettiFall {
    0% { transform: translateY(-10px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

.celebration-text {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 42px;
    font-weight: 900;
    color: #fff;
    text-shadow: 3px 3px 0 rgba(0,0,0,0.2);
    z-index: 301;
    animation: celebPop 2s ease-out forwards;
    text-align: center;
}

@keyframes celebPop {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    30% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
    60% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

/* Floating background shapes */
.bg-shape {
    position: fixed;
    opacity: 0.08;
    font-size: 40px;
    pointer-events: none;
    animation: floatBg 10s ease-in-out infinite;
    z-index: 0;
}

@keyframes floatBg {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(15deg); }
}