:root {
  color-scheme: dark;
  --background: #12171b;
  --surface: #1b2328;
  --text: #f4f5f5;
  --muted: #aab2b7;
  --accent: #b3262d;
  --accent-hover: #cf3038;
  --border: #354047;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  background: var(--background);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

main {
  min-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 28px;
}

.portal-grid {
  width: min(94%, 1600px);
  margin: 0 auto 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.portal-box {
  min-height: 0;
  aspect-ratio: 3.5 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 20px;
  border: 2px solid var(--accent);
  border-radius: 6px;
  background: var(--surface);
  color: var(--accent-hover);
  font-size: 1.4rem;
  font-weight: 850;
  letter-spacing: 0;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .2);
  transition: border-color .18s ease, filter .18s ease, transform .18s ease;
}

.portal-box:hover { filter: brightness(1.16); transform: translateY(-2px); }
.portal-box:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }

.portal-box:first-child {
  background-image:
    linear-gradient(90deg, rgba(8, 11, 13, .2) 0%, rgba(8, 11, 13, .38) 24%, rgba(8, 11, 13, .78) 42%, rgba(8, 11, 13, .78) 58%, rgba(8, 11, 13, .38) 76%, rgba(8, 11, 13, .2) 100%),
    url("fsu-mobil-bg.png");
  background-position: center;
  background-size: cover;
}

.portal-box:nth-child(2) {
  background-image:
    linear-gradient(90deg, rgba(8, 11, 13, .2) 0%, rgba(8, 11, 13, .38) 24%, rgba(8, 11, 13, .78) 42%, rgba(8, 11, 13, .78) 58%, rgba(8, 11, 13, .38) 76%, rgba(8, 11, 13, .2) 100%),
    url("stevneadmin-bg.png");
  background-position: center;
  background-size: cover;
}

.hero {
  position: relative;
  width: min(94%, 1600px);
  margin: 0 auto;
  overflow: hidden;
  background: #0b0e10;
  border: 2px solid var(--accent);
  border-radius: 8px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, .32);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(8, 11, 13, .08) 0%, rgba(8, 11, 13, .12) 25%, rgba(8, 11, 13, .2) 43%, rgba(8, 11, 13, .2) 57%, rgba(8, 11, 13, .12) 75%, rgba(8, 11, 13, .08) 100%);
}

.hero img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 72vh;
  object-fit: cover;
  object-position: center;
}

.actions {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 140px;
  padding: 30px 24px;
}

.admin-button, .primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 28px;
  border: 1px solid #d3484f;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: 0;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .28);
  transition: background-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.admin-button svg { width: 21px; height: 21px; fill: currentColor; }

.admin-button:hover, .primary-button:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, .34);
}

.admin-button:focus-visible, .primary-button:focus-visible, .back-link:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
}

footer {
  min-height: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .9rem;
}

.footer-admin {
  min-height: 22px;
  padding: 0 7px;
  gap: 4px;
  border-color: #4b555b;
  border-radius: 4px;
  background: #242c31;
  color: var(--muted);
  font-size: .6rem;
  font-weight: 650;
  box-shadow: none;
}

.footer-admin svg { width: 11px; height: 11px; }
.footer-admin:hover { background: #303a40; box-shadow: none; transform: none; color: #fff; }

.admin-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background: radial-gradient(circle at top, #253037 0, var(--background) 48%);
}

.admin-panel {
  width: min(100%, 430px);
  padding: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 22px 60px rgba(0, 0, 0, .34);
}

.target-mark {
  width: 50px;
  height: 50px;
  margin-bottom: 24px;
  border: 4px solid var(--text);
  border-radius: 50%;
  box-shadow: inset 0 0 0 10px var(--surface), inset 0 0 0 15px var(--accent);
}

h1 { margin: 0 0 10px; font-size: clamp(1.7rem, 5vw, 2.2rem); letter-spacing: 0; }
.admin-panel p { margin: 0 0 28px; color: var(--muted); line-height: 1.6; font-size: 1rem; }
.back-link { display: inline-block; margin-top: 22px; color: var(--text); text-underline-offset: 4px; }

.subpage-main { justify-content: flex-start; padding: 0 0 64px; }
.subpage-header {
  width: 100%;
  min-height: 270px;
  display: flex;
  align-items: flex-end;
  border-bottom: 2px solid var(--accent);
  background-position: center;
  background-size: cover;
}
.subpage-header.fsu { background-image: linear-gradient(rgba(8,11,13,.38), rgba(8,11,13,.86)), url("fsu-mobil-bg.png"); }
.subpage-header.skytter { background-image: linear-gradient(rgba(8,11,13,.38), rgba(8,11,13,.86)), url("stevneadmin-bg.png"); }
.subpage-header-inner, .subpage-content { width: min(92%, 1080px); margin: 0 auto; }
.subpage-header-inner { padding: 42px 0; }
.subpage-kicker { margin: 0 0 8px; color: var(--accent-hover); font-weight: 800; }
.subpage-header h1 { margin: 0; font-size: clamp(2.2rem, 7vw, 4.5rem); }
.subpage-content { padding-top: 42px; }
.subpage-intro { max-width: 760px; margin: 0 0 34px; color: #d8dcde; font-size: 1.08rem; line-height: 1.75; }
.resource-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.resource-card { display: block; padding: 22px; border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 6px; background: var(--surface); color: var(--text); text-decoration: none; }
.resource-card:hover { border-color: var(--accent); background: #222c31; }
.resource-type { display: block; margin-bottom: 7px; color: var(--accent-hover); font-size: .78rem; font-weight: 800; text-transform: uppercase; }
.resource-name { display: block; font-size: 1.08rem; font-weight: 800; }
.subpage-nav { display: flex; gap: 18px; margin-top: 38px; }
.subpage-nav a { color: var(--muted); text-underline-offset: 4px; }

.admin-shell { min-height: 100vh; padding: 32px 20px; background: var(--background); }
.admin-wrap { width: min(100%, 980px); margin: 0 auto; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.admin-topbar h1 { margin: 0; }
.admin-topbar a { color: var(--muted); }
.admin-message { margin-bottom: 20px; padding: 13px 15px; border: 1px solid var(--border); border-left: 3px solid var(--accent); background: var(--surface); }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.admin-section { padding: 24px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.admin-section h2 { margin: 0 0 10px; }
.admin-section p { color: var(--muted); line-height: 1.6; }
.admin-section a { color: var(--accent-hover); font-weight: 800; }
.admin-form { padding: 26px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.admin-form label { display: block; margin: 18px 0 7px; color: #dfe3e5; font-weight: 750; }
.admin-form input, .admin-form textarea, .admin-form select { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #465159; border-radius: 4px; background: #11171a; color: #fff; font: inherit; }
.admin-form textarea { min-height: 120px; resize: vertical; }
.link-editor { display: grid; grid-template-columns: 1.1fr 1.7fr .7fr; gap: 10px; margin-bottom: 10px; }
.admin-actions { display: flex; gap: 12px; margin-top: 24px; }
.admin-actions button { min-height: 46px; padding: 0 22px; border: 1px solid #d3484f; border-radius: 5px; background: var(--accent); color: #fff; font: inherit; font-weight: 800; cursor: pointer; }
.login-panel { width: min(100%, 440px); margin: 9vh auto 0; padding: 30px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); }
.login-panel h1 { margin-top: 0; }
.login-panel p { color: var(--muted); line-height: 1.55; }

@media (max-width: 700px) {
  main { padding-top: 18px; }
  .portal-grid {
    width: calc(100% - 24px);
    gap: 8px;
    margin-bottom: 10px;
  }
  .portal-box { min-height: 100px; aspect-ratio: auto; padding: 10px; font-size: 1.08rem; }
  .hero { width: calc(100% - 24px); }
  .hero img { min-height: 38vh; object-fit: cover; }
  .actions { min-height: 150px; padding: 30px 20px; }
  .actions .admin-button { width: min(100%, 320px); }
  .admin-panel { padding: 28px 24px; }
  .admin-grid { grid-template-columns: 1fr; }
  .link-editor { grid-template-columns: 1fr; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
  .subpage-header { min-height: 220px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
