html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body { background: var(--cream); }
.bg-fixed { position: fixed; inset: 0; z-index: -1; }
.bg-fixed .checker { width: 100%; height: 100%; }

#app {
  height: 100dvh; display: flex; flex-direction: column;
  padding: max(10px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
  gap: 12px; user-select: none; -webkit-user-select: none;
}

.top {
  display: flex; align-items: center; gap: 10px; flex: none; min-height: 52px;
  background: var(--paper); border: 3px solid var(--ink); border-radius: 30px; box-shadow: 4px 4px 0 var(--ink);
  padding: 3px 14px 3px 3px;
}
.top .team-icon { font-size: 44px; }
.top .nm { flex: 1; font-size: 20px; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top .pts { font-family: var(--font-head); font-size: 24px; white-space: nowrap; }
.top .pts small { font-family: var(--font-body); font-size: 15px; opacity: .7; }

.main { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.panel { background: var(--paper); color: var(--ink); border: 3px solid var(--ink); border-radius: 18px; padding: 14px 16px; box-shadow: 5px 5px 0 var(--ink); }
.center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; }
.center .head { font-size: 44px; line-height: 1.05; }
.center p { margin: 0; font-size: 20px; max-width: 22em; background: var(--paper); border: 3px solid var(--ink); border-radius: 14px; padding: 8px 14px; box-shadow: 4px 4px 0 var(--ink); }

/* question window (smaller version of the display window) */
.qwin { flex: none; }
.qwin .win-bar { font-size: 19px; padding: 3px 8px 3px 14px; border-width: 3px; box-shadow: 4px 4px 0 var(--ink); border-radius: 12px; }
.qwin .win-btns { gap: 4px; }
.qwin .win-btns i { width: 22px; height: 22px; font-size: 16px; border-width: 2.5px; }
.qwin .win-body { border-width: 3px; box-shadow: 5px 5px 0 var(--ink); padding: 12px 34px 12px 14px; border-radius: 14px; }
.qwin .win-scroll { width: 11px; right: 9px; top: 10px; bottom: 10px; border-width: 2px; }
.qwin .qtitle { font-family: var(--font-head); font-size: 24px; line-height: 1.1; margin-bottom: 4px; }
.qwin .qt { font-size: 20px; line-height: 1.25; max-height: 28vh; overflow: auto; user-select: text; -webkit-user-select: text; }

.input-area { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; overflow: auto; padding: 2px 6px 6px 2px; }

.btn {
  border: 3px solid var(--ink); border-radius: 16px; padding: 12px 16px; font-size: 21px;
  background: var(--paper); color: var(--ink); box-shadow: 4px 4px 0 var(--ink);
  transition: transform .08s, box-shadow .08s;
}
.btn:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn.primary { background: var(--coral); font-family: var(--font-head); font-size: 28px; font-weight: 400; }
.btn:disabled { opacity: .45; }
.btn.sel { background: var(--sage); }
.btn.small { padding: 6px 12px; font-size: 17px; border-radius: 12px; }

.opt-btn { display: flex; align-items: center; gap: 12px; text-align: left; background: var(--sage-light); }
.opt-btn .letter {
  flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: var(--cream); font-family: var(--font-head); font-size: 20px;
}

/* Wahr / Falsch: stacked, green and red */
.tf { display: grid; grid-template-rows: 1fr 1fr; gap: 14px; flex: 1; max-height: 340px; padding: 2px 6px 6px 2px; }
.tf .btn { font-family: var(--font-head); font-weight: 400; font-size: 40px; color: #fff; text-shadow: 2px 2px 0 var(--ink); }
.tf .btn.tf-true { background: var(--true); }
.tf .btn.tf-false { background: var(--false); }
.tf.chosen .btn:not(.sel) { opacity: .4; }
.tf .btn.sel { outline: 4px solid var(--ink); outline-offset: 3px; }
.tf .btn.sel::after { content: " ✓"; }

textarea.answer {
  width: 100%; min-height: 110px; resize: none; border: 3px solid var(--ink); border-radius: 16px; box-shadow: 4px 4px 0 var(--ink);
  padding: 12px 14px; font: inherit; font-size: 23px; color: var(--ink); background: var(--paper);
  user-select: text; -webkit-user-select: text;
}
textarea.answer:disabled { opacity: .7; }

.est-val { font-family: var(--font-head); font-size: 44px; text-align: center; }
.est-val.unset { opacity: .5; font-size: 26px; }
input[type=range] { width: 100%; height: 44px; accent-color: var(--coral); }
.est-row { display: flex; gap: 10px; align-items: center; }
.est-row input[type=number] {
  flex: 1; min-width: 0; font: inherit; font-size: 23px; text-align: center; border: 3px solid var(--ink);
  border-radius: 14px; padding: 8px; color: var(--ink); background: var(--paper); user-select: text; -webkit-user-select: text;
}
.est-row .btn { width: 56px; padding: 8px 0; }
.minmax { display: flex; justify-content: space-between; font-size: 15px; opacity: .7; }

.order { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.order li {
  display: flex; align-items: center; gap: 8px; background: var(--paper); border: 3px solid var(--ink); border-radius: 14px;
  box-shadow: 3px 3px 0 var(--ink); padding: 5px 5px 5px 10px; font-size: 19px; line-height: 1.15; touch-action: none; position: relative;
}
.order li.drag { z-index: 5; background: var(--saffron-light); box-shadow: 6px 8px 0 var(--ink); }
.order .n { flex: none; font-family: var(--font-head); color: var(--coral); font-size: 24px; width: 26px; text-align: center; }
.order .tx { flex: 1; }
.order .grip { flex: none; font-size: 20px; opacity: .45; padding: 0 4px; }
.order .arr { flex: none; width: 36px; height: 36px; padding: 0; border-radius: 10px; font-size: 15px; border-width: 2.5px; box-shadow: 2px 2px 0 var(--ink); }

.submit-row { flex: none; display: flex; flex-direction: column; gap: 8px; }
.submitted {
  display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 21px;
  background: var(--sage-light); border: 3px solid var(--ink); border-radius: 16px; box-shadow: 4px 4px 0 var(--ink); padding: 12px;
}
.linkbtn { background: none; border: 0; text-decoration: underline; font-size: 17px; }

/* buzzer */
.buzzer-wrap { flex: 1; display: grid; place-items: center; }
.buzzer {
  width: min(76vw, 44vh); aspect-ratio: 1; border-radius: 50%;
  border: 5px solid var(--ink); background: var(--coral);
  box-shadow: 0 14px 0 var(--ink); color: #fff; text-shadow: 3px 3px 0 var(--ink);
  font-family: var(--font-head); font-size: min(14vw, 8vh);
  transition: transform .06s, box-shadow .06s; touch-action: manipulation;
}
.buzzer:active:not(:disabled) { transform: translateY(10px); box-shadow: 0 4px 0 var(--ink); }
.buzzer:disabled { filter: grayscale(.85); opacity: .6; }
.buzzer.mine { background: var(--true); animation: wiggle .6s ease-in-out 3; }
.buzzer.mine:disabled { filter: none; opacity: 1; }
.buzz-msg { font-size: 22px; text-align: center; min-height: 1.5em; background: var(--paper); border: 3px solid var(--ink); border-radius: 14px; padding: 6px 12px; box-shadow: 4px 4px 0 var(--ink); }

/* profile editor */
.canvas-box { flex: 1; min-height: 0; display: grid; place-items: center; }
canvas.draw {
  width: min(82vw, 42vh); aspect-ratio: 1; background: #fff; border-radius: 50%;
  touch-action: none; border: 4px solid var(--ink); box-shadow: 7px 7px 0 var(--ink);
}
.tools { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; flex: none; }
.swatch { width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--ink); padding: 0; }
.swatch.sel { outline: 3px solid var(--ink); outline-offset: 3px; }
.name-input {
  width: 100%; font: inherit; font-size: 22px; padding: 10px 14px; border: 3px solid var(--ink); border-radius: 14px;
  box-shadow: 4px 4px 0 var(--ink); color: var(--ink); background: var(--paper); user-select: text; -webkit-user-select: text;
}

.result-big { font-family: var(--font-head); font-size: 60px; text-shadow: 3px 3px 0 var(--paper); }
.solution-box { width: 100%; text-align: left; }
.solution-box .lbl { font-size: 15px; opacity: .6; text-transform: uppercase; letter-spacing: .05em; }
.solution-box .v { font-size: 23px; line-height: 1.2; margin-bottom: 10px; overflow-wrap: anywhere; }

/* pictures + map */
.qwin .qimg { display: block; margin: 8px auto 0; max-width: 100%; max-height: 22vh; border: 3px solid var(--ink); border-radius: 10px; background: #fff; cursor: zoom-in; }
.zoom { position: fixed; inset: 0; z-index: 200; background: rgba(42, 37, 35, .85); display: grid; place-items: center; padding: 16px; }
.zoom img { max-width: 100%; max-height: 100%; border: 4px solid var(--ink); border-radius: 12px; background: #fff; }
.pmap { flex: 1; min-height: 240px; border: 3px solid var(--ink); border-radius: 16px; box-shadow: 4px 4px 0 var(--ink); overflow: hidden; }
.map-tip { font-size: 16px; text-align: center; opacity: .8; }
