* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #fff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: monospace;
}

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

.grid {
    display: grid;
    grid-template-columns: repeat(7, 50px);
    grid-template-rows: repeat(7, 50px);
    gap: 0;
    position: relative;
    border: 1px solid #000;
}

.cell {
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    cursor: pointer;
    border: 1px solid #ddd;
}

.island {
    width: 30px;
    height: 30px;
    background: #000;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-weight: bold;
    font-size: 16px;
    z-index: 10;
}

.island.selected {
    background: #666;
}

.bridge {
    position: absolute;
    background: #000;
    z-index: 5;
}

.bridge.horizontal {
    height: 2px;
    top: 50%;
    transform: translateY(-50%);
}

.bridge.vertical {
    width: 2px;
    left: 50%;
    transform: translateX(-50%);
}

.bridge.double.horizontal {
    height: 6px;
}

.bridge.double.vertical {
    width: 6px;
}

button {
    padding: 10px 20px;
    font-size: 14px;
    border: 1px solid #000;
    background: #fff;
    cursor: pointer;
    font-family: monospace;
}

button:hover {
    background: #000;
    color: #fff;
}