.container {
    position: relative;
    min-height: 100vh;
    height: 200%;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
        -ms-flex-direction: column;
            flex-direction: column;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    z-index: 2;
}

h1, h2 {
    color: white;
    font-size: 48px;
    font-weight: 900;
    text-transform: uppercase;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.7), 
                 0 0 30px rgba(0, 136, 255, 0.8),
                 0 0 45px rgba(0, 106, 255, 0.5);
    letter-spacing: 4px;
    text-align: center;
    margin: 30px 0;
}

.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.grid-settings {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    z-index: 2;
    -ms-flex-wrap: wrap;
        flex-wrap: wrap;
    -webkit-box-pack: center;
        -ms-flex-pack: center;
            justify-content: center;
}

.grid-settings div {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
        -ms-flex-direction: column;
            flex-direction: column;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
}

.grid-settings label {
    color: white;
    margin-bottom: 8px;
    font-weight: bold;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.grid-settings input {
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 5px;
    padding: 8px;
    text-align: center;
    font-weight: bold;
    width: 100px;
}

.grid-container {
    position: relative;
    margin: 0 auto;
    width: -webkit-fit-content;
    width: -moz-fit-content;
    width: fit-content;
    background-color: transparent;
    -webkit-box-shadow: none;
            box-shadow: none;
}

.editor-container {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
        -ms-flex-pack: center;
            justify-content: center;
    width: 100%;
    z-index: 2;
    background-color: transparent;
    -webkit-box-shadow: none;
            box-shadow: none;
}

.editor-panel {
    width: 100%;
    max-width: 600px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    padding: 20px;
    -webkit-box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
            box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
}

.controls {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
        flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    -webkit-box-pack: center;
        -ms-flex-pack: center;
            justify-content: center;
}

button {
    background-color: #2d73ff;
    color: white;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    border-radius: 50px;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    -webkit-box-shadow: 0 0 20px rgba(45, 115, 255, 0.5);
            box-shadow: 0 0 20px rgba(45, 115, 255, 0.5);
    -webkit-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
}

button:hover {
    -webkit-transform: scale(1.05);
        -ms-transform: scale(1.05);
            transform: scale(1.05);
    -webkit-box-shadow: 0 0 30px rgba(66, 133, 244, 0.7);
            box-shadow: 0 0 30px rgba(66, 133, 244, 0.7);
}

button#create-grid {
    background-color: #ff3e3e;
    -webkit-box-shadow: 0 0 20px rgba(255, 62, 62, 0.5);
            box-shadow: 0 0 20px rgba(255, 62, 62, 0.5);
}

button#create-grid:hover {
    background-color: #ff5252;
    -webkit-box-shadow: 0 0 30px rgba(255, 62, 62, 0.7);
            box-shadow: 0 0 30px rgba(255, 62, 62, 0.7);
}

button.secondary {
    background-color: #2d2d2d;
    -webkit-box-shadow: 0 0 20px rgba(45, 45, 45, 0.5);
            box-shadow: 0 0 20px rgba(45, 45, 45, 0.5);
}

button.secondary:hover {
    background-color: #444444;
    -webkit-box-shadow: 0 0 30px rgba(68, 68, 68, 0.7);
            box-shadow: 0 0 30px rgba(68, 68, 68, 0.7);
}

button.success {
    background-color: #00a67e;
    -webkit-box-shadow: 0 0 20px rgba(0, 166, 126, 0.5);
            box-shadow: 0 0 20px rgba(0, 166, 126, 0.5);
}

button.success:hover {
    background-color: #00bf8f;
    -webkit-box-shadow: 0 0 30px rgba(0, 191, 143, 0.7);
            box-shadow: 0 0 30px rgba(0, 191, 143, 0.7);
}

button.warning {
    background-color: #ff3e3e;
    -webkit-box-shadow: 0 0 20px rgba(255, 62, 62, 0.5);
            box-shadow: 0 0 20px rgba(255, 62, 62, 0.5);
}

button.warning:hover {
    background-color: #ff5252;
    -webkit-box-shadow: 0 0 30px rgba(255, 62, 62, 0.7);
            box-shadow: 0 0 30px rgba(255, 62, 62, 0.7);
}

#save-level {
    background-color: #2d73ff;
    -webkit-box-shadow: 0 0 20px rgba(45, 115, 255, 0.5);
            box-shadow: 0 0 20px rgba(45, 115, 255, 0.5);
}

#save-level:hover {
    background-color: #4285f4;
    -webkit-box-shadow: 0 0 30px rgba(66, 133, 244, 0.7);
            box-shadow: 0 0 30px rgba(66, 133, 244, 0.7);
}

table.puzzle-grid {
    border-collapse: collapse;
    position: relative;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
    -webkit-box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
            box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    margin: 0 auto;
}

table.puzzle-grid th.corner-cell {
    width: 30px;
    height: 30px;
    background-color: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

table.puzzle-grid th.col-hint {
    width: 50px;
    height: 30px;
    background-color: rgba(0, 0, 0, 0.3);
    color: white;
    text-align: center;
    font-weight: bold;
    border: 2px solid rgba(255, 255, 255, 0.2);
    font-size: 16px;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.7), 
                0 0 10px rgba(0, 136, 255, 0.8),
                0 0 15px rgba(0, 106, 255, 0.5);
}

table.puzzle-grid th.row-hint {
    width: 30px;
    height: 50px;
    background-color: rgba(0, 0, 0, 0.3);
    color: white;
    text-align: center;
    font-weight: bold;
    border: 2px solid rgba(255, 255, 255, 0.2);
    font-size: 16px;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.7), 
                0 0 10px rgba(0, 136, 255, 0.8),
                0 0 15px rgba(0, 106, 255, 0.5);
}

table.puzzle-grid td {
    width: 50px;
    height: 50px;
    border: 2px solid rgba(0, 0, 0, 0.3);
    text-align: center;
    font-weight: bold;
    position: relative;
}

table.puzzle-grid td.cell {
    cursor: pointer;
    background-color: white;
    -webkit-transition: background-color 0.2s ease;
    -o-transition: background-color 0.2s ease;
    transition: background-color 0.2s ease;
    color: black;
}

table.puzzle-grid td.cell:hover {
    background-color: rgba(200, 200, 200, 1);
}

table.puzzle-grid td.filled {
    background-color: black;
    -webkit-box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
            box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
    color: white;
}

table.puzzle-grid td.head {
    background-color: #ff3e3e; 
    -webkit-box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
            box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

table.puzzle-grid td.tail {
    background-color: #00a67e; 
    -webkit-box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
            box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

.status {
    padding: 12px;
    border-radius: 8px;
    margin: 15px 0;
    text-align: center;
    font-weight: bold;
    max-width: 600px;
    width: 100%;
}

.success-msg {
    background-color: rgba(0, 166, 126, 0.2);
    border: 1px solid #00a67e;
    color: #00bf8f;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.error-msg {
    background-color: rgba(255, 62, 62, 0.2);
    border: 1px solid #ff3e3e;
    color: #ff5252;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.info-box {
    background-color: rgba(45, 115, 255, 0.2);
    border: 1px solid #2d73ff;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    text-align: center;
    color: white;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
}

.mode-selector {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    -webkit-box-pack: center;
        -ms-flex-pack: center;
            justify-content: center;
}

.radio-buttons {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    gap: 15px;
}

.radio-buttons label {
    display: inline-block;
    background-color: #2d2d2d;
    padding: 10px 15px;
    border-radius: 50px;
    margin-right: 5px;
    cursor: pointer;
    font-weight: bold;
    -webkit-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
    -webkit-box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
            box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.radio-buttons label:hover {
    -webkit-transform: scale(1.05);
        -ms-transform: scale(1.05);
            transform: scale(1.05);
}

.radio-buttons input[type="radio"] {
    display: none;
}

.radio-buttons input[type="radio"]:checked + label {
    background-color: #2d73ff;
    color: white;
    -webkit-box-shadow: 0 0 20px rgba(45, 115, 255, 0.5);
            box-shadow: 0 0 20px rgba(45, 115, 255, 0.5);
}

.table-wrapper {
    margin: 30px auto;
    overflow: hidden;
    border-radius: 8px;
    -webkit-box-shadow: 0 0 25px rgba(0, 0, 0, 0.3);
            box-shadow: 0 0 25px rgba(0, 0, 0, 0.3);
}

.title {
    position: relative;
    font-size: 72px;
    font-weight: 900;
    color: white;
    text-transform: uppercase;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.7), 
                 0 0 30px rgba(0, 136, 255, 0.8),
                 0 0 45px rgba(0, 106, 255, 0.5);
    letter-spacing: 4px;
    text-align: center;
    margin-bottom: 40px;
}

.controls .control-group {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0;
}

.controls .control-group label {
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    color: #fff;
    white-space: nowrap;
}

.controls .control-group input[type="text"],
.controls .control-group select {
    background-color: #f0f4ff;
    border: 1px solid #2d73ff;
    border-radius: 20px;
    padding: 8px 12px;
    font-size: 14px;
    color: #0D1B2A;
    min-width: 160px;
}

.controls .control-group input[type="text"]::placeholder {
    color: #777;
}

.controls .control-group select {
    appearance: none;
    background-repeat: no-repeat;
    background-position: calc(100% - 12px) center;
    padding-right: 32px;
}

footer{
    position: relative;
    z-index: 10;
}



@media (max-width: 768px) {
    h1 {
        font-size: 36px;
    }
    
    .grid-settings {
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
            -ms-flex-direction: column;
                flex-direction: column;
        -webkit-box-align: center;
            -ms-flex-align: center;
                align-items: center;
    }
    
    .controls {
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
            -ms-flex-direction: column;
                flex-direction: column;
        -webkit-box-align: center;
            -ms-flex-align: center;
                align-items: center;
    }
    
    .radio-buttons {
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
            -ms-flex-direction: column;
                flex-direction: column;
        -webkit-box-align: center;
            -ms-flex-align: center;
                align-items: center;
    }
}