/* Game Board Container */
.game-board-container {
    display: flex;
    justify-content: center;
    margin-bottom: 0.7rem;
    padding-top: 0.5rem;
}

.game-board {
    display: grid;
    row-gap: 0.35rem;
    column-gap: 0.25rem;
    margin: 0 auto;
    justify-content: center;
}

.cell {
    width: 45px;
    height: 45px;
    border: 2px solid #d1d5db;
    border-radius: 0px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    line-height: 1.5rem;
    font-weight: 700;
    background-color: #ffffff;
    color: #141c3a;
    transition: all 0.3s;
    border-radius: 6px;
}

/* Desktop: 45x45 (default) */
@media (min-width: 768px) {
    .cell {
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 767px) {
    .cell {
        width: 55px;
        height: 55px;
    }
}

.cell.filled {
    border-color: #9ca3af;
}

.cell.correct {
    background-color: #22c55e;
    color: #ffffff;
    border-color: #22c55e;
}

.cell.present {
    background-color: #facc15;
    color: #ffffff;
    border-color: #facc15;
}

.cell.absent {
    background-color: rgb(107 114 128);
    color: #ffffff;
    border-color: rgb(107 114 128);
}

.cell.shake {
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Keyboard */
.keyboard-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
    padding-top: 0.5rem;
}

.keyboard {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.keyboard-wrapper {
    display: flex;
    align-items: stretch; /* Stretch to match letters container height */
    gap: 0.2rem; /* 0.25rem * 0.8 = 0.2rem */
    direction: rtl;
    justify-content: center;
}

.keyboard-letters {
    display: flex;
    flex-direction: column;
    gap: 0.2rem; /* 0.25rem * 0.8 = 0.2rem */
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 0.2rem; /* 0.25rem * 0.8 = 0.2rem */
}

.key {
    min-width: 2rem;
    width: 2rem;
    height: 2.7rem;
    border: none;
    border-radius: 0px;
    background-color: #d1d5db;
    color: #141c3a;
    font-size: 1.25rem; /* 0.8rem * 1.2 = 0.96rem - 20% larger */
    line-height: 1.2rem;
    font-weight: 700;
    font-family: 'Assistant', 'Arial', 'Rubik', sans-serif;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.key:hover {
    background-color: #c4c8d0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.key:active {
    background-color: #bfc3c9;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    transform: translateY(1px);
}



.key-backspace {
    min-width: 4rem; /* Double width - 2 cells */
    width: 4rem;
    height: 2.7rem;
    background-color: #d1d5db;
    color: #141c3a;
    border: none;
    border-radius: 0px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.key-backspace svg {
    width: 18px;
    height: 18px;
    display: block;
}

.key-confirm {
    min-width: 4rem; /* Double width - 2 keys */
    width: 4rem;
    height: 8.5rem; /* 3 * 2.7rem + 2 * 0.2rem = 8.1rem + 0.4rem = 8.5rem */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.375rem; /* 6px gap between text and arrow */
    padding: 0.4rem 0.2rem;
    direction: rtl;
    background-color: #d1d5db;
    color: #0f172a;
    border: none;
    border-radius: 0px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.key-confirm:hover {
    background-color: #c4c8d0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.key-confirm:active {
    background-color: #bfc3c9;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    transform: translateY(1px);
}

.confirm-text {
    font-size: 0.9375rem; /* 15px */
    line-height: 1.2rem;
    font-weight: 700;
    text-align: center;
    color: #0f172a;
    font-family: 'Assistant', 'Arial', 'Rubik', sans-serif;
}

.confirm-icon {
    font-size: 1.5rem;
    line-height: 1.25rem;
    text-align: center;
    color: #0f172a;
    font-weight: 500;
}

.key.correct {
    background-color: #22c55e;
    color: #ffffff;
    border-color: #22c55e;
}

.key.present {
    background-color: #facc15;
    color: #ffffff;
    border-color: #facc15;
}

.key.absent {
    background-color: rgb(107 114 128);
    color: #ffffff;
    border-color: rgb(107 114 128);
}

.keyboard-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Header positioning for info button */
header > div {
    position: relative;
}

header .info-button-desktop {
    position: absolute;
    right: calc(50% + 270px);
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
}

/* Game Settings */
.game-settings {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin-bottom: 0.7rem;
    padding: 0;
    flex-wrap: wrap;
    gap: 1.5rem;
    direction: rtl;
    position: relative;
}

/* Custom Word Action Buttons */
.custom-word-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.custom-action-btn {
    padding: 0.7rem 1.05rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
    white-space: nowrap;
}

.custom-action-btn-green {
    background-color: #22c55e;
    color: #ffffff;
}

.custom-action-btn-green:hover {
    background-color: #16a34a;
}

.custom-action-btn-gray {
    background-color: #4b5563;
    color: #ffffff;
}

.custom-action-btn-gray:hover {
    background-color: #374151;
}

.setting-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.setting-label {
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 500;
    color: #141c3a;
    text-align: center;
    margin-bottom: 0.25rem;
}

.setting-label-desktop {
    text-align: right !important;
}

.difficulty-buttons,
.length-buttons {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
    justify-content: center;
}

.difficulty-btn,
.length-btn {
    padding: 0.375rem 1rem;
    border-radius: 0.375rem;
    font-size: 17px;
    font-weight: 400;
    background-color: #eff6ff;
    color: #141c3a;
    font-size: 0.875rem;
    line-height: 1.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 17px;
    font-weight: 400;
}

.difficulty-btn:hover,
.length-btn:hover {
    background-color: #f3f4f6;
}

.difficulty-btn.active,
.length-btn.active {
    background-color: #22c55e;
    color: #ffffff;
    border-color: #22c55e;
}

.length-btn {
    min-width: 2.5rem;
}

.create-word-btn {
    background-color: #1e40af;
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    text-decoration: none;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 500;
    transition: background-color 0.2s;
    border: none;
    cursor: pointer;
    display: inline-block;
    text-align: center;
}

.create-word-btn:hover {
    background-color: #1e3a8a;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background-color: #2563eb;
    color: #fff;
}

.btn-primary:hover {
    background-color: #1e40af;
}

.btn-secondary {
    background-color: #6b7280;
    color: #fff;
}

.btn-secondary:hover {
    background-color: #4b5563;
}

/* Game Message - Toast Style */
.game-message {
    display: none;
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    max-width: 90%;
    max-width: 400px;
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
    z-index: 9999;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    animation: toastFadeIn 0.3s ease-out;
    pointer-events: none;
}

.game-board-container {
    margin-top: 0;
}

.game-message.show {
    display: block;
}

.game-message.success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.game-message.error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

@keyframes toastFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

@keyframes toastFadeOut {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px) scale(0.9);
    }
}

.game-message.hiding {
    animation: toastFadeOut 0.3s ease-in;
}

/* Mobile Menu Button */
.mobile-menu-button {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    align-items: center;
    justify-content: center;
}

.menu-line {
    width: 24px;
    height: 3px;
    background-color: #141c3a;
    border-radius: 2px;
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    direction: rtl;
}

.mobile-menu.hidden {
    display: none;
}

.mobile-menu-content {
    background-color: #ffffff;
    border-radius: 0.5rem;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.mobile-menu-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: #6b7280;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.mobile-menu-close:hover {
    color: #141c3a;
}

.mobile-menu-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

/* Responsive */
@media (max-width: 767px) {
    /* Hide INFO button on mobile */
    .info-button-desktop {
        display: none !important;
    }
    
    /* Make header title full width and bold */
    .header-title-container {
        width: 100%;
    }
    
    .header-title {
        width: 100%;
        font-size: 18px !important;
    }
    
    /* Hide mobile menu button from header (it's now in length buttons) */
    header .mobile-menu-button {
        display: none;
    }
    
    /* Show mobile menu button inline with length buttons */
    .mobile-menu-button-inline {
        display: flex !important;
        margin-left: 0.5rem;
    }
    
    /* Hide labels on mobile */
    .setting-label-desktop {
        display: none;
    }
    
    /* Show only "צרו" on mobile, hide "צרו מילה" */
    .create-word-text-desktop {
        display: none;
    }
    
    .create-word-text-mobile {
        display: inline;
    }
    
    .mobile-menu-button {
        display: flex;
    }
    
    .difficulty-group {
        display: none;
    }
    
    .length-btn-mobile-hidden {
        display: none;
    }
    
    .length-buttons-container {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    /* Increase font size for length buttons and create word button on mobile */
    .length-btn {
        font-size: 1.01rem !important; /* ~15% increase from 0.875rem */
    }
    
    .create-word-btn {
        font-size: 1.01rem !important; /* ~15% increase from 0.875rem */
    }
    
    .game-board {
        row-gap: 0.25rem;
        column-gap: 0.12rem;
    }
    
    .cell {
        width: 55px;
        height: 55px;
        font-size: 1.3rem;
        line-height: 1.375rem;
    }
    
    /* Smaller cells for length 6-7 on mobile */
    .cell-size-small {
        width: 48px !important;
        height: 48px !important;
        font-size: 1.15rem !important;
    }
    .key {
        font-size: 1.3rem;
    }
    
    
    .game-settings {
        gap: 1rem;
    }
}

@media (min-width: 768px) {
    .create-word-text-desktop {
        display: inline;
    }
    
    .create-word-text-mobile {
        display: none;
    }
    
    .mobile-menu-button-inline {
        display: none !important;
    }
}

