:root {
  --red: #dc0504;
  --red2: #b30706;
  --ink: #26262a;
  --dark: #17171a;
  --paper: #f7f5f1;
  --line: #ded9cf;
  --orange: #ff801a;
  --ok: #1f9d55;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #cfe9f8;
  font-family: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
  overscroll-behavior: none;
}
[hidden] {
  display: none !important;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 0;
  touch-action: manipulation;
}
kbd {
  font: 700 11px ui-monospace, Menlo, monospace;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  padding: 2px 6px;
  margin: 0 2px;
}
#c {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

/* ------------------------------------------------------------------ HUD */
#hud > * {
  position: fixed;
  z-index: 5;
}
.pill {
  background: rgba(23, 23, 26, 0.82);
  color: #fff;
  border-radius: 999px;
  padding: 9px 16px;
  font-weight: 700;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  box-shadow: 0 6px 18px -8px rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.tl {
  top: calc(12px + var(--safe-t));
  left: calc(12px + var(--safe-l));
}
#btnMissions b {
  font-size: 18px;
}
#btnMissions i {
  font-style: normal;
  opacity: 0.6;
  font-size: 13px;
}
#btnMissions em {
  font-style: normal;
  margin-left: 6px;
  padding-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.25);
}
.panel {
  margin-top: 8px;
  width: min(340px, calc(100vw - 24px));
  max-height: calc(100vh - 150px);
  overflow: auto;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 8px;
  box-shadow: 0 18px 44px -18px rgba(0, 0, 0, 0.55);
  touch-action: pan-y;
}
.panel ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.panel li {
  padding: 9px 10px;
  border-radius: 13px;
  font-weight: 650;
  font-size: 14px;
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 8px;
  align-items: center;
}
.panel li + li {
  margin-top: 2px;
}
.panel li .ck {
  width: 22px;
  height: 22px;
  border-radius: 99px;
  border: 2px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 13px;
  color: #fff;
}
.panel li.done {
  color: #6b6a66;
}
.panel li.done .ck {
  background: var(--ok);
  border-color: var(--ok);
}
.panel li .bar {
  grid-column: 2 / 4;
  height: 6px;
  border-radius: 9px;
  background: #ece8df;
  overflow: hidden;
}
.panel li .bar i {
  display: block;
  height: 100%;
  background: var(--orange);
  border-radius: 9px;
}
.panel li .s {
  font-size: 12px;
  white-space: nowrap;
}
#info {
  top: calc(12px + var(--safe-t));
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  max-width: max(170px, calc(100vw - 470px));
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
#info small {
  font-weight: 600;
  color: #ffc48a;
}
.tr {
  top: calc(12px + var(--safe-t));
  right: calc(12px + var(--safe-r));
  display: flex;
  gap: 8px;
}
.round {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: rgba(23, 23, 26, 0.82);
  color: #fff;
  font-size: 19px;
  font-weight: 800;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 18px -8px rgba(0, 0, 0, 0.5);
}
.round:active,
.act:active {
  transform: scale(0.94);
}
#next {
  top: calc(64px + var(--safe-t));
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 14px;
  padding: 7px 14px;
  max-width: 92vw;
  white-space: nowrap;
}
#next b {
  color: var(--red);
}
#toast {
  left: 50%;
  bottom: calc(26% + var(--safe-b));
  transform: translate(-50%, 12px);
  background: rgba(23, 23, 26, 0.9);
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  padding: 12px 20px;
  border-radius: 18px;
  max-width: min(560px, 88vw);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* páčky (len dotyk) */
.stick {
  width: 136px;
  height: 136px;
  border-radius: 999px;
  background: rgba(23, 23, 26, 0.28);
  border: 3px solid rgba(255, 255, 255, 0.55);
  bottom: calc(22px + var(--safe-b));
  display: none;
  touch-action: none;
}
.stick i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 58px;
  height: 58px;
  margin: -29px 0 0 -29px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 14px -6px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}
.stick span {
  position: absolute;
  left: 0;
  right: 0;
  top: -24px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}
#stickL {
  left: calc(22px + var(--safe-l));
}
#stickR {
  right: calc(22px + var(--safe-r));
}
body.touch #stickL,
body.touch.rstick #stickR {
  display: block;
}

/* tlačidlá akcií */
#actions {
  right: calc(16px + var(--safe-r));
  bottom: calc(18px + var(--safe-b));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 9px;
}
body.touch.rstick #actions {
  right: calc(176px + var(--safe-r));
}
.act {
  background: rgba(23, 23, 26, 0.86);
  color: #fff;
  border-radius: 18px;
  padding: 12px 16px;
  font-weight: 800;
  font-size: 16px;
  min-width: 150px;
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.6);
}
.act.main {
  background: var(--red);
  font-size: 18px;
  min-height: 58px;
}
.act.mini {
  min-width: 0;
  width: 56px;
  justify-content: center;
  font-size: 22px;
  padding: 8px;
}
.act.mini kbd {
  display: none;
}
body.touch .act kbd {
  display: none;
}
body.touch .act {
  min-width: 128px;
  justify-content: center;
}

/* oslava splnenej úlohy */
#celebrate {
  position: fixed;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  pointer-events: none;
}
#celebrate .box {
  background: #fff;
  border-radius: 26px;
  padding: 20px 30px;
  text-align: center;
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.6);
  animation: popin 0.5s cubic-bezier(0.2, 1.6, 0.4, 1);
  max-width: 86vw;
}
#celebrate .st {
  font-size: 40px;
  letter-spacing: 4px;
}
#celebrate b {
  display: block;
  font-size: 22px;
  margin-top: 4px;
}
@keyframes popin {
  from {
    transform: scale(0.4);
    opacity: 0;
  }
}
.confetti {
  position: fixed;
  top: -40px;
  z-index: 7;
  font-size: 26px;
  pointer-events: none;
  animation: fall linear forwards;
}
@keyframes fall {
  to {
    transform: translateY(115vh) rotate(540deg);
  }
}

/* ------------------------------------------------------------------ menu, pomoc */
#menu,
#help,
#talk {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  padding: 18px calc(18px + var(--safe-r)) 18px calc(4vw + var(--safe-l));
  touch-action: pan-y;
  overflow: auto;
}
#help,
#talk {
  justify-content: center;
  background: rgba(23, 23, 26, 0.55);
  z-index: 30;
  padding: 16px;
}
.talk .who {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.talk .who > div {
  flex: 1;
  display: grid;
}
.talk .who b {
  font-size: 20px;
}
.talk .who small {
  color: #6b6a66;
}
.talk .av {
  font-size: 40px;
  width: 60px;
  height: 60px;
  border-radius: 99px;
  background: #e8eefb;
  display: grid;
  place-items: center;
}
.talk .round {
  background: var(--ink);
}
.bubble {
  background: #fff5e8;
  border: 2px solid #ffd9a8;
  border-radius: 6px 18px 18px 18px;
  padding: 12px 14px;
  font-size: 16px;
  line-height: 1.45;
  min-height: 74px;
  margin-bottom: 12px;
}
.qs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  max-height: 44vh;
  overflow: auto;
  touch-action: pan-y;
}
.qs button {
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 9px 12px;
  font-weight: 700;
  font-size: 14px;
}
.qs button.on {
  border-color: var(--red);
  background: #fff5f4;
}
.card {
  width: min(400px, 100%);
  background: rgba(255, 255, 255, 0.96);
  border-radius: 28px;
  padding: 22px 22px 18px;
  box-shadow: 0 30px 80px -24px rgba(0, 0, 0, 0.6);
  text-align: center;
  margin: auto 0;
}
.card.wide {
  width: min(760px, 100%);
  margin: auto;
  text-align: left;
}
.card .logo {
  width: 210px;
  max-width: 70%;
  display: block;
  margin: 0 auto;
}
.card h1 {
  margin: 4px 0 2px;
  font-size: 46px;
  letter-spacing: 0.06em;
  color: var(--red);
  font-weight: 900;
}
.card h2 {
  margin: 0 0 10px;
  font-size: 26px;
}
.card h3 {
  margin: 12px 0 6px;
  font-size: 15px;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.card p {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.4;
  color: #4a4a4f;
}
.outfits {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.outfits button {
  background: var(--paper);
  border: 3px solid var(--line);
  border-radius: 18px;
  padding: 10px 8px;
  display: grid;
  gap: 2px;
  justify-items: center;
}
.outfits button.on {
  border-color: var(--red);
  background: #fff5f4;
}
.outfits small {
  font-size: 11.5px;
  color: #6b6a66;
}
.sw {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  margin-bottom: 4px;
  border: 2px solid rgba(0, 0, 0, 0.12);
}
.sw.plaid {
  background:
    linear-gradient(90deg, rgba(15, 15, 18, 0.55) 50%, transparent 50%) 0 0 / 23px 23px,
    linear-gradient(0deg, rgba(15, 15, 18, 0.55) 50%, transparent 50%) 0 0 / 23px 23px,
    #d21a24;
}
.sw.tee {
  background: #fff url(../assets/logo.png) center / 84% no-repeat;
}
.sw.vest {
  background:
    linear-gradient(0deg, transparent 22%, #e6ee6a 22% 34%, transparent 34% 58%, #e6ee6a 58% 70%, transparent 70%),
    #f47a1c;
}
.sw.winter {
  background:
    radial-gradient(circle at 50% 13%, #fff 0 12%, transparent 13%),
    linear-gradient(180deg, #d3202a 0 36%, #f4f4f2 36% 46%, #2f6fd0 46%);
}
.big {
  width: 100%;
  background: var(--red);
  color: #fff;
  font-weight: 900;
  font-size: 24px;
  padding: 14px;
  border-radius: 20px;
  box-shadow: 0 10px 24px -10px rgba(220, 5, 4, 0.8);
}
.big:active {
  background: var(--red2);
}
.row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
/* súťaž o zľavu */
.contestBtn {
  width: 100%;
  margin-top: 10px;
  background: #fff5e8;
  border: 2px solid #ffd9a8;
  border-radius: 14px;
  padding: 8px 10px;
  font: inherit;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}
.contestBtn small {
  color: #8a5a1c;
  font-weight: 700;
}
.dlg {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(23, 23, 26, 0.55);
  padding: 16px;
  overflow: auto;
  touch-action: pan-y;
}
.dlg .card {
  position: relative;
  text-align: left;
  margin: auto;
}
.dlg .x {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--ink);
}
#cForm {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}
#cName,
#cCity,
#cEmail {
  font: inherit;
  font-size: 16px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  -webkit-user-select: text;
  user-select: text;
}
#contest .skip {
  width: 100%;
  margin-top: -2px;
  background: none;
  border: 0;
  color: #6b6b72;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  text-decoration: underline;
  padding: 6px;
  cursor: pointer;
}
.agree {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 14px;
  line-height: 1.35;
}
.agree input {
  width: 20px;
  height: 20px;
  flex: none;
  margin: 0;
}
.dlg details {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.45;
}
.dlg summary {
  font-weight: 800;
  cursor: pointer;
}
.dlg ol {
  padding-left: 20px;
  margin: 8px 0 0;
}
.code {
  margin: 12px 0;
  text-align: center;
  font: 900 34px/1.2 ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: 0.16em;
  background: #17171a;
  color: #ffd23c;
  border-radius: 16px;
  padding: 12px 8px;
  -webkit-user-select: all;
  user-select: all;
}
#prize .card {
  text-align: center;
}

/* hra pre dvoch */
.mp {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.mp button,
.mp input {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 9px 8px;
  font: inherit;
  font-weight: 700;
  font-size: 13.5px;
  min-width: 0;
}
.mp .join {
  display: flex;
  gap: 6px;
}
.mp input {
  width: 74px;
  flex: none;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  -webkit-user-select: text;
  user-select: text;
}
.mp .join button {
  flex: 1;
}
#mpInfo {
  grid-column: 1 / 3;
  font-size: 13.5px;
  line-height: 1.35;
  background: #fff5e8;
  border-radius: 12px;
  padding: 8px 10px;
}
#mpInfo b,
#mpPill b {
  letter-spacing: 0.08em;
  color: var(--red);
}
#mpPill {
  top: calc(64px + var(--safe-t));
  left: calc(12px + var(--safe-l));
  font-size: 13px;
  padding: 6px 12px;
}
#mpPill b {
  color: #ffc48a;
}
.row button {
  flex: 1;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 9px;
  font-weight: 700;
  font-size: 14px;
}
.cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 24px;
}
#help table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
}
#help td {
  padding: 5px 4px;
  border-bottom: 1px solid #eee9df;
  vertical-align: top;
}
#help td:first-child {
  white-space: nowrap;
  font-weight: 700;
}
#help kbd {
  background: var(--ink);
  color: #fff;
}
.tip {
  margin: 14px 0 12px !important;
  background: #fff5e8;
  border-radius: 12px;
  padding: 9px 12px;
}

#loading,
#rotate,
#err {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: var(--paper);
  text-align: center;
  font-weight: 800;
  font-size: 20px;
}
#loading img {
  width: 240px;
  display: block;
  margin: 0 auto 14px;
}
#loading {
  align-content: center;
}
#rotate {
  display: none;
  background: var(--dark);
  color: #fff;
  font-size: 26px;
  line-height: 1.5;
}
#err {
  padding: 30px;
  font-size: 16px;
  white-space: pre-wrap;
}

@media (max-width: 760px) {
  .cols,
  .qs {
    grid-template-columns: 1fr;
  }
  #btnMissions em {
    display: none;
  }
  #next {
    font-size: 12.5px;
  }
}
@media (max-height: 520px) {
  .card {
    padding: 10px 16px 10px;
    border-radius: 22px;
  }
  .card .logo {
    width: 104px;
  }
  .card h1 {
    font-size: 24px;
    margin: 0;
  }
  .card p,
  .outfits small {
    display: none;
  }
  .outfits {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 8px;
  }
  .outfits button {
    padding: 5px 2px;
    border-radius: 14px;
    font-size: 12px;
  }
  .sw {
    width: 30px;
    height: 30px;
    margin: 0;
  }
  .big {
    font-size: 20px;
    padding: 9px;
  }
  .row {
    margin-top: 7px;
  }
  .row button {
    padding: 6px;
  }
  #toast {
    bottom: auto;
    top: calc(96px + var(--safe-t));
    font-size: 14px;
    padding: 8px 14px;
  }
  .stick {
    width: 116px;
    height: 116px;
  }
  .act {
    min-height: 42px;
    padding: 8px 12px;
    font-size: 14px;
  }
  .act.main {
    min-height: 48px;
    font-size: 16px;
  }
  body.touch.rstick #actions {
    right: calc(152px + var(--safe-r));
  }
  .round {
    width: 38px;
    height: 38px;
    font-size: 16px;
  }
  #next {
    top: calc(54px + var(--safe-t));
  }
}
/* telefón na šírku: menšie texty, aby hlášky nezakrývali hru */
@media (max-height: 520px) {
  .pill {
    font-size: 12.5px;
    padding: 6px 11px;
    gap: 5px;
  }
  #next {
    font-size: 11.5px;
    padding: 5px 10px;
    max-width: 46vw;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #toast {
    top: calc(132px + var(--safe-t));
    font-size: 12.5px;
    padding: 6px 12px;
    border-radius: 12px;
    max-width: 56vw;
  }
  #celebrate {
    place-items: start center;
    padding-top: calc(84px + var(--safe-t));
  }
  #celebrate .box {
    padding: 8px 16px;
    border-radius: 16px;
    max-width: 58vw;
  }
  #celebrate .st {
    font-size: 20px;
    letter-spacing: 2px;
  }
  #celebrate b {
    font-size: 14px;
    margin-top: 0;
  }
  #missions {
    font-size: 12px;
  }
}
/* tablet */
@media (pointer: coarse) and (min-height: 521px) {
  #toast {
    font-size: 15px;
    padding: 9px 16px;
    max-width: min(460px, 70vw);
  }
  #celebrate .box {
    padding: 14px 22px;
    max-width: 70vw;
  }
  #celebrate .st {
    font-size: 28px;
  }
  #celebrate b {
    font-size: 18px;
  }
}
/* telefón na výšku: hrá sa na šírku */
@media (orientation: portrait) and (max-width: 560px) and (pointer: coarse) {
  #rotate {
    display: grid;
  }
}

/* odkaz na web v kartičke stroja */
.weblink {
  display: block;
  text-align: center;
  background: var(--red);
  color: #fff;
  font-weight: 800;
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 12px;
  text-decoration: none;
}
