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

body {
    font-family: 'Times New Roman', 'Georgia', 'Garamond', 'Book Antiqua', serif;
    background: linear-gradient(135deg, #d4b896 0%, #c4a373 25%, #b8965a 50%, #a68b5b 75%, #8b7355 100%);
    background-size: 400% 400%;
    animation: subtleShift 20s ease-in-out infinite;
    min-height: 100vh;
    padding: 20px;
    color: #333;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODAwIiBoZWlnaHQ9IjYwMCIgdmlld0JveD0iMCAwIDgwMCA2MDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxkZWZzPgo8cGF0dGVybiBpZD0ic2hpcCIgcGF0dGVyblVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgd2lkdGg9IjgwMCIgaGVpZ2h0PSI2MDAiPgo8cGF0aCBkPSJNMTAwIDQwMEM5MCA0MjAgMTEwIDQ0MCA5MCA0NjBDMTEwIDQ4MCA5MCA1MDAgMTEwIDUyMEMxMzAgNTEwIDE1MCA1MDAgMTcwIDQ5MEM5MCA1MDAgMTEwIDQ4MCA5MCA0NjBDMTEwIDQ0MCA5MCA0MjAgMTAwIDQwMFoiIHN0cm9rZT0iIzZiNWI0ZiIgc3Ryb2tlLXdpZHRoPSIwLjUiIGZpbGw9Im5vbmUiIG9wYWNpdHk9IjAuMTUiLz4KPHN2ZyB4PSIyMDAiIHk9IjIwMCIgd2lkdGg9IjEwMCIgaGVpZ2h0PSIxNTAiPgo8cGF0aCBkPSJNMjAgMTMwTDgwIDEzMEw4MCA5MEw2MCA3MEw0MCA1MEwyMCA3MFoiIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzZiNWI0ZiIgc3Ryb2tlLXdpZHRoPSIxIiBvcGFjaXR5PSIwLjEiLz4KPHN2Zz4KPHN2ZyB4PSI2MDAiIHk9IjMwMCIgd2lkdGg9IjgwIiBoZWlnaHQ9IjEwMCI+CjxjaXJjbGUgY3g9IjQwIiBjeT0iNTAiIHI9IjMwIiBmaWxsPSJub25lIiBzdHJva2U9IiM2YjViNGYiIHN0cm9rZS13aWR0aD0iMSIgb3BhY2l0eT0iMC4wOCIvPgo8L3N2Zz4KPC9wYXR0ZXJuPgo8L2RlZnM+CjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc2hpcCkiLz4KPC9zdmc+'),
        radial-gradient(circle at 20% 80%, rgba(139, 115, 85, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(180, 150, 90, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(196, 163, 115, 0.08) 0%, transparent 50%);
    background-size: 1200px 900px, 800px 800px, 600px 600px, 400px 400px;
    background-repeat: no-repeat;
    background-position: center center, 0% 50%, 100% 50%, 40% 40%;
    pointer-events: none;
    z-index: -1;
    opacity: 0.15;
}

/* Watermark positioning for different screen sizes */
body::after {
    content: '';
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 300px;
    height: 200px;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAwIiBoZWlnaHQ9IjIwMCIgdmlld0JveD0iMCAwIDMwMCAyMDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik01MCA4MEw1MCA2MEw3MCA0MEw5MCA2MEw5MCA4MEw3MCA5MEw1MCA4MFoiIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzZiNWI0ZiIgc3Ryb2tlLXdpZHRoPSIxLjUiIG9wYWNpdHk9IjAuMiIvPgo8cGF0aCBkPSJNMTUwIDEyMEwxNTAgMTAwTDE3MCA4MEwxOTAgMTAwTDE5MCAxMjBMMTcwIDEzMEwxNTAgMTIwWiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjNmI1YjRmIiBzdHJva2Utd2lkdGg9IjEuNSIgb3BhY2l0eT0iMC4yIi8+CjxwYXRoIGQ9Ik0yMCA5MEwyODAgOTAiIHN0cm9rZT0iIzZiNWI0ZiIgc3Ryb2tlLXdpZHRoPSIxIiBvcGFjaXR5PSIwLjE1Ii8+CjxjaXJjbGUgY3g9IjIzMCIgY3k9IjQwIiByPSIyMCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjNmI1YjRmIiBzdHJva2Utd2lkdGg9IjEiIG9wYWNpdHk9IjAuMTUiLz4KPC9zdmc+');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: none;
    z-index: -1;
    opacity: 0.08;
}

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

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    color: #3d2914;
    margin-bottom: 30px;
    font-size: 2.8em;
    font-weight: 900;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3), 1px 1px 3px rgba(139, 115, 85, 0.5);
    font-family: 'Palatino Linotype', 'Book Antiqua', 'Palatino', 'serif';
    letter-spacing: 2px;
    text-transform: uppercase;
    font-variant: small-caps;
    position: relative;
    background: linear-gradient(145deg, #6b5b4f, #8b7355, #a68b5b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
}

h1::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #8b7355, transparent);
    border-radius: 2px;
}

h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #8b7355, transparent);
    border-radius: 2px;
}

.disclaimer {
    text-align: center;
    font-size: 0.75em;
    color: #8b7355;
    margin-top: -15px;
    margin-bottom: 25px;
    font-family: 'Times New Roman', 'Georgia', 'Garamond', 'Book Antiqua', serif;
    font-style: italic;
    opacity: 0.8;
    letter-spacing: 0.3px;
}

.converter-grid {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-top: 30px;
}

.converter-card {
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.converter-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.converter-card h3 {
    color: #4a3728;
    margin-bottom: 20px;
    font-size: 1.4em;
    text-align: center;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: 'Times New Roman', 'Georgia', 'Garamond', 'Book Antiqua', serif;
    letter-spacing: 0.3px;
    text-transform: capitalize;
}

.converter-card h3 .icon {
    font-size: 1.2em;
    color: #8b7355;
}

.converter-card h3 .icon.volume-icon {
    color: #c4a373;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.input-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-row label {
    font-weight: 500;
    color: #4a3728;
    min-width: 80px;
    font-family: 'Times New Roman', 'Georgia', 'Garamond', 'Book Antiqua', serif;
    letter-spacing: 0.2px;
}

.input-row input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #c4a373;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #faf8f3;
    -webkit-appearance: none;
    -moz-appearance: textfield;
    min-height: 44px;
    font-family: 'Times New Roman', 'Georgia', 'Garamond', 'Book Antiqua', serif;
    color: #4a3728;
}

.input-row input::-webkit-outer-spin-button,
.input-row input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.input-row input:focus {
    outline: none;
    border-color: #8b7355;
    box-shadow: 0 0 0 3px rgba(139, 115, 85, 0.1);
}

.input-row select {
    padding: 12px 15px;
    border: 2px solid #c4a373;
    border-radius: 8px;
    font-size: 16px;
    background: #faf8f3;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a3728' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
    min-height: 44px;
    font-family: 'Times New Roman', 'Georgia', 'Garamond', 'Book Antiqua', serif;
    color: #4a3728;
}

.input-row select:focus {
    outline: none;
    border-color: #8b7355;
    box-shadow: 0 0 0 3px rgba(139, 115, 85, 0.1);
}

.swap-btn {
    align-self: center;
    background: linear-gradient(145deg, #8b7355, #a68b5b);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 115, 85, 0.3);
}

.swap-btn:hover {
    transform: rotate(180deg) scale(1.1);
    box-shadow: 0 6px 20px rgba(139, 115, 85, 0.4);
}

.result {
    margin-top: 15px;
    padding: 15px;
    background: linear-gradient(145deg, #f0ebe0, #e8dcc6);
    border-radius: 8px;
    border-left: 4px solid #8b7355;
    font-weight: 500;
    color: #4a3728;
    font-family: 'Times New Roman', 'Georgia', 'Garamond', 'Book Antiqua', serif;
    font-style: italic;
    letter-spacing: 0.2px;
}

.unit-badge {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-left: 8px;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 15px;
        border-radius: 15px;
    }
    
    h1 {
        font-size: 2.2em;
        margin-bottom: 20px;
        letter-spacing: 1.5px;
    }
    
    h1::before, h1::after {
        width: 80px;
        height: 2px;
    }
    
    .disclaimer {
        font-size: 0.7em;
        margin-top: -10px;
        margin-bottom: 20px;
    }
    
    /* Hide corner watermark on mobile */
    body::after {
        display: none;
    }
    
    .converter-grid {
        gap: 20px;
    }
    
    .converter-card {
        padding: 20px;
    }
    
    .converter-card h3 {
        font-size: 1.2em;
        margin-bottom: 15px;
        gap: 8px;
    }
    
    .converter-card h3 .icon {
        font-size: 1.1em;
    }
    
    .converter-card h3 .icon.volume-icon {
        color: #c4a373;
    }
    
    .input-row {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
    
    .input-row label {
        min-width: unset;
        font-size: 14px;
        font-weight: 600;
        color: #4a3728;
        font-family: 'Times New Roman', 'Georgia', 'Garamond', 'Book Antiqua', serif;
    }
    
    .input-row input, .input-row select {
        width: 100%;
        padding: 15px;
        font-size: 16px;
        border-radius: 10px;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        font-family: 'Times New Roman', 'Georgia', 'Garamond', 'Book Antiqua', serif;
        color: #4a3728;
        border: 2px solid #c4a373;
        background: #faf8f3;
    }
    
    .input-row select {
        background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a3728' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
        background-repeat: no-repeat;
        background-position: right 15px center;
        background-size: 20px;
        padding-right: 45px;
    }
    
    .swap-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
        margin: 10px auto;
        box-shadow: 0 4px 15px rgba(139, 115, 85, 0.4);
        background: linear-gradient(145deg, #8b7355, #a68b5b);
    }
    
    .swap-btn:hover {
        transform: rotate(90deg) scale(1.05);
    }
    
    .result {
        margin-top: 12px;
        padding: 12px;
        font-size: 14px;
        line-height: 1.4;
    }
}

@media (max-width: 480px) {
    .container {
        margin: 5px;
        padding: 12px;
        border-radius: 12px;
    }
    
    h1 {
        font-size: 1.9em;
        margin-bottom: 15px;
        letter-spacing: 1px;
    }
    
    h1::before, h1::after {
        width: 60px;
        height: 2px;
    }
    
    .disclaimer {
        font-size: 0.65em;
        margin-top: -8px;
        margin-bottom: 15px;
    }
    
    /* Hide corner watermark on small mobile */
    body::after {
        display: none;
    }
    
    .converter-card {
        padding: 15px;
        border-radius: 12px;
    }
    
    .converter-card h3 {
        font-size: 1.1em;
        margin-bottom: 12px;
        gap: 6px;
    }
    
    .converter-card h3 .icon {
        font-size: 1em;
    }
    
    .converter-card h3 .icon.volume-icon {
        color: #c4a373;
    }
    
    .input-row input, .input-row select {
        padding: 12px;
        font-size: 16px;
    }
    
    .swap-btn {
        width: 45px;
        height: 45px;
        font-size: 18px;
        background: linear-gradient(145deg, #8b7355, #a68b5b);
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .input-row input, .input-row select {
        padding: 16px;
        font-size: 16px;
        border-width: 2px;
        font-family: 'Times New Roman', 'Georgia', 'Garamond', 'Book Antiqua', serif;
        color: #4a3728;
        border-color: #c4a373;
        background: #faf8f3;
    }
    
    .swap-btn {
        width: 55px;
        height: 55px;
        font-size: 22px;
        background: linear-gradient(145deg, #8b7355, #a68b5b);
    }
    
    .converter-card:hover {
        transform: none;
    }
}