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

:root {
    --electric-blue: #00d4ff;
    --cyber-purple: #b537f2;
    --neon-pink: #ff2e97;
    --dark-bg: #0a0e27;
    --darker: #050814;
    --card-bg: rgba(15, 23, 42, 0.85);
    --border-glow: rgba(0, 212, 255, 0.3);
    --text-primary: #ffffff;
    --text-muted: #94a3b8;
    --success: #10b981;
    --error: #ef4444;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Syne', sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    height: 100vh; /* Kunci tinggi body sebatas layar */
    overflow: hidden; /* Matikan scroll bar sepenuhnya */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Animated background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(181, 55, 242, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(0, 212, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255, 46, 151, 0.1) 0%, transparent 50%);
    animation: bgPulse 15s ease-in-out infinite;
    z-index: 0;
}

@keyframes bgPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.9; }
}

/* Grid overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: 0;
    pointer-events: none;
}

.container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 580px;
    padding: 0 24px; /* Padding kiri-kanan saja */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.app-header {
    text-align: center;
    margin-bottom: 20px; /* Dikecilkan dari 48px */
    animation: fadeInDown 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem; /* Dikecilkan dari 2.5rem */
    font-weight: 900;
    background: linear-gradient(135deg, var(--electric-blue), var(--cyber-purple), var(--neon-pink));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientFlow 4s ease infinite;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    text-transform: uppercase;
}

@keyframes gradientFlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 400;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid var(--border-glow);
    padding: 24px; /* Dikecilkan dari 32px */
    box-shadow:
        0 0 40px rgba(0, 212, 255, 0.1),
        0 20px 60px rgba(0, 0, 0, 0.4);
    animation: fadeInUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.2s backwards;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--electric-blue), var(--cyber-purple), transparent);
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-label {
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--electric-blue);
    margin-bottom: 12px; /* Dikecilkan dari 20px */
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-label::before {
    content: '▸';
    font-size: 1.2rem;
    animation: pulse 2s ease-in-out infinite;
}

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

.radio-group {
    display: flex;
    gap: 12px;
    margin-bottom: 20px; /* Dikecilkan dari 32px */
}

.radio-option {
    flex: 1;
    position: relative;
}

.radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.radio-option label {
    display: block;
    padding: 12px 16px; /* Padding label dikecilkan */
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    user-select: none;
}

.radio-option input[type="radio"]:checked+label {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(181, 55, 242, 0.2));
    border-color: var(--electric-blue);
    box-shadow:
        0 0 20px rgba(0, 212, 255, 0.3),
        inset 0 0 20px rgba(0, 212, 255, 0.1);
    transform: translateY(-2px);
}

.radio-option label:hover {
    border-color: rgba(0, 212, 255, 0.5);
    transform: translateY(-1px);
}

.input-group {
    margin-bottom: 16px; /* Dikecilkan dari 24px */
}

.input-label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 6px;
    color: var(--text-primary);
}

input[type="number"] {
    width: 100%;
    padding: 12px 16px; /* Padding input dikecilkan */
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    font-size: 1rem;
    font-family: 'Syne', sans-serif;
    font-weight: 600;
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    outline: none;
    -moz-appearance: textfield; /* Menghilangkan spinner */
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"]:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--electric-blue);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
    transform: translateY(-2px);
}

input[type="number"]::placeholder {
    color: rgba(148, 163, 184, 0.5);
}

.hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hint::before {
    content: 'ⓘ';
    color: var(--electric-blue);
    font-size: 1rem;
}

.button-row {
    display: flex;
    gap: 12px;
    margin-top: 20px; /* Dikecilkan dari 32px */
}

button {
    flex: 1;
    padding: 12px 20px; /* Padding tombol dikecilkan */
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--electric-blue), var(--cyber-purple));
    color: white;
    box-shadow: 0 8px 24px rgba(0, 212, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 212, 255, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.result-box {
    margin-top: 20px; /* Dikecilkan dari 32px */
    padding: 20px; /* Dikecilkan dari 28px */
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(181, 55, 242, 0.1));
    border: 2px solid var(--electric-blue);
    border-radius: 18px;
    backdrop-filter: blur(10px);
    animation: resultAppear 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow:
        0 0 30px rgba(0, 212, 255, 0.2),
        inset 0 0 30px rgba(0, 212, 255, 0.05);
}

@keyframes resultAppear {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.result-box.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.1));
    border-color: var(--error);
}

.result-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 6px;
}

.result-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem; /* Dikecilkan dari 2.5rem */
    font-weight: 900;
    background: linear-gradient(135deg, var(--electric-blue), var(--neon-pink));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: numberGlow 2s ease-in-out infinite;
}

@keyframes numberGlow {
    0%, 100% { filter: drop-shadow(0 0 10px rgba(0, 212, 255, 0.5)); }
    50% { filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.8)); }
}

.error-text {
    color: var(--error);
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.error-text::before {
    content: '⚠';
    font-size: 1.5rem;
}

@media (max-width: 640px) {
    h1 { font-size: 1.6rem; }
    .subtitle { font-size: 0.85rem; }
    .card { padding: 20px; }
    .radio-group { flex-direction: column; gap: 8px; }
    .button-row { flex-direction: column; gap: 8px; }
    .result-value { font-size: 1.8rem; }
}