/* Forside (PC) og mobil-app */
:root {
  /* Standardfarver. Kan ændres i admin under "Farver og logo" (theme.php overskriver dem). */
  --header-bg: #14213d; --header-text: #ffffff; --header-sub: #c9d0e0;
  --page-bg: #f4f1ea; --card: #ffffff; --ink: #1b1b1b; --muted: #6b6b6b; --line: #e4ded1;
  --accent: #e9b84a; --accent-text: #14213d; --primary: #14213d; --primary-text: #ffffff;
  --info-bg: #14213d; --info-text: #ffffff;
  --h1: #1f9d4c; --h1-text: #ffffff; --h2: #f2c200; --h2-text: #1b1b1b; --sold: #b3261e; --sold-text: #ffffff;
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--page-bg); color: var(--ink); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
button { font: inherit; cursor: pointer; }
.inner { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* Topbjælke */
.top { background: var(--header-bg); color: var(--header-text); }
.pc .top .inner { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; padding-top: 28px; padding-bottom: 22px; }
.pc .top h1 { font-size: 34px; }
.desc { margin: 6px 0 0; color: var(--header-sub); white-space: pre-line; }
.side { display: flex; align-items: center; gap: 16px; }
.langs { display: inline-flex; border: 1px solid rgba(255,255,255,.3); border-radius: 999px; overflow: hidden; }
.langs button { background: none; border: 0; color: var(--header-text); padding: 6px 12px; font-weight: 600; font-size: 14px; }
.langs button.on { background: var(--accent); color: var(--accent-text); }
.status { font-size: 13px; display: inline-flex; align-items: center; gap: 6px; color: var(--header-sub); }
.status.ok::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #4cd07d; box-shadow: 0 0 0 0 #4cd07d; animation: pulse 2s infinite; }
.status.err { color: #ffb4ab; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(76,208,125,.6); } 100% { box-shadow: 0 0 0 8px rgba(76,208,125,0); } }
.applink { display: none; }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 20px 0 0; }
.tabs button { border: 1px solid var(--line); background: var(--card); padding: 8px 14px; border-radius: 999px; }
.tabs button.on { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }

/* Logo */
.brandrow { display: flex; align-items: center; gap: 18px; min-width: 0; }
.logo { max-height: 72px; max-width: 220px; width: auto; height: auto; object-fit: contain; object-position: left center; flex: none; }
.app .logo { max-height: 36px; max-width: 120px; }
.app .brandrow { gap: 10px; min-width: 0; flex: 1; }
.app .langs { flex: none; }

/* Infotekst over pedestalen */
.infotext { margin: 24px 0 0; background: var(--info-bg); color: var(--info-text); border-left: 6px solid var(--accent); border-radius: 14px; padding: 16px 22px; font-size: 22px; font-weight: 600; white-space: pre-line; }
.infotext + .pedestal { margin-top: 16px; }
.infotext { position: relative; }
.infotext .info-body { padding-right: 36px; }
.info-close { position: absolute; top: 8px; right: 10px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(255,255,255,.15); color: var(--info-text); font-size: 24px; line-height: 1; }
.infotext.collapsed { background: none; border: 0; padding: 0; }
.info-bar { display: block; width: 100%; text-align: left; border: 0; border-left: 6px solid var(--accent); border-radius: 10px; background: var(--info-bg); color: var(--info-text); padding: 8px 16px; font-size: 15px; font-weight: 700; }
.app .infotext { margin: 12px 0 0; font-size: 17px; padding: 12px 16px; border-radius: 12px; }
.app .infotext + .pedestal { margin-top: 10px; }

/* Pedestal */
.pedestal { background: var(--card); border-radius: 18px; margin: 24px 0; overflow: hidden; box-shadow: 0 10px 30px rgba(20,33,61,.12); border: 2px solid var(--accent); }
.ped-label { background: var(--accent); color: var(--accent-text); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: 13px; padding: 8px 18px; display: flex; align-items: center; gap: 8px; }
.ped-label .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--sold); animation: pulse 1.6s infinite; }
.ped-body { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.ped-body img { width: 100%; height: 100%; max-height: 460px; object-fit: contain; background: var(--page-bg); }
.ped-info { padding: 24px 28px; display: flex; flex-direction: column; gap: 10px; }
.ped-info h2 { font-size: 30px; }
.ped-body > .ped-info:only-child { grid-column: 1 / -1; }
.text { margin: 0; color: var(--ink); opacity: .85; white-space: pre-line; }
.bidlabel { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: auto; }
.bigbid { font-size: 56px; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; line-height: 1; }
.bigbid small { font-size: 22px; font-weight: 600; }
.bigbid.sold { color: var(--sold); }

/* Hammerslag 1. 2. 3. Solgt */
.hammer { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.hs { min-width: 34px; text-align: center; padding: 4px 9px; border-radius: 8px; border: 1px solid var(--line); color: #b5ae9f; font-weight: 700; font-size: 14px; background: #fff; }
.hs.on { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.hs.sold.on { background: var(--sold); border-color: var(--sold); color: var(--sold-text); }
.pedestal .hs { font-size: 20px; padding: 8px 16px; min-width: 56px; }

.lot { display: inline-block; background: var(--primary); color: var(--primary-text); border-radius: 10px; padding: 2px 12px; margin-right: 10px; font-size: .8em; vertical-align: 2px; }

/* Kun det aktuelle hammerslag, blinkende */
/* 1. = grøn, 2. = gul, 3./Solgt = rød. Kun pedestalen blinker. */
.hammer-now { display: inline-block; padding: 4px 12px; border-radius: 8px; font-weight: 800; font-size: 16px; }
.hammer-now.h1 { background: var(--h1); color: var(--h1-text); }
.hammer-now.h2 { background: var(--h2); color: var(--h2-text); }
.hammer-now.sold { background: var(--sold); color: var(--sold-text); text-transform: uppercase; letter-spacing: .04em; }
.pedestal .hammer-now { font-size: 28px; padding: 8px 22px; border-radius: 12px; align-self: center; animation: blink 1s steps(1, end) infinite; }
.app .pedestal .hammer-now { font-size: 22px; padding: 6px 16px; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .pedestal .hammer-now { animation-duration: 2s; } }

/* Liste over genstande */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; padding-bottom: 48px; }
.pc main .grid { margin-top: 24px; }
.item { background: var(--card); border-radius: 14px; overflow: hidden; border: 1px solid var(--line); display: flex; flex-direction: column; }
.item.current { border: 2px solid var(--accent); box-shadow: 0 6px 18px rgba(233,184,74,.35); }
.item.is-sold { opacity: .78; }
.pic { position: relative; overflow: hidden; aspect-ratio: 4 / 3; background: var(--line); }
.pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pic .no { position: absolute; top: 10px; left: 10px; background: var(--primary); color: var(--primary-text); font-weight: 800; border-radius: 10px; padding: 4px 14px; font-size: 22px; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.soldtag { position: absolute; top: 14px; right: -34px; transform: rotate(35deg); background: var(--sold); color: var(--sold-text); font-weight: 800; text-transform: uppercase; padding: 4px 40px; font-size: 13px; letter-spacing: .08em; }
.body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.body h3 { font-size: 18px; }
.body .text { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.foot { margin-top: auto; display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.bid { font-size: 22px; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; }
.sold-divider { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; margin: 16px 0 4px; color: var(--sold); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: 15px; }
.sold-divider::before, .sold-divider::after { content: ""; flex: 1; height: 2px; background: var(--sold); opacity: .6; }
.app .sold-divider { margin: 10px 0 2px; font-size: 13px; }
.idle { grid-column: 1 / -1; text-align: center; padding: 56px 16px; }
.idle-logo { max-width: min(420px, 80%); max-height: 260px; object-fit: contain; margin-bottom: 24px; }
.idle-text { margin: 0 auto; max-width: 720px; font-size: 24px; line-height: 1.5; color: var(--ink); white-space: pre-line; }
.app .idle { padding: 32px 8px; }
.app .idle-text { font-size: 18px; }
.empty { color: var(--muted); font-size: 18px; padding: 40px 0; text-align: center; grid-column: 1 / -1; }

@media (max-width: 800px) {
  .pc .top .inner { flex-direction: column; align-items: flex-start; }
  .ped-body { grid-template-columns: 1fr; }
  .bigbid { font-size: 44px; }
  .pc .applink { display: block; text-align: center; background: var(--accent); color: var(--accent-text); font-weight: 700; padding: 10px; text-decoration: none; }
}

/* Mobil-app */
.app { padding-bottom: env(safe-area-inset-bottom); }
.app .top { position: sticky; top: 0; z-index: 5; padding: calc(env(safe-area-inset-top) + 12px) 16px 10px; }
.app .bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.app .top h1 { font-size: 21px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app .sub { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; min-height: 22px; }
.app .wake { color: var(--header-sub); margin-left: auto; margin-right: 10px; }
.install { background: var(--accent); color: var(--accent-text); border: 0; border-radius: 999px; padding: 4px 12px; font-weight: 700; font-size: 13px; }
.app main { padding: 0 12px 24px; }
.app .tabs { margin-top: 12px; flex-wrap: nowrap; overflow-x: auto; }
.app .tabs button { white-space: nowrap; }
.app .desc { color: var(--muted); margin: 12px 4px 0; font-size: 14px; }
.app .desc:empty { display: none; }
.app .pedestal { margin: 12px 0 16px; border-radius: 16px; }
.app .ped-body { grid-template-columns: 1fr; }
.app .ped-body img { max-height: 300px; }
.app .ped-info { padding: 16px; gap: 8px; }
.app .ped-info h2 { font-size: 22px; }
.app .bigbid { font-size: 42px; }
.app .pedestal .hs { font-size: 17px; padding: 6px 12px; min-width: 46px; }
.app .list { display: flex; flex-direction: column; gap: 10px; }
.app .item { flex-direction: row; border-radius: 12px; }
.app .pic { width: 104px; flex: none; aspect-ratio: auto; min-height: 104px; }
.app .pic .no { font-size: 15px; padding: 2px 8px; top: 6px; left: 6px; }
.app .soldtag { font-size: 10px; right: -40px; top: 10px; }
.app .body { padding: 10px 12px; gap: 4px; min-width: 0; }
.app .body h3 { font-size: 16px; }
.app .body .text { font-size: 13px; -webkit-line-clamp: 2; }
.app .bid { font-size: 18px; }
.app .hs { font-size: 12px; padding: 2px 6px; min-width: 26px; }

/* Skydeknap: hold skærmen tændt */
.wake { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; font-weight: 600; margin: 0; user-select: none; }
.wake[hidden] { display: none; }
.wake input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.wake .slider { position: relative; width: 40px; height: 22px; border-radius: 999px; background: rgba(255,255,255,.3); transition: background .2s; flex: none; }
.wake .slider::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; }
.wake input:checked + .slider { background: #1f9d4c; }
.wake input:checked + .slider::after { transform: translateX(18px); }
.wake input:focus-visible + .slider { outline: 2px solid #fff; outline-offset: 2px; }

/* Pop-op-besked fra admin */
.popup { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.55); display: grid; place-items: center; padding: 20px; animation: popfade .25s ease-out; }
.popup-card { position: relative; background: var(--card); color: var(--ink); border-top: 8px solid var(--accent); border-radius: 18px; padding: 36px 32px 24px; max-width: 640px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.35); text-align: center; }
.popup-card p { margin: 0 0 24px; font-size: 26px; font-weight: 700; line-height: 1.35; white-space: pre-line; }
.popup-x { position: absolute; top: 10px; right: 12px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--line); color: var(--ink); font-size: 26px; line-height: 1; }
.popup-ok { border: 0; border-radius: 999px; background: var(--primary); color: var(--primary-text); font-weight: 800; font-size: 18px; padding: 12px 40px; }
.app .popup-card { padding: 30px 20px 20px; }
.app .popup-card p { font-size: 20px; }
@keyframes popfade { from { opacity: 0; } to { opacity: 1; } }

/* Eksempel på SMS-bud under buddet på pedestalen */
.sms-example { margin-top: 4px; padding: 10px 14px; border: 2px dashed var(--accent); border-radius: 10px; font-weight: 700; font-size: 18px; }
.app .sms-example { font-size: 16px; }

/* Hammerslaget står til højre for buddet på pedestalen */
.bidrow { display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; }

/* Ren pedestal-side (pedestal.php): fylder hele vinduet, fx til en ekstern skærm */
html:has(body.solo), body.solo { height: 100%; overflow: hidden; }
.solo-main { height: 100vh; height: 100dvh; display: flex; align-items: center; justify-content: center; }
.solo .pedestal { width: 100%; height: 100%; margin: 0; border: 0; border-radius: 0; box-shadow: none; display: flex; flex-direction: column; }
.solo .pedestal[hidden] { display: none; }
.solo .ped-label { flex: none; }
.solo .ped-body { flex: 1; min-height: 0; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.solo .ped-body img { height: 100%; max-height: none; }
.solo .ped-info { min-height: 0; overflow: hidden; justify-content: center; padding: 3vh 3vw; }
.solo .ped-info .bidlabel { margin-top: 0; }
.solo-empty { margin: 0; padding: 24px; text-align: center; font-size: 34px; font-weight: 700; color: var(--muted); }
.fs-btn { position: fixed; right: 14px; bottom: 14px; z-index: 10; border: 0; border-radius: 999px; padding: 10px 18px; background: rgba(0,0,0,.6); color: #fff; font-weight: 700; font-size: 15px; transition: opacity .4s; }
.solo.idle-mouse, .solo.idle-mouse * { cursor: none; }
.solo.idle-mouse .fs-btn { opacity: 0; pointer-events: none; }
@media (orientation: portrait) {
  .solo .ped-body { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
}

/* Preview fra admin */
.preview-bar { position: sticky; top: 0; z-index: 20; background: #b3261e; color: #fff; text-align: center; font-weight: 800; padding: 6px 12px; font-size: 14px; letter-spacing: .03em; }
.preview-bar[hidden] { display: none; }
