/* ==== Global Reset & Base ==== */
body {
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', Arial, sans-serif;
    color: #1d2e56;
    overflow: hidden;
}
/* Allow game overlays and story/how-to modals to render */
body > div:not(#container):not(#leaderboardModal):not(#streakBanner):not(#howToPlayModal):not(#whoIsDomainKhanModal) {
  display: none !important;
}

body.modal-active #streakBanner {
    pointer-events: none !important;
}
body.modal-active * {
    user-select: auto !important;
}



#container {
    max-width: 1080px;
    min-width: 340px;
    width: 1000px;
    min-height: 600px;
    background: #fff;
    margin: 24px auto 0 auto;
    padding-bottom: 50px;
    border-radius: 30px;
    box-shadow: 0 8px 48px #29416725;
    overflow: hidden;
    padding: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}
canvas {
    display: block;
    background: transparent;
    border-radius: 30px;
    box-shadow: 0 4px 30px #29416725;
    margin: 0 auto;
}
canvas#game {
    display: block;
    background: transparent;
    border-radius: 30px;
    margin: 0 auto;
    margin-top: 0;
}
.copyright {
  margin-top: 40px !important;
  margin-bottom: 8px !important;
  flex-shrink: 0 !important;
  text-align: center;
  color: #8491a5;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.03em;
  position: static !important;
  width: 100%;
}


#gameHeader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: none;
    z-index: 21;
    pointer-events: none;
}
#hud {
    position: absolute;
    text-align: center;
    left: 50%;
    top: 12px;
    transform: translateX(-50%);
    background: #fff;
    box-shadow: 0 1px 8px #29416719;
    border-radius: 14px;
    padding: 8px 28px;
    font-size: 20px;
    font-weight: 700;
    color: #213366;
    z-index: 22;
    min-width: 600px;
    max-width: 800px;
}
#hearts {
    position: absolute;
    left: 50%;
    top: 92px;
    transform: translateX(-50%);
    font-size: 25px;
    letter-spacing: 2px;
    z-index: 12;
    width: auto;
    text-align: center;
}
#leaderboard,
#headerRight,
#hud {
    pointer-events: auto;
}
#soundToggle, #musicToggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 6px #29416724;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 24px;
    z-index: 120;
    border: none;
    margin-left: 0;
    margin-right: 0;
    transition: background 0.15s;
}
#soundToggle:hover, #musicToggle:hover {
    background: #ffe999;
}
#soundIcon, #musicToggleIcon {
    font-size: 24px;
    color: #1d56ac;
    pointer-events: none;
}
#headerRight {
    position: absolute;
    right: 65px;
    top: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 23;
}
/* ==== Leaderboard Button (Unified Style) ==== */
.leaderboard-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: #202e4e;
  color: #fff;
  font-weight: 700;
  font-size: 1.18rem;
  border: none;
  border-radius: 1.7em;
  padding: 10px 32px 10px 18px !important;
  min-width: 170px;
  box-sizing: border-box;
  box-shadow: 0 2px 12px #22336018;
  margin-top: 0;
  margin-bottom: 0;
  cursor: pointer;
  outline: none;
  transition: background 0.16s, color 0.16s;
  position: relative;
}

.leaderboard-link .icon {
  font-size: 1.35em;   /* Make emoji large and equal */
  color: #ffe180;      /* Trophy color for both */
  margin-right: 2px;
  margin-left: 2px;
  line-height: 1;
  text-shadow: 0 1px 3px #0002;
}

.leaderboard-link .text {
  font-size: 1.11em;
  font-weight: 700;
  text-decoration: none; /* Remove underline unless both need it */
  letter-spacing: 0.01em;
}

.leaderboard-link:active, .leaderboard-link:focus {
  background: #18203a;
}
.leaderboard-link:hover {
  background: #3652a1;
  color: #ffe999;
}

#leaderboard {
    position: absolute;
    left: 28px;
    top: 12px;
    margin: 0;
    z-index: 23;
}

.gameover-actions {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 32px;
  margin-top: 35px;
  width: 100%;
}

.gameover-actions.leaderboard-alone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin: 24px 0 0 0;
}
.gameover-actions.leaderboard-alone .leaderboard-link {
  width: 340px;
  max-width: 90vw;
  justify-content: center;
  margin-left: auto;
  margin-right: auto;
}


/* Center all gameover content */
#gameover.game-screen {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  min-height: 80vh;
  width: 100vw;  /* full width of viewport */
  max-width: 100%;
  margin: 0 auto;
  padding: 0 0 40px 0;
  position: relative;
  box-sizing: border-box;
}

/* Make scoreboard info row centered and inline */
.gameover-score-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  font-size: 1.15rem;
  margin-bottom: 10px;
}

/* Style for small icons inside score row */
.gameover-score-row img,
.gameover-score-row .country-flag-name {
  margin: 0 4px;
  vertical-align: middle;
}

/* Social and button row */
.gameover-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin: 30px 0 0 0;
}

/* Center "Brag your score" and icons */


#gameover h3 {
  text-align: center;
  width: 100%;
}

#gameover h1 {
    margin-bottom: 0px;  /* Reduce from default (usually 20-30px) */
    margin-top: 16px;     /* Or even 12px if you want it tighter */
}


/* ==== TWO-COLUMN INTRO LAYOUT ==== */
#intro {
  position: absolute !important;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000; /* higher than .game-screen, .gameover, etc */
  background: #fff !important; /* full solid background, hides anything below */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.intro-header {
  width: 100%;
  text-align: center;
  margin-bottom: 20px;
}
.intro-header h2 {
  font-size: 2.3rem;
  font-weight: 900;
  color: #1d2e56;
  margin: 10px 0 6px 0;
  letter-spacing: 0.02em;
}
.gosubtitle {
  color: #8092b5;
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 3px;
}

.intro-main-wrapper {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Intro extra buttons */
.intro-btn-flex-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.how-to-play-btn,
.whois-btn {
  background: #304673;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 8px 16px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 12px #1d2e562a;
  transition: background 0.18s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.how-to-play-btn:hover,
.whois-btn:hover {
  background: #283d77;
}
.how-to-play-btn:link,
.how-to-play-btn:visited,
.how-to-play-btn:hover,
.how-to-play-btn:focus,
.whois-btn:link,
.whois-btn:visited,
.whois-btn:hover,
.whois-btn:focus {
  color: #fff;
  text-decoration: none;
}


.intro-layout {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-start;
  gap: 68px;
  width: 100%;
  margin-top: 18px;
}



.intro-columns {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: stretch;
  width: 100%;
  max-width: 800px;
  gap: 48px;
}
.intro-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.intro-col-img {
  align-items: center;
  flex: 1.1 1 0;
  min-width: 220px;
  max-width: 340px;
}
.intro-img {
  max-width: 90%;
  max-height: 420px;
  display: block;
  margin: 0 auto;
  /* Remove caption from HTML, as per your instructions */
}

.intro-img-col {
  flex: 0 1 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;   /* Center the image in its half */
  min-width: 240px;
}
.intro-img-col img {
  max-width: 330px;
  width: 85%;
  height: auto;
  margin: 0 auto;
  display: block;
}


.intro-col-form {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.intro-form-label {
  font-weight: 700;
  font-size: 1.2em;
  margin-bottom: 2px;
  display: block;
  text-align: left;
}


.intro-caption {
  margin-top: 14px;
  text-align: center;
  color: #161616;
  font-size: 1.1em;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.intro-img-caption {
  text-align: left;
  font-size: 1.13em;
  margin-top: 14px;
  line-height: 1.3;
  font-weight: 600;
  color: #212;
  max-width: 280px;
}

.intro-row {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 950px;
  margin: 0 auto;
  gap: 0;
}

.intro-main-wrapper {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.intro-heading-row {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 12px;
}
.intro-title {
  font-size: 2.4rem;
  font-weight: 800;
  margin: 0 0 8px 0;
  text-align: center;
}

.intro-form-col {
  flex: 1 1 420px;
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* All children left-aligned */
  min-width: 260px;
}
.intro-col-form h2 {
  font-size: 2.8rem;
  font-weight: 900;
  margin: 0 0 10px 0;
}

.intro-title-row {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 18px;
}
.intro-title-row h2 {
  font-size: 2.8em;
  font-weight: 900;
  margin: 12px 0 2px 0;
  color: #243059;
  text-align: center;
}

.gosubtitle {
  font-size: 1.13rem;
  color: #899db8;
  margin-bottom: 12px;
  text-align: center;
}

.intro-col-form .intro-form-group {
  margin-bottom: 14px;
  width: 100%;
}
.intro-col-form input,
.intro-col-form select {
  width: 300px;
  max-width: 98%;
  font-size: 1.1em;
  padding: 10px 12px;
  border-radius: 7px;
  border: 1.2px solid #c4cae0;
}
.intro-col-form input:focus,
.intro-col-form select:focus {
  border: 2px solid #2563d8;
}


.gosubtitle {
  color: #8092b5;
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 18px;
}

#playerForm {
  width: 100%;
}

.playerinfo {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.labelbox {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 2px;
}
.labelbox label {
  font-size: 16px;
  font-weight: 700;
}
.playerinfo input,
.playerinfo select {
  font-size: 15px;
  font-family: inherit;
  border-radius: 8px;
  border: 1px solid #d1d8e4;
  padding: 8px 16px;
  margin-left: 2px;
  max-width: 180px;
  background: #fff;
  outline: none;
}
.playerinfo input:focus,
.playerinfo select:focus {
  border: 2px solid #1d56ac;
  box-shadow: 0 0 5px #1d56ac44;
}

.form-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  width: 100%;
  justify-content: flex-start; /* Left align fields */
}

.form-row label {
  font-size: 1.08em;
  font-weight: 700;
  min-width: 84px;
  text-align: left;
}

.form-row input,
.form-row select {
  font-size: 1.07em;
  padding: 9px 18px;
  border-radius: 8px;
  border: 1px solid #d1d8e4;
  outline: none;
  min-width: 180px;
  background: #fff;
  font-family: inherit;
  text-align: left;
  margin-left: 0;
}

.form-group {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.form-group label {
  font-size: 1.12rem;
  font-weight: 700;
  margin-right: 15px;
  min-width: 95px;
  text-align: left;
}

.form-group input,
.form-group select {
  font-size: 1.06rem;
  padding: 7px 16px;
  border-radius: 8px;
  border: 1px solid #d1d8e4;
  max-width: 230px;
  width: 230px;
  background: #fff;
}

.quote {
    margin: 12px auto 5px auto;
    font-size: 16px;
    font-style: italic;
    background: #e8f1ff;
    border-radius: 12px;
    padding: 12px 0;
    color: #2746aa;
    font-weight: 600;
    max-width: 96%;
    box-shadow: 0 1px 8px #295ea81a;
}
#startBtn.small, .restart-btn.small {
  font-size: 1.3em;
  width: 270px;
  padding: 13px 0;
  border-radius: 12px;
  margin-top: 28px;
    margin-bottom: 18px;

}
/* ==== End Intro 2-column ==== */
#gameover {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  text-align: center;
  min-height: 75vh;
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  padding-bottom: 38px;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  background: transparent;
  box-sizing: border-box;
}
#gameover h2, #gameover .gosubtitle, #gameover h3, #gameover .go-inline, #gameover .quote, #gameover, #gameover .gameover-actions {
  width: 100%;
  text-align: center;
  margin-left: auto;
  margin-right: auto;
  justify-content: center;
  align-items: center;
}
.go-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  font-size: 1.18rem;
  margin-bottom: 10px;
  text-align: center;
  flex-wrap: wrap; /* If mobile, wrap cleanly */
}
.go-inline span {
  white-space: nowrap;
}

.gameover-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 30px !important;
  margin-top: 32px !important;
  width: 100% !important;
}
.restart-btn {
  margin: 16 !important;
}
#sharebar {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 12px;
  width: 100%;
  margin: 12px 0 18px 0;
}
#sharebar button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  outline: none;
}
#sharebar img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}




#startBtn {
    display: block;
    margin-top: 26px;
  margin-bottom: 16px;
    padding: 18px 0;
    width: 260px;
    max-width: 90%;
    background: #2563d8;
    color: #fff;
    font-size: 1.45em;
    font-weight: 700;
    border-radius: 18px;
    border: none;
    box-shadow: 0 2px 16px #2563d82a;
    transition: background 0.2s;
    cursor: pointer;
    align-self: center;
}
#startBtn:hover, .restart-btn:hover {
    background: #194ba7;
}



.restart-btn {
    display: block;
    margin: 8px auto 2px auto;
    padding: 13px 0;         /* in between 9px and 18px */
    width: 255px;            /* in between 170px and 340px */
    max-width: 90%;
    background: #2563d8;
    color: #fff;
    font-size: 1.5em;        /* in between 1em and 2em */
    font-weight: 700;
    border-radius: 14px;     /* in between 10px and 18px */
    border: none;
    box-shadow: 0 2px 16px #2563d82a;
    transition: background 0.2s;
    cursor: pointer;
}
.restart-btn:hover {
    background: #194ba7;
}

/* For the Restart button between quote and scorecard */
#restartBtn.restart-btn {
  margin: 20px auto 24px auto;
  display: block;
}

/* Make the Share/Leaderboard buttons row just above the card, tighter spacing */
#gameover .gameover-actions.leaderboard-alone {
  margin-top: 10px;    /* Reduce vertical gap */
  margin-bottom: 0;
  gap: 18px;           /* Buttons closer together */
  justify-content: center;
}

/* Space below the scorecard */
.playerinfo {
  margin-bottom: 14px;
}

#leaderboardIntroBtn {
  margin-top: 24px !important;        /* Add space above the button */
  width: 210px !important;            /* Correct width (not 250x) */
  font-size: 1em;
  padding: 11px 38px 11px 18px !important; /* top right bottom left, extra right padding for bg */
  border-radius: 11px;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}



/* ==== Leaderboard Modal ==== */
#leaderboardModal {
      display: none;

    position: fixed;
    left: 0; top: 0; width: 100vw; height: 100vh;
    z-index: 9999 !important; /* << SUPER HIGH */
    display: none;
    align-items: center;
    justify-content: center;
}
#leaderboardModalBg {
    position: absolute;
    left: 0; top: 0; width: 100vw; height: 100vh;
    background: #1d2e5699;
    z-index: 4001;
}
#leaderboardModalContent {
    position: relative;
    z-index: 4002;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 3px 38px #295ea839;
    padding: 38px 48px 32px 48px;
    width: 460px;
    min-width: 290px;
    text-align: left;
    max-height: 82vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}
#leaderboardModalContent h2 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 22px;
    font-size: 32px;
    color: #1d56ac;
    font-weight: 800;
}
#leaderboardTableModal {
    width: 100%;
}
#leaderboardTableModal ol {
    margin: 0 0 0 16px;
    padding-left: 0;
    font-size: 19px;
    color: #222;
    font-weight: 700;
}
#leaderboardTableModal li {
    margin: 12px 0;
    padding: 0;
    line-height: 1.6;
    letter-spacing: 0.01em;
}
.closeBtn {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    color: #324886;
    border: none;
    font-size: 36px;
    font-weight: 800;
    cursor: pointer;
    z-index: 101;
    transition: color 0.12s;
}
.closeBtn:hover { color: #d43b4b; }
#fxLayer {
    position: absolute;
    left: 0; top: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 5000;
}
.sparkle-effect {
    width: 48px; height: 48px;
    background: url('assets/sparkle.gif'), radial-gradient(circle, #fff8 70%, #fff3 100%);
    background-size: cover;
    position: absolute;
    pointer-events: none;
    animation: pop 0.6s;
}
.bad-effect {
    width: 48px; height: 48px;
    background: url('assets/bad.gif'), radial-gradient(circle, #f33 70%, #f003 100%);
    background-size: cover;
    position: absolute;
    pointer-events: none;
    animation: pop 0.6s;
}
@keyframes pop {
    0%   { transform: scale(0.7); opacity: 0.7;}
    60%  { transform: scale(1.2); opacity: 1;}
    100% { transform: scale(1); opacity: 0;}
}
/* Lock the width of the Choices.js dropdown to match your input box */
.choices[data-type*='select-one'] {
  width: 180px !important;
  min-width: 140px !important;
  max-width: 220px !important;
}
.choices__list--dropdown, .choices__list[aria-expanded] {
  width: 100% !important;
  min-width: 100% !important;
  box-sizing: border-box;
}

  

#comboFill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  height: 100%;
  width: 0%; /* JS sets this */
  background: #36d44f;
  border-radius: 10px;
  transition: width 0.4s;
  z-index: 1;
}

/* Combo Meter Shake Animation */
.shake {
  animation: shake 0.4s;
}
@keyframes shake {
    0% { transform: translate(0px, 0px);}
    20% { transform: translate(-10px, 3px);}
    40% { transform: translate(8px, -6px);}
    60% { transform: translate(-5px, 5px);}
    80% { transform: translate(7px, -3px);}
    100% { transform: translate(0px, 0px);}
}
#flashOverlay {
  position:fixed;
  left:0; top:0;
  width:100vw; height:100vh;
  background:rgba(255,215,0,0.3);
  pointer-events:none;
  z-index:9999;
  opacity:0;
  transition:opacity 0.2s;
}
.choices__inner {
    display: flex !important;
    align-items: center !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    line-height: 1.3 !important;
    min-height: 34px !important;
    height: 34px !important;
}
.choices__item.choices__item--select-one {
    display: flex !important;
    align-items: center !important;
    line-height: 1.3 !important;
    font-size: 15px !important;
    padding: 0 !important;
}
.choices__item--choice {
    display: flex !important;
    align-items: center !important;
    font-size: 15px !important;
    padding: 7px 15px !important;
    line-height: 1.3 !important;
}
.choices__item,
.choices__item--choice,
.choices__item--select-one {
    font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', 'Montserrat', Arial, sans-serif !important;
    font-size: 17px !important;
    display: flex !important;
    align-items: center !important;
    line-height: 1.3 !important;
}
.country-flag-name {
    font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', 'Montserrat', Arial, sans-serif !important;
    font-size: 1em;
     margin-left: 4px;  /* Adds a small gap to the right of the name */
  vertical-align: middle;
  font-size: 1.13em;
  display: inline-block;
}
.choices__list--dropdown, .choices__list--single, .choices__item, .country-flag-name, select, option {
    font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Twemoji', 'Noto Color Emoji', 'Segoe UI', Arial, sans-serif !important;
    font-size: 16px;
}
button, .leaderboard-link, #leaderboard {
    -webkit-tap-highlight-color: transparent;
}
::-webkit-scrollbar {
    width: 8px;
    background: #f7fafc;
}
::-webkit-scrollbar-thumb {
    background: #e5eaf5;
    border-radius: 8px;
}


#streakBox {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-left: 28px;
  position: relative;
  z-index: 36;
  min-width: 200px;
}


#comboMeter {
  display: flex;
  align-items: center;
  position: relative;
  width: 180px; /* Adjust for your HUD */
}

.comboTrack {
  position: relative;
  width: 140px;      /* The visible bar length */
  height: 20px;
  background: #e2e7ee;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#streakLabel {
  position: relative;
  color: #253d6a;
  font-weight: 700;
  font-size: 0.95em;
  z-index: 2;
  background: none;
  text-align: center;
  width: 100%;
  pointer-events: none; /* Ignore pointer so bar is clickable if needed */
}



body.streak-active #streakBanner { display: block; }
canvas {
  image-rendering: auto;
  -webkit-font-smoothing: antialiased;
  font-smooth: always;
}



.go-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  font-size: 1.15rem;
  margin-bottom: 10px;
  text-align: center;
}
.go-inline span {
  white-space: nowrap;
}

#intro {
  position: absolute !important;
  top: 0; left: 0;
  width: 100% !important;
  height: 100% !important;
  min-width: 100% !important;
  min-height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  z-index: 3000 !important;
  background: #fff !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.hide-overlay {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  z-index: -1 !important;
}


#scoreCard {
    margin-top: 5px;

  width: 350px;
  height: 350px;
border-radius: 28px;
  box-shadow: 0 6px 36px #1d225a33;
  background: url('scoreb.png') center center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Inner card for opaque backdrop and padding for BG feel */
.scorecard-inner {
  width: 90%;
  height: 90%;
  background: rgba(37, 41, 54, 0.88); /* modern, opaque */
  border-radius: 20px;
  margin: auto;
  padding: 10px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
  box-shadow: 0 0 30px #0003;
}


.scorecard-title {
  font-size: 1.2em; /* 30% smaller */
  font-weight: 600;
  color: #fff;
  text-shadow: 0 2px 14px #0002;

  margin-bottom: 10px;
  text-align: center;
  line-height: 1.1;
}

.scorecard-subtitle {
  font-size: 0.95em; /* 20% smaller */
  font-weight: 400;
  color: #ffe180;
  margin-bottom: 5px;
  text-align: center;
  letter-spacing: 0.01em;
}

.scorecard-playername {
  margin: 6px 0 0 0;
  font-size: 1.22em;
  font-weight: bold;
  text-align: center;
  color: rgb(247, 255, 16);  /* Bright yellow-green */
}


.scorecard-info-row {
  font-size: 1.11em;
  font-weight: 600;
  color: #c7d3e5;
  margin: 10px 0 0 0;
  text-align: center;
}

.score-row {
  width: 98%;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  margin: 15px 0 0 0;
  gap: 8px;
}

.score-box {
  width: 46%;   /* Smaller boxes */
  min-width: 75px;
  border-radius: 12px;
  padding: 10px 0 8px 0;
  margin-bottom: 5px;
  background: #445e8ee6;
  box-shadow: 0 2px 10px #0002;
  text-align: center;
  font-size: 0.7em;
  align-items: center;
}

.score-box .label {
  font-size: 0.95em;
  margin-bottom: 3px;
  font-weight: 300;
}

.score-box.good { background: #24ca75e6; color: #fff; }
.score-box.bad { background: #f44336e6; color: #fff; }
.score-box.time { background: #ab9affde; color: #fff; }
.score-box.learning { background: #ffe180e6; color: #222; font-weight: bold; }

.scorecard-footer {
      color: #000000;
  text-shadow: 0 2px 14px #0002;
    width: 100%;   /* Smaller boxes */
  min-width: 75px;
  border-radius: 5px;
  padding: 10px 0 8px 0;

  margin-bottom: 5px;
  background: #ebd90be6;
  box-shadow: 0 2px 10px rgba(255, 242, 0, 0.133);
  text-align: center;
  font-size: 1em;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.scorecard-share-btn {
  margin-top: 12px;
  width: 20%;
  padding: 10px 0;
  background: linear-gradient(90deg, #3ec7e0, #5263ff 70%);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 1.16em;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 10px #252a3a30;
  transition: background 0.16s, color 0.16s;
}
.scorecard-share-btn:hover {
  background: linear-gradient(90deg, #34b6cc, #4e56dc 70%);
  color: #ffe999;
}
#scoreCard.screenshot-mode,
.screenshot-mode { /* Applies to both real and clone if needed */
  width: 700px !important;
  height: 700px !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 48px !important;
  box-shadow: none !important;
  background-size: cover !important;
  font-size: 2.2em !important; /* Multiplies all inner text size */
}

.screenshot-mode .scorecard-inner {
  width: 92% !important;
  height: 92% !important;
  margin: auto !important;
  padding: 0 32px !important;
  border-radius: 38px !important;
}

.screenshot-mode .scorecard-title {
  font-size: 1.2em !important;
}
.screenshot-mode .scorecard-subtitle {
  font-size: 0.8em !important;
}
.screenshot-mode .scorecard-info-row,
.screenshot-mode .score-row,
.screenshot-mode .scorecard-footer {
  font-size: 0.8em !important;
}
/* Adjust the scaling as needed for perfect balance */
.screenshot-mode {
  width: 700px !important;
  height: 700px !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 48px !important;
  box-shadow: none !important;
  background-size: cover !important;
  font-size: 2em !important;
}
.screenshot-mode .scorecard-inner {
  width: 92% !important;
  height: 92% !important;
  margin: auto !important;
  padding: 0 32px !important;
  border-radius: 38px !important;
}
.screenshot-mode .scorecard-share-btn {
  display: none !important; /* Hide if you don't want it in download */
}

.screenshot-padding {
  padding-top: 36px !important;
  /* You can adjust the value until download and browser match */
}



.gameover-actions.leaderboard-alone {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px !important;   /* Sets the gap */
  width: 100%;
  margin: 24px 0 0 0;
}

/* Remove forced width, so buttons shrink to fit content! */
.gameover-actions.leaderboard-alone .leaderboard-link {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  margin: 0 !important;    /* Make sure there are no side margins! */
  font-size: 1.04rem;      /* Keep your preferred font size */
  padding: 10px 20px;      /* Adjust as you like, but don't make left/right padding huge */
}


#rotateDeviceOverlay,
#rotateDeviceOverlay * {
  filter: none !important;
  opacity: 1 !important;
  pointer-events: all !important;
  z-index: 99999 !important;
  display: flex !important;
}
#rotateDeviceOverlay {
  position: fixed !important;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: #fff !important;
  justify-content: center;
  align-items: center;
}
#rotateDeviceOverlay .rotate-msg-box {
  background: #fff !important;
  color: #25406a !important;
  font-size: 1.5em !important;
  padding: 32px 16px !important;
  border-radius: 22px;
  box-shadow: 0 2px 24px #25406a22;
  z-index: 100000 !important;
}

 

.intro-btn-row {
  display: flex;
  flex-direction: row;
  gap: 16px;
  align-items: stretch;
  justify-content: flex-start;
  margin-top: 28px;
  width: 100%;
  max-width: 440px;
  /* Prevent overflow on small screens */
  box-sizing: border-box;
}

#startBtn,
#leaderboardIntroBtn {
  flex: 1 1 0px;
  min-width: 120px;
  max-width: 210px;
  font-size: 1.11em;
  padding: 14px 0;
  border-radius: 12px;
  margin: 0;
  text-align: center;
  box-sizing: border-box;
  /* For consistent button style, adjust color as needed */
}

#leaderboardIntroBtn .star {
  margin-right: 3px;
  font-size: 1.2em;
  vertical-align: middle;
}

/* How to Play modal */
.how-to-play-modal {
  position: fixed;
  inset: 0;
  z-index: 11010 !important;
  background: rgba(30, 39, 66, 0.23);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s;
}
.htp-content-card {
  background: #fff;
  border-radius: 2.2em;
  box-shadow: 0 8px 48px #1d2e5627, 0 2px 16px #b8c4e93a;
  padding: 32px 42px 18px 42px;
  width: 680px;
  max-width: 97vw;
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 0.97em;
  color: #213366;
  position: relative;
  overflow-y: auto;
  max-height: 92vh;
  border: 1.5px solid #e7ebf5;
  animation: popUp .25s cubic-bezier(.47,2.02,.68,.92);
}
@keyframes popUp {
  0% { transform: scale(.84); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.htp-close-btn {
  position: absolute;
  top: 18px;
  right: 24px;
  background: #fff;
  border: none;
  font-size: 1.7em;
  font-weight: 800;
  color: #253053;
  border-radius: 50%;
  padding: 2px 10px;
  box-shadow: 0 3px 12px #1a223628;
  cursor: pointer;
  z-index: 2;
  transition: background .14s, color .14s;
}
.htp-close-btn:hover { color: #e44d6b; background: #f8eaea; }
.htp-heading {
  text-align: left;
  font-size: 1.34em;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: #122d5c;
  margin-bottom: 6px;
}
.htp-joystick { margin-right: 6px; }
.htp-intro {
  text-align: left;
  color: #334066;
  line-height: 1.5;
  margin-bottom: 14px;
}
.htp-steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.htp-step {
  display: flex;
  gap: 10px;
  align-items: center;
  background: #f6f8ff;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #e7ebf5;
}
.htp-step-icon { font-size: 1.2em; }
.htp-step-label { font-size: 0.98em; }
.htp-key {
  background: #243a5e;
  color: #fff;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.9em;
  margin: 0 2px;
}
.htp-table-wrap { overflow-x: auto; }
.htp-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 0.95em;
}
.htp-table th, .htp-table td {
  border: 1px solid #e7ebf5;
  padding: 8px;
  text-align: left;
}
.htp-table th {
  background: #f3f6ff;
  font-weight: 800;
  color: #1f2f55;
}
.htp-ico { text-align: center; width: 48px; }
.htp-good { color: #0c8c3d; font-weight: 700; }
.htp-risk { color: #c92b2b; font-weight: 700; }
.htp-extras {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}
.htp-extra {
  background: #fdf8e8;
  border: 1px solid #ffe29a;
  border-radius: 10px;
  padding: 10px 12px;
  color: #4a3b00;
  font-size: 0.96em;
}
.htp-tipbar {
  background: #eef6ff;
  border: 1px solid #cddffe;
  border-radius: 10px;
  padding: 10px 12px;
  color: #1e3b7a;
  font-weight: 700;
}
@media (max-width: 950px) {
  .htp-content-card { width: 98vw; max-width: 99vw; border-radius: 1.3em; padding: 16px 2vw 12vw 2vw; font-size: 0.93em; }
}

/* Who is Domain Khan modal */
.whois-modal {
  position: fixed;
  z-index: 20000;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(30,40,56, 0.84);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 10px; /* gap from viewport edges */
  overflow: auto;
  font-family: 'Montserrat', Arial, sans-serif;
  animation: modalFadeIn 0.21s;
}
@keyframes modalFadeIn { from { opacity: 0; } to { opacity: 1; } }
.whois-content {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 6px 42px #0003;
  width: 94vw; max-width: 650px;
  padding: 22px 26px 30px 26px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 22px;
  box-sizing: border-box;
  margin: 10px auto; /* gap top/bottom inside overlay */
  max-height: calc(100vh - 20px);
  overflow-y: auto;
}
.whois-close-btn {
  position: absolute;
  top: 14px; right: 18px;
  font-size: 2em;
  background: none;
  border: none;
  color: #2b3045;
  cursor: pointer;
  z-index: 2;
  opacity: 0.88;
  transition: color 0.18s;
}
.whois-close-btn:hover { color: #e22020; }
.whois-header-row {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: -3px;
}
.whois-trophy { font-size: 2.1em; margin-right: 5px; margin-bottom: 2px; }
.whois-title {
  font-size: 1.6em;
  font-weight: 800;
  letter-spacing: -1px;
  color: #122d5c;
  text-shadow: 0 1.5px 0 #ffe86455;
  text-align: left;
}
.whois-main-story {
  font-size: 1.14em;
  font-weight: 500;
  color: #223366;
  line-height: 1.53;
  margin-bottom: 2px;
  margin-top: 3px;
  position: relative;
  text-align: justify;
}
.whois-highlight-tip {
  display: block;
  background: #fffbe7;
  border-left: 5px solid #ffde72;
  border-radius: 7px;
  color: #684900;
  padding: 10px 14px;
  margin: 13px 0 2px 0;
  font-size: 1em;
  font-weight: 600;
  box-shadow: 0 2px 14px #ffe86412;
  text-align: justify;
}
.whois-row.whois-big-avatar {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 18px;
  margin: 0;
  padding: 0;
}
.whois-story-col {
  width: calc(100% - 250px);
  padding-right: 14px;
  text-align: justify;
}
.whois-secondary-story {
  font-size: 0.90em;
  color: #343743;
  line-height: 1.49;
  text-align: justify;
}
.whois-avatar-col {
  width: 44%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 140px;
  min-height: 150px;
}
.whois-avatar-img {
  width: 120px;
  height: 148px;
  object-fit: contain;
  border-radius: 16px;
  border: 3.5px solid #ffe262;
  background: #fffef6;
  box-shadow: 0 2px 14px #eebd2b11;
  display: block;
  margin-top: 8px;
}
.whois-avatar-hero-img {
  width: 160px;
  height: 200px;
  object-fit: contain;
  border-radius: 24px;
  border: 4px solid #ffe262;
  background: #fffef6;
  box-shadow: 0 4px 18px #eebd2b22, 0 1px 16px #fffba222;
  margin-top: 10px;
  margin-bottom: 8px;
  transition: transform 0.22s cubic-bezier(.43,2.2,.19,.98);
}
.whois-avatar-hero-img:hover {
  transform: scale(1.06) rotate(-3deg);
  box-shadow: 0 8px 36px #eebd2b44, 0 3px 25px #fffba299;
}
.whois-avatar-caption {
  font-size: 1em;
  color: #000000;
  font-weight: bold;
  margin-top: 8px;
  text-shadow: 0 1.5px 0 #fff5;
}
.whois-punchline-row {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 13px;
  padding: 0;
  gap: 9px;
}
.whois-star { font-size: 1.5em; color: #ffd500; filter: drop-shadow(0 0 7px #fff49c); }
.whois-punchline {
  font-size: 1.13em;
  font-weight: 700;
  color: #09702e;
  background: linear-gradient(90deg, #eaffc6 80%, #fffbe2 100%);
  padding: 10px 20px;
  border-radius: 11px;
  box-shadow: 0 2px 16px #abffaf15;
  letter-spacing: -.2px;
  text-align: justify;
}
@media (max-width: 950px) {
  .whois-modal { align-items: flex-start; overflow: auto; }
  .whois-content {
    width: 92vw;
    max-width: 98vw;
    min-height: 90vh;
    margin: 4vw auto 4vw auto;
    border-radius: 18px;
    padding: 5vw 4vw 6vw 4vw;
    box-sizing: border-box;
    overflow-y: auto;
    max-height: 97vh;
    -webkit-overflow-scrolling: touch;
    background: #fff;
  }
  .whois-row.whois-big-avatar {
    flex-direction: row !important;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
  }
  .whois-story-col {
    width: 55%;
    min-width: 120px;
    padding-right: 10px;
    text-align: left;
  }
  .whois-avatar-col {
    width: 45%;
    min-width: 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    margin: 0;
    text-align: center;
  }
  .whois-avatar-hero-img {
    width: 45vw;
    max-width: 120px;
    min-width: 100px;
    height: auto;
    margin: 0 auto 6px auto;
    object-fit: contain;
  }
  .whois-avatar-caption { font-size: 0.97em; margin-bottom: 6px; margin-top: 2px; }
  .whois-main-story,
  .whois-secondary-story { font-size: 0.86em; word-break: break-word; }
  .whois-header-row { font-size: 1.04em; }
  .whois-title { font-size: 1.11em; }
  .whois-highlight-tip { font-size: 0.92em; padding: 8px 10px; margin: 10px 0 2px 0; }
  .whois-punchline-row { font-size: 0.97em; margin-top: 3vw; gap: 7px; }
  .whois-punchline { padding: 7px 9px; font-size: 1em; }
}
/* DESKTOP: Make Start Game button big, Leaderboard button 50% width of Start Game, both in a row */
@media (min-width: 701px) {
  .intro-btn-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 18px !important;  /* move up by 10px */
  }

  #startBtn {
    min-width: 320px !important;   /* large and wide */
    max-width: 300px !important;
    font-size: 2.1rem !important;
    padding: 20px 0 !important;
    font-weight: 800 !important;
    border-radius: 22px !important;
    box-shadow: 0 3px 20px #2563d830 !important;
  }

  #leaderboardIntroBtn {
    min-width: 160px !important;    /* about half of Start Game */
    max-width: 200px !important;
    font-size: 1.17rem !important;
    padding: 13px 18px !important;
    border-radius: 18px !important;
    font-weight: 700 !important;
    margin: 0 !important;
    height: auto !important;
    box-shadow: 0 3px 18px #1d2e5630 !important;
  }
}
 
#rotateDeviceOverlay {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 99999 !important;
  background: #fff !important;
  opacity: 1 !important;
  pointer-events: all !important;
  filter: none !important;
}

#rotateDeviceOverlay > * {
  color: #25406a !important;
  font-size: 22px !important;
  z-index: 100000 !important;
}

body.portrait-blocked #container,
body.portrait-blocked #intro,
body.portrait-blocked #gameover {
  pointer-events: none !important;
  user-select: none !important;
  /* No filter/blur here! */
}
