:root {
    --bg: #252525;
    --panel: #2f2f2f;
    --panel-strong: #333333;
    --text: #f1f1f1;
    --muted: #b8b8b8;
    --nav-bg: #202020;
    --nav-text: #f5f5f5;
    --border: #555;
    --primary: #2d5a2d;
    --primary-hover: #3a6f3a;
    --button-bg: #444;
    --button-hover: #555;
    --button-shadow: #151515;
}

body {
    font-family: 'Courier New', Courier, monospace;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
}

/* Shared top navigation. */
.navbar {
    background-color: var(--nav-bg);
    padding: 10px 20px;
    display: flex;
    gap: 20px;
    align-items: center;
    border-bottom: 3px solid var(--primary);
}

.navbar .logo {
    font-size: 1.45em;
    font-weight: bold;
    color: #72b772;
    text-decoration: none;
    margin-right: auto;
}

.navbar a {
    color: var(--nav-text);
    text-decoration: none;
    font-size: 1em;
}

.navbar a:hover {
    text-decoration: underline;
    color: #72b772;
}

.navbar .github-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin-left: -8px;
}

.navbar .github-link img {
    width: 28px;
    height: 28px;
    display: block;
    filter: invert(1);
}

.container {
    width: calc(100% - 56px);
    max-width: 1180px;
    margin: 30px auto;
    background: var(--panel);
    padding: 20px 30px;
    box-sizing: border-box;
    border: 1px solid var(--border);
    box-shadow: 4px 4px 0px #111;
}

.home-page .container p,
.home-page .container li {
    font-size: 1.08rem;
    line-height: 1.5;
}

.thesis-preview {
    display: block;
    width: min(100%, 320px);
    margin: 20px auto;
}

.thesis-preview img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--border);
    box-shadow: 4px 4px 0 #111;
}

h1, h2 { border-bottom: 1px solid var(--border); padding-bottom: 5px; }
p, small, li { color: var(--muted); }
code { color: #b7d7ff; }

button {
    background: var(--button-bg);
    color: var(--text);
    border: 1px solid #666;
    padding: 8px 16px;
    font-family: inherit;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 2px 2px 0px var(--button-shadow);
}
button:hover { background: var(--button-hover); transform: translate(1px, 1px); box-shadow: 1px 1px 0px var(--button-shadow); }
button:active { transform: translate(2px, 2px); box-shadow: 0px 0px 0px var(--button-shadow); }

input[type="number"], textarea {
    font-family: inherit;
    color: var(--text);
    padding: 5px;
    border: 1px solid #777;
    background: #202020;
}

.editor-frame {
    min-height: 400px;
    max-height: 60vh;
    overflow: auto;
    border: 1px solid #777;
    background: #202020 !important;*/
    box-shadow: inset 1px 1px 0 #111;
}

#code-editor {
    display: block;
    min-height: 400px;
    outline: none;
    white-space: pre;
    color: #EfEfEf;
    background: #202020;
}

.result-box {
    margin-top: 20px;
    padding: 15px;
    background: #223322;
    border: 1px solid #4f7e4f;
    font-size: 1.1em;
}

.grid {
    display: grid;
    gap: 3px;
    margin: 28px 0;
    background: #555;
    border: 2px solid #777;
    padding: 3px;
    width: max-content;
}
.cell {
    width: var(--cell-size, 40px);
    height: var(--cell-size, 40px);
    background: #202020;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
}


.board-page .container {
    min-height: calc(100vh - 150px);
    font-size: 1.25rem;
}

.board-page h1 { font-size: 2.6rem; }
.board-page p, .board-page label, .board-page button, .board-page .result-box { font-size: 1.25rem; }
.board-page input[type="number"] { width: 5.5rem; font-size: 1.2rem; }
.board-page .grid { --cell-size: clamp(88px, 9vw, 112px); }
.board-page .cell { font-size: 1.6rem; }
