
.mktsk-layout{
  width:min(1100px, calc(100vw - 40px));
  margin: 0 auto;
  display:flex;
  gap: 24px;
  align-items:flex-end;
  justify-content: center;
  position: relative;
}

@media (max-width: 780px){
  .mktsk-wrap{
    margin: 10px auto;
    padding: 0 12px;
    /* Mobiilissa annetaan sisällön kasvaa — vieritys sivulla, ei piiloon leikkaus */
    max-height: none;
    overflow-x: hidden;
    overflow-y: visible;
  }
  .mktsk-layout{
    flex-direction:column;
    align-items:stretch;
    position: relative;
    overflow: visible;
    padding-top: 40px;
  }
  #mktsk-game{
    overflow-x: hidden;
  }
  #mktsk-game.mktsk-wrap{
    min-height: min(560px, calc(100vh - 32px));
    max-height: none;
  }
}

@media (min-width: 781px){
  .mktsk-layout{
    width: min(1100px, calc(100vw - 40px)) !important;
    max-width: 1100px !important;
  }
  #mktsk-game .mktsk-layout{
    width: min(1100px, calc(100vw - 40px)) !important;
    max-width: 1100px !important;
    margin: 0 auto !important;
  }
  /* Yksi vieritys (ikkuna): ei .mktsk-wrap + .mktsk-card pinottua scrollia — näytti "kahtena sivuna" */
  #mktsk-game.mktsk-wrap{
    max-height: none;
    overflow-y: visible;
  }
  /* Kissa piilossa: älä anna kortin kasvaa täyttämään riviä (flex 1 1 auto) */
  #mktsk-game .mktsk-card{
    flex: 0 0 auto;
    width: min(100%, var(--mktsk-card-w));
    max-width: var(--mktsk-card-w);
    /* Sama vähimmäiskorkeus kuin aiemmin kiinteällä height:lla: lyhyellä sisällöllä kortti ei kutistu,
       jolloin .mktsk-layout + flex-end ei nosta kissaa ja kuplaa ylös */
    min-height: min(900px, calc(98vh - 40px));
    height: auto;
    max-height: none;
    overflow-y: visible;
  }
}

:root{
  --mktsk-card-w: 720px;
  --mktsk-radius: 18px;
  --mktsk-bg: none;
  --mktsk-glass: rgba(255,255,255,0.18);
  --mktsk-glass-strong: rgba(255,255,255,0.28);
  --mktsk-line: rgba(255,255,255,0.28);
  --mktsk-shadow: rgba(0,0,0,0.28);
  --mktsk-text: rgba(255,255,255,0.92);
  --mktsk-text-dim: rgba(255,255,255,0.70);
  --mktsk-accent: #36d7c6;
  /* Kissan piilotusnapin (kissa_stop tms.) kieltokuvion keltainen — sama kuin Info-renkaassa työpöydällä */
  --mktsk-cat-ring-yellow: #fff159;
  /* Kelluvat apunapit (info + kissa) — sama koko molemmilla */
  --mktsk-fab-size: 56px;
  --mktsk-fab-inset: 28px;
  --mktsk-fab-gap: 22px;
  /* kissa_stop.webp:ssä on tyhjää reunaa — skaalataan visuaalisesti info-napin kokoon */
  --mktsk-fab-cat-img-scale: 1.32;
  /* Speech bubble typography is auto-fitted in JS; this is the max content height */
  --mktsk-bubble-max-h: 380px;
  /* Kissa + puhekupla: yläraja työpöydällä (isompi kissa = kupla leikkaantuu) */
  --mktsk-mascot-w-max: 220px;
  --mktsk-mascot-h-max: 300px;
  --mktsk-mascot-slot-w: 240px;
}

body{
  background-image: var(--mktsk-bg);
  background-size: cover;
  background-position: center top;
  background-attachment: scroll;
  background-repeat: no-repeat;
  background-color: #2c6f7b;
}

/*
 * Pelisivu: tausta näkymään (viewport), ei body-dokumentin pituuteen.
 * Muuten cover skaalautuu koko scrollatun sivun korkeuteen → “venyy” ja näyttää muuttumattomalta fixiltä.
 */
html:has(#mktsk-game){
  background-color: #2c6f7b;
}

body:has(#mktsk-game){
  background-image: none !important;
  background-color: transparent !important;
}

body:has(#mktsk-game)::before{
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: #2c6f7b;
  background-image: var(--mktsk-bg);
  background-size: cover;
  /* Alareuna kiinni näkymän alareunaan; ylimääräinen rajautuu ylhäältä (ei “nouse” ylös). */
  background-position: center bottom;
  background-repeat: no-repeat;
}

body:has(#mktsk-game) .site-content,
body:has(#mktsk-game) #content,
body:has(#mktsk-game) .entry-content,
body:has(#mktsk-game) .post-content{
  background: transparent !important;
}

/* Elementor-boxed: älä leikkaa pelialuetta kapeaan sarakkeeseen */
body:has(#mktsk-game) .elementor-shortcode,
body:has(#mktsk-game) .elementor-widget-shortcode,
body:has(#mktsk-game) .e-con-inner{
  overflow: visible !important;
}

/* U-sarjan pelisivu: tiiviimpi pystyasettelu + Elementor-välit (menu.css ei lataudu pelissä) */
body.mktsk-uudet-page .elementor-widget-shortcode,
body.mktsk-uudet-page .elementor-element:has(#mktsk-game),
body.mktsk-uudet-page .e-con:has(#mktsk-game),
body.mktsk-uudet-page .e-con-inner:has(#mktsk-game),
body.mktsk-uudet-page .entry-content,
body.mktsk-uudet-page .site-content,
body.mktsk-uudet-page #content{
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

body.mktsk-uudet-page.mktsk-game-view #mktsk-game.mktsk-wrap{
  margin-top: 0;
  margin-bottom: 0;
  min-height: auto;
}

body.mktsk-uudet-page.mktsk-game-view #mktsk-game .mktsk-card{
  min-height: min(720px, calc(92vh - 32px));
}

/* Piilota WordPress footer kun peli on käynnissä */
body:has(#mktsk-game) #footer,
body:has(#mktsk-game) footer,
body:has(#mktsk-game) .site-footer,
body:has(#mktsk-game) .wp-site-footer,
#mktsk-game ~ #footer,
#mktsk-game ~ footer,
#mktsk-game ~ .site-footer,
#mktsk-game ~ .wp-site-footer {
  display: none !important;
}

/* MemberSpace: Jäsenyys-nappi ei peitä peliä (kaikki näyttökoot — aiemmin vain mobiili) */
body:has(#mktsk-game) ms-button[data-testid="memberButton"],
body:has(#mktsk-game) ms-button[label="Jäsenyys"],
body:has(#mktsk-game) ms-button[label="Membership"],
body:has(#mktsk-game) #MemberSpaceWidget,
body:has(#mktsk-game) .MemberSpaceWidget,
body:has(#mktsk-game) #memberspace-footer-widget {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
}

.mktsk-wrap{
  margin: 20px auto;
  padding: 0 16px;
  max-height: calc(100vh - 40px);
  /* Älä leikkaa koko peliä pois: sisältö voi nousta korkeammaksi kuin näyttö (vastausnapit, seuraava) */
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  box-sizing: border-box;
}

/* WordPress-teemat voivat kutistaa mainin korkeuden nollaan flexissä */
#mktsk-game.mktsk-wrap{
  /* Kapea Elementor-sarake (esim. /uudet-liikennemerkit/) – sama täysleveys kuin [mktsk_menu]-sivulla */
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  min-height: min(720px, calc(100vh - 32px));
  box-sizing: border-box;
}

.mktsk-card{
  flex: 1 1 auto;
  position: relative;
  background: var(--mktsk-glass);
  border: 1px solid var(--mktsk-line);
  border-radius: var(--mktsk-radius);
  box-shadow: 0 14px 40px var(--mktsk-shadow);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  /* Sisäinen scroll: otsikko+kuva+napit eivät katoa overflow:hidden takia */
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  height: min(900px, calc(98vh - 40px));
  /* Ei pakoteta liian korkeaksi pienellä näytöllä — vähentää leikkauksen riskiä */
  min-height: min(480px, calc(85vh - 48px));
  max-height: min(1000px, calc(100vh - 40px));
  display: flex;
  flex-direction: column;
}

.mktsk-header{
  display:flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 18px 10px;
  gap: 10px;
  position: relative;
  flex-wrap: wrap;
}

.mktsk-header-actions{
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.mktsk-title{
  font-size: 18px;
  font-weight: 700;
  color: #0b1a24;
  flex: 1;
  text-align: center;
  margin: 0 16px;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.mktsk-meta{
  font-size: 16px;
  color: #1a2330;
  white-space: nowrap;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.mktsk-progress{
  margin: 20px 18px 16px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.30);
  border: 1px solid rgba(255,255,255,0.45);
  overflow: hidden;
}
.mktsk-progress-bar{
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,210,80,0.95), rgba(48,180,175,0.95));
  transition: width 220ms ease-out;
}

.mktsk-hint-btn{
  min-width: auto;
  height: auto;
  border-radius: 22px !important;
  border: 2px solid rgba(255, 210, 80, 0.95) !important;
  background: rgba(255,255,255,0.14) !important;
  color: rgba(255,255,255,0.95);
  display: none !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: 8px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  flex-direction: row;
  gap: 6px;
  padding: 8px 12px;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  box-sizing: border-box;
}

.mktsk-hint-btn.is-hidden{
  display: none !important;
}

.mktsk-hint-btn:disabled{
  opacity: 0.45;
  cursor: default;
}

.mktsk-hint-btn-icon{
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  color: #ffd34d;
  line-height: 1;
  text-shadow: 0 2px 6px rgba(0,0,0,0.35);
  flex-shrink: 0;
}
img.mktsk-hint-btn-icon{
  width: 28px;
  height: 28px;
  max-width: 28px;
  max-height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

.mktsk-hint-btn-label{
  font-size: 15px;
  color: inherit;
  font-family: inherit;
  line-height: 1.35;
}

.mktsk-hint-btn.is-blink{
  animation: mktsk-hint-blink 1.5s ease-in-out infinite;
  border-color: rgba(255, 210, 80, 0.95);
}

@keyframes mktsk-hint-blink{
  0%, 100% {
    box-shadow: 0 0 0 rgba(255, 210, 80, 0);
    filter: brightness(1);
  }
  50% {
    box-shadow: 0 0 20px rgba(255, 210, 80, 0.9);
    filter: brightness(1.08);
  }
}

@media (min-width: 781px){
  .mktsk-hint-btn{
    display: none !important;
  }
  /* Työpöytä: i kiinnitetään bodyyn (JS), ei headeriin */
  #mktsk-game .mktsk-header-actions .mktsk-info-btn{
    display: none !important;
  }
  body > button.mktsk-info-btn.mktsk-sign-info-floating:not(.is-hidden){
    position: fixed !important;
    z-index: 999000;
    box-sizing: border-box !important;
    width: var(--mktsk-fab-size) !important;
    height: var(--mktsk-fab-size) !important;
    min-width: var(--mktsk-fab-size) !important;
    min-height: var(--mktsk-fab-size) !important;
    max-width: var(--mktsk-fab-size) !important;
    max-height: var(--mktsk-fab-size) !important;
    flex: 0 0 var(--mktsk-fab-size) !important;
    padding: 0 !important;
    border-radius: 50% !important;
    border: 2px solid var(--mktsk-cat-ring-yellow) !important;
    box-shadow:
      0 0 0 2px rgba(255, 241, 89, 0.95),
      0 0 18px rgba(255, 210, 80, 0.65),
      0 4px 14px rgba(0, 0, 0, 0.2);
    animation: mktsk-fab-glow 2.4s ease-in-out infinite;
    right: calc(max(var(--mktsk-fab-inset), env(safe-area-inset-right, 0px)) + var(--mktsk-fab-size) + var(--mktsk-fab-gap));
    bottom: max(24px, env(safe-area-inset-bottom, 0px));
    top: auto !important;
    left: auto !important;
    transform: none !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    margin: 0;
    overflow: hidden;
    font-size: 20px;
    font-weight: 900;
    line-height: 1;
  }
  /* Sama kiinteä koko kuin info-napilla — teeman button/img-säännöt eivät saa kutistaa */
  body > button.mktsk-mascot-dismiss.is-visible{
    position: fixed !important;
    right: max(var(--mktsk-fab-inset), env(safe-area-inset-right, 0px)) !important;
    bottom: max(24px, env(safe-area-inset-bottom, 0px)) !important;
    z-index: 999001 !important;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: var(--mktsk-fab-size) !important;
    height: var(--mktsk-fab-size) !important;
    min-width: var(--mktsk-fab-size) !important;
    min-height: var(--mktsk-fab-size) !important;
    max-width: var(--mktsk-fab-size) !important;
    max-height: var(--mktsk-fab-size) !important;
    flex: 0 0 var(--mktsk-fab-size) !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
    overflow: visible !important;
    line-height: 0 !important;
  }
  body > button.mktsk-mascot-dismiss.is-visible img{
    width: var(--mktsk-fab-size) !important;
    height: var(--mktsk-fab-size) !important;
    min-width: var(--mktsk-fab-size) !important;
    min-height: var(--mktsk-fab-size) !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: contain !important;
    object-position: center !important;
    display: block !important;
    flex: 0 0 var(--mktsk-fab-size) !important;
    transform: scale(var(--mktsk-fab-cat-img-scale));
    transform-origin: center center;
    animation: mktsk-fab-img-glow 2.6s ease-in-out infinite;
  }
}

@keyframes mktsk-fab-glow{
  0%, 100% {
    box-shadow:
      0 0 0 2px rgba(255, 241, 89, 0.95),
      0 0 18px rgba(255, 210, 80, 0.65),
      0 4px 14px rgba(0, 0, 0, 0.2);
    filter: brightness(1);
  }
  50% {
    box-shadow:
      0 0 0 3px rgba(255, 241, 89, 1),
      0 0 32px rgba(255, 210, 80, 1),
      0 0 48px rgba(255, 180, 60, 0.45),
      0 6px 20px rgba(0, 0, 0, 0.24);
    filter: brightness(1.08);
  }
}

/* Kissan kuva: hehku seuraa kuvan muotoa (ei neliölaatikkoa) */
@keyframes mktsk-fab-img-glow{
  0%, 100% {
    filter:
      drop-shadow(0 0 10px rgba(255, 210, 80, 0.7))
      drop-shadow(0 2px 8px rgba(0, 0, 0, 0.18));
  }
  50% {
    filter:
      drop-shadow(0 0 22px rgba(255, 210, 80, 1))
      drop-shadow(0 0 36px rgba(255, 180, 60, 0.48))
      drop-shadow(0 4px 12px rgba(0, 0, 0, 0.22));
  }
}

/* Merkin virallinen selitys (oikean vastauksen jälkeen) */
.mktsk-info-btn{
  display: none;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  padding: 0 10px;
  margin: 0;
  border-radius: 999px !important;
  /* Sama kultainen reunus kuin vihje / kissan apunapit */
  border: 2px solid rgba(255, 210, 80, 0.95) !important;
  background: rgba(255,255,255,0.88) !important;
  box-shadow:
    0 0 0 2px rgba(255, 241, 89, 0.95),
    0 0 18px rgba(255, 210, 80, 0.65),
    0 4px 14px rgba(0, 0, 0, 0.2);
  color: #0b1a24 !important;
  font-size: 16px;
  font-weight: 800;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.mktsk-info-btn.is-hidden{
  display: none !important;
}
.mktsk-info-btn:not(.is-hidden){
  display: inline-flex !important;
  animation: mktsk-fab-glow 2.4s ease-in-out infinite;
}
.mktsk-info-btn:disabled{
  opacity: 0.45;
  cursor: default;
}
body > button.mktsk-info-btn.mktsk-sign-info-floating:not(.is-hidden):hover{
  filter: brightness(1.1);
}
.mktsk-info-btn:hover:not(:disabled){
  filter: brightness(1.06);
}

.mktsk-sign-info-modal{
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100001;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  box-sizing: border-box;
}
.mktsk-sign-info-modal.is-open{
  display: flex;
}
.mktsk-sign-info-modal-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.65);
  -webkit-tap-highlight-color: transparent;
}
.mktsk-sign-info-panel{
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: min(85vh, 720px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  color: #0b1a24;
  border-radius: 18px;
  padding: 22px 20px 20px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.28);
  box-sizing: border-box;
  text-align: left;
}
.mktsk-sign-info-title{
  margin: 0 40px 14px 0;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.mktsk-sign-info-body{
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  white-space: normal;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.mktsk-sign-info-main{
  margin: 0 0 18px;
  white-space: pre-wrap;
}
.mktsk-sign-info-source{
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid rgba(11, 26, 36, 0.1);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  color: #1a3344;
}
.mktsk-sign-info-source a{
  color: #0b5d8a;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.mktsk-sign-info-source a:hover{
  color: #063652;
}
#mktsk-game .mktsk-sign-info-close,
.mktsk-sign-info-close{
  position: absolute;
  z-index: 2;
  top: max(12px, env(safe-area-inset-top));
  right: 12px;
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0;
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  color: #333 !important;
  background: #ffffff !important;
  border: 2px solid #ffd258 !important;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}
.mktsk-sign-info-close:hover,
.mktsk-sign-info-close:focus{
  background: #f5f5f5 !important;
  color: #000 !important;
}

.mktsk-back-btn{
  font-size: 16px;
  text-decoration: none;
  font-weight: 600;
  padding: 12px 14px;
  border-radius: 22px !important;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  white-space: nowrap;
  order: -1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  border: 1px solid rgba(0,0,0,0.12) !important;
  background: rgba(255,255,255,0.78) !important;
  color: #0b1a24 !important;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: none !important;
}

.mktsk-back-btn:hover{
  background: rgba(255,255,255,0.88) !important;
  border-color: rgba(0,0,0,0.18) !important;
  color: #06111a !important;
  text-decoration: none;
  box-shadow: none !important;
}

@media (max-width: 600px){
  .mktsk-title{
    margin: 0 60px 0 0;
    text-align: left;
  }
}

.mktsk-image-wrap{
  position: relative;
  padding: 16px 18px 12px;
  display:flex;
  justify-content:center;
  align-items:center;
  /* Skaalautuva korkeus - kuva skaalautuu sisään */
  height: min(380px, calc(45vh - 20px));
  min-height: min(320px, calc(38vh - 20px));
  max-height: min(440px, calc(52vh - 20px));
  overflow: visible;
}

.mktsk-sign{
  width: min(420px, 82vw);
  max-width: 420px;
  max-height: 100%;
  height: auto;
  aspect-ratio: 2/3;
  border-radius: 18px;
  background: #ffffff;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.55);
  box-shadow: 0 10px 22px rgba(0,0,0,0.10);
  object-fit: contain;
  object-position: center;
  /* Varmista että kuva pysyy rajojen sisällä - kuva skaalautuu mutta ei vaikuta pelialueen kokoon */
  display: block;
  /* Varmista että kuva ei ylitä image-wrap:n korkeutta */
}

.mktsk-choices{
  display:grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 24px 18px 8px;
  flex: 1 1 auto;
  overflow-y: visible;
  min-height: 0;
  flex-shrink: 1;
  max-height: 100%;
}

.mktsk-next-wrapper{
  /* Kuva-alueen sisällä, oikea reuna, pystysuunnassa keskitetty */
  display: none;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  padding: 0;
  margin: 0;
  width: auto;
  pointer-events: none;
}
.mktsk-next-wrapper.is-visible{
  display: flex;
  pointer-events: auto;
}

.mktsk-choice{
  font-size: 17px;
  padding: 14px 12px;
  border-radius: 22px !important;
  border: 1px solid rgba(0,0,0,0.12) !important;
  background: rgba(255,255,255,0.78) !important;
  color: #0b1a24 !important;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  cursor: pointer;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  white-space: normal !important;
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
  height: auto;
}

.mktsk-choice:hover{
  background: rgba(255,255,255,0.88) !important;
  border-color: rgba(0,0,0,0.18) !important;
  color: #06111a !important;
}

.mktsk-choice.is-correct{
  border-color: rgba(12, 145, 138, 1) !important;
  border-width: 2px !important;
  background: rgba(48, 200, 190, 0.68) !important;
  color: #043532 !important;
  box-shadow:
    0 0 0 2px rgba(48, 180, 175, 0.55),
    inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}
.mktsk-choice.is-correct:hover{
  background: rgba(48, 200, 190, 0.78) !important;
  border-color: rgba(8, 130, 124, 1) !important;
}

.mktsk-choice.is-wrong{
  border-color: rgba(210, 45, 85, 1) !important;
  border-width: 2px !important;
  background: rgba(255, 95, 125, 0.52) !important;
  color: #4a0f22 !important;
  box-shadow:
    0 0 0 2px rgba(255, 80, 110, 0.5),
    inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}
.mktsk-choice.is-wrong:hover{
  background: rgba(255, 95, 125, 0.62) !important;
  border-color: rgba(190, 30, 70, 1) !important;
}

.mktsk-choice.is-correct:disabled,
.mktsk-choice.is-wrong:disabled{
  opacity: 1;
}

.mktsk-choice:disabled{
  cursor: default;
  opacity: 0.85;
}

.mktsk-footer{
  display:none;
  /* Footer piilotettu - ei tarvita erillistä alaosaa */
}

/* Loppuruutu */
.mktsk-result-wrapper{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  min-height: 300px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  animation: fadeInScale 0.5s ease-out;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.mktsk-result-icon{
  font-size: 80px;
  margin-bottom: 20px;
  animation: bounceIn 0.6s ease-out 0.2s both;
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3) translateY(-50px);
  }
  50% {
    opacity: 1;
    transform: scale(1.1) translateY(0);
  }
  100% {
    transform: scale(1) translateY(0);
  }
}

.mktsk-result-title{
  font-size: 32px;
  font-weight: 700;
  color: var(--mktsk-text);
  margin-bottom: 24px;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.mktsk-result-score{
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  white-space: nowrap;
}

.mktsk-result-number{
  font-size: 64px;
  font-weight: 800;
  color: var(--mktsk-accent);
  line-height: 1;
}

.mktsk-result-divider{
  font-size: 48px;
  font-weight: 600;
  color: var(--mktsk-text-dim);
  line-height: 1;
}

.mktsk-result-total{
  font-size: 48px;
  font-weight: 600;
  color: var(--mktsk-text);
  line-height: 1;
}

.mktsk-result-percentage{
  font-size: 20px;
  font-weight: 500;
  color: var(--mktsk-text-dim);
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Ilmaisten visojen loppuruutu: kutsu täyteen Liikennemerkkikouluun */
.mktsk-result-upsell{
  margin-top: 8px;
  max-width: 34em;
  padding: 0 6px;
}
.mktsk-result-upsell-lead{
  margin: 0 0 0.45em 0;
  font-size: clamp(15px, 2.4vw, 17px);
  font-weight: 700;
  line-height: 1.45;
  color: var(--mktsk-text);
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.mktsk-result-upsell-text{
  margin: 0;
  font-size: clamp(15px, 2.4vw, 17px);
  font-weight: 500;
  line-height: 1.45;
  color: var(--mktsk-text-dim);
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.mktsk-result-upsell-link{
  color: var(--mktsk-accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.mktsk-result-upsell-link:hover{
  filter: brightness(1.08);
}

.mktsk-result-perfect .mktsk-result-number{
  color: #ffd700;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.mktsk-result-high .mktsk-result-number{
  color: #36d7c6;
}

.mktsk-result-medium .mktsk-result-number{
  color: #ffb84d;
}

.mktsk-result-low .mktsk-result-number{
  color: #ff6e8c;
}

/* Sama ilme kuin .mktsk-choice; nappi oikealla (ei täyttä riviä) */
.mktsk-next{
  font-size: 16px;
  padding: 14px 20px;
  border-radius: 22px !important;
  border: 1px solid rgba(0,0,0,0.12) !important;
  background: rgba(255,255,255,0.78) !important;
  color: #0b1a24 !important;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  cursor: pointer;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  width: auto;
  max-width: 100%;
  box-sizing: border-box;
  text-align: center;
  white-space: normal;
  line-height: 1.35;
  min-width: min(12em, 100%);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.mktsk-next:hover:not(:disabled){
  background: rgba(255,255,255,0.88) !important;
  border-color: rgba(0,0,0,0.18) !important;
  color: #06111a !important;
}

/* Icon-only triangle next (desktop). */
.mktsk-next.is-triangle{
  width: 56px;
  height: 56px;
  min-width: 56px;
  padding: 0;
  border-radius: 999px !important;
  border: 1px solid rgba(255,255,255,0.65) !important;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.95), rgba(255,255,255,0.60)) !important;
  color: #0b1a24 !important;
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 rgba(255,210,80,0.0);
  animation: mktsk-next-pulse 1.6s ease-in-out infinite;
}
.mktsk-next.is-triangle:hover:not(:disabled){
  filter: brightness(1.05);
}
.mktsk-next.is-triangle:disabled{
  opacity: 0.55;
  animation: none;
}
@keyframes mktsk-next-pulse{
  0%, 100% { box-shadow: 0 0 0 rgba(255,210,80,0.0), 0 0 0 rgba(48,180,175,0.0); }
  50% { box-shadow: 0 0 22px rgba(255,210,80,0.55), 0 0 30px rgba(48,180,175,0.35); }
}

.mktsk-next:disabled{
  cursor: default;
  opacity: 0.85;
}

.mktsk-mascot{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap: 0;
  flex: 0 0 300px;
  width: 300px;
  max-width: min(300px, 92vw);
  position: relative;
  height: auto;
  min-height: 0;
  overflow: visible;
  justify-content: flex-end;
}

.mktsk-mascot-figure{
  position: relative;
  align-self: flex-end;
  flex-shrink: 0;
  width: 240px;
  height: 320px;
  max-width: var(--mktsk-mascot-w-max);
  max-height: var(--mktsk-mascot-h-max);
  overflow: visible;
}

.mktsk-mascot.is-hidden{
  display: none;
}

@media (max-width: 780px){
  .mktsk-header{
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "back meta hint";
    align-items: center;
    gap: 6px 10px;
  }
  .mktsk-header-actions{
    grid-area: hint;
    justify-self: end;
    margin-right: 4px;
  }
  .mktsk-title{
    display: none !important;
  }
  .mktsk-back-btn{
    grid-area: back;
    justify-self: start;
    color: #000 !important;
  }
  .mktsk-back-btn:hover{
    color: #222 !important;
  }
  .mktsk-meta{
    grid-area: meta;
    justify-self: center;
    font-size: 14px;
    color: #222 !important;
  }
  .mktsk-hint-btn-label{
    color: #000 !important;
  }
  .mktsk-hint-btn{
    display: inline-flex !important;
    margin-left: 0;
    border: 2px solid #ffd258 !important;
    background: rgba(255,255,255,0.88) !important;
  }
  .mktsk-info-btn:not(.is-hidden){
    display: inline-flex !important;
    border: 2px solid #ffd258 !important;
    background: rgba(255,255,255,0.88) !important;
    color: #000 !important;
    box-shadow:
      0 0 0 2px rgba(255, 241, 89, 0.95),
      0 0 18px rgba(255, 210, 80, 0.65),
      0 4px 14px rgba(0, 0, 0, 0.2);
    animation: mktsk-fab-glow 2.4s ease-in-out infinite;
  }
  .mktsk-hint-btn-label{
    color: #000 !important;
  }
  .mktsk-choice{
    background: rgba(255,255,255,0.88) !important;
    border-color: rgba(0,0,0,0.12) !important;
    color: #000 !important;
  }
  .mktsk-choice:hover{
    background: rgba(255,255,255,0.92) !important;
    border-color: rgba(0,0,0,0.2) !important;
    color: #000 !important;
  }
  .mktsk-choice.is-correct{
    color: #043532 !important;
    border-color: rgba(12, 145, 138, 1) !important;
    background: rgba(48, 200, 190, 0.72) !important;
  }
  .mktsk-choice.is-correct:hover{
    background: rgba(48, 200, 190, 0.82) !important;
    border-color: rgba(8, 130, 124, 1) !important;
  }
  .mktsk-choice.is-wrong{
    color: #4a0f22 !important;
    border-color: rgba(210, 45, 85, 1) !important;
    background: rgba(255, 95, 125, 0.55) !important;
  }
  .mktsk-choice.is-wrong:hover{
    background: rgba(255, 95, 125, 0.65) !important;
    border-color: rgba(190, 30, 70, 1) !important;
  }
  .mktsk-result-title{
    color: #000 !important;
  }
  .mktsk-result-number,
  .mktsk-result-total,
  .mktsk-result-sep{
    color: #000 !important;
  }
  .mktsk-result-percentage{
    color: #333 !important;
  }
  .mktsk-next{
    background: rgba(255,255,255,0.88) !important;
    border-color: rgba(0,0,0,0.12) !important;
    color: #000 !important;
  }
  .mktsk-next:hover:not(:disabled){
    background: rgba(255,255,255,0.92) !important;
    border-color: rgba(0,0,0,0.2) !important;
    color: #000 !important;
  }
  .mktsk-card{
    height: auto;
    min-height: min(420px, calc(72vh - 20px));
    max-height: none;
  }
  .mktsk-header{
    padding: 10px 18px 6px 12px;
  }
  .mktsk-image-wrap{
    height: min(300px, calc(38vh - 16px));
    min-height: 0;
    max-height: min(340px, calc(42vh - 16px));
    padding: 12px 14px 10px;
    flex-shrink: 1;
  }
  .mktsk-choices{
    padding: 16px 14px 12px;
    gap: 8px;
    min-height: 0;
  }
  .mktsk-choice{
    padding: 11px 12px;
    font-size: 18px;
  }

  /* Mobiili: sama kuin työpöytä — nuoli kuva-alueen sisällä oikealla */
  .mktsk-next-wrapper{
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    padding: 0;
    margin: 0;
    width: auto;
    justify-content: center;
  }
  .mktsk-next.is-triangle{
    width: 50px;
    height: 50px;
    min-width: 50px;
    padding: 0;
    border-radius: 999px !important;
    font-size: 30px;
  }
  /* Mobiilissa ei "Seuraava"-kolmiota — siirtyminen ajastimella; loppuruudussa näkyy uudelleenaloitus. */
  .mktsk-card:not(.is-finish) .mktsk-next-wrapper{
    display: none !important;
  }
  .mktsk-card.is-finish .mktsk-next-wrapper{
    display: flex !important;
  }
  .mktsk-mascot:not(.mktsk-mascot-in-modal){
    flex: 0 0 auto;
    width: 280px;
    max-width: 280px;
    align-self: flex-end;
    height: auto;
  }
  .mktsk-mascot:not(.mktsk-mascot-in-modal) .mktsk-mascot-figure{
    width: 200px;
    height: 280px;
  }
  .mktsk-mascot.is-overlay{
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 9999;
  }
  .mktsk-bubble-close{
    display: inline-flex !important;
    z-index: 10000;
    top: -12px;
  }
  .mktsk-mascot-img{
    width: 200px;
    height: 280px;
  }
  .mktsk-bubble{
  overflow: visible;
    --mktsk-bubble-anchor-w: 260px;
    max-width: min(260px, calc(100vw - 24px));
    padding: clamp(10px, 2vw, 16px) clamp(12px, 2.5vw, 18px);
    min-height: 54px;
    border-radius: 20px;
    --mktsk-bubble-max-h: 310px;
    bottom: 100%;
    margin-bottom: -30px;
    font-size: clamp(11px, 2.2vw, 14px);
  }
  .mktsk-mascot:not(.mktsk-mascot-in-modal) .mktsk-bubble:not(.mktsk-bubble--wide){
    --mktsk-bubble-nudge-x: 8px;
  }
  .mktsk-bubble:not(.mktsk-bubble--wide){
    max-width: min(248px, calc(100vw - 24px));
    min-width: 156px;
    --mktsk-bubble-anchor-w: 248px;
  }
  .mktsk-mascot:not(.mktsk-mascot-in-modal) .mktsk-bubble.mktsk-bubble--wide{
    --mktsk-bubble-nudge-x: 30px;
  }
  .mktsk-bubble.mktsk-bubble--wide{
    --mktsk-bubble-wide-design-cap: 440px;
    --mktsk-bubble-wide-clear-extra: 36px;
    max-width: min(var(--mktsk-bubble-wide-design-cap), calc(100vw - 16px));
    --mktsk-bubble-max-h: 480px;
    --mktsk-bubble-anchor-w: min(312px, calc(100vw - 48px));
    font-size: clamp(11px, 2.2vw, 16px);
  }
  .mktsk-bubble:after{
    content: "";
    position: absolute;
    left: 50%;
    bottom: -10px;
    width: 26px;
    height: 26px;
    background: #ffffff;
    transform: translateX(-50%) rotate(45deg);
    border-radius: 4px;
    pointer-events: none;
  }
}

/* Mobiili: vihje-modal — sama rakenne kuin .mktsk-sign-info-modal (flex + tausta position:absolute inset:0). Ei gridiä / overflow-x:clip. */
@media (min-width: 781px){
  .mktsk-hint-modal{ display: none !important; }
}
.mktsk-hint-modal{
  display: none;
  position: fixed;
  inset: 0;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 100000;
  box-sizing: border-box;
  direction: ltr;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-right));
}
.mktsk-hint-modal.is-open{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  /* Ei overflow-y:tä ulkokuoressa — se rikkoo keskityksen; scroll vain panelissa (kuten .mktsk-sign-info-modal). */
  overflow: hidden;
  overscroll-behavior: contain;
}
.mktsk-hint-modal-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.65);
  -webkit-tap-highlight-color: transparent;
}
.mktsk-hint-modal-panel{
  position: relative;
  z-index: 1;
  flex: 0 1 auto;
  width: min(400px, 100%);
  max-width: 100%;
  max-height: min(92vh, calc(100dvh - max(32px, env(safe-area-inset-top)) - max(32px, env(safe-area-inset-bottom))));
  overflow-x: visible;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  padding: 32px 20px 40px;
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  cursor: pointer;
}
body .mktsk-hint-modal > .mktsk-hint-modal-close,
.mktsk-hint-modal-close{
  position: absolute;
  z-index: 2;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  margin: 0;
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  color: #333 !important;
  background: #ffffff !important;
  border: 2px solid #ffd258 !important;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}
.mktsk-hint-modal-close:hover,
.mktsk-hint-modal-close:focus{
  background: #f5f5f5 !important;
  color: #000;
}
/* Kissa + kupla: kapea sisältö keskelle panelia (ei 100% leveyttä — margin-auto ei vaikuta) */
.mktsk-mascot.mktsk-mascot-in-modal{
  position: relative;
  margin-left: auto;
  margin-right: auto;
  align-items: center;
  justify-content: flex-start;
  width: fit-content;
  max-width: 100%;
  box-sizing: border-box;
  height: auto;
  flex-shrink: 0;
  flex: 0 0 auto;
  margin-top: 0;
  margin-bottom: 0;
  /* Hieman oikealle (optinen tasoitus mobiililla) */
  transform: translateX(clamp(10px, 3.2vw, 18px));
}
.mktsk-mascot.mktsk-mascot-in-modal .mktsk-mascot-figure{
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: center;
  width: 100%;
  max-width: 100%;
  height: auto;
  min-height: 0;
}
.mktsk-mascot.mktsk-mascot-in-modal .mktsk-bubble{
  position: relative;
  bottom: auto;
  left: auto !important;
  right: auto !important;
  align-self: center;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 10px;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  max-height: none;
  padding: 14px 16px;
  font-size: 16px;
  overflow: visible;
}
.mktsk-mascot.mktsk-mascot-in-modal .mktsk-bubble.mktsk-bubble--wide{
  max-width: 100%;
  max-height: none;
}
.mktsk-mascot.mktsk-mascot-in-modal .mktsk-bubble-text{
  /* Ei fitBubbleText-inlineä: luettava koko teeman yli */
  font-size: clamp(15px, 3.8vw, 17px) !important;
  max-height: none;
  overflow-y: visible;
}
.mktsk-mascot.mktsk-mascot-in-modal .mktsk-bubble.mktsk-bubble--wide .mktsk-bubble-text{
  max-height: none;
}
.mktsk-mascot.mktsk-mascot-in-modal .mktsk-bubble.mktsk-bubble--scroll .mktsk-bubble-text{
  max-height: none;
  overflow-y: visible;
}
.mktsk-mascot.mktsk-mascot-in-modal .mktsk-bubble:after{
  content: "";
  position: absolute;
  left: 50%;
  bottom: -10px;
  width: 26px;
  height: 26px;
  background: #ffffff;
  transform: translateX(-50%) rotate(45deg);
  border-radius: 4px;
  pointer-events: none;
}
.mktsk-mascot.mktsk-mascot-in-modal .mktsk-mascot-img{
  position: relative;
  display: block;
  /* ~30 % pienempi kuin 240×320 (0.7×) */
  width: 168px;
  max-width: 100%;
  height: auto;
  max-height: 224px;
  object-fit: contain;
  flex-shrink: 0;
  margin-left: auto;
  margin-right: auto;
}

.mktsk-bubble{
  position: absolute;
  bottom: 100%;
  /* Sijainti: .mktsk-mascot:not(.in-modal) .mktsk-bubble (vasen reuna kiinni ankkurissa, leveys kasvaa oikealle). */
  --mktsk-bubble-nudge-x: 0px;
  --mktsk-bubble-anchor-w: 300px;
  /* Negatiivisempi marginaali = kupla laskeutuu lähemmäs kissaa (ankkuri: .mktsk-mascot-figure) */
  margin-bottom: -32px;
  max-width: min(300px, calc(100vw - 24px));
  min-width: 200px;
  width: auto;
  /* Puhekuplalla on maksimikorkeus, ei kiinteä korkeus - venyy tarvittaessa */
  min-height: 62px;
  max-height: min(var(--mktsk-bubble-max-h), 88vh);
  height: auto;
  padding: clamp(12px, 2vw, 18px) clamp(14px, 2.5vw, 18px);
  /* Puhekupla sarjakuvatyylillä - valkoinen tausta */
  border-radius: 20px;
  background: #ffffff;
  box-shadow: none;
  color: #000;
  /* Base font-size is intentionally a bit smaller; long hints will be auto-shrunk */
  font-size: clamp(12px, 2.5vw, 14px);
  font-weight: 500;
  line-height: 1.45;
  /* Teksti näkyy kokonaan - fonttikoko pienentyy automaattisesti */
  /* overflow: visible jotta väkä näkyy */
  overflow: visible;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  /* Näyttää selkeämmin että kissa puhuu */
  z-index: 3;
  /* Alustava transition */
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  /* Puhekupla on absoluuttisesti sijoitettu kissa-hahmon yläpuolelle */
  flex-shrink: 0;
}

/* Yksi ankkuri kaikille kuplille: ei hyppyä kapea ↔ leveä. Leveys kasvaa oikealle (oikea reuna liikkuu). */
.mktsk-mascot:not(.mktsk-mascot-in-modal) .mktsk-bubble{
  right: auto;
  left: calc(100% - var(--mktsk-bubble-anchor-w) + var(--mktsk-bubble-nudge-x));
}

/* Leveä / XL: hieman enemmän nudgea (kauemmas visalaatikosta). */
.mktsk-mascot:not(.mktsk-mascot-in-modal) .mktsk-bubble.mktsk-bubble--wide{
  --mktsk-bubble-nudge-x: 20px;
}
/* Kapea kupla: kauemmas pelialueen reunasta; kapeampi laatikko kuin pitkillä */
.mktsk-mascot:not(.mktsk-mascot-in-modal) .mktsk-bubble:not(.mktsk-bubble--wide){
  --mktsk-bubble-nudge-x: 10px;
}
.mktsk-bubble:not(.mktsk-bubble--wide){
  max-width: min(264px, calc(100vw - 24px));
  min-width: 168px;
  --mktsk-bubble-anchor-w: 264px;
}
/* Yksi leveä taso: iso ankkuri siirtää kuplan vasemmalle → enemmän tilaa leveydelle oikealla */
.mktsk-bubble.mktsk-bubble--wide{
  --mktsk-bubble-wide-design-cap: 620px;
  /* JS: ensureBubbleClearsCard — välys kortin/vison jälkeen (ei vain kiinni reunassa) */
  --mktsk-bubble-wide-clear-extra: 48px;
  max-width: min(var(--mktsk-bubble-wide-design-cap), calc(100vw - 16px));
  --mktsk-bubble-max-h: 680px;
  /* Kohtuullinen ankkuri: kasvattaa leveyttä oikealle ilman että kupla peittää pelikortin */
  --mktsk-bubble-anchor-w: min(372px, calc(100vw - 100px));
  font-size: clamp(12px, 2.3vw, 16px);
}

.mktsk-bubble-text{
  max-width: 100%;
  width: 100%;
  text-align: center;
  white-space: pre-line;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
  line-height: inherit;
  overflow: hidden;
  display: block;
  font-size: 14px;
  flex: 0 1 auto;
  min-height: 0;
  /* Teksti on väkän yläpuolella */
  position: relative;
  z-index: 10;
}

/* Viimeinen vara: pitkä teksti, fontti jo minimissä — sisäinen scroll */
.mktsk-bubble.mktsk-bubble--scroll{
  /* Älä leikkaa väkästä (pseudo-elementti bubble:after on kuplan ulkopuolella) */
  overflow: visible;
  align-items: flex-start;
  justify-content: center;
}
.mktsk-bubble.mktsk-bubble--scroll .mktsk-bubble-text{
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  min-height: 0;
  flex: 1 1 auto;
  overscroll-behavior: contain;
}

/* Puhekuplan väkä poistettu */

.mktsk-mascot-img{
  width: 240px;
  /* Kiinteä korkeus estää kissa-hahmon koon vaihtelun */
  height: 320px;
  max-width: var(--mktsk-mascot-w-max);
  max-height: var(--mktsk-mascot-h-max);
  object-fit: contain;
  object-position: bottom;
  filter: drop-shadow(0 14px 26px rgba(0,0,0,0.30));
  /* Kissa-hahmo kiinnitetty alareunaan - ei liiku */
  position: absolute;
  bottom: 0;
  right: 0;
  flex-shrink: 0;
}

@media (min-width: 700px){
  .mktsk-mascot:not(.mktsk-mascot-in-modal) .mktsk-bubble:not(.mktsk-bubble--wide){
    --mktsk-bubble-nudge-x: 26px;
  }
  .mktsk-mascot:not(.mktsk-mascot-in-modal) .mktsk-bubble.mktsk-bubble--wide{
    --mktsk-bubble-nudge-x: 46px;
  }
  .mktsk-choices{ grid-template-columns: 1fr 1fr; }
  .mktsk-title{ font-size: 20px; }
  .mktsk-card{
    height: min(900px, calc(98vh - 40px));
    min-height: min(800px, calc(90vh - 40px));
    max-height: min(1000px, calc(100vh - 40px));
  }
  .mktsk-image-wrap{
    height: min(420px, calc(50vh - 20px));
    min-height: min(360px, calc(43vh - 20px));
    max-height: min(480px, calc(57vh - 20px));
  }
  .mktsk-bubble{
  overflow: visible;
    --mktsk-bubble-anchor-w: 320px;
    max-width: min(320px, calc(100vw - 24px));
    font-size: 14px;
    padding: 16px 18px;
    min-height: 62px;
    border-radius: 20px;
    --mktsk-bubble-max-h: 400px;
    bottom: 100%;
    margin-bottom: -36px;
  }
  .mktsk-bubble:not(.mktsk-bubble--wide){
    --mktsk-bubble-anchor-w: 300px;
    max-width: min(300px, calc(100vw - 24px));
    min-width: 168px;
  }
  .mktsk-bubble.mktsk-bubble--wide{
    --mktsk-bubble-wide-design-cap: 680px;
    --mktsk-bubble-wide-clear-extra: 52px;
    max-width: min(var(--mktsk-bubble-wide-design-cap), calc(100vw - 16px));
    --mktsk-bubble-max-h: 720px;
    --mktsk-bubble-anchor-w: min(452px, calc(100vw - 96px));
    font-size: 16px;
  }
  .mktsk-bubble:after{
    content: "";
    position: absolute;
    left: 50%;
    /* Nosta väkäsen neliötä hieman ylemmäs, ettei "kääntyminen" näy */
    bottom: -10px;
    width: 26px;
    height: 26px;
    background: #ffffff;
    transform: translateX(-50%) rotate(45deg);
    border-radius: 4px;
    pointer-events: none;
  }
}

/* Työpöytä (≥781px): kissa ei kasva yli maksimin — kuplalle jää tilaa ylhäällä */
@media (min-width: 781px){
  .mktsk-mascot:not(.mktsk-mascot-in-modal){
    flex: 0 0 var(--mktsk-mascot-slot-w);
    width: var(--mktsk-mascot-slot-w);
    max-width: var(--mktsk-mascot-slot-w);
  }
  .mktsk-mascot-img,
  .mktsk-mascot-figure{
    width: var(--mktsk-mascot-w-max);
    height: var(--mktsk-mascot-h-max);
    max-width: var(--mktsk-mascot-w-max);
    max-height: var(--mktsk-mascot-h-max);
  }
  /* Ankkuri = kissan leveys: kupla ei työnnä visa-alueen päälle */
  .mktsk-mascot:not(.mktsk-mascot-in-modal) .mktsk-bubble:not(.mktsk-bubble--wide){
    --mktsk-bubble-anchor-w: var(--mktsk-mascot-w-max);
    --mktsk-bubble-nudge-x: 8px;
    max-width: min(240px, calc(100vw - var(--mktsk-card-w) - var(--mktsk-mascot-slot-w) - 64px));
  }
  .mktsk-mascot:not(.mktsk-mascot-in-modal) .mktsk-bubble.mktsk-bubble--wide{
    --mktsk-bubble-anchor-w: var(--mktsk-mascot-w-max);
    --mktsk-bubble-nudge-x: 12px;
    --mktsk-bubble-wide-design-cap: min(480px, calc(100vw - var(--mktsk-card-w) - var(--mktsk-mascot-slot-w) - 48px));
    --mktsk-bubble-wide-clear-extra: 16px;
  }
  .mktsk-bubble{
    --mktsk-bubble-max-h: min(340px, 42vh);
  }
  .mktsk-bubble.mktsk-bubble--wide{
    --mktsk-bubble-max-h: min(420px, 52vh);
  }
}

/* Matala työpöytä (13–14"): tiukempi kuplakatto */
@media (min-width: 781px) and (max-height: 920px){
  :root{
    --mktsk-bubble-max-h: 300px;
  }
  #mktsk-game .mktsk-card{
    min-height: min(760px, calc(96vh - 24px));
  }
  .mktsk-bubble{
    --mktsk-bubble-max-h: min(280px, 38vh);
  }
  .mktsk-bubble.mktsk-bubble--wide{
    --mktsk-bubble-max-h: min(360px, 46vh);
  }
}


@media (max-width: 420px){
  .mktsk-card{
    height: min(750px, calc(95vh - 40px));
    min-height: min(650px, calc(85vh - 40px));
    max-height: min(850px, calc(98vh - 40px));
  }
  .mktsk-mascot:not(.mktsk-mascot-in-modal){ right: 12px; bottom: 12px; }
  .mktsk-mascot:not(.mktsk-mascot-in-modal) .mktsk-mascot-figure{
    width: 160px;
    height: 240px;
  }
  .mktsk-mascot:not(.mktsk-mascot-in-modal) .mktsk-mascot-img{
    width: 160px;
    height: 240px;
  }
  .mktsk-bubble{
  overflow: visible;
    --mktsk-bubble-anchor-w: 220px;
    max-width: min(220px, calc(100vw - 24px));
    bottom: 100%;
    margin-bottom: -26px;
    border-radius: 18px;
  }
  .mktsk-mascot:not(.mktsk-mascot-in-modal) .mktsk-bubble:not(.mktsk-bubble--wide){
    --mktsk-bubble-nudge-x: 6px;
  }
  .mktsk-bubble:not(.mktsk-bubble--wide){
    --mktsk-bubble-anchor-w: 204px;
    max-width: min(204px, calc(100vw - 24px));
    min-width: 148px;
  }
  .mktsk-mascot:not(.mktsk-mascot-in-modal) .mktsk-bubble.mktsk-bubble--wide{
    --mktsk-bubble-nudge-x: 24px;
  }
  .mktsk-bubble.mktsk-bubble--wide{
    --mktsk-bubble-wide-design-cap: 360px;
    --mktsk-bubble-wide-clear-extra: 28px;
    max-width: min(var(--mktsk-bubble-wide-design-cap), calc(100vw - 16px));
    --mktsk-bubble-max-h: 440px;
    --mktsk-bubble-anchor-w: min(276px, calc(100vw - 32px));
  }
  .mktsk-bubble:after{
    content: "";
    position: absolute;
    left: 50%;
    /* Nosta väkäsen neliötä hieman ylemmäs, ettei "kääntyminen" näy */
    bottom: -10px;
    width: 26px;
    height: 26px;
    background: #ffffff;
    transform: translateX(-50%) rotate(45deg);
    border-radius: 4px;
    pointer-events: none;
  }
.mktsk-image-wrap{
    height: min(280px, calc(35vh - 20px));
    min-height: min(240px, calc(30vh - 20px));
    max-height: min(320px, calc(40vh - 20px));
  }
}

/* --- Result screen tweaks (no emojis, score centered) --- */
.mktsk-result-wrapper{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  min-height: 260px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.mktsk-card.is-finish .mktsk-image-wrap{
  display: none;
}

.mktsk-card.is-finish .mktsk-progress{
  display: none;
}

/* Loppuruutu: älä käytä 2-sarakkeista vastausruudukkoa — tulos keskelle korttia */
.mktsk-card.is-finish .mktsk-choices{
  grid-template-columns: 1fr;
  justify-items: stretch;
  align-content: center;
}

/*
 * Loppuruutu: tumma teksti (valkoinen --mktsk-text katoaa lasikortin + vaalean taustakuvan päällä).
 * Pistemäärän värit (.mktsk-result-perfect|high|medium|low .mktsk-result-number) säilyvät.
 */
.mktsk-card.is-finish .mktsk-result-title{
  color: #0b1a24;
}
.mktsk-card.is-finish .mktsk-result-encourage{
  color: #0b1a24;
  text-shadow: none;
}
.mktsk-card.is-finish .mktsk-result-total,
.mktsk-card.is-finish .mktsk-result-sep{
  color: #0b1a24;
}
.mktsk-card.is-finish .mktsk-result-upsell-lead{
  color: #0b1a24;
}
.mktsk-card.is-finish .mktsk-result-upsell-text{
  color: #243240;
}
.mktsk-card.is-finish .mktsk-result-upsell-link{
  color: #067a6f;
}
.mktsk-card.is-finish .mktsk-result-upsell-link:hover{
  filter: none;
  color: #044d46;
}

/* Seuraava / Aloita alusta -nappi kortissa kun kuva piilotettu */
.mktsk-card.is-finish .mktsk-next-wrapper{
  position: static;
  right: auto;
  top: auto;
  transform: none;
  width: 100%;
  box-sizing: border-box;
  justify-content: center;
  padding: 6px 18px 22px;
  margin: 0;
}

@media (max-width: 780px){
  .mktsk-result-wrapper{
    padding-top: 6px;
  }
}
.mktsk-result-icon{ display:none !important; }

.mktsk-result-title{
  font-size: clamp(20px, 3.2vw, 30px);
  font-weight: 700;
}
.mktsk-result-score{
  margin-top: 6px;
  font-weight: 800;
  letter-spacing: 0.5px;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.mktsk-result-encourage{
  margin: 18px 0 0;
  padding: 0 12px;
  max-width: 36em;
  font-size: clamp(17px, 2.4vw, 22px);
  font-weight: 600;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.94);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}
.mktsk-result-number,
.mktsk-result-total{
  font-size: clamp(64px, 9vw, 96px);
  line-height: 1;
}
.mktsk-result-sep{
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1;
  padding: 0 10px;
}

/* Desktop / tabletti (≥600px): kissan piilota / palauta -nappi oikeassa alakulmassa */
.mktsk-mascot-dismiss{
  position: fixed;
  right: max(var(--mktsk-fab-inset), env(safe-area-inset-right, 0px));
  bottom: max(24px, env(safe-area-inset-bottom, 0px));
  z-index: 999001;
  box-sizing: border-box;
  display: none;
  padding: 0;
  margin: 0;
  border: none !important;
  appearance: none;
  -webkit-appearance: none;
  background: transparent !important;
  cursor: pointer;
  overflow: visible;
  -webkit-tap-highlight-color: transparent;
  line-height: 0;
  outline: none !important;
}
.mktsk-mascot-dismiss:hover,
.mktsk-mascot-dismiss:focus,
.mktsk-mascot-dismiss:active{
  outline: none !important;
  border: none !important;
}
.mktsk-mascot-dismiss.is-visible{
  display: flex;
  align-items: center;
  justify-content: center;
}
.mktsk-mascot-dismiss img{
  object-fit: contain;
  object-position: center;
  display: block;
  pointer-events: none;
  border: 0 !important;
  outline: 0 !important;
  vertical-align: middle;
}
.mktsk-mascot-dismiss:focus-visible{
  outline: 3px solid rgba(54, 215, 198, 0.95) !important;
  outline-offset: 2px;
}
@media (min-width: 600px){
  body > button.mktsk-mascot-dismiss.is-visible{
    box-sizing: border-box !important;
    width: var(--mktsk-fab-size) !important;
    height: var(--mktsk-fab-size) !important;
    min-width: var(--mktsk-fab-size) !important;
    min-height: var(--mktsk-fab-size) !important;
    max-width: var(--mktsk-fab-size) !important;
    max-height: var(--mktsk-fab-size) !important;
    flex: 0 0 var(--mktsk-fab-size) !important;
  }
  body > button.mktsk-mascot-dismiss.is-visible img{
    width: var(--mktsk-fab-size) !important;
    height: var(--mktsk-fab-size) !important;
    min-width: var(--mktsk-fab-size) !important;
    min-height: var(--mktsk-fab-size) !important;
    max-width: none !important;
    max-height: none !important;
    flex: 0 0 var(--mktsk-fab-size) !important;
    transform: scale(var(--mktsk-fab-cat-img-scale));
    transform-origin: center center;
    animation: mktsk-fab-img-glow 2.6s ease-in-out infinite;
  }
}
@media (max-width: 599px){
  .mktsk-mascot-dismiss{
    display: none !important;
  }
}

/* --- Fix: prevent "two pages" / double scroll on desktop --- */
@media (min-width: 781px){
  #mktsk-game.mktsk-wrap{
    max-height: none !important;
    overflow-y: visible !important;
  }
  #mktsk-game .mktsk-card{
    height: auto !important;
    max-height: none !important;
    overflow-y: visible !important;
  }
}
