:root {
    /* Light theme (default) */
    --bg-primary: #fff9ee;
    --bg-secondary: #fefaee;
    --text-primary: #2c2416;
    --text-secondary: #6b6158;
    --border-color: #e8dcd0;
    --link-text: #d97706;
    --link-text-2: rgb(187, 103, 6);
    --link-bg: #fef3e2;
    --link-hover-text: #ffffff;
    --link-hover-bg: #d97706;
    --visited-color: #8b5cf6;
    --visited-bg: #f3e8ff;
    --easy-color: #22c55e;
    --medium-color: #f59e0b;
    --tricky-color: #eab308;
    --hard-color: #ef4444;
    --evil-color: #a855f7;
    --row-color-1:#fff9ee;
    --row-color-2:#f9e9ca;
}

html[data-theme="dark"] {
    /* Dark theme */
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --text-primary: #c9d1d9;
    --text-secondary: #c4c7cb;
    --border-color: #30363d;
    --link-text: #58a6ff;
    --link-text-2: rgb(151, 196, 248);
    --link-bg: rgba(88, 166, 255, 0.10);
    --link-hover-text: #0d1117;
    --link-hover-bg: #79c1ff9b;
    --visited-color: #d291ff;
    --visited-bg: #b56aea;
    --easy-color: #3fb950;
    --medium-color: #fb8500;
    --tricky-color: #d29922;
    --hard-color: #ff7b72;
    --evil-color: #d291ff;
    --row-color-1:#0d1117;
    --row-color-2:#1d2737;
}

* {
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    margin: 0;
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

h2 {
    font-size:18px;
}

div.error {
    border-radius: 5px;
    border: 1px solid red;
    color:red;
    max-width: 400px;
    margin:5px auto;
}

div.auth, div.activate {
    padding: 0px 40px;
    margin:30px auto;
    max-width: 600px;
    text-align: center;
}

div.activate {
    margin:150px auto 0px;
    text-align: center;
    padding:30px;
}

div.activate form button    {
    margin:auto;
}

div.auth form {
    max-width:400px;
    margin:auto;
    text-align: left;
}

form div {
    display:grid;
    grid-template-columns: 100px 1fr;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

form label {
  font-size: 14px;
  font-weight: 600;
}

form input {
  padding: 10px 12px;
  font-size: 14px;
  width: 100%;
  font-size: 16px;
}

div.auth label {
    display:inline-block;
}
div.auth input {
    display:inline-block;
}

div.error p {
    margin:5px;
}

div.content {
    padding: 0px 20px 20px 20px;
    margin:auto;
    text-align: center;
}


div.top {
    display:flex;
    justify-content: space-between;
    align-content: center;
    background-color: var(--bg-primary);
    padding:20px 20px;
}

h1 {
    margin: 0 0 0.5rem 0;
    font-size: 1.75rem;
    font-weight: 600;
}

.subtitle {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}


button, table a {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    border: 1px solid var(--link-text);
    background-color: var(--link-bg);
    color: var(--link-text);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
    opacity: 0.92;
}

button:hover, button:focus, table a:hover,
table a:focus {
    background-color: var(--link-hover-bg);
    color: var(--link-hover-text);
    border-color: var(--link-hover-bg);
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
    outline: none;
}

table {
    margin: 2px 0px;
    font-family: monospace;
    border-collapse: collapse;
}

.stats {
    margin: 10px 0px 0px 0px;
    padding-left: 45px;
}

[hidden] {
  display: none !important;
}


.stats table tr {
    display:block; float: left;
}

.stats th, .stats td { display:block; }

th {
    width:100px;
    padding:0px 2px;
}

th,
td {
    box-sizing: content-box;
    text-align: left;
    border:none;
    padding: 2px 20px 2px 2px;
}

tr {
    margin:5px 0px;
    border:none;
}

tr.odd {
    background-color: var(--row-color-1);
}

tr.even {
    background-color: var(--row-color-2);
}

a.logo {
    height:40px;
}

a.logo img {
    width:40px;
    height:40px;
}

img.logo {
    width:100px;
    height:100px;
}

div.puzzle-entry {
    display:flex;
    flex-direction: column;
    padding:10px 10px 10px 0px;
    align-items: left;

    border-radius: 6px;
    border: 1px solid var(--link-text);
    background-color: var(--link-bg);
    color: var(--link-text);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    text-align: left;
    opacity: 0.92;
}

div.puzzle-entry .row {
    display:flex;
    flex-direction: row;
    width:100%;

}

div.puzzle-entry .col {
    width: 100%;
}

h5 {
    margin: 5px 0px;
}

div.puzzle-entry .check {
    width:17px;
    height:16px;
    margin: 10px 15px;
}

div.puzzle-entry .check.empty {
    border: 1px solid var(--link-text);
    border-radius: 2px;
    opacity: 0.8;
}


div.puzzle-entry div.row > div * {
    flex: 0 0 50%;
}

p.result {
    text-align: center;
    min-width: 100px;
}

div.puzzle-entry p {
    margin:0px;
    line-height: 1.5;
}

div.puzzle-entry .date {
    font-weight: bold;
    color:var(--link-text-2);

}

form.link {
   margin:40px auto;
   max-width: 520px; 
   border: dotted 1px var(--link-text);
   padding:20px;
   border-radius: 6px;
}

form.link button {
    margin:auto;
}

div.archive {
    max-width: 520px;
    margin:auto;
    display:flex;
    flex-direction: column;
    gap:10px;
}

span.title {
    font-size: 90%;
    opacity: 0.8;
    margin-right: 5px;
}

.expand-stats {
    cursor:pointer;
}


.my-percentile {
    font-weight: bold;
    text-decoration: underline;
}