/*
Fargekilder:
https://www.sv.no/ressursbanken/grafisk-og-sosiale-medier/grafisk-profil/
*/

:root {
  --green: #539760;
  --green-hover: #447a52;
  --red: #eb4040;
  --shadow: rgba(20, 26, 20, 0.18);
  --text: #1b1b1b;
}

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

body {
  font-family: Arial, Helvetica, sans-serif;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: stretch;
  background: radial-gradient(
    circle at top,
    #faf6ef 0%,
    #efe7d8 35%,
    #e4dfd4 100%
  );
  color: var(--text);
}

.app {
  width: min(1100px, 95vw);
  height: 100vh;
  padding: 18px 0 10px;
  display: flex;
  flex-direction: column;
}

h1 {
  font-size: 64px;
  margin-bottom: 20px;
  text-align: center;
  letter-spacing: 0.03em;
  font-weight: 800;
  color: #213a2b;
}

#container {
  background: rgba(255, 255, 255, 0.32);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 22px;
  box-shadow: 0 24px 50px var(--shadow);
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
}

#top {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #fdfdfb 0%, #f1efe9 100%);
  padding: 36px 30px 28px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

#topNumber {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 120px;
  font-weight: 700;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: translateY(28px) scale(0.75);
  transition:
    opacity 0.45s ease,
    transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1),
    font-size 0.2s ease;
}

#topNumber.result-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

#topNumber p {
  margin: 0;
}

#navn {
  font-size: 38px;
}

.smallerText {
  font-size: 48px;
}

.Harald {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(1);
  height: 92%;
  opacity: 0.92;
  z-index: 0;
  pointer-events: none;
  object-fit: cover;
  transition:
    transform 3.8s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 5s ease,
    filter 4.8s ease,
    height 5s cubic-bezier(0.22, 1, 0.36, 1);
}

.Harald.is-falling {
  transform: translate(-50%, 18%) scale(0.8) rotate(4deg);
  opacity: 0;
  filter: blur(6px);
}

#topNumber img {
  width: 170px;
  border-radius: 14px;
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.18);
  margin-top: 6px;
}

#bottom {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px 22px;
  background: linear-gradient(180deg, #12281d 0%, #1c382b 100%);
  color: #fff;
}

#bottom > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

#bottom label {
  font-size: 24px;
  margin-bottom: 8px;
  text-align: center;
  color: #eef6ef;
  letter-spacing: 0.02em;
}

input,
button {
  width: 100%;
  font-size: 32px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

input {
  background: #fff;
  color: var(--text);
  text-align: center;
}

button {
  height: 100%;
  min-height: 92px;
  background-color: var(--green);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition:
    background-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

button:hover {
  background-color: var(--green-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(83, 151, 96, 0.25);
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid #d3f0d8;
  outline-offset: 2px;
}

button.trukket {
  background-color: var(--red);
}
