/* ord.css - fælles stil for ordbogens sider (samme farver som spillet) */
:root {
	--color-correct: #4caf50;
	--color-present: #fbc02d;
	--color-absent: #757575;
	--color-deleted: #e53935;
	--color-bg: #f8f8fb;
	--color-text: #1a1a1a;
	--color-muted: #666;
	--color-line: #e0e0e0;
	--color-focus: #2196f3;
}

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

body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	background: var(--color-bg);
	color: var(--color-text);
	line-height: 1.5;
}

a { color: var(--color-focus); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Fælles toolbar for forside, ordbog og statistik (samme opbygning som i spillene):
   hus-ikon og titel til venstre, brugernavn og menu til højre. Menuen bygges i ord.js. */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 12px; background: #fff; border-bottom: 1px solid var(--color-line); }
.toolbar-left { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.toolbar h1 { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.5px; white-space: nowrap; }
.toolbar h1 a { color: inherit; }
.toolbar h1 a:hover { text-decoration: none; }
.home-link { display: block; width: 32px; height: 32px; margin-left: -4px; border-radius: 4px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' viewBox='0 -960 960 960' width='24' fill='%231f1f1f'%3E%3Cpath d='M240-200h120v-240h240v240h120v-360L480-740 240-560v360Zm-80 80v-480l320-240 320 240v480H520v-240h-80v240H160Zm320-350Z'/%3E%3C/svg%3E") center no-repeat; }
.home-link:hover { background-color: #f0f0f5; }
.toolbar-right { position: relative; display: flex; align-items: center; gap: 4px; min-width: 0; }
.toolbar-user { min-width: 0; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: inherit; font-size: 0.8rem; font-weight: 600; color: var(--color-focus); background: none; border: none; cursor: pointer; }
.menu-btn { display: flex; flex-shrink: 0; background: none; border: none; cursor: pointer; padding: 4px; border-radius: 4px; }
.menu-btn:hover { background: #f0f0f5; }
.dropdown { display: none; position: absolute; top: 100%; right: 0; margin-top: 4px; min-width: 190px; background: #fff; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); overflow: hidden; z-index: 20; }
.dropdown.active { display: block; }
.dropdown button, .dropdown a { display: block; width: 100%; text-align: left; padding: 10px 14px; background: none; border: none; border-bottom: 1px solid #f0f0f0; font: inherit; font-size: 0.9rem; font-weight: 600; color: var(--color-text); cursor: pointer; }
.dropdown a:hover, .dropdown button:hover { background: #f5f5f8; text-decoration: none; }
.dropdown hr { border: none; border-top: 4px solid #f5f5f8; margin: 0; }

main { max-width: 820px; margin: 0 auto; padding: 20px 16px 48px; }
section { margin-bottom: 28px; }
h2 { font-size: 1.1rem; margin-bottom: 10px; }
p + p { margin-top: 8px; }
.muted { color: var(--color-muted); font-size: 0.85rem; }
.notice { background: #fff8e1; border: 1px solid #ffe082; border-radius: 8px; padding: 10px 12px; font-size: 0.9rem; margin-bottom: 14px; }
.error { color: var(--color-deleted); font-size: 0.9rem; margin-top: 6px; }

.card { background: #fff; border: 1px solid var(--color-line); border-radius: 10px; padding: 14px 16px; }

input[type=text], input[type=password], input[type=search], select, textarea {
	font: inherit; font-size: 16px; padding: 8px 10px;
	border: 1px solid #ccc; border-radius: 6px; background: #fff; color: inherit;
}
textarea { width: 100%; min-height: 80px; resize: vertical; }
.btn { font: inherit; font-weight: 700; font-size: 0.9rem; padding: 8px 14px; border: none; border-radius: 6px; cursor: pointer; background: var(--color-focus); color: #fff; }
.btn-secondary { background: #e2e4e9; color: var(--color-text); }
.btn-small { padding: 4px 10px; font-size: 0.8rem; }
.btn:disabled { opacity: 0.5; cursor: default; }
.link-btn { background: none; border: none; color: var(--color-focus); font: inherit; font-size: 0.8rem; cursor: pointer; padding: 0; }
.link-btn:hover { text-decoration: underline; }

.search { display: flex; gap: 8px; }
.search input { flex: 1; min-width: 0; text-transform: uppercase; }
.search input::placeholder { text-transform: none; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 0.75rem; font-weight: 700; color: #fff; white-space: nowrap; }
.badge-common { background: var(--color-correct); }
.badge-rare { background: var(--color-present); color: #1a1a1a; }
.badge-deleted { background: var(--color-absent); }
.badge-new { background: var(--color-focus); }
.badge-locked { background: #424242; }

.word { font-weight: 800; letter-spacing: 2px; }

.word-list { list-style: none; }
.word-list > li { padding: 12px 0; border-bottom: 1px solid var(--color-line); }
.word-list > li:last-child { border-bottom: none; }
.word-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.word-row .word { font-size: 1.05rem; }
.edit-meta { font-size: 0.8rem; color: var(--color-muted); }
.comment { margin-top: 4px; font-size: 0.9rem; white-space: pre-wrap; overflow-wrap: anywhere; }

.history { list-style: none; }
.history > li { padding: 12px 0; border-bottom: 1px solid var(--color-line); }
.history > li:last-child { border-bottom: none; }
.history > li:target { background: #e3f2fd; border-radius: 6px; padding: 12px 8px; }
.history-actions { margin-top: 4px; display: flex; gap: 12px; }

.status-legend { padding-left: 20px; margin: 8px 0 16px; font-size: 0.9rem; }
.status-legend li { margin-bottom: 4px; }
.status-options { display: flex; gap: 14px; flex-wrap: wrap; margin: 8px 0 10px; }
.status-options label { display: flex; align-items: center; gap: 6px; cursor: pointer; }

/* Lange lister scroller inde i kortet i stedet for at gøre siden meget lang */
.scroll { max-height: min(65vh, 600px); overflow-y: auto; overscroll-behavior: contain; }
.scroll-short { max-height: 340px; }
.scroll > h3 { position: sticky; top: -14px; background: #fff; padding: 2px 0; }

.columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.missing-list { list-style: none; font-size: 0.9rem; }
.missing-list li { display: flex; justify-content: space-between; padding: 3px 0; }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 10; }
.modal { background: #fff; border-radius: 12px; padding: 18px; width: 100%; max-width: 380px; max-height: 85vh; overflow-y: auto; }
.modal-wide { max-width: 480px; }
.modal h3 { margin-bottom: 10px; }
.modal input, .modal textarea { width: 100%; margin-bottom: 8px; }
.modal-buttons { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }

@media (max-width: 560px) {
	.columns { grid-template-columns: 1fr; }
	.toolbar h1 { font-size: 1.1rem; }
	.toolbar-user { max-width: 90px; }
}
