body {
    margin: 0;
    padding: 0;
    /* background-color: #f0f0f0; */
    text-align:center;
    font-family: 'Golos Text', sans-serif;
    font-weight: 800;
    font-style: normal;
}
.text-center{
    color: #004359;
}

/*the grid of 9 puzzles*/
.grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    max-width: 800px;
    width: 100%;
    padding: 20px;
    margin: auto;
    box-sizing: border-box;
}

.grid-item {
    text-align: center;
    background-color: #E4E9EC;
    border-radius: 0 0 18px 18px; /* Only bottom corners rounded */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    cursor: pointer;
}
.grid-item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 0;
}
.lock-icon {
    display: none;
    font-size: 4em;
    color: #bbb;
    position: absolute;
    top: 38%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    z-index: 5; /* above clouds */
}
.unlocked-icon {
    display: none;
    font-size: 4em;
    color: #bbb;
    position: absolute;
    top: 38%;
    left: 51.5%; /* moved a tiny bit right for visual alignment */
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    z-index: 2;
}
/*
.cloud-icon {
    display: none;
    font-size: 7em;
    color: #d0d0d0;
    position: absolute;
    top: 62%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    opacity: 0.95;
    z-index: 1;
    animation: cloudmove 2.2s ease-in-out infinite alternate;
}
@keyframes cloudmove {
    0% { transform: translate(-60%, -50%) scale(1.15);}
    100% { transform: translate(-40%, -50%) scale(1);}
}
    old cloud icon that moves left to right cartoony looking saving for possible future use  */ 
.star-green,
.star-grey-outline {
    font-size: 2em;
    display: inline-block;
    margin: 0 2px;
    position: static;
    text-align: center;
    vertical-align: middle;
}
.star-green {
    color: #4caf50;
    text-shadow: 0 0 12px #b6e388;
}
.star-grey-outline {
    color: #bbb;
}
.grid-item.completed .star-green {
    display: inline-block;
}
.grid-item.unlocked .star-grey-outline {
    display: inline-block;
}
/* Overlay Styles */
#sudokuPadOverlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh; /* Adjust height for top padding */
    /* Remove the background so the rest of the screen is not greyed out */
    background: none;
    z-index: 999;
    justify-content: center;
    align-items: center;
}
#sudokuPadOverlay.active {
    display: flex;
}
#closeSudokuPad {
    position: fixed;
    top: -8px; /* Move the x up just a tiny bit to match with top bar */
    right: 0;
    font-size: 2.5em;
    z-index: 1001;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 0 18px;
    line-height: 1;
    height: 56px;
    width: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}
#sudokuPadOverlay > div {
    border-radius: 0 !important;
    width: 75vw;
    max-width: 75vw;
    min-width: 320px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}
#sudokuPadFrame {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    border: none;
    box-shadow: 0 0 30px #000;
    background: #fff;
    z-index: 1000;
    min-width: 320px;
    max-width: 100vw;
    margin-top: 0;
}
@media (max-width: 900px) {
    #sudokuPadOverlay > div,
    #sudokuPadFrame {
        width: 100vw !important;
        max-width: 100vw !important;
        min-width: 0 !important;
    }
}
.cloud-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
}
.grid-item.locked .grid-image {
    filter: blur(7px) brightness(0.85);
}
.grid-item.locked .grid-title,
.grid-item.locked .stars {
    filter: none;
    /*filter: blur(2.5) brightness(0.85);*/
}
.grid-item.locked .cloud-canvas {
    display: block;
}
.grid-item:not(.locked) .cloud-canvas {
    display: none;
}
#videoHintOverlay {
    position: fixed;
    top: 435px;
    left: 10px;
    width: 340px;
    height: 200px;
    z-index: 2000;
    background: rgba(255,255,255,0.98);
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.18);
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    padding: 8px;
}
#videoHintOverlay iframe {
    width: 320px;
    height: 180px;
    border: none;
    border-radius: 8px;
}
@media (max-width: 1200px) {
    #videoHintOverlay {
        top: auto;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 95vw;
        max-width: 360px;
        height: 200px;
        padding: 4px;
    }
    #videoHintOverlay iframe {
        width: 100%;
        height: 180px;
    }
}
#hint-buttons-container {
    position: fixed;
    top: 80px;
    right: 40px;
    z-index: 1100;
    display: grid;
    grid-template-columns: repeat(3, 48px);
    grid-template-rows: repeat(3, 48px); /* 3 rows for 9 hints */
    gap: 12px;
    background: rgba(255,255,255,0.92);
    border-radius: 12px;
    padding: 12px 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.10);
}
.hint-btn {
    font-family: 'Golos Text', sans-serif;
    font-weight: 600;
    width: 44px;
    height: 44px;
    font-size: 1.5em;
    border: none;
    border-radius: 8px;
    background: #e4e9ec;
    color: #004359;
    cursor: pointer;
    transition: background 0.2s;
}
.hint-btn:hover {
    background: #d0dde5;
}
#hint-question-btn {
    position: fixed;
    top: -8px;
    right: 56px;
    width: 56px;
    height: 56px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2em;
    cursor: pointer;
    display: none;
    z-index: 1002;
    align-items: center;
    justify-content: center;
}
#constraints-question-btn {
    position: fixed;
    top: -8px;
    left: 70px; /* Place to the left of the hint button */
    width: 56px;
    height: 56px;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5em;
    cursor: pointer;
    display: none;
    z-index: 1002;
    align-items: center;
    justify-content: center;
}
#constraintsOverlay {
    display:none; 
    position:fixed; 
    top:40px; 
    left:-5px; 
    width:25vw; 
    height:calc(100vh); 
    z-index:2100; 
    background:rgba(255,255,255); 
    border-radius: 12px;  
    padding: 8px 0 8px 0;
    overflow-y:auto;
}
/*this is the x it is hidden rn cuz i cant get it to work*/
#closeConstraintsOverlay{
    display:none;
}
@media (max-width: 900px) {
    #hint-buttons-container {
        display: none;
    }
    #hint-question-btn {
        display: flex !important;
    }
    #constraints-question-btn {
        display: flex !important;
    }
}
@media (min-width: 901px) {
    #constraints-question-btn {
        display: flex !important;
    }
}

/* Make sure nothing scrolls */
html, body {
  height: 100%;
  overflow: hidden;
}

/* Full-viewport content wrapper */
.content {
  height: 100vh;
  width: 100vw;
  display: grid;
  place-items: center;
}

/* Grid that centers and uses fixed track sizes from CSS vars */
.grid-container {
  /* driven by JS variables */
  --cols: 3;
  --rows: 3;
  --gap: 30px;
  --pad: 20px;
  --cell: 220px;       /* fallback before JS runs */

  display: grid;
  grid-template-columns: repeat(var(--cols), var(--cell));
  grid-auto-rows: var(--cell);
  gap: var(--gap);
  padding: var(--pad);
  width: 100vw;
  height: 100vh;
  box-sizing: border-box;
  place-content: center;   /* centers the whole 3x3 block */
}

/* Each tile is a fixed square that scales with --cell */
.grid-item {
  position: relative;
  width: var(--cell);
  height: var(--cell);
  border-radius: 18px;
  overflow: hidden;
  text-align: left;
  background-color: #E4E9EC;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transition: transform .3s ease, box-shadow .3s ease;
  cursor: pointer;
}

/* Image fills the square */
.grid-item .grid-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0;
}

/* Move title & stars INSIDE the square so height doesn't grow */
.grid-title,
.stars {
  position: absolute;
  left: 8px;
  right: 8px;
  color: #004359;
  text-shadow: 0 1px 2px rgba(255,255,255,0.75);
  pointer-events: none;
}

.grid-title {
  bottom: 35px;
  font-weight: 800;
  font-size: clamp(20px, calc(var(--tile-font) * 1.0), 22px);
  line-height: 1.2;
}
.stars {
  bottom: 8px;
}

/* Star sizes scale with tile size */
.star-green,
.star-grey-outline {
  font-size: clamp(12px, calc(var(--tile-font) * 2), 28px);
  margin: 0 2px;
  vertical-align: middle;
}

/* Lock/unlock icons scale and stay centered */
.lock-icon,
.unlocked-icon {
  display: none;
  position: absolute;
  font-size: var(--icon-size);
  color: #bbb;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  z-index: 5;
}

/* Cloud canvas keeps covering the square */
.cloud-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}

/* Footer bar behind title + stars */
.grid-item::after {
  /* size */
  --footer-h: clamp(52px, calc(var(--cell) * 0.26), 90px);
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--footer-h);

  /* look */
  background: rgba(211, 211, 211, 0.95);

  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
  pointer-events: none;

  /* stack under text/icons, over the image */
  z-index: 2;
}

/* ensure text sits over the bar & clouds */
.grid-title,
.stars { z-index: 4; }

/* clouds stay below text, above the bar */
.cloud-canvas { z-index: 3; }

/* icons stay on top of everything */
.lock-icon,
.unlocked-icon { z-index: 5; }