/* ========================================
   RUUDUKKO JA SOLUT
   ======================================== */

#parentContainer  {
   width: 100%;
   background-color: var(--yds-color-background);

}

#parentWrapper  {
    max-width: 440px;
    margin: auto;
    padding: 16px;
    color: var(--yds-color-text-default);
}

#parentWrapper #playerCells {
    display: grid;
    justify-content: center;
    gap: clamp(1px, 0.5vw, 3px);
    width: 100%;
    margin: auto;
}

#parentWrapper #playerGrid {
    position: relative;
    margin: auto;
}

#parentWrapper #welcomeGrid {
    display: grid;
    justify-content: center;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    margin: 1em;
    width: 40%;
    min-width: 80px;
}

#welcomeBox #welcomeGrid .cell {
    box-sizing: border-box;
    width: 100%;
    aspect-ratio: 1 / 1;
}

#parentWrapper #welcomeBox #welcomeGrid .cell:hover {
    filter: none;
}

#parentWrapper .feedbackItem {
    margin-top: 16px;
    text-align: left;
}

.feedbackItem h2 {
    letter-spacing: 0px;
        text-transform: none;
        font-family: "Yle Next", sans-serif;
        font-size: 1.125rem;
        line-height: 1.45;
        font-weight: 700;
        font-style: normal;
        font-stretch: normal;
}

.feedbackItem .bLyHUx {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 16px;
}

#parentWrapper .feedbackItem.completion-card.links {
    text-align: left;
}

.feedbackItem a.fWfBLJ  {
    color: var(--yds-color-text-default, #131415);
    text-decoration: none;
    letter-spacing: 0px;
    text-transform: none;
    font-family: "Yle Next", sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    font-weight: 700;
    font-style: normal;
}


.feedbackItem .gbWXiW {
    flex-shrink: 0;
    min-width: 104px;
    max-width: 30%;
}

.feedbackItem img.LPzKX{
    min-width: 104px;
    max-width: 30%;
}

.feedbackItem .ksFlzV {
    position: relative;
    margin-top: 16px;
    margin-bottom: 16px;
}


.yle__story__image-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.yle__story__image-wrapper img{
width: 100%;
border-radius: 8px;
}

#formsContainer {
    padding-top: 16px;
}

.yle__story__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

#feedbackList h2, #feedbackList h3 {
    padding: 16px 0;
}
#parentWrapper .cell {
    position: relative;
    box-sizing: border-box;
    cursor: pointer;
    user-select: none;
    touch-action: none;
    transition: all 0.2s;
    border: 1px solid rgb(165, 165, 165);
    margin: 0px;
    font-family: inherit;
    color: rgb(58 61 64);
    aspect-ratio: 1 / 1;
    width: 100%;
    border-radius: 12%;
    display: grid;
    place-content: center;
    text-align: center;
    padding: 3px 4px 5px;
    background: linear-gradient(135deg, rgba(232, 233, 235, 1) 0%, rgba(240, 241, 242, 1) 100%);
    box-shadow: rgba(255, 255, 255, 0.05) 0px 2px 0px inset,
                rgba(0, 0, 0, 0.2) 0px -3px 0px inset,
                rgba(0, 0, 0, 0.1) 0px 3px 0px 0px;
}

#parentWrapper #playerGrid .cell:hover {
    filter: brightness(0.95);
}

#parentWrapper #playerGrid .cell span {
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: clamp(18px, 3.5vw, 28px);
}

#parentWrapper #playerGrid .cell.selected span {
    font-weight: 900;
}

#parentWrapper #playerGrid .cell.selected {
    background: #ffffff;
    border: 2px solid rgba(0, 0, 0, 1);
}

#parentWrapper #playerCells .cell.unused.selected {
    outline: none;
    filter: none;
}

#parentWrapper #playerCells .cell.unused {
    background: #d0d0d0 !important;
    opacity: 0.5;
}

#parentWrapper #playerCells .cell.unused span {
    font-size: 0em;
}

/* Löydetyt sanat - värit */
#parentWrapper .cell.found-0 {
    background-color: rgb(240, 241, 245);
    background-image: linear-gradient(rgb(247, 120, 152) 0%, rgb(249, 159, 181) 100%);
}

#parentWrapper .cell.found-1 {
    background-color: rgb(240, 241, 245);
    background-image: linear-gradient(rgb(95, 224, 178) 0%, rgb(136, 234, 199) 100%);
}

#parentWrapper .cell.found-2 {
    background-color: rgb(240, 241, 245);
    background-image: linear-gradient(rgb(113, 176, 255) 0%, rgb(149, 198, 255) 100%);
}

#parentWrapper .cell.found-3 {
    background-color: rgb(240, 241, 245);
    background-image: linear-gradient(rgb(255, 217, 89) 0%, rgb(255, 227, 135) 100%);
}

#parentWrapper .cell.found-4 {
    background-color: rgb(240, 241, 245);
    background-image: linear-gradient(rgb(202, 145, 222) 0%, rgb(217, 176, 232) 100%);
}

/* Vihjeet */
#parentWrapper #playerGrid .cell.hint-cell span {
    border-radius: 999px;
}

#parentWrapper #playerGrid .cell.hint-cell.hint-0 span {
    background-image: radial-gradient(circle, rgb(247, 120, 152) 0%, rgba(249, 159, 181, 0) 100%);
}

#parentWrapper #playerGrid .cell.hint-cell.hint-1 span {
    background-image: radial-gradient(circle, rgb(95, 224, 178) 0%, rgba(136, 234, 200, 0) 100%);
}

#parentWrapper #playerGrid .cell.hint-cell.hint-2 span {
    background-image: radial-gradient(circle, rgb(113, 176, 255) 0%, rgba(149, 198, 255, 0) 100%);
}

#parentWrapper #playerGrid .cell.hint-cell.hint-3 span {
    background-image: radial-gradient(circle, rgb(255, 217, 89) 0%, rgba(255, 227, 135, 0) 100%);
}

#parentWrapper #playerGrid .cell.hint-cell.hint-4 span {
    background-image: radial-gradient(circle, rgb(202, 145, 222) 0%, rgba(217, 176, 232, 0) 100%);
}

/* Animaatiot */
#parentWrapper #playerCells .cell.foundAnim {
    animation: pop 0.4s ease;
}

#parentWrapper .celebrate {
    animation: pop 0.4s;
    animation-iteration-count: 2;
}

#parentWrapper .article-image {
    width: 128px;
    height: 128px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

#parentWrapper #credits{
    margin: 16px;
    font-size: clamp(0.8em, 3vw, 0.9em);
}

#theme {
    display: flex;
    flex-direction: column;
    align-content: center;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    margin-bottom: 16px;
}

#theme .theme{
font-size: 1.2em;
font-weight: 700;
}

#parentWrapper .container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    font-family: "Yle Next", sans-serif;
    margin: 0;
}

#parentWrapper #welcomeBox {
    /* background: linear-gradient(135deg, rgb(187, 220, 255), rgb(113, 176, 255)); */
    /* background: rgb(255, 255, 255); */
    background-color: var(--yds-color-background-variant, #f8f9fa);
    border: 1px solid rgba(0, 0, 0, 0.09);
    text-align: center;
    padding: 2em;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 4px;
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 8px;
}

#parentWrapper .sanasuora-svg{
    display: flex;
    justify-content: center;  /* keskittää vaakasuunnassa */
    align-items: center;
    width: 100%;
    height: auto;  /* ei kiinteää/isoa korkeutta */
}

#parentWrapper .sanasuora-svg svg {
    display: block;
    width: 100%;
    height: auto;        /* ratkaisevin rivi: ei venytetä korkeutta erikseen */
    aspect-ratio: 1 / 1;  /* vastaa viewBoxin 320x320 -suhdetta */
    max-width: 320px;     /* tai mikä tahansa haluamasi maksimileveys */
    margin: 0 auto;       /* keskittää svg:n div:in sisällä */
}
#parentWrapper .author {
    font-weight: bold;
}

#parentWrapper .box {
    border-radius: 4px;
    margin: auto;
    position: relative;
    width: 100%;
}

#parentWrapper .container button.secondary {
    background-color: var(--yds-color-action-primary, #131415);
    border-color: transparent;
    /* color: var(--yds-color-text-negative, #f8f9fa); */
    font-size: clamp(0.9em, 3vw, 1.1em);
}


#parentWrapper .container .button:hover {
    background-color: #333;
}


#parentWrapper button {
    padding: 8px 16px;
    border: none;
    border-radius: 999px;
    background-color: black;
    color: white;
    /* font-size: clamp(0.9em, 3vw, 1.1em); */
    cursor: pointer;
    background-color: var(--yds-color-action-primary, #131415);
    border-color: transparent;
    color: var(--yds-color-text-negative, #f8f9fa);
        font-size: 1em;
    font-weight: 700;
}


#parentWrapper #welcomeBox button.startgame {
        margin-top: 16px;
}
#parentWrapper #welcomeBox button.startgame:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Pelin ohjaus / vihjeet / luovutus */
#parentWrapper #playerInfo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 1em;
}

#parentWrapper #gameButtons {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 10px;
}

#parentWrapper #playerInfo button {
    padding: 8px 20px;
    display: inline-flex;
    align-items: center;
}

#parentWrapper #instructions {
    font-size: 0.9em;
    color: #888888;
    text-align: left;
    margin: 0;
}

#parentWrapper #hintBtn {
    background-color: transparent;
   border: 2px solid;
    border-color:  var(--yds-color-border, #f8f9fa);
    color: var(--yds-color-text-default, #f8f9fa);
}

#parentWrapper #hintBtn .hint-label {
    /* color: black; */
}

#parentWrapper .hint-count {
    /* background-color: rgb(19, 20, 21); */
    background-color: var(--yds-color-action-primary, #131415);
   color: var(--yds-color-text-negative, #f8f9fa);
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    font-size: 12px;
    position: relative;
}

#parentWrapper #hintBtn.disabled,
#parentWrapper #hintBtn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

@keyframes pop {
    0% { transform: scale(1) }
    50% { transform: scale(1.2) }
    100% { transform: scale(1) }
}

/* Flip-animaatiot */
@keyframes flipInY {
    from {
        transform: perspective(1400px) rotate3d(0, 1, 0, -90deg);
        opacity: 0;
    }
    to {
        transform: perspective(1400px) rotate3d(0, 1, 0, 0deg);
    }
}

.flipInY {
    animation-duration: 0.2s;
    backface-visibility: visible !important;
    animation-name: flipInY;
    animation-timing-function: ease-in;
}

@keyframes flipOutY {
    from {
        transform: perspective(1400px);
    }
    to {
        transform: perspective(1400px) rotate3d(0, 1, 0, 90deg);
        opacity: 0;
    }
}

.flipOutY {
    animation-duration: 0.2s;
    backface-visibility: visible !important;
    animation-name: flipOutY;
    animation-timing-function: ease-in;
}
