/*! Talhjul 1.0.0 – styling */
.talhjul {
  --th-accent: #0f766e;
  --th-accent-hover: #115e59;
  --th-accent-ink: #ffffff;
  --th-bg: #ffffff;
  --th-surface: #f5f7f8;
  --th-border: #d8dde3;
  --th-text: #1b2430;
  --th-muted: #5b6573;
  --th-error: #b42318;
  box-sizing: border-box;
  position: relative;
  max-width: 920px;
  margin: 1.5em auto;
  padding: 20px;
  background: var(--th-bg);
  color: var(--th-text);
  border: 1px solid var(--th-border);
  border-radius: 16px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}
.talhjul *, .talhjul *::before, .talhjul *::after { box-sizing: border-box; }
.talhjul [hidden] { display: none !important; }

.talhjul__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.talhjul__title { margin: 0; font-size: 1.35em; line-height: 1.2; font-weight: 700; color: inherit; }

.talhjul__body { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 720px) { .talhjul__body { grid-template-columns: 1fr; gap: 20px; } }

.talhjul__wheel-wrap { position: relative; width: 100%; max-width: 460px; aspect-ratio: 1 / 1; margin: 0 auto; }
.talhjul__canvas { display: block; width: 100%; height: 100%; }
.talhjul__pointer {
  position: absolute; top: -8px; left: 50%; transform: translateX(-50%); z-index: 2;
  width: 0; height: 0;
  border-left: 15px solid transparent; border-right: 15px solid transparent;
  border-top: 28px solid var(--th-text);
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .25));
}
.talhjul .talhjul__hub {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 2;
  width: 22%; height: 22%; min-width: 58px; min-height: 58px; padding: 0; margin: 0;
  border-radius: 50%; border: 4px solid #fff;
  background: var(--th-text); color: #fff;
  font-family: inherit; font-size: .95em; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  cursor: pointer; box-shadow: 0 2px 10px rgba(0, 0, 0, .3);
  transition: transform .15s ease;
}
.talhjul .talhjul__hub:hover:not(:disabled) { transform: translate(-50%, -50%) scale(1.05); }
.talhjul .talhjul__hub:disabled { cursor: default; opacity: .85; }
.talhjul__status { margin: 12px 0 0; text-align: center; color: var(--th-muted); font-size: .92em; }

.talhjul__group { margin: 0 0 14px; padding: 12px 14px 14px; border: 1px solid var(--th-border); border-radius: 12px; background: var(--th-surface); min-width: 0; }
.talhjul__group legend { padding: 0 6px; font-weight: 700; font-size: .95em; }
.talhjul__row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.talhjul label { display: block; font-size: .88em; font-weight: 600; color: var(--th-text); margin: 0; }
.talhjul__full { margin-top: 10px !important; }
.talhjul__hint { font-weight: 400; color: var(--th-muted); }
.talhjul input[type="number"], .talhjul input[type="text"] {
  display: block; width: 100%; margin: 4px 0 0; padding: 8px 10px;
  font: inherit; font-size: 1em; font-weight: 400; color: var(--th-text);
  background: #fff; border: 1px solid var(--th-border); border-radius: 8px; box-shadow: none;
}
.talhjul input:focus-visible, .talhjul button:focus-visible { outline: 3px solid var(--th-accent); outline-offset: 2px; }
.talhjul .talhjul__radio { display: flex; align-items: flex-start; gap: 8px; font-weight: 400; margin: 6px 0 0; cursor: pointer; }
.talhjul .talhjul__radio input { margin: 3px 0 0; accent-color: var(--th-accent); }

.talhjul__error { min-height: 0; margin: 0 0 10px; color: var(--th-error); font-size: .9em; font-weight: 600; }
.talhjul__error:empty { display: none; }

.talhjul__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.talhjul .talhjul__btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 16px; margin: 0; min-height: 40px;
  font-family: inherit; font-size: .95em; font-weight: 600; line-height: 1.2; text-transform: none; letter-spacing: normal;
  color: var(--th-text); background: #fff; border: 1px solid var(--th-border); border-radius: 999px;
  cursor: pointer; box-shadow: none; text-decoration: none;
}
.talhjul .talhjul__btn:hover:not(:disabled) { background: var(--th-surface); }
.talhjul .talhjul__btn--primary { background: var(--th-accent); border-color: var(--th-accent); color: var(--th-accent-ink); }
.talhjul .talhjul__btn--primary:hover:not(:disabled) { background: var(--th-accent-hover); }
.talhjul .talhjul__btn:disabled { opacity: .5; cursor: default; }
.talhjul .talhjul__icon-btn, .talhjul .talhjul__link {
  padding: 4px 8px; margin: 0; background: none; border: 0; box-shadow: none; cursor: pointer;
  font-family: inherit; color: var(--th-muted); text-transform: none;
}
.talhjul .talhjul__icon-btn { font-size: 1.3em; line-height: 1; border-radius: 8px; }
.talhjul .talhjul__icon-btn:hover, .talhjul .talhjul__link:hover { color: var(--th-text); }
.talhjul .talhjul__link { font-size: .88em; text-decoration: underline; }

.talhjul__history { border-top: 1px solid var(--th-border); padding-top: 10px; }
.talhjul__history-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.talhjul__history-list { margin: 0; padding: 0 0 0 2.2em; max-height: 180px; overflow-y: auto; font-variant-numeric: tabular-nums; }
.talhjul__history-list li { margin: 0; padding: 2px 0; }
.talhjul__history-list li:first-child { font-weight: 700; }
.talhjul__history-list:empty::before { content: "Ingen drej endnu"; display: block; margin-left: -2.2em; color: var(--th-muted); font-size: .9em; }

.talhjul__overlay {
  position: absolute; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(17, 24, 39, .55); border-radius: inherit;
}
.talhjul__result {
  width: 100%; max-width: 320px; padding: 24px 20px 20px; text-align: center;
  background: #fff; color: var(--th-text); border-radius: 16px; box-shadow: 0 12px 40px rgba(0, 0, 0, .3);
  animation: talhjul-pop .25s ease-out;
}
.talhjul__result-label { margin: 0; color: var(--th-muted); font-size: .85em; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.talhjul__result-num { margin: 4px 0 6px; font-size: 4em; line-height: 1.1; font-weight: 800; color: var(--th-accent); font-variant-numeric: tabular-nums; word-break: break-all; }
.talhjul__result-note { margin: 0 0 14px; color: var(--th-muted); font-size: .9em; }
.talhjul__result-note:empty { display: none; }
.talhjul__result .talhjul__btn { min-width: 120px; }
@keyframes talhjul-pop { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.talhjul:fullscreen { max-width: none; width: 100%; height: 100%; margin: 0; border-radius: 0; border: 0; overflow: auto; padding: 24px 32px; }
.talhjul:fullscreen .talhjul__wheel-wrap { max-width: min(78vh, 680px); }
.talhjul:fullscreen .talhjul__result-num { font-size: 7em; }

@media (prefers-reduced-motion: reduce) { .talhjul__result { animation: none; } }
