@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@600;700;800&display=swap');

:root {
--bg-page: #fdf1f3;
--bg-card: #ffffff;
--surface: #fbe4e8;
--surface-2: #fdf1f3;
--border: #f1e7e9;
--accent: #8c325d;
--accent-dark: #70284a;
--hero-dark: #3d0e28;
--gold: #ffc94d;
--confetti: radial-gradient(3px 3px at 15% 20%, var(--gold) 99%, transparent), radial-gradient(3px 3px at 80% 15%, #fff 99%, transparent), radial-gradient(2.5px 2.5px at 60% 30%, #2bc98d 99%, transparent), radial-gradient(2.5px 2.5px at 30% 65%, var(--gold) 99%, transparent), radial-gradient(3px 3px at 90% 70%, #fff 99%, transparent), radial-gradient(2.5px 2.5px at 10% 80%, var(--cta) 99%, transparent), radial-gradient(2.5px 2.5px at 45% 90%, #fff 99%, transparent), radial-gradient(2px 2px at 70% 45%, var(--gold) 99%, transparent);
--cta: #ff6b4a;
--cta-dark: #e8542f;
--text: #2b2b33;
--text-dim: #45454c;
--text-faint: #b7b7c0;
--correct: #3cae6b;
--wrong: #e8542f;
--radius: 16px;
--font-display: 'Baloo 2', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
background-image: var(--confetti), radial-gradient(120% 90% at 50% 0%, var(--accent), var(--hero-dark) 78%);
background-attachment: fixed, fixed;
background-color: var(--hero-dark);
color: var(--text);
min-height: 100vh;
}

body.app-shell {
background-image: var(--confetti), radial-gradient(120% 90% at 50% 0%, var(--accent), var(--hero-dark) 78%);
background-attachment: fixed, fixed;
background-color: var(--hero-dark);
}

#app {
display: flex;
justify-content: center;
padding: 16px;
padding-top: 24px;
padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
min-height: 100vh;
}

.hidden { display: none !important; }

.screen {
width: 100%;
max-width: 720px;
}

.card {
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 24px 20px;
box-shadow: 0 10px 30px rgba(140, 50, 93, 0.12);
}

#playForm {
background: rgba(255, 255, 255, 0.08);
border: 1px solid rgba(255, 255, 255, 0.14);
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

#playForm .field span {
color: rgba(255, 255, 255, 0.75);
}

#playForm input[type="text"] {
background: rgba(0, 0, 0, 0.18);
border: 1px solid rgba(255, 255, 255, 0.14);
color: #ffffff;
}

#playForm input[type="text"]::placeholder {
color: rgba(255, 255, 255, 0.45);
}

.contact-form {
background: rgba(255, 255, 255, 0.08);
border: 1px solid rgba(255, 255, 255, 0.14);
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.contact-form .field span {
color: rgba(255, 255, 255, 0.75);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
color: rgba(255, 255, 255, 0.45);
}

.contact-form .hint {
color: rgba(255, 255, 255, 0.55);
}

#nameInput {
background: rgba(0, 0, 0, 0.18);
border: 1px solid rgba(255, 255, 255, 0.14);
color: #ffffff;
}

#nameInput::placeholder {
color: rgba(255, 255, 255, 0.45);
}

#screen-home .card {
background: transparent;
border: none;
box-shadow: none;
}

#screen-create .card {
background: transparent;
border: none;
box-shadow: none;
}

#screen-join .card {
background: transparent;
border: none;
box-shadow: none;
}

#screen-lobby .card {
background: transparent;
border: none;
box-shadow: none;
}

#screen-roundresults .card {
background: transparent;
border: none;
box-shadow: none;
}

#screen-final .card {
background: transparent;
border: none;
box-shadow: none;
}

.card-wide { max-width: 720px; }

.title {
font-size: 2.2rem;
margin: 0 0 4px;
background: linear-gradient(90deg, var(--accent), var(--accent-dark));
-webkit-background-clip: text;
background-clip: text;
color: transparent;
text-align: center;
}

.home-banner {
  display: block;
  max-width: 220px;
  width: 55%;
  margin: 0 auto 16px;
}

.subtitle {
text-align: center;
color: var(--text-dim);
margin-bottom: 24px;
}

h2 { margin-top: 0; color: var(--text); }

.field {
display: block;
margin-bottom: 18px;
}

.field > span {
display: block;
margin-bottom: 6px;
color: var(--text-dim);
font-size: 0.9rem;
}

input[type="text"] {
width: 100%;
padding: 14px;
font-size: 1.1rem;
border-radius: 10px;
border: 1px solid var(--border);
background: var(--surface-2);
color: var(--text);
}

input[type="text"]::placeholder {
color: var(--text-faint);
font-style: italic;
}

.slider-wrap {
position: relative;
padding-top: 32px;
}

#screen-create .slider-wrap {
--accent: #ffb648;
}

.slider-tooltip {
position: absolute;
top: 0;
left: 0;
transform: translateX(-50%);
background: var(--accent);
color: #ffffff;
font-size: 0.8rem;
font-weight: 700;
padding: 4px 11px;
border-radius: 8px;
white-space: nowrap;
pointer-events: none;
}

.slider-tooltip::after {
content: "";
position: absolute;
top: 100%;
left: 50%;
transform: translateX(-50%);
border: 5px solid transparent;
border-top-color: var(--accent);
}

input[type="range"] {
width: 100%;
height: 8px;
border-radius: 999px;
background: var(--surface);
accent-color: var(--accent);
-webkit-appearance: none;
appearance: none;
}

input[type="range"]::-webkit-slider-runnable-track {
height: 8px;
border-radius: 999px;
background: transparent;
}

input[type="range"]::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 22px;
height: 22px;
border-radius: 50%;
background: #ffffff;
border: 4px solid var(--accent);
margin-top: -7px;
cursor: pointer;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

input[type="range"]::-moz-range-track {
height: 8px;
border-radius: 999px;
background: var(--surface);
}

input[type="range"]::-moz-range-progress {
height: 8px;
border-radius: 999px;
background: var(--accent);
}

input[type="range"]::-moz-range-thumb {
width: 22px;
height: 22px;
border-radius: 50%;
background: #ffffff;
border: 4px solid var(--accent);
cursor: pointer;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.btn {
display: block;
width: 100%;
padding: 16px;
font-size: 1.05rem;
font-weight: 600;
border: none;
border-radius: 12px;
margin-top: 12px;
cursor: pointer;
transition: transform 0.1s ease;
text-align: center;
box-sizing: border-box;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
background: linear-gradient(135deg, var(--cta), var(--accent));
color: white;
box-shadow: 0 12px 24px rgba(232, 84, 47, 0.35);
}

.btn-secondary {
background: var(--surface);
color: var(--accent-dark);
border: 1px solid var(--border);
}

.cta-row .btn-secondary {
background: rgba(255, 255, 255, 0.08);
color: #ffffff;
border: 1px solid rgba(255, 255, 255, 0.14);
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

#screen-home .home-btn-row,
#screen-create .create-btn-row,
#screen-join .join-btn-row,
#screen-lobby .lobby-btn-row {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

#screen-home .home-btn-row .btn,
#screen-create .create-btn-row .btn,
#screen-join .join-btn-row .btn,
#screen-lobby .lobby-btn-row .btn {
  width: auto;
  flex: 1;
  margin-top: 0;
}

#screen-home .btn-secondary,
#screen-create .btn-secondary,
#screen-join .btn-primary,
#screen-join .btn-secondary,
#screen-lobby .btn-secondary,
#screen-review .btn-primary,
#screen-roundresults .btn-secondary,
#screen-final .btn-secondary {
  border-radius: 14px;
  background: rgba(20, 8, 14, 0.45);
  box-shadow: none;
  backdrop-filter: blur(4px);
  transition: color 0.15s ease, border-color 0.15s ease;
}

#screen-join .btn-primary,
#screen-review .btn-primary {
  color: var(--cta);
  border: 1.5px solid var(--cta);
}

#screen-home .btn-secondary,
#screen-create .btn-secondary,
#screen-join .btn-secondary,
#screen-lobby .btn-secondary,
#screen-roundresults .btn-secondary,
#screen-final .btn-secondary {
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

#screen-home .btn-secondary:hover,
#screen-create .btn-secondary:hover,
#screen-join .btn-secondary:hover,
#screen-lobby .btn-secondary:hover,
#screen-roundresults .btn-secondary:hover,
#screen-final .btn-secondary:hover {
  color: var(--cta);
}

.btn-link {
background: none;
color: var(--text-dim);
text-decoration: underline;
}

.btn:disabled {
opacity: 0.4;
cursor: not-allowed;
}

.hint {
color: #9b9ba3;
font-size: 0.85rem;
text-align: center;
margin-top: 10px;
}

.warning {
color: #96650a;
background: #fff3d6;
padding: 10px;
border-radius: 10px;
font-size: 0.85rem;
}

.letter-grid {
display: grid;
grid-template-columns: repeat(8, 1fr);
gap: 6px;
}

.letter-chip {
padding: 8px 0;
text-align: center;
background: var(--surface);
color: var(--text);
border-radius: 8px;
cursor: pointer;
font-weight: 600;
user-select: none;
font-size: 0.9rem;
}

.letter-chip.selected {
background: var(--accent);
color: white;
}

#screen-create .letter-chip.selected {
background: #ffb648;
}

#screen-create .toggle-field {
--accent: #ffb648;
}

#screen-create .slider-tooltip {
color: #4a2600;
}

.toggle-field {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 12px;
}

.toggle-field span { margin-bottom: 0; }

.switch {
position: relative;
display: inline-block;
width: 50px;
height: 28px;
flex-shrink: 0;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
position: absolute;
cursor: pointer;
inset: 0;
background-color: var(--surface);
border: 1px solid var(--border);
border-radius: 28px;
transition: 0.2s;
}

.slider::before {
content: "";
position: absolute;
height: 22px;
width: 22px;
left: 2px;
bottom: 2px;
background-color: white;
box-shadow: 0 2px 4px rgba(0,0,0,0.15);
border-radius: 50%;
transition: 0.2s;
}

.switch input:checked + .slider {
background-color: var(--accent);
border-color: var(--accent);
}

.switch input:checked + .slider::before {
transform: translateX(22px);
}

.room-code-box {
text-align: center;
margin-bottom: 16px;
background: rgba(0, 0, 0, 0.18);
border: 1px solid rgba(255, 255, 255, 0.14);
border-radius: 16px;
padding: 16px;
}

.room-code-box .label {
display: block;
color: rgba(255, 255, 255, 0.75);
font-size: 0.9rem;
letter-spacing: 0.06em;
text-transform: uppercase;
}

.room-code {
font-size: 2.6rem;
font-weight: 800;
letter-spacing: 0.15em;
color: var(--gold);
}

.player-list {
list-style: none;
padding: 0;
margin: 0;
}

.player-list li {
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
padding: 8px 14px 8px 8px;
background: var(--bg-card);
border: none;
border-radius: 14px;
margin-bottom: 8px;
color: var(--text);
box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
}

.player-list .name-col {
display: flex;
align-items: center;
gap: 10px;
min-width: 0;
}

.player-list .avatar {
width: 32px;
height: 32px;
border-radius: 50%;
flex: none;
display: flex;
align-items: center;
justify-content: center;
font-size: 0.85rem;
font-weight: 800;
color: #ffffff;
}

.player-list .host-badge {
font-size: 0.75rem;
font-weight: 700;
color: var(--accent-dark);
background: var(--surface);
padding: 3px 8px;
border-radius: 999px;
white-space: nowrap;
flex: none;
}

.player-list li .offline {
color: var(--text-dim);
font-size: 0.8rem;
}

.settings-summary {
margin-bottom: 16px;
}

.settings-summary-label {
display: block;
color: #ffffff;
font-weight: 700;
font-size: 0.8rem;
letter-spacing: 0.02em;
margin-bottom: 8px;
}

.settings-summary-grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 8px;
}

.settings-chip {
display: flex;
align-items: center;
gap: 10px;
background: var(--bg-card);
border-radius: 12px;
padding: 10px 12px;
box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
min-width: 0;
}

.settings-chip-wide {
grid-column: 1 / -1;
}

.settings-chip-icon {
width: 32px;
height: 32px;
border-radius: 50%;
background: var(--surface);
display: flex;
align-items: center;
justify-content: center;
font-size: 15px;
flex: none;
}

.settings-chip-text {
display: flex;
flex-direction: column;
min-width: 0;
}

.settings-chip-label {
font-size: 0.64rem;
font-weight: 700;
letter-spacing: 0.04em;
text-transform: uppercase;
color: var(--accent-dark);
opacity: 0.7;
}

.settings-chip-value {
font-size: 0.85rem;
font-weight: 700;
color: var(--text);
line-height: 1.2;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 550;
  background-image: var(--confetti), radial-gradient(120% 90% at 50% 0%, var(--accent), var(--hero-dark) 78%);
  background-attachment: fixed, fixed;
  background-color: var(--hero-dark);
  padding: 10px 16px;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.app-topbar-inner {
  display: flex;
  align-items: center;
  max-width: 720px;
  margin: 0 auto;
  position: relative;
}

.app-topbar:not(:has(.game-status-group:not(.hidden))) {
  display: none;
}

.menu-toggle {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: none;
  background: rgba(255, 255, 255, 0.16);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-shrink: 0;
  padding: 0;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2.5px;
  border-radius: 2px;
  background: var(--gold);
}

.menu-toggle:active {
  opacity: 0.7;
}

.game-status-group {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 8px 16px;
}

.round-dots {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.round-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
}

.round-dot.active {
  width: 8px;
  height: 8px;
  background: var(--gold);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 250px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  z-index: 560;
}

.dropdown-menu::before {
  content: "Meny";
  display: block;
  padding: 10px 16px 6px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-dark);
  background: linear-gradient(90deg, var(--cta), var(--accent)) top / 100% 4px no-repeat, var(--bg-card);
}

.dropdown-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: none;
  background: none;
  padding: 10px 16px 10px 54px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.dropdown-item:active {
  background: var(--surface);
}

.dropdown-item + .dropdown-item {
  border-top: 1px solid var(--border);
}

.dropdown-item::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  width: 30px;
  height: 30px;
  margin-top: -15px;
  border-radius: 50%;
  background: var(--surface);
}

.dropdown-item::after {
  content: "";
  position: absolute;
  left: 23.5px;
  top: 50%;
  width: 15px;
  height: 15px;
  margin-top: -7.5px;
  background-color: var(--accent-dark);
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

a.dropdown-item:nth-of-type(1)::after {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19.5A2.5 2.5 0 0 1 6.5 17H20'/%3E%3Cpath d='M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19.5A2.5 2.5 0 0 1 6.5 17H20'/%3E%3Cpath d='M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z'/%3E%3C/svg%3E");
}

a.dropdown-item:nth-of-type(2)::after {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4'/%3E%3Cpath d='M12 8h.01'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4'/%3E%3Cpath d='M12 8h.01'/%3E%3C/svg%3E");
}

a.dropdown-item:nth-of-type(3)::after {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4h16v16H4z'/%3E%3Cpath d='m4 6 8 7 8-7'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4h16v16H4z'/%3E%3Cpath d='m4 6 8 7 8-7'/%3E%3C/svg%3E");
}

a.dropdown-item:nth-of-type(4)::after {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2 4 6v6c0 5 3.4 8.7 8 10 4.6-1.3 8-5 8-10V6z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2 4 6v6c0 5 3.4 8.7 8 10 4.6-1.3 8-5 8-10V6z'/%3E%3C/svg%3E");
}

a.dropdown-item:nth-of-type(5)::after {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Ccircle cx='9' cy='10' r='1' fill='%23000' stroke='none'/%3E%3Ccircle cx='14' cy='14' r='1' fill='%23000' stroke='none'/%3E%3Ccircle cx='13' cy='8' r='1' fill='%23000' stroke='none'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Ccircle cx='9' cy='10' r='1' fill='%23000' stroke='none'/%3E%3Ccircle cx='14' cy='14' r='1' fill='%23000' stroke='none'/%3E%3Ccircle cx='13' cy='8' r='1' fill='%23000' stroke='none'/%3E%3C/svg%3E");
}

a.dropdown-item:nth-of-type(6)::after {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6'/%3E%3Cpath d='M9 13h6'/%3E%3Cpath d='M9 17h6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6'/%3E%3Cpath d='M9 13h6'/%3E%3Cpath d='M9 17h6'/%3E%3C/svg%3E");
}

.dropdown-item-icon {
  display: flex;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent-dark);
}

.dropdown-item-danger {
  color: var(--wrong);
  margin-top: 2px;
}

.dropdown-item-danger .dropdown-item-icon {
  color: var(--wrong);
}

.dropdown-item-danger::before {
  background: #fde8e4;
}

.dropdown-item-danger::after {
  background-color: var(--wrong);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m15 9-6 6'/%3E%3Cpath d='m9 9 6 6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m15 9-6 6'/%3E%3Cpath d='m9 9 6 6'/%3E%3C/svg%3E");
}

#screen-board {
  padding-bottom: 40vh;
}

.timer-wrap {
display: flex;
align-items: baseline;
gap: 4px;
flex-shrink: 0;
}

.timer-unit {
font-size: 0.7rem;
font-weight: 600;
color: rgba(255, 255, 255, 0.75);
}

.letter-badge {
width: 56px;
height: 56px;
border-radius: 16px;
background: var(--gold);
display: flex;
align-items: center;
justify-content: center;
font-size: 1.7rem;
font-weight: 800;
color: var(--hero-dark);
box-shadow: 0 10px 24px rgba(255, 201, 77, 0.35);
}

#screen-letterreveal .round-label {
display: block;
margin-top: 20px;
font-size: 0.95rem;
letter-spacing: 1px;
opacity: 0.85;
}

.timer {
font-size: 1.4rem;
font-weight: 800;
min-width: 50px;
text-align: right;
font-variant-numeric: tabular-nums;
flex-shrink: 0;
color: #ffffff;
text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.timer.low { color: #ff5252; }

.review-title {
font-size: 1.1rem;
margin: 0;
color: var(--text);
}

.category-list, .review-list {
max-width: 720px;
margin: 0 auto;
}

.category-item {
background: rgba(0, 0, 0, 0.22);
border: 1px solid rgba(255, 255, 255, 0.12);
border-radius: 12px;
padding: 14px;
margin: 0 10px 12px;
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
display: flex;
gap: 12px;
align-items: flex-start;
}

.category-item .cat-icon {
width: 38px;
height: 38px;
border-radius: 10px;
flex: none;
display: flex;
align-items: center;
justify-content: center;
font-size: 1.2rem;
background: rgba(0, 0, 0, 0.32);
border: 1px solid rgba(255, 255, 255, 0.16);
color: white;
}

.category-item .cat-body { flex: 1; min-width: 0; }

.category-item .cat-name {
display: block;
margin-bottom: 8px;
font-weight: 700;
font-size: 0.85rem;
letter-spacing: 0.08em;
text-transform: uppercase;
color: #ffffff;
}

.review-category .cat-name {
display: block;
margin-bottom: 8px;
font-weight: 700;
font-size: 0.85rem;
letter-spacing: 0.08em;
text-transform: uppercase;
color: var(--accent);
}

.category-item input {
width: 100%;
padding: 6px 0 8px;
font-size: 1rem;
border-radius: 0;
border: none;
border-bottom: 1px solid rgba(255, 255, 255, 0.25);
background: transparent;
color: #ffffff;
}

.category-item input::placeholder {
color: rgba(255, 255, 255, 0.4);
}

.review-category {
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: 12px;
padding: 14px;
margin: 0 10px 14px;
box-shadow: 0 6px 16px rgba(140, 50, 93, 0.08);
}

.review-category .cat-name {
font-weight: 700;
margin-bottom: 10px;
display: block;
color: var(--accent-dark);
}

.review-answer-row {
display: flex;
align-items: center;
justify-content: space-between;
padding: 8px 0;
border-top: 1px solid var(--border);
}

.review-answer-row .player-name {
font-size: 0.85rem;
color: var(--text-dim);
width: 90px;
flex-shrink: 0;
}

.review-answer-row .answer-text {
flex: 1;
font-size: 1.05rem;
padding: 0 8px;
color: var(--text);
}

.review-answer-row .answer-text.empty {
color: var(--text-dim);
font-style: italic;
}

.mark-buttons {
display: flex;
gap: 6px;
}

.mark-btn {
width: 40px;
height: 40px;
border-radius: 50%;
border: 2px solid transparent;
background: var(--surface);
font-size: 1.2rem;
cursor: pointer;
color: var(--text);
}

.mark-btn.correct.active {
background: var(--correct);
border-color: var(--correct);
color: white;
}

.mark-btn.wrong.active {
background: var(--wrong);
border-color: var(--wrong);
color: white;
}

.mark-btn:disabled {
cursor: default;
opacity: 0.85;
}

.score-list {
list-style: none;
padding: 0;
margin: 0 0 16px;
}

.score-list li {
display: flex;
justify-content: space-between;
align-items: center;
padding: 12px 14px;
background: var(--surface-2);
border: 1px solid var(--border);
border-radius: 10px;
margin-bottom: 8px;
color: var(--text);
}

.score-list .delta {
color: var(--correct);
font-weight: 700;
margin-left: 8px;
}

.score-list.final li {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(20, 8, 14, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(4px);
}

.score-list.final .final-rank {
  flex: 0 0 auto;
  width: 26px;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.45);
}

.score-list.final .final-info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.score-list.final .final-name {
  font-weight: 700;
  font-size: 1.02rem;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.score-list.final .final-sub {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 2px;
}

.score-list.final .final-points {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.score-list.final .final-points-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
}

.score-list.final .final-points-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 2px;
}

.score-list.final li.rank-1 {
  border: 1.5px solid #ffd54f;
  box-shadow: 0 0 0 1px rgba(255, 213, 79, 0.25);
}
.score-list.final li.rank-1 .final-rank {
  color: #ffd54f;
}

.score-list.final li.rank-2 {
  border: 1.5px solid #cdd3dc;
  box-shadow: 0 0 0 1px rgba(205, 211, 220, 0.2);
}
.score-list.final li.rank-2 .final-rank {
  color: #cdd3dc;
}

.score-list.final li.rank-3 {
  border: 1.5px solid #d38b4c;
  box-shadow: 0 0 0 1px rgba(211, 139, 76, 0.2);
}
.score-list.final li.rank-3 .final-rank {
  color: #d38b4c;
}

.toast {
position: fixed;
top: 16px;
left: 50%;
transform: translateX(-50%);
background: var(--wrong);
color: white;
padding: 12px 18px;
border-radius: 10px;
z-index: 100;
max-width: 90%;
text-align: center;
box-shadow: 0 10px 24px rgba(112, 40, 74, 0.35);
}

/* ---------- BOKSTAVSSLUMPNING (helskärm) ---------- */
.screen.letterreveal-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
}

.letterreveal-screen {
background-image: var(--confetti), radial-gradient(120% 90% at 50% 0%, var(--accent), var(--hero-dark) 78%);
background-attachment: fixed, fixed;
background-color: var(--hero-dark);
flex-direction: column;
color: #ffffff;
text-align: center;
}

.letterreveal-label {
font-size: 1.1rem;
letter-spacing: 3px;
text-transform: uppercase;
opacity: 0.85;
margin: 0 0 24px;
}

.letterreveal-badge {
width: 200px;
height: 200px;
border-radius: 50%;
background: rgba(255, 255, 255, 0.14);
border: 4px solid rgba(255, 255, 255, 0.5);
display: flex;
align-items: center;
justify-content: center;
font-size: 6rem;
font-weight: 800;
transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.letterreveal-badge.landed {
animation: letterPop 0.55s cubic-bezier(.34,1.56,.64,1) both;
background: rgba(255, 255, 255, 0.24);
border-color: #ffffff;
box-shadow: 0 0 0 8px rgba(255,201,77,0.18), 0 0 40px rgba(255,201,77,0.35);
}

@media (min-width: 500px) {
.letter-grid { grid-template-columns: repeat(10, 1fr); }
}


.field-label-centered {
text-align: center;
}

.value-inline {
display: none !important;
}

#screen-create .field > span,
#screen-join .field > span,
#screen-lobby .field > span {
font-weight: 700;
font-size: 0.85rem;
letter-spacing: 0.08em;
text-transform: uppercase;
color: #ffffff;
text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
text-align: center;
}

#screen-create .hint,
#screen-lobby .hint,
#screen-review .hint,
#screen-roundresults .hint {
color: rgba(255, 255, 255, 0.75);
}

#screen-create h2,
#screen-join h2,
#screen-lobby h2,
#screen-roundresults h2,
#screen-final h2 {
color: #ffffff;
text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

#screen-lobby .room-code-box .label {
color: rgba(255, 255, 255, 0.75);
}

#screen-lobby .room-code {
color: #ffb648;
text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

#screen-home .field > span {
font-weight: 700;
font-size: 0.85rem;
letter-spacing: 0.08em;
text-transform: uppercase;
color: #ffffff;
text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
text-align: center;
}

.rules-card {
width: 100%;
max-width: 480px;
box-sizing: border-box;
padding: 0 12px;
}

.rules-back-btn {
margin-top: 0;
margin-bottom: 10px;
padding-left: 0;
text-align: left;
width: auto;
color: #ffffff;
}

.rules-title {
color: #ffffff;
text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
font-size: 1.4rem;
}

.rules-card p {
line-height: 1.6;
color: rgba(255, 255, 255, 0.92);
}

.rules-list {
padding-left: 20px;
color: rgba(255, 255, 255, 0.92);
line-height: 1.5;
}

.rules-list > li {
margin-bottom: 14px;
}

.rules-list ul {
margin-top: 8px;
padding-left: 18px;
color: rgba(255, 255, 255, 0.7);
}

.rules-list ul li {
margin-bottom: 8px;
}

.rules-card h2,
.rules-card h3 {
color: #ffffff;
font-size: 1.05rem;
margin-top: 24px;
margin-bottom: 8px;
}

.rules-meta {
color: rgba(255, 255, 255, 0.7);
font-size: 0.85rem;
margin: 0 0 4px;
}

.rules-card a {
color: #ffd166;
}

.rules-card strong {
color: #ffffff;
}

/* ---------- SITE HEADER / FOOTER (marknadsförings- & infosidor) ---------- */
.site-header {
}

.site-header-inner {
max-width: 720px;
margin: 0 auto;
padding: 14px 16px;
display: flex;
align-items: center;
justify-content: space-between;
position: relative;
}

.site-logo {
display: flex;
align-items: center;
gap: 8px;
font-weight: 800;
font-size: 1.1rem;
color: #ffffff;
text-decoration: none;
}

.site-logo img {
height: 32px;
width: auto;
display: block;
}



.site-header .dropdown-menu {
top: calc(100% + 8px);
right: 0;
left: auto;
}

.site-header .dropdown-item {
text-decoration: none;
box-sizing: border-box;
}

.site-main {
max-width: 720px;
margin: 0 auto;
padding: 32px 20px 60px;
}

.site-main.narrow { max-width: 560px; }

.site-footer {
border-top: 1px solid rgba(255, 255, 255, 0.14);
padding: 24px 16px 44px;
text-align: center;
color: rgba(255, 255, 255, 0.65);
font-size: 0.85rem;
}

.site-footer nav {
display: flex;
flex-wrap: wrap;
gap: 6px 16px;
justify-content: center;
margin-bottom: 12px;
}

.site-footer a { color: rgba(255, 255, 255, 0.75); }



.hero {
text-align: center;
padding: 28px 0 8px;
position: relative;
z-index: 0;
}

.hero::before {
content: "";
position: absolute;
z-index: -1;
top: -80px;
left: 50%;
transform: translateX(-50%);
width: 320px;
height: 320px;
border-radius: 50%;
background: radial-gradient(circle, rgba(255, 201, 77, 0.45), transparent 70%);
filter: blur(30px);
}

.hero img.home-banner {
max-width: 180px;
margin: 0 auto 16px;
display: block;
position: relative;
filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.35));
}

.hero h1 {
font-size: 1.9rem;
margin: 0 0 12px;
color: #ffffff;
position: relative;
}

.hero p.lead {
color: rgba(255, 255, 255, 0.85);
font-size: 1.05rem;
line-height: 1.6;
max-width: 480px;
margin: 0 auto 24px;
position: relative;
}

.hero .cta-row {
display: flex;
flex-direction: column;
gap: 10px;
}

.hero .cta-row .btn { margin-top: 0; }

.how-it-works {
display: grid;
gap: 14px;
margin: 36px 0;
}

.how-it-works .step {
background: rgba(0, 0, 0, 0.18);
border: 1px solid rgba(255, 255, 255, 0.08);
border-radius: var(--radius);
padding: 16px 18px;
display: flex;
gap: 14px;
align-items: flex-start;
}

.how-it-works .step-icon {
width: 40px;
height: 40px;
border-radius: 12px;
flex: none;
display: flex;
align-items: center;
justify-content: center;
font-size: 1.15rem;
background: linear-gradient(135deg, #ffc94d, var(--cta));
color: white;
}

.how-it-works .step-body { flex: 1; min-width: 0; }

.how-it-works .step strong {
color: #ffffff;
display: block;
margin-bottom: 4px;
}

.how-it-works .step p {
margin: 0;
color: rgba(255, 255, 255, 0.75);
line-height: 1.5;
}

.section-title {
color: #ffffff;
font-size: 1.3rem;
margin: 0 0 6px;
text-align: center;
}

/* Ljust artikel-tema för regler/policy/villkor-sidorna (återanvänder
.rules-card/.rules-list/.rules-title-strukturen, men med mörk text
istället för det vita temat som är gjort för mörk bakgrundsbild). */
.article { color: rgba(255, 255, 255, 0.85); }
.article .rules-title,
.article h1 { color: #ffffff; text-shadow: none; }
.article .rules-meta { color: rgba(255, 255, 255, 0.65); }
.article p { color: rgba(255, 255, 255, 0.85); }
.article .rules-list,
.article .rules-list ul { color: rgba(255, 255, 255, 0.85); }
.article h2,
.article h3 { color: #ffffff; text-shadow: none; }
.article a { color: var(--gold); }
.article strong { color: #ffffff; }

.contact-form .field input,
.contact-form .field textarea {
width: 100%;
padding: 12px;
border-radius: 10px;
border: 1px solid rgba(255, 255, 255, 0.14);
background: rgba(0, 0, 0, 0.18);
color: #ffffff;
font-family: inherit;
font-size: 1rem;
}

.contact-form .field textarea { resize: vertical; min-height: 120px; }

.error-page {
text-align: center;
padding: 60px 0;
}

.error-page h1 { color: #ffffff; }
.error-page p { color: rgba(255, 255, 255, 0.85); }

.error-page .code {
font-size: 4rem;
font-weight: 800;
color: var(--gold);
margin: 0;
}

.consent-banner {
position: fixed;
left: 0;
right: 0;
bottom: 0;
z-index: 1000;
background: var(--bg-card);
border-top: 1px solid var(--border);
box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.12);
padding: 16px;
}

.consent-banner-inner {
max-width: 720px;
margin: 0 auto;
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 12px 20px;
}

.consent-banner-inner p {
flex: 1 1 320px;
margin: 0;
font-size: 0.92rem;
color: var(--text-dim);
}

.consent-banner-inner a { color: var(--accent-dark); }

.consent-banner-actions {
display: flex;
gap: 10px;
flex-wrap: wrap;
}

.consent-btn {
padding: 10px 18px;
font-size: 0.95rem;
font-weight: 600;
border: none;
border-radius: 10px;
cursor: pointer;
transition: transform 0.1s ease;
}

.consent-btn:active { transform: scale(0.97); }

.consent-btn-primary {
background: linear-gradient(90deg, var(--accent), var(--accent-dark));
color: white;
}

.consent-btn-secondary {
background: var(--surface);
color: var(--accent-dark);
border: 1px solid var(--border);
}

@media (max-width: 480px) {
.consent-banner-inner { flex-direction: column; align-items: stretch; }
.consent-banner-actions { justify-content: stretch; }
.consent-btn { flex: 1 1 0; }
}


/* ---- Design refresh: rounded display type, coral CTA accent, micro-animations ---- */

h1, h2, h3,
.title, .site-logo, .hero h1,
.btn, .room-code, .letterreveal-badge,
.review-title {
font-family: var(--font-display);
letter-spacing: 0.01em;
}

@keyframes letterPop {
0% { transform: scale(0.7); }
55% { transform: scale(1.22); }
80% { transform: scale(1.05); }
100% { transform: scale(1.15); }
}

.mark-btn.active {
animation: markPop 0.35s ease;
}

@keyframes markPop {
0% { transform: scale(0.85); }
60% { transform: scale(1.18); }
100% { transform: scale(1); }
}

#screen-lobby:not(.hidden) .room-code {
animation: codePop 0.5s cubic-bezier(.34,1.56,.64,1) both;
}

@keyframes codePop {
0% { transform: scale(0.6); opacity: 0; }
70% { transform: scale(1.08); opacity: 1; }
100% { transform: scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
.letterreveal-badge.landed, .mark-btn.active, #screen-lobby:not(.hidden) .room-code { animation: none !important; }
}
