:root {
  --grit-cols: 102;
  --grit-rows: 102;
  --grid-size: 6px;
  --cell-size: 5.9px;
}

body {
    display: flex;
    flex-direction: row-reverse;
    min-height: 100vh;
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0d1117;
    color: #e0e0e0;
    justify-content: space-evenly;
    align-items: center;
}

h1 {
    text-align: center;
}

h2, h3 {
    margin: 0;
}

#game {
    display: grid;
    grid-template-columns: repeat(var(--grit-cols), var(--grid-size));
    grid-template-rows: repeat(var(--grit-rows), var(--grid-size));
    gap: 0;
    background-color: rgba(255,255,255,0.05);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.cell {
    width: var(--cell-size);
    height: var(--cell-size);
    border-radius: 0;
    display: inline-block;
    box-sizing: border-box;
    border: none;
    padding: 0px;
}


#settings {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    flex-direction: column;
}

button, select {
    padding: 8px 16px;
    background-color: rgba(30,30,30,0.7);
    border: none;
    color: #e0e0e0;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.8);
}

button:hover, select:hover {
    background-color: rgba(30,30,30,0.9);
}

select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position-x: 95%;
    background-position-y: 50%;
    padding-right: 30px;
}

#rule0-settings, #convolution-settings {
    background-color: rgba(30,30,30,0.6);
    border-radius: 4px;
    padding: 15px;
    color: #e0e0e0;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.2);
}

#rule0-settings h2, #convolution-settings h2 {
    text-align: center;
    margin-top: 0;
}

#rule3-settings {
    background-color: rgba(30,30,30,0.6);
    padding: 10px;
    border-radius: 4px;
    color: #e0e0e0;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.2);
}

#rule3-settings label {
    margin-right: 10px;
}

.setting label {
    margin-right: 10px;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
}

.filter-grid input {
    width: 50px;
    padding: 4px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    background-color: rgba(255,255,255,0.1);
    color: #e0e0e0;
}

.separator {
    width: 4px;
    height: 100vh;
    background-color: rgba(255,255,255,0.2);
    margin: 0 20px;
}

footer {
    margin-top: 0;
    text-align: center;
    font-size: 0.9em;
    color: #888;
}

a {
    color: #58a6ff;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    text-decoration: underline;
    color: #79c0ff;
}
