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

:root {
    --black: #000000;
    --white: #FFFFFF;
    --yellow: #FFD700;
    --yellow-dark: #FFA500;
    --gray-dark: #1a1a1a;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--black);
    color: var(--white);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

.container {
    max-width: 500px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

.brand-name {
    font-size: 36px;
    color: var(--yellow);
    margin-bottom: 10px;
    font-weight: 700;
    letter-spacing: 2px;
}

header h1 {
    font-size: 32px;
    color: var(--yellow);
    margin-bottom: 10px;
}

.subtitle {
    font-size: 18px;
    color: var(--white);
    opacity: 0.8;
}

.currency-pair-names {
    font-size: 14px;
    color: var(--yellow);
    opacity: 0.9;
    margin-top: 5px;
    font-weight: 500;
}

.currency {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--gray-dark);
    border: 2px solid var(--yellow);
    border-radius: 15px;
    padding: 15px 20px;
    gap: 15px;
}

.currency-select-wrapper {
    position: relative;
    flex: 1;
    min-width: 100px;
}

.currency-select-wrapper input[type="text"] {
    width: 100%;
    background: transparent;
    border: 0;
    padding: 0;
    font-size: 22px;
    color: var(--yellow);
    font-weight: 600;
    outline: none;
    cursor: text;
}

.currency-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--gray-dark);
    border: 2px solid var(--yellow);
    border-radius: 10px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.currency-item {
    padding: 12px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.1);
    transition: background-color 0.2s;
    text-align: left;
}

.currency-item:hover {
    background-color: rgba(255, 215, 0, 0.1);
}

.currency-item:last-child {
    border-bottom: none;
}

.currency-item .currency-name {
    flex: 1;
    color: var(--white);
    font-size: 14px;
    opacity: 0.8;
    text-align: left;
}

.currency-item .currency-type {
    font-size: 16px;
    min-width: 20px;
    text-align: left;
}

.currency-item .currency-code {
    font-weight: 600;
    color: var(--yellow);
    font-size: 18px;
    min-width: 60px;
    text-align: left;
}

.currency select {
    background: transparent;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23FFD700%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat, repeat;
    background-position: right .5em top 50%, 0 0;
    background-size: .6em auto, 100%;
    border: 0;
    padding-right: 30px;
    font-size: 22px;
    color: var(--yellow);
    font-weight: 600;
    -moz-appearance: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    min-width: 100px;
}

.currency input {
    border: 0;
    background: transparent;
    font-size: 22px;
    text-align: right;
    color: var(--white);
    flex: 1;
    outline: none;
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

.currency input::placeholder {
    color: var(--white);
    opacity: 0.3;
}

.middle {
    color: var(--yellow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 10px 0;
}

.middle button {
    background-color: var(--yellow);
    border: 2px solid var(--yellow);
    border-radius: 50%;
    cursor: pointer;
    color: var(--black);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
    width: 50px;
    transition: all 0.3s ease;
    font-weight: bold;
}

.middle button:hover {
    transform: rotate(180deg);
    background-color: var(--yellow-dark);
}

.middle button:active {
    transform: rotate(180deg) scale(0.9);
}

.middle .rate {
    background-color: var(--gray-dark);
    border: 2px solid var(--yellow);
    border-radius: 50px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 20px;
    margin: 0 15px 0 25px;
    color: var(--yellow);
    flex: 1;
    text-align: center;
}

select:focus, input:focus, button:focus {
    outline: 0;
}

.exchange-btn {
    width: 100%;
    padding: 18px;
    background-color: var(--yellow);
    color: var(--black);
    border: none;
    border-radius: 15px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 10px;
}

.exchange-btn:hover {
    background-color: var(--yellow-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.3);
}

.exchange-btn:active {
    transform: translateY(0);
}

.exchange-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.terms-link {
    display: block;
    text-align: center;
    color: var(--yellow);
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
    opacity: 0.7;
    text-decoration: none;
}

.terms-link:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Боковое меню - полукруги */
.side-menu {
    position: fixed;
    width: 80px;
    height: 80px;
    border: none;
    background-color: var(--yellow);
    color: var(--black);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.side-menu.left-menu {
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 0 50px 50px 0;
    padding-left: 10px;
}

.side-menu.right-menu {
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 50px 0 0 50px;
    padding-right: 10px;
}

.side-menu:hover {
    background-color: var(--yellow-dark);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5);
}

.side-menu.left-menu:hover {
    transform: translateY(-50%) scale(1.1);
}

.side-menu.right-menu:hover {
    transform: translateY(-50%) scale(1.1);
}

.side-menu span {
    font-size: 16px;
    letter-spacing: 1px;
    white-space: nowrap;
}

.side-menu svg {
    width: 24px;
    height: 24px;
    stroke: var(--black);
    display: block;
}

/* Секция с условиями обмена */
.terms-section {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    background-color: var(--gray-dark);
    border-top: 3px solid var(--yellow);
    border-radius: 30px 30px 0 0;
    max-height: 60vh;
    transition: bottom 0.4s ease;
    z-index: 200;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}

.terms-section.active {
    bottom: 0;
}

.terms-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid var(--yellow);
    background-color: var(--black);
    border-radius: 30px 30px 0 0;
}

.terms-header h3 {
    color: var(--yellow);
    font-size: 20px;
    margin: 0;
}

.close-terms {
    background: transparent;
    border: none;
    color: var(--yellow);
    font-size: 32px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-terms:hover {
    background-color: var(--yellow);
    color: var(--black);
    transform: rotate(90deg);
}

.terms-content {
    overflow-y: auto;
    padding: 20px;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

.terms-content::-webkit-scrollbar {
    width: 8px;
}

.terms-content::-webkit-scrollbar-track {
    background: var(--black);
    border-radius: 10px;
}

.terms-content::-webkit-scrollbar-thumb {
    background: var(--yellow);
    border-radius: 10px;
}

.terms-content::-webkit-scrollbar-thumb:hover {
    background: var(--yellow-dark);
}

.term-item {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.term-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.term-item h4 {
    color: var(--yellow);
    font-size: 18px;
    margin-bottom: 10px;
}

.term-item p {
    color: var(--white);
    font-size: 14px;
    line-height: 1.6;
    opacity: 0.9;
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 300;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--gray-dark);
    border: 3px solid var(--yellow);
    border-radius: 20px;
    max-width: 90%;
    max-height: 80vh;
    width: 500px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(255, 215, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid var(--yellow);
    background-color: var(--black);
    border-radius: 17px 17px 0 0;
}

.modal-header h2 {
    color: var(--yellow);
    font-size: 24px;
    margin: 0;
}

.close-modal {
    background: transparent;
    border: none;
    color: var(--yellow);
    font-size: 32px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-modal:hover {
    background-color: var(--yellow);
    color: var(--black);
    transform: rotate(90deg);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.more-item {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.more-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.more-item h3 {
    color: var(--yellow);
    font-size: 18px;
    margin-bottom: 10px;
}

.more-item p {
    color: var(--white);
    font-size: 14px;
    line-height: 1.6;
    opacity: 0.9;
}

.more-item a {
    color: var(--yellow);
    text-decoration: none;
    transition: color 0.3s ease;
}

.more-item a:hover {
    color: var(--yellow-dark);
    text-decoration: underline;
}

.rate-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background-color: var(--black);
    border: 1px solid var(--yellow);
    border-radius: 10px;
}

.rate-item-currency {
    font-weight: 600;
    color: var(--yellow);
    font-size: 16px;
}

.rate-item-value {
    color: var(--white);
    font-size: 16px;
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
        padding-top: 80px;
        padding-bottom: 80px;
    }
    
    .brand-name {
        font-size: 28px;
    }
    
    header h1 {
        font-size: 28px;
    }
    
    .currency {
        padding: 12px 15px;
    }
    
    .currency select,
    .currency input {
        font-size: 18px;
    }
    
    .middle .rate {
        font-size: 12px;
        padding: 0 15px;
    }

    .side-menu {
        width: 120px;
        height: 60px;
        font-size: 12px;
        padding: 0;
    }

    .side-menu svg {
        width: 28px;
        height: 28px;
    }
    
    /* Кнопка "Курсы" - полусфера снизу по центру */
    .side-menu.left-menu {
        left: 50% !important;
        right: auto !important;
        top: auto;
        bottom: -20px;
        transform: translateX(-50%);
        margin-left: 0;
        border-radius: 60px 60px 0 0;
        padding-left: 0;
    }
    
    .side-menu.left-menu:hover {
        transform: translateX(-50%) scale(1.1);
    }
    
    /* Кнопка "Больше" - полусфера сверху по центру */
    .side-menu.right-menu {
        left: 50% !important;
        right: auto !important;
        top: -20px;
        bottom: auto;
        transform: translateX(-50%);
        margin-left: 0;
        border-radius: 0 0 60px 60px;
        padding-right: 0;
    }
    
    .side-menu.right-menu:hover {
        transform: translateX(-50%) scale(1.1);
    }

    .terms-section {
        max-height: 70vh;
    }

    .modal-content {
        max-width: 95%;
        width: 100%;
    }
}


