/* ---------- Base Reset ---------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Orbitron', 'Segoe UI', sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(-45deg, #0f0c29, #302b63, #24243e, #0f0c29);
    background-size: 400% 400%;
    animation: bgGradient 20s ease infinite;
    overflow: hidden;
    perspective: 1000px;
    color: #fff;
}

/* ---------- Background gradient animation ---------- */
@keyframes bgGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ---------- Card ---------- */
.app {
    position: relative;
    width: 100%;
    max-width: 500px;
    background: rgba(0,0,0,0.7);
    border-radius: 25px;
    padding: 35px;
    box-shadow: 0 0 30px rgba(0,255,255,0.5), inset 0 0 20px rgba(0,255,255,0.2);
    border: 2px solid #0ff;
    transform-style: preserve-3d;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    animation: cardGlow 2s infinite alternate;
}

.app:hover {
    transform: rotateY(10deg) rotateX(5deg) scale(1.02);
    box-shadow: 0 0 50px #0ff, 0 0 80px #0ff inset;
}

@keyframes cardGlow {
    0% { box-shadow: 0 0 30px #0ff, inset 0 0 15px #0ff; }
    50% { box-shadow: 0 0 50px #ff00ff, inset 0 0 25px #ff00ff; }
    100% { box-shadow: 0 0 30px #0ff, inset 0 0 15px #0ff; }
}

/* ---------- Headings ---------- */
h2 {
    text-align: center;
    font-size: 2rem;
    color: #0ff;
    text-shadow: 0 0 10px #0ff, 0 0 20px #ff00ff;
    animation: textColorCycle 5s linear infinite;
}

.subtitle {
    text-align: center;
    font-size: 0.9rem;
    color: #66fcf1;
    margin: 8px 0 18px;
    text-shadow: 0 0 5px #66fcf1;
}

/* ---------- Hero Image ---------- */
.hero-img {
    width: 100%;
    border-radius: 14px;
    margin-bottom: 20px;
    box-shadow: 0 0 30px #0ff, 0 0 60px #ff00ff inset;
    transform-style: preserve-3d;
    transition: transform 0.6s ease, box-shadow 0.6s ease;
    animation: floatImg 6s ease-in-out infinite;
}

.hero-img:hover {
    transform: rotateY(15deg) rotateX(5deg) scale(1.05);
    box-shadow: 0 0 50px #ff00ff, 0 0 100px #0ff inset;
}

@keyframes floatImg {
    0%,100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ---------- Input ---------- */
label {
    font-size: 0.85rem;
    color: #66fcf1;
    text-shadow: 0 0 3px #0ff;
}

input[type="number"] {
    width: 100%;
    margin-top: 6px;
    padding: 14px;
    border-radius: 12px;
    background: rgba(0,0,0,0.5);
    border: 2px solid #0ff;
    color: #fff;
    font-size: 1rem;
    font-weight: bold;
    outline: none;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px #0ff;
    animation: inputBorderCycle 6s linear infinite;
}

input[type="number"]:focus {
    transform: scale(1.03);
    box-shadow: 0 0 20px #ff00ff, 0 0 40px #0ff inset;
}

/* ---------- Buttons ---------- */
.actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin: 24px 0;
    perspective: 600px;
}

.btn {
    padding: 14px;
    border-radius: 15px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: bold;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    border: 2px solid #0ff;
    background: transparent;
    color: #0ff;
    transform-style: preserve-3d;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: rotateX(5deg) rotateY(5deg) scale(1.05);
    box-shadow: 0 0 30px #0ff, 0 0 60px #ff00ff inset;
    color: #000;
    background: #0ff;
}

/* Ripple effect */
.btn::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0;
    height: 0;
    background: rgba(255,0,255,0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
    z-index: 0;
}

.btn:hover::after {
    width: 300%;
    height: 300%;
}

/* ---------- Result Box ---------- */
.result {
    background: rgba(0,0,0,0.5);
    border-radius: 16px;
    padding: 18px;
    font-size: 1rem;
    line-height: 1.4;
    color: #0ff;
    border: 2px solid #ff00ff;
    min-height: 80px;
    white-space: pre-wrap;
    text-shadow: 0 0 10px #0ff, 0 0 20px #ff00ff;
    animation: resultGlow 3s linear infinite;
    transform-style: preserve-3d;
}

/* ---------- Animations ---------- */
@keyframes bgColorCycle { 0%,100% {filter:hue-rotate(0deg);} 50% {filter:hue-rotate(360deg);} }
@keyframes textColorCycle { 0%,100% {color:#0ff;} 25% {color:#ff00ff;} 50% {color:#f0f;} 75% {color:#0ff;} }
@keyframes inputBorderCycle { 0%,100% {border-color:#0ff;} 25% {border-color:#f0f;} 50% {border-color:#ff00ff;} 75% {border-color:#0ff;} }
@keyframes resultGlow { 0%,100% {box-shadow:0 0 10px #0ff, 0 0 20px #ff00ff;} 50% {box-shadow:0 0 30px #ff00ff, 0 0 50px #0ff;} }
