* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background: #ffffff;
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.grid-container {
    position: relative;
    width: 400px;
    height: 400px;
    background: #808080;
    border: 4px solid #000000;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.8);
    border-radius: 8px;
}

.connections-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.connection-line {
    stroke: #000000;
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke 0.2s;
}

.connection-line.active {
    stroke: #ffffff;
}


.letters-grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    width: 100%;
    height: 100%;
    z-index: 2;
    padding: 20px;
    gap: 0;
}

.letter {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: #858585;
    cursor: pointer;
    user-select: none;
    width: 50px;
    height: 50px;
    margin: auto;
}

.letter::before {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    background: #000000;
    border-radius: 50%;
    z-index: -1;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.8);
    transition: box-shadow 0.2s, background 0.2s;
}

.letter.active::before {
    background: #ffffff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
}

.status {
    text-align: center;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: bold;
    display: none;
}

.status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.attempts {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 400px;
    margin-top: 15px;
    padding: 10px;
    background: #ffffff;
    box-shadow: 2px 1px 5px rgba(0, 0, 0, 0.8);
    border-radius: 6px;
}

.attempt {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 8px;
    border-bottom: 1px solid #ccc;
}

.attempt:last-child {
    border-bottom: none;
}

.attempt h2 {
    margin: 0;
    font-size: 16px;
}

.fail {
    color: #f17777;
    text-shadow: 0 0 5px rgba(252, 96, 96, 0.8);
    font-weight: bold;
}

.input-box {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    width: 100%;
    max-width: 400px;
    justify-content: center;
}

.input-box input {
    flex: 1;
    padding: 8px 12px;
    font-size: 16px;
    border-radius: 6px;
    outline: none;
}

.input-box button {
    padding: 8px 16px;
    font-size: 16px;
    background: #000;
    color: #fff;
    border-radius: 6px;
    border: none !important;
    cursor: pointer;
    box-shadow: 2px 1px 5px rgba(0, 0, 0, 0.8);
    transition: box-shadow 0.2s ease, background 0.2s ease;
}

.input-box button:hover {
    background: #333;
}

.input-box button#check-btn.Valid {
    box-shadow: 2px 1px 5px rgba(124, 218, 70, 0.8);
    background: #a9ff8f;
}

.input-box button#check-btn.Invalid {
    box-shadow: 2px 1px 5px rgba(253, 124, 124, 0.8);
    background: #f76868;
}
