@import url("https://fonts.googleapis.com/css2?family=Roboto+Mono&family=Tiny5");

/* --- Base --- */

html {
    padding: 1rem;
}

body {
    font-family: "Roboto Mono", monospace;
}

main {
    max-width: 720px;
    margin: 0 auto;
}

main a:visited {
    color: blue;
}

code {
    background-color: #f4f4f4;
    padding: 2px 5px;
    border-radius: 3px;
}

pre code {
    background: none;
    padding: 0;
    border-radius: 0;
}

pre {
    background-color: #f4f4f4;
    padding: 10px;
    border: 1px solid #ddd;
    white-space: pre-wrap;
    user-select: text;
    overflow-wrap: anywhere;
}

header hr {
    max-width: 720px;
    margin: 0 auto;
}

/* --- Header & nav --- */

.header {
    font-family: "Tiny5", sans-serif;
    text-decoration: none;
    color: black;
}

.header:visited {
    color: black;
}

h1 {
    max-width: 720px;
    margin: 0 auto 1em;
}

.orange {
    color: #d45b12;
}

.container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 720px;
    margin: 0 auto;
}

.right-links {
    display: flex;
}

.nav-bar {
    font-size: 16px;
    color: blue;
    text-decoration: none;
    padding: 5px;
    transition: color 0.3s;
}

.nav-bar:hover {
    color: #000033;
    text-shadow:
        0.3px 0 currentColor,
        -0.3px 0 currentColor;
}

/* --- Problem list --- */

.problem-link {
    text-decoration: none;
    color: black;
    padding: 0.5rem;
    transition: background-color 0.3s;
}

.problem-link:visited {
    color: black;
}

.problem-link:hover {
    background-color: rgb(240, 240, 240);
}

.problem-link.solved {
    text-decoration: line-through;
}

.problem-link.unpublished {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.countdown {
    margin-left: 8px;
    font-size: 0.85em;
    opacity: 0.6;
}

/* --- Problem page --- */

#submit-feedback {
    color: #c0392b;
    font-weight: 600;
}

/* --- Profile --- */

.username-input {
    width: 120px;
    padding: 0;
    margin: 0;
    border: none;
    outline: none;
    background: transparent;
    color: inherit;
    font: inherit;
    line-height: inherit;
    caret-color: currentColor;
}

/* --- Statistics --- */

.stats-table tr:last-child {
    border-top: 2px solid #ccc;
    font-weight: 600;
}

.stats-table tr:last-child td {
    padding-top: 10px;
}

/* --- Dark mode --- */

[data-theme="dark"] {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

[data-theme="dark"] .header,
[data-theme="dark"] .header:visited {
    color: #e0e0e0;
}

[data-theme="dark"] .orange {
    color: #e8762a;
}

[data-theme="dark"] code {
    background-color: #2a2a2a;
}

[data-theme="dark"] pre {
    background-color: #2a2a2a;
    border-color: #444;
}

[data-theme="dark"] header hr {
    border-color: #444;
}

[data-theme="dark"] a,
[data-theme="dark"] main a:visited {
    color: #6ea8fe;
}

[data-theme="dark"] .nav-bar {
    color: #6ea8fe;
}

[data-theme="dark"] .nav-bar:hover {
    color: #e2eeff;
    text-shadow:
        0.3px 0 currentColor,
        -0.3px 0 currentColor;
}

[data-theme="dark"] .problem-link {
    color: #e0e0e0;
}

[data-theme="dark"] .problem-link:visited {
    color: #e0e0e0;
}

[data-theme="dark"] .problem-link:hover {
    background-color: #2a2a2a;
}

[data-theme="dark"] .problem-link.solved {
    color: #666;
}

[data-theme="dark"] .problem-link.unpublished {
    color: #666;
}

[data-theme="dark"] .countdown {
    color: #999;
}

[data-theme="dark"] #submit-feedback {
    color: #e74c3c;
}

[data-theme="dark"] .stats-table tr:last-child {
    border-color: #555;
}

.nav-separator {
    color: #ccc;
    padding: 0 2px;
    position: relative;
    top: 3px;
}

#theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
    color: inherit;
    padding: 5px;
}

#theme-toggle:hover {
    text-shadow:
        0.3px 0 currentColor,
        -0.3px 0 currentColor;
}
