/* Стили для кнопки меню - используем те же стили, что и у frame1-button */
.menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--color-bg);
    border: 2px solid #393639;
    border-radius: 12px;
    color: #393639;
    text-decoration: none;
    font-family: 'Days One', sans-serif;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.3s;
    box-shadow: 
        0 2px 0px rgba(0, 0, 0, 0.2),
        0 4px 8px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    cursor: pointer;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    line-height: 1.2;
    box-sizing: border-box;
    flex-shrink: 0;
}

.menu-button:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 0px rgba(0, 0, 0, 0.3),
        0 8px 16px rgba(0, 0, 0, 0.15);
    background: var(--color-bg);
    color: #393639;
}

.menu-button:active {
    transform: translateY(0px);
}

.menu-button span {
    display: inline-flex;
    align-items: center;
}

/* Выравнивание иконки меню так, чтобы средняя линия была по центру текста */
.menu-button span:first-child {
    font-size: 1em;
    line-height: 1;
    display: inline-block;
    vertical-align: middle;
    transform: translateY(-0.1em);
}

/* Адаптивность для мобильных - как у frame1-button */
@media (max-width: 767px) {
    .menu-button {
        flex-shrink: 1 !important;
        min-width: 0 !important;
        padding: 10px 14px !important;
        font-size: 13px !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
}

@media (max-width: 480px) {
    .menu-button {
        padding: 8px 12px !important;
        font-size: 12px !important;
        letter-spacing: 0.3px !important;
    }
}

/* Выпадающее меню настроек */
.settings-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: clamp(300px, 90vw, 500px);
    max-width: 90vw;
    height: 100vh;
    background: #F2F2F2;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    overflow-y: auto;
    padding: clamp(12px, 2.5vw, 24px) clamp(16px, 3vw, 24px);
    box-sizing: border-box;
}

.settings-menu.open {
    transform: translateX(0);
}

.settings-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: clamp(8px, 1.5vw, 12px);
    margin-top: clamp(-10px, -2vw, -5px);
    padding-bottom: clamp(8px, 1.5vw, 12px);
    border-bottom: none;
}

.settings-menu-title {
    font-family: 'Days One', sans-serif;
    font-size: clamp(18px, 4vw, 24px);
    color: #373639;
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1.2;
}

.settings-menu-close {
    background: #ff7664;
    border: 2px solid #383638;
    border-radius: 8px;
    padding: clamp(4px, 1vw, 6px) clamp(8px, 1.5vw, 10px);
    font-family: 'Days One', sans-serif;
    font-size: clamp(12px, 2vw, 16px);
    font-weight: 700;
    color: #FFFFFF;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 
        0 2px 0px rgba(0, 0, 0, 0.15),
        0 4px 8px rgba(0, 0, 0, 0.1);
    text-transform: uppercase;
    min-width: auto;
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    margin-top: -20px;
}

.settings-menu-close:hover {
    background: #ff5a45;
    transform: translateY(-1px);
    box-shadow: 
        0 3px 0px rgba(0, 0, 0, 0.2),
        0 5px 10px rgba(0, 0, 0, 0.15);
}

.settings-menu-close:active {
    transform: translateY(1px);
    box-shadow: 
        0 1px 0px rgba(0, 0, 0, 0.2),
        0 2px 4px rgba(0, 0, 0, 0.1);
}

.settings-menu-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(16px, 3vw, 24px);
    margin-top: clamp(-15px, -3vw, -10px);
}

.settings-menu-card {
    background: #F2F2F2;
    border: 3px solid #383638;
    border-radius: clamp(12px, 2.5vw, 20px);
    padding: clamp(16px, 3vw, 24px);
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    box-shadow: 
        0 4px 0px rgba(0, 0, 0, 0.15),
        0 6px 12px rgba(0, 0, 0, 0.1);
    display: block;
}

.settings-menu-card:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 0px rgba(0, 0, 0, 0.2),
        0 8px 16px rgba(0, 0, 0, 0.15);
    background: rgba(242, 242, 242, 0.9);
}

.settings-menu-card-icon {
    font-size: clamp(32px, 6vw, 48px);
    margin-bottom: clamp(12px, 2vw, 16px);
    display: block;
    text-align: center;
}

.settings-menu-card-title {
    font-family: 'Days One', sans-serif;
    font-size: clamp(18px, 3.5vw, 24px);
    color: #373639;
    font-weight: 700;
    margin-bottom: clamp(8px, 1.5vw, 12px);
    text-align: center;
}

.settings-menu-card-description {
    font-family: 'Days One', sans-serif;
    font-size: clamp(14px, 2.5vw, 18px);
    color: #373639;
    font-weight: 400;
    opacity: 0.85;
    text-align: center;
    line-height: 1.4;
}

.local-mode-link {
    display: block;
    margin-top: 12px;
    padding: 8px 16px;
    background: rgba(0, 193, 89, 0.1);
    border: 2px solid #00C159;
    border-radius: 8px;
    color: #00C159;
    text-decoration: none;
    font-family: 'Days One', sans-serif;
    font-size: clamp(12px, 2vw, 14px);
    text-align: center;
    transition: all 0.2s;
    font-weight: 700;
}

.local-mode-link:hover {
    background: #00C159;
    color: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 193, 89, 0.3);
}

.local-mode-link:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 193, 89, 0.2);
}

/* Оверлей для закрытия меню */
.settings-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(56, 54, 56, 0.5);
    z-index: 9999;
    display: none;
    backdrop-filter: blur(2px);
}

.settings-menu-overlay.active {
    display: block;
}

/* Модальное окно для пароля настроек */
.settings-password-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(56, 54, 56, 0.85);
    z-index: 10001;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.settings-password-modal.active {
    display: flex;
}

.settings-password-content {
    background: #F2F2F2;
    border-radius: 24px;
    padding: clamp(24px, 4vw, 36px) clamp(20px, 4vw, 32px);
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 
        0 8px 0px rgba(0, 0, 0, 0.2),
        0 16px 32px rgba(0, 0, 0, 0.3);
    box-sizing: border-box;
}

.settings-password-title {
    font-family: 'Days One', sans-serif;
    font-size: clamp(24px, 5vw, 32px);
    color: #393639;
    margin-bottom: 16px;
    text-transform: uppercase;
}

.settings-password-input {
    width: 100%;
    padding: clamp(14px, 3vw, 18px);
    border: 3px solid #393639;
    border-radius: 12px;
    font-family: 'Days One', sans-serif;
    font-size: clamp(20px, 4vw, 24px);
    text-align: center;
    margin-bottom: clamp(16px, 3vw, 20px);
    box-sizing: border-box;
}

.settings-password-input:focus {
    outline: none;
    border-color: #abf67c;
    box-shadow: 0 0 0 4px rgba(168, 224, 99, 0.2);
}

.settings-password-buttons {
    display: flex;
    gap: clamp(8px, 2vw, 12px);
    width: 100%;
    box-sizing: border-box;
}

.settings-password-button {
    background: #abf67c;
    color: #2fb95d;
    border: none;
    padding: clamp(12px, 2.5vw, 16px) clamp(16px, 3vw, 24px);
    border-radius: 12px;
    font-family: 'Days One', sans-serif;
    font-size: clamp(16px, 3vw, 20px);
    cursor: pointer;
    box-shadow: 0 4px 0px rgba(47, 185, 93, 0.3), 0 6px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
    flex: 1;
    box-sizing: border-box;
    min-width: 0;
}

.settings-password-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0px rgba(47, 185, 93, 0.4), 0 8px 16px rgba(0, 0, 0, 0.15);
}

.settings-password-button:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0px rgba(0, 0, 0, 0.2);
}

.settings-password-button.back {
    background: #f2f2f2;
    color: #393639;
}

.settings-password-button.back:hover {
    background: #E0E0E0;
}

.settings-password-error {
    color: #ff7664;
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(14px, 2.5vw, 16px);
    margin-top: 12px;
    min-height: 20px;
    display: none;
}

.settings-password-error.show {
    display: block;
}

/* Переключатель режима игры */
.mode-toggle-switch {
    margin-top: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 0;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
    border: 2px solid #383638;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
    background-color: #00C159;
    border-color: #00C159;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

input:disabled + .slider {
    opacity: 0.5;
    cursor: not-allowed;
}

#mode-toggle-card {
    cursor: pointer;
}

#mode-toggle-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

#current-mode-text {
    font-size: clamp(12px, 2vw, 14px);
    margin-top: 8px;
    display: block;
}

