/* Full-height white canvas when embedded or fullscreen */
html,
body {
    margin: 0;
    min-height: 100%;
    height: 100%;
    overflow: hidden;
    background: #fff;
}

body {
    display: flex;
    flex-direction: column;
}

/* Container fills iframe height; no page scroll */
.container {
    box-sizing: border-box;
    position: relative;
    flex: 1 1 auto;
    width: 100%;
    max-width: 600px;
    height: 100%;
    max-height: 100%;
    margin: 0 auto;
    padding: clamp(6px, 1.2vh, 12px) 12px clamp(6px, 1.2vh, 10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    overflow: hidden;
}

.game-body {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
}

.container header,
.container .info,
#hint-display,
#word-display,
#input-section,
.reset-wrap {
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.container header {
    flex-shrink: 0;
    margin-bottom: 0.15rem;
}

.container header h1 {
    margin: 0;
    padding-top: 0;
    font-size: clamp(1rem, 2.2vh, 1.35rem);
    line-height: 1.2;
}

.container header p {
    margin: 0.1rem 0 0;
    line-height: 1.25;
    font-size: clamp(0.72rem, 1.6vh, 0.85rem);
}

/* Flower visual — real 2× layout size (600×500), not transform scale */
.hangman-visual-wrap {
    flex: 0 0 auto;
    width: min(600px, 100%);
    margin: 0.05rem auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

#hangman-visual {
    position: relative;
    width: 100%;
    aspect-ratio: 300 / 250;
    height: auto;
    margin: 0;
}

#flower-bg {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Individual petal styling with radial distribution */
.petal {
    position: absolute;
    width: 26.6667%;
    height: auto;
    top: 30%;
    left: 48%;
    transform-origin: 8% 50%;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.petal-1 { transform: rotate(0deg); }
.petal-2 { transform: rotate(60deg); }
.petal-3 { transform: rotate(120deg); }
.petal-4 { transform: rotate(180deg); }
.petal-5 { transform: rotate(240deg); }
.petal-6 { transform: rotate(300deg); }

.petal-hidden {
    visibility: hidden;
    opacity: 0;
}

#hint-display {
    flex-shrink: 0;
    margin: 0.15rem 0 0.1rem;
    line-height: 1.25;
    font-size: clamp(0.75rem, 1.6vh, 0.88rem);
}

#word-display {
    flex-shrink: 0;
    font-size: clamp(1.2rem, 3.5vh, 1.75rem);
    font-weight: bold;
    letter-spacing: clamp(0.3rem, 1vh, 0.55rem);
    margin: 2px 0 4px;
    padding-left: clamp(0.3rem, 1vh, 0.55rem);
}

.info {
    flex-shrink: 0;
    margin: 0;
    font-size: clamp(0.75rem, 1.6vh, 0.85rem);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem 1rem;
}

.info p {
    margin: 0;
}

#input-section {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 0;
    margin: 4px 0 0;
    width: auto;
    max-width: none;
}

#letter-input,
#guess-btn {
    box-sizing: border-box;
    height: clamp(38px, 6vh, 44px);
    margin: 0 !important;
    line-height: 1;
    border: 2px solid #118bee;
}

#letter-input {
    width: 68px;
    border-radius: 8px 0 0 8px;
    text-align: center;
    font-size: clamp(1.05rem, 2.8vh, 1.25rem);
    padding: 0;
}

#guess-btn {
    border-radius: 0 8px 8px 0;
    padding: 0 20px;
    font-size: clamp(0.8rem, 1.8vh, 0.9rem);
    font-weight: 700;
    background-color: #118bee;
    color: white;
    cursor: pointer;
}

.reset-wrap {
    flex-shrink: 0;
    width: 100%;
    max-width: 420px;
    min-height: 40px;
    margin-top: 0;
    margin-bottom: 0;
    padding: 4px 0 2px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #fff;
    border-top: 1px solid #eaeaea;
    z-index: 200;
}

#reset-btn {
    display: inline-block;
    margin: 0;
    background-color: transparent;
    color: #118bee;
    border: 1px solid #118bee;
    position: relative;
    transition: all 0.2s ease;
    z-index: 100;
    padding: 0.35rem 0.75rem;
    font-size: clamp(0.8rem, 1.8vh, 0.9rem);
}

#reset-btn.reset-btn--locked {
    position: relative !important;
    left: auto !important;
    top: auto !important;
}

footer.signiture {
    display: block !important;
    text-align: left !important;
    margin-top: 50px;
    border-top: 1px solid #eaeaea;
    padding-top: 10px;
    width: 100%;
}

footer.signiture p {
    text-align: left !important;
    margin: 0;
    font-size: 0.9rem;
}

/* Embed: hide subtitle to give the flower more room */
@media (max-height: 820px) {
    .container header p {
        display: none;
    }
}

@media (max-height: 560px) {
    .container {
        padding-top: 4px;
        padding-bottom: 4px;
    }

    #hint-display {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}

