/* Base Styles (Consistent Across All Devices) */
body {
    font-family: Arial, sans-serif;
    background: url('assets/background.jpg') no-repeat center center fixed;
    background-size: cover;
    color: white;
    overflow: hidden;
    margin: 0;
    padding: 0;
    padding-top: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

/* Full-screen Access Denied styling */
#access-denied {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 10000; /* Ensure it’s above all other content */
    padding: 20px;
    box-sizing: border-box;
}

#access-denied h1 {
    font-size: 24px;
    margin-bottom: 20px;
}

#access-denied p {
    font-size: 16px;
    max-width: 80%;
}

/* Existing Layer Styles */
.layer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.layer-content {
    background: linear-gradient(90deg, rgba(43, 43, 43, 0.911), rgba(34, 34, 34, 0.842));
    padding: 0%;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    height: 70%;
    text-align: center;
    color: white;
    position: relative;
    max-height: 90%;
    display: flex;
    flex-direction: column;
}

.layer-content h2 {
    margin: 17px 0 10px;
    font-size: 16px;
}

.layer-content input {
    width: 80%;
    padding: 10px;
    margin: 10px auto;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 12px;
    font-weight: 400;
    outline: none;
    transition: border-color 0.3s;
}

.layer-content input:focus {
    border-color: #00ff00;
}

/* Currency Selector for Top-Up */
.currency-selector {
    display: flex;
    justify-content: center;
    margin: 10px 0;
}

.currency-option {
    padding: 5px 15px;
    margin: 0 5px;
    background: #333;
    border: 1px solid #444;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.currency-option.active {
    background: #703a94f8;
    color: rgb(255, 255, 255);
}

.topup-section {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.payment-widget {
    width: 100%;
    height: 150px;
    border: none;
    border-radius: 5px;
    margin-top: 10px;
}



/* Styling for wallet address in topup layer */
.topup-rectangle.wallet-address p.copyable {
    font-size: 10px; /* Smaller font size */
    word-spacing: 1px; /* Add spacing between characters */
    margin: 5px 0;
    padding: 0 10px;
}

/* Existing styles unchanged */
.topup-countdown {
    font-size: 14px;
    color: #ff5555;
    margin: 10px 0;
    text-align: center;
}

/* Styling for URLs in help layer */
#help .layer-content a {
    display: inline-block;
    background: linear-gradient(90deg, rgba(90, 90, 90, 0.5), rgba(255, 255, 255, 0.11));
    color: white;
    text-decoration: none;
    padding: 8px 10px; /* Reduced horizontal padding to make narrower */
    max-width: 250px; /* Set maximum width to constrain button width */
    border-radius: 8px;
    margin: 5px auto; /* Center horizontally with auto margins */
    font-size: 14px;
    transition: background 0.3s;
    text-align: center;
    box-sizing: border-box;
}

#help .layer-content a:hover {
    background: linear-gradient(90deg, rgba(90, 90, 90, 0.7), rgba(255, 255, 255, 0.2));
}

/* Rest of your existing styles remain unchanged */
.miner-slider {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.miner-image {
    width: 250px;
    height: 250px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

#miner-stats {
    display: none;
}

.arrow {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    padding: 0;
}

.arrow-left {
    left: 10px;
}

.arrow-right {
    right: 10px;
}

/* Remove text content and use pseudo-elements for arrows */
.arrow-left::before {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-right: 15px solid white; /* Left arrow pointing left */
}

.arrow-right::before {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 15px solid white; /* Right arrow pointing right */
}

.arrow:hover::before {
    border-right-color: #00ff00; /* Hover effect for left arrow */
}

.arrow-right:hover::before {
    border-left-color: #00ff00; /* Hover effect for right arrow */
}

.miner-details {
    font-size: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#buy .layer-content {
    background: linear-gradient(90deg, rgba(43, 43, 43, 0.911), rgba(34, 34, 34, 0.842));
    padding: 2%;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    height: 70%;
    text-align: center;
    color: white;
    position: relative;
    max-height: 90%;
    display: flex;
    flex-direction: column;
}

.buy-button {
    position: absolute;
    top: 83%; /* Center vertically */
    left: 50%; /* Center horizontally */
    transform: translate(-50%, -50%); /* Adjust for button dimensions */
    background: #00ff00;
    color: black;
    border: none;
    border-radius: 5px;
    width: 100px;
    cursor: pointer;
    font-size: 20px;
    padding: 10px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.buy-button:disabled {
    background: #666;
    cursor: not-allowed;
}

/* Ensure parent is positioned */
#buy .layer-content {
    position: relative; /* Required for absolute positioning */
    display: flex;
    flex-direction: column;
    /* Remove justify-content if using absolute positioning */
}

.progress-rectangle {
    margin-top: 6%;
    background: linear-gradient(90deg, rgba(90, 90, 90, 0.5), rgba(255, 255, 255, 0.11));
    width: 355px;
    max-width: 355px;
    height: 55px;
    max-height: 55px;
    border-radius: 10px;
    padding: 0%;
    display: flex;
    align-items: center;
    position: relative;
    cursor: pointer;
}

.progress-rectangle img:first-child {
    width: 30px;
    max-width: 30px;
    height: 30px;
    max-height: 30px;
    margin-left: 5%;
    margin-right: 10%;
}

.progress-rectangle .transaction-text {
    flex-grow: 1;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 25px;
}

.progress-rectangle .transaction-arrow {
    width: 20px !important;
    height: 20px !important;
    position: absolute !important;
    right: 20px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin: 0 !important;
    padding: 0 !important;
}

.th-s-rectangle,
.leaderboard-rectangle {
    background: linear-gradient(90deg, rgba(90, 90, 90, 0.5), rgba(255, 255, 255, 0.11));
    width: 355px;
    max-width: 355px;
    height: 55px;
    max-height: 55px;
    border-radius: 10px;
    padding: 0%;
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-top: 5%;
}

.th-s-rectangle img,
.leaderboard-rectangle img {
    width: 30px;
    max-width: 30px;
    height: 30px;
    max-height: 30px;
    margin-left: 5%;
    margin-right: 10%;
}

.leaderboard-list {
    max-height: 60vh;
    overflow-y: auto;
    padding: 0;
    border-radius: 10px;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    background: linear-gradient(90deg, rgba(90, 90, 90, 0.5), rgba(255, 255, 255, 0.11));
    border-radius: 20px;
    margin: 10px 0;
    padding: 10px;
    color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.leaderboard-item span {
    font-size: 12px;
    border-radius: 10px;
}

.leaderboard-table {
    margin-top: 10%;
    width: 100%;
    border-collapse: collapse;
    color: white;
    background: transparent;
    border-radius: 10px;
}

.leaderboard-table thead {
    background: linear-gradient(90deg, rgba(90, 90, 90, 0.5), rgba(255, 255, 255, 0.11));
}

.leaderboard-table th {
    padding: 10px;
    font-size: 12px;
    text-align: center;
    border-radius: 10px;
}

.leaderboard-table tbody tr {
    background: linear-gradient(90deg, rgba(90, 90, 90, 0.5), rgba(255, 255, 255, 0.11));
    border-radius: 10px;
}

.leaderboard-table td {
    padding: 10px;
    font-size: 12px;
    text-align: center;
    border-radius: 10px;
}

#transactions .layer-content {
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.transaction-list {
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.transaction-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(90deg, rgba(90, 90, 90, 0.5), rgba(255, 255, 255, 0.11));
    border-radius: 10px;
    margin: 5px 0;
    padding: 5px;
    width: 100%;
    box-sizing: border-box;
    min-height: 60px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    text-align: left;
    font-size: 12px;
}

.transaction-item span {
    flex: 1;
    padding: 0 5px;
}

.transaction-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 40px;
}

.transaction-table thead {
    position: sticky;
    top: 0;
    background: #333;
    z-index: 1;
}

.transaction-table tbody {
    display: block;
    max-height: calc(80vh - 100px);
    overflow-y: auto;
    overflow-x: hidden;
}

.transaction-table tr {
    display: table;
    width: 100%;
}

.transaction-table th,
.transaction-table td {
    padding: 10px;
    text-align: left;
    font-size: 12px;
}

.close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

.withdraw-option {
    display: flex;
    align-items: center;
    width: 375px;
    height: 60px;
    margin-top: 20px;
    background: #222;
    color: white;
    border-radius: 15px;
    cursor: pointer;
    margin-left: 4%;
}

.withdraw-option img {
    margin-left: 5%;
    margin-right: 5%;
    width: 35px;
    height: 35px;
}

.withdraw-input {
    margin-left: 5%;
    margin-top: 2.5%;
    text-align: left;
    width: 90.5%;
}

.withdraw-input label {
    display: block;
    margin-bottom: 1%;
    font-weight: bold;
    font-size: 12px;
}

.withdraw-input input {
    width: 75%;
    background: #333;
    border: 1px solid #444;
    color: white;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 15px;
}

.withdraw-button {
    background: #00ff00;
    color: black;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 20px;
    width: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin-top: 10px;
    position: relative;
}

.withdraw-button:disabled {
    background: #666;
    cursor: not-allowed;
}

#confirm-withdraw {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

#confirm-withdraw .layer-content {
    width: 90%;
    max-width: 400px;
    padding: 20px;
    background: #1a1a1a;
    border-radius: 10px;
    text-align: center;
}

.confirm-buttons {
    margin-top: 20px;
}

.confirm-buttons button {
    padding: 10px 20px;
    margin: 0 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 15px;
}

#confirm-yes {
    background: #00ff00;
    color: black;
}

#confirm-no {
    background: #ff0000;
    color: white;
}

.currency-selector {
    display: flex;
    justify-content: center;
    margin-top: 10px;
    margin-bottom: 10px;
}

.currency-option {
    padding: 5px 10px;
    margin: 0 10px;
    background: #333;
    border: 1px solid #444;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 15px;
}

.currency-option.active {
    background: #703a94f8;
    color: rgb(255, 255, 255);
}

.error-message {
    color: #ff5555;
    min-height: 20px;
    margin: 5px 0;
    font-size: 12px;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 96%;
    padding: 0 2%;
    margin-bottom: 2%;
}

.left-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.balance-container {
    margin-left: -0%;
    margin-top: 63%;
    display: flex;
    justify-content: flex-start;
}

.balance {
    background: linear-gradient(90deg, rgba(90, 90, 90, 0.5), rgba(255, 255, 255, 0.11));
    width: 150px;
    max-width: 150px;
    height: 45px;
    max-height: 45px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 3%;
    cursor: pointer;
}

.balance-text {
    margin-left: 5%;
    font-size: 15px;
}

.balance-icon {
    background-color: rgba(50, 163, 255, 0.801);
    border: 2px solid rgba(255, 255, 255, 0);
    border-radius: 10px;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 2px;
}

.right-buttons {
    margin-top: 28%;
    margin-right: 0%;
    display: flex;
    align-items: center;
}

.help-square, .lang-square {
    background: linear-gradient(90deg, rgba(90, 90, 90, 0.5), rgba(255, 255, 255, 0.11));
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 12px;
    cursor: pointer;
    width: 45px;
    max-width: 45px;
    height: 45px;
    max-height: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.help-square {
    margin-right: 10px;
}

.mining-rig {
    width: 240px;
    max-width: 240px;
    height: 240px;
    max-height: 240px;
    border-radius: 25px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: #333;
    margin: 5% auto;
}

.btc-balance-rectangle {
    background: linear-gradient(90deg, rgba(90, 90, 90, 0.5), rgba(255, 255, 255, 0.11));
    width: 150px;
    max-width: 150px;
    height: 40px;
    max-height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 3%;
    font-size: 15px;
    margin: 1% auto;
    color: #ff8c00;
    margin-bottom: 5%;
}

.btc-income-rectangle {
    background: linear-gradient(90deg, rgba(90, 90, 90, 0.5), rgba(255, 255, 255, 0.11));
    width: 170px;
    max-width: 170px;
    height: 30px;
    max-height: 30px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3%;
    font-size: 10px;
    margin: 1% auto;
    color: #f7931a;
}

.btc-icon {
    width: 30px;
    max-width: 30px;
    height: 30px;
    max-height: 30px;
    cursor: pointer;
    background-color: rgba(231, 145, 16, 0.37);
    border: 2px solid rgba(255, 255, 255, 0);
    border-radius: 10px;
}

.button-bar {
    display: flex;
    justify-content: space-around;
    width: 96%;
    padding: 0 2%;
    margin-bottom: 2%;
}

.button-bar button {
    margin-top: 5%;
    background: linear-gradient(90deg, rgba(90, 90, 90, 0.5), rgba(255, 255, 255, 0.11));
    border: none;
    padding: 2%;
    border-radius: 10px;
    cursor: pointer;
    width: 55px;
    max-width: 55px;
    height: 55px;
    max-height: 55px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.button-bar button img {
    width: 30px;
    max-width: 30px;
    height: 30px;
    max-height: 30px;
}

.graph-rectangle {
    background: linear-gradient(90deg, rgba(90, 90, 90, 0.5), rgba(255, 255, 255, 0.11));
    width: 375px;
    max-width: 375px;
    height: 155px;
    max-height: 155px;
    border-radius: 10px;
    position: relative;
    margin-top: 7%;
    overflow: hidden;
}

.graph-logo {
    background: url('assets/logograph.png') no-repeat center;
    background-size: contain;
    width: 70px;
    max-width: 70px;
    height: 70px;
    max-height: 70px;
    position: absolute;
    top: 0%;
    left: 0%;
    background-color: #50374d;
    border-radius: 10px;
}

.graph {
    width: 100%;
    height: calc(100% - 8vh);
    max-height: calc(100% - 40px);
    position: absolute;
    top: 8vh;
}

.graph-tabs {
    position: absolute;
    bottom: 0;
    width: 100%;
    display: flex;
    justify-content: space-around;
    padding: 1% 0;
    background: linear-gradient(90deg, rgba(90, 90, 90, 0.5), rgba(255, 255, 255, 0.11));
}

.graph-tabs button {
    background: none;
    border: none;
    color: white;
    font-size: 12px;
    cursor: pointer;
    padding: 1%;
}

.graph-tabs button.active {
    color: #00ff00;
    border-bottom: 2px solid #00ff00;
}

#market .layer-content {
    overflow: hidden;
}

.market-list {
    margin-top: 20px;
    max-height: 60vh;
    overflow-y: auto;
    padding: 0;
    width: 100%; /* Ensure it fills container */
}

.market-buy-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.market-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(90deg, rgba(90, 90, 90, 0.5), rgba(255, 255, 255, 0.11));
    border-radius: 10px;
    margin: 10px 0;
    padding: 10px;
    width: 100%;
    box-sizing: border-box;
    min-height: 80px;
    max-height: 80px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.market-item-left {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.market-item-image {
    width: 50px;
    height: 50px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border: 1px solid #444;
    border-radius: 5px;
}

.market-item-details {
    flex: 1;
    color: white;
    text-align: left;
    font-size: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.market-item-details p {
    margin: 2px 0; /* Reduce default margin from ~16px to 2px */
    margin-left: 5%;
}

.market-item-right {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-left: 10px;
}

.market-button {
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 15px;
    text-align: center;
    white-space: nowrap;
    background: #00ff00; /* Match sell-button */
    color: black; /* Match sell-button */
}

.sell-button {
    /* No additional styles needed; inherits from .market-button */
}

.remove-button {
    background: #ff4444;
    color: white;
}

.market-tabs {
    display: flex;
    justify-content: center;
    margin-top: 10px;
    margin-bottom: -5px;
}

.market-tab {
    background: #333;
    border: none;
    color: white;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 15px;
    border-radius: 5px 5px 0 0;
}

.market-tab.active {
    background: #703a94f8;
    color: rgb(255, 255, 255);
}

.market-tab-content {
    background: #1d1d1de1;
    padding: 10px;
    border-radius: 15px;
}

.topup-rectangle {
    background: linear-gradient(90deg, rgba(90, 90, 90, 0.5), rgba(255, 255, 255, 0.11));
    border-radius: 10px;
    padding: 10px;
    margin: 10px 0;
    color: white;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.topup-rectangle p {
    margin: 5px 0;
    font-size: 15px;
}

.copy-button {
    background: #aa4cb3;
    color: rgb(255, 255, 255);
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 5px;
    font-size: 15px;
}

#confirm-username-btn {
    position: absolute;
    top: 27%;
    left: 37%;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    background-color: #00cc00;
    color: white;
    opacity: 1;
    transition: opacity 0.3s, background-color 0.3s;
    width: 100px;
}

#confirm-username-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.6;
}

button {
    all: unset;
    box-sizing: border-box;
}

#new-username {
    display: block;
    width: 80%;
    margin: 10px auto;
}

#settings .layer-content .username-row .edit-username-btn {
    background: #703a94 !important;
    color: white !important;
    border: none !important;
    padding: 5px 10px !important;
    border-radius: 5px !important;
    cursor: pointer !important;
    font-size: 12px !important;
    width: auto !important;
    text-align: center !important;
    transition: background 0.3s !important;
}

#change-username .layer-content {
    background: linear-gradient(90deg, rgba(90, 90, 90, 0.6), rgba(255, 255, 255, 0.11));
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#change-username p:first-of-type {
    font-size: 15px;
    color: #32a6f3;
    margin: 15px 0;
}

.copyright {
    position: fixed;
    bottom: 3%;
    left: 0;
    width: 100%;
    text-align: center;
    color: white;
    font-size: 14px;
    z-index: 1000;
    margin: 0;
    padding: 5px 0;
}

#amount {
    width: 100%;
    padding: 10px;
    margin: 10px 0 50px; /* Increased margin-bottom to 20px for more space */
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 16px;
    background-color: var(--input-bg, #fff);
    color: var(--text-color, #000);
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

#amount:focus {
    outline: none;
    border-color: var(--primary-color, #4CAF50);
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.3);
}

.submit-button {
    width: 150px;
    padding: 14px 20px 8px; /* Text shifted down */
    background-color: var(--primary-color, #4CAF50);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 100;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-align: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%); /* Centers horizontally */
    top: 250px; /* Moves button 20px down from top of parent */
}

.submit-button:hover {
    background-color: var(--primary-hover, #45a045);
}

.submit-button:active {
    background-color: var(--primary-active, #3d8b3d);
}
.min_deposit_rub {
    position: absolute;
    top: 300px; /* Reduced from 330px to position closer to submit-button */
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    font-size: 12px;
    color: var(--text-muted-dark, #aaa);
}

/* Style for the footer text */
.footer-text {
    font-size: 12px;
    color: var(--text-muted, #666);
    text-align: center;
    margin-top: 12px;
    opacity: 0.8;
}

#ton-equivalent {
    font-size: 14px;
    color: #fff;
    margin: 10px 0;
    text-align: center;
}

/* Small Devices (Phones, up to 410px) */
@media screen and (max-width: 410px) {
    body {
        padding-top: 20px;
    }

    .layer-content {
        width: 90%;
        max-width: 90%;
    }

    .top-bar {
        width: 98%;
        padding: 0 1%;
    }

    .balance {
        width: 150px;
        max-width: 150px;
        height: 45px;
        max-height: 45px;
    }

    .balance-text {
        font-size: 15px;
    }

    .balance-icon {
        width: 30px;
        height: 30px;
    }

    .right-buttons {
        margin-top: 29.5%;
        margin-right: 0%;
        display: flex;
        align-items: center;
    }

    .mining-rig {
        width: 240px;
        max-width: 240px;
        height: 240px;
        max-height: 240px;
    }

    .button-bar {
        width: 98%;
        padding: 0 1%;
    }

    .button-bar button {
        width: 55px;
        max-width: 55px;
        height: 55px;
        max-height: 55px;
    }

    .button-bar button img {
        width: 30px;
        max-width: 30px;
        height: 30px;
        max-height: 30px;
    }

    .buy-button {
        position: absolute;
        top: 95%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: #00ff00;
        color: black;
        border: none;
        border-radius: 5px;
        width: 100px;
        cursor: pointer;
        font-size: 20px;
        padding: 10px 20px;
        display: flex;
        justify-content: center;
        align-items: center;
    }    

    .progress-rectangle,
    .th-s-rectangle,
    .leaderboard-rectangle {
        width: 325px;
        max-width: 325px;
    }

    .graph-rectangle {
        width: 375px;
        max-width: 375px;
        height: 155px;
        max-height: 155px;
    }

    .graph-logo {
        width: 70px;
        max-width: 70px;
        height: 70px;
        max-height: 70px;
    }

    .withdraw-option {
        width: 91.5%;
    }

    .withdraw-button {
        top: -2%;
        left: 25%;
        width: 150px;
    }

    .withdraw-input input {
        width: 100%;
        background: #333;
        border: 1px solid #444;
        color: white;
        border-radius: 5px;
        box-sizing: border-box;
        font-size: 15px;
    }

    #confirm-username-btn {
        top: 29%;
        left: 37%;
        width: 100px;
    }

    .market-item {
        padding: 8px; /* Slightly reduce padding for smaller screens */
    }

    .market-item-image {
        width: 40px; /* Adjust image size */
        height: 40px;
    }

    .market-item-details {
        font-size: 9px; /* Slightly smaller text */
    }

    .market-button {
        padding: 6px 12px; /* Adjust button size */
        font-size: 13px;
    }

    /* Adjust wallet address for smaller screens */
    .topup-rectangle.wallet-address p.copyable {
        font-size: 12px;
        word-spacing: 1.5px;
    }

    /* Adjust help layer buttons for smaller screens */
    #help .layer-content a {
        padding: 6px 8px;
        font-size: 13px;
        max-width: 180px;
    }
    .payment-widget {
        height: 120px;
    }
    .currency-option {
        padding: 5px 10px;
        font-size: 13px;
    }
    #amount {
        border-color: #444;
        background-color: var(--input-bg-dark, #2a2a2a);
        color: var(--text-color-dark, #fff);
    }

    #amount:focus {
        border-color: var(--primary-color, #4CAF50);
        box-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
    }

    .footer-text {
        color: var(--text-muted-dark, #aaa);
    }
    .submit-button {
        width: 120px; /* Slightly smaller for small screens */
        padding: 8px 16px;
        font-size: 14px;
    }
    .min_deposit_rub {
        top: 290px; /* Adjust for smaller screens */
    }
}

/* Medium Mobile Devices (411px to 435px) */
@media screen and (min-width: 411px) and (max-width: 435px) {
    body {
        padding-top: 20px;
    }

    .layer-content {
        width: 90%;
        max-width: 90%;
    }

    .top-bar {
        width: 98%;
        padding: 0 1%;
    }

    .balance {
        width: 150px;
        max-width: 150px;
        height: 45px;
        max-height: 45px;
    }

    .balance-text {
        font-size: 15px;
    }

    .balance-icon {
        width: 30px;
        height: 30px;
    }

    .right-buttons {
        margin-top: 29.5%;
        margin-right: 0%;
        display: flex;
        align-items: center;
    }

    .mining-rig {
        width: 240px;
        max-width: 240px;
        height: 240px;
        max-height: 240px;
    }

    .button-bar {
        width: 98%;
        padding: 0 1%;
    }

    .button-bar button {
        width: 55px;
        max-width: 55px;
        height: 55px;
        max-height: 55px;
    }

    .button-bar button img {
        width: 30px;
        max-width: 30px;
        height: 30px;
        max-height: 30px;
    }

    .buy-button {
        position: absolute;
        top: 87%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: #00ff00;
        color: black;
        border: none;
        border-radius: 5px;
        width: 100px;
        cursor: pointer;
        font-size: 20px;
        padding: 10px 20px;
        display: flex;
        justify-content: center;
        align-items: center;
    }    

    .progress-rectangle,
    .th-s-rectangle,
    .leaderboard-rectangle {
        width: 325px;
        max-width: 325px;
    }

    .graph-rectangle {
        width: 375px;
        max-width: 375px;
        height: 155px;
        max-height: 155px;
    }

    .graph-logo {
        width: 70px;
        max-width: 70px;
        height: 70px;
        max-height: 70px;
    }

    .withdraw-option {
        width: 91.5%;
    }

    .withdraw-button {
        top: -2%;
        left: 28%;
        width: 150px;
    }

    .withdraw-input input {
        width: 100%;
        background: #333;
        border: 1px solid #444;
        color: white;
        border-radius: 5px;
        box-sizing: border-box;
        font-size: 15px;
    }

    .market-item {
        padding: 10px;
    }

    .market-item-image {
        width: 45px;
        height: 45px;
    }

    .market-item-details {
        font-size: 10px;
    }

    .market-button {
        padding: 8px 15px;
        font-size: 14px;
    }

    #confirm-username-btn {
        top: 29%;
        left: 37%;
        width: 100px;
    }

    /* Adjust wallet address for medium screens */
    .topup-rectangle.wallet-address p.copyable {
        font-size: 12.5px;
        word-spacing: 1.8px;
    }

    /* Adjust help layer buttons for medium screens */
    #help .layer-content a {
        padding: 7px 9px;
        font-size: 13.5px;
        max-width: 190px;
    }
    .payment-widget {
        height: 130px;
    }
    .currency-option {
        padding: 5px 12px;
        font-size: 13.5px;
    }
    #amount {
        border-color: #444;
        background-color: var(--input-bg-dark, #2a2a2a);
        color: var(--text-color-dark, #fff);
    }

    #amount:focus {
        border-color: var(--primary-color, #4CAF50);
        box-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
    }

    .footer-text {
        color: var(--text-muted-dark, #aaa);
    }
    .submit-button {
        width: 130px;
        padding: 8px 18px;
        font-size: 14.5px;
    }
    .min_deposit_rub {
        top: 295px;
    }
}

/* Tablets (431px to 767px) */
@media screen and (min-width: 431px) and (max-width: 767px) {
    body {
        padding-top: 22px;
    }

    .layer-content {
        width: 90%;
        max-width: 400px;
    }

    .top-bar {
        width: 96%;
        padding: 0 2%;
    }

    .balance {
        width: 150px;
        max-width: 150px;
        height: 45px;
        max-height: 45px;
    }

    .mining-rig {
        width: 240px;
        max-width: 240px;
        height: 240px;
        max-height: 240px;
    }

    .button-bar button {
        width: 55px;
        max-width: 55px;
        height: 55px;
        max-height: 55px;
    }

    .buy-button {
        position: absolute;
        top: 90%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: #00ff00;
        color: black;
        border: none;
        border-radius: 5px;
        width: 100px;
        cursor: pointer;
        font-size: 20px;
        padding: 10px 20px;
        display: flex;
        justify-content: center;
        align-items: center;
    }  

    .progress-rectangle,
    .th-s-rectangle,
    .leaderboard-rectangle {
        width: 355px;
        max-width: 355px;
    }

    .graph-rectangle {
        width: 375px;
        max-width: 375px;
        height: 155px;
        max-height: 155px;
    }

    .withdraw-option {
        width: 91.5px;
    }

    .withdraw-button {
        top: 1%;
        left: 33%;
        width: 150px;
    }

    .market-item {
        padding: 10px;
    }

    .market-item-image {
        width: 50px;
        height: 50px;
    }

    .market-item-details {
        font-size: 10px;
    }

    .market-button {
        padding: 8px 15px;
        font-size: 15px;
    }

    #confirm-username-btn {
        top: 27%;
        left: 37%;
        width: 100px;
    }

    /* Adjust wallet address for tablets */
    .topup-rectangle.wallet-address p.copyable {
        font-size: 13px;
        word-spacing: 2px;
    }

    /* Adjust help layer buttons for tablets */
    #help .layer-content a {
        padding: 8px 10px;
        font-size: 14px;
        max-width: 200px;
    }
    .payment-widget {
        height: 140px;
    }
    .currency-option {
        padding: 5px 15px;
        font-size: 14px;
    }
    #amount {
        border-color: #444;
        background-color: var(--input-bg-dark, #2a2a2a);
        color: var(--text-color-dark, #fff);
    }

    #amount:focus {
        border-color: var(--primary-color, #4CAF50);
        box-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
    }

    .footer-text {
        color: var(--text-muted-dark, #aaa);
    }
    .submit-button {
        width: 140px;
        padding: 10px 20px;
        font-size: 15px;
    }
    .min_deposit_rub {
        top: 300px;
    }
}

/* Large Devices (Desktops, 768px and up) */
@media screen and (min-width: 768px) {
    #access-denied h1 {
        font-size: 32px;
    }

    #access-denied p {
        font-size: 20px;
    }
    .payment-widget {
        height: 160px;
    }
    .currency-option {
        padding: 5px 15px;
        font-size: 14px;
    }
    #amount {
        border-color: #444;
        background-color: var(--input-bg-dark, #2a2a2a);
        color: var(--text-color-dark, #fff);
    }

    #amount:focus {
        border-color: var(--primary-color, #4CAF50);
        box-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
    }

    .footer-text {
        color: var(--text-muted-dark, #aaa);
    }
    .submit-button {
        width: 150px;
        padding: 10px 20px;
        font-size: 16px;
    }
    /* No need to adjust app-specific styles since they won’t be shown on desktop */
}