/* -----------------------------------------
   1️⃣ GLOBAL RESET & BODY
   ---------------------------------------------- */
*,
*:before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html, body {
    height: 100%;
    font-family: Arial, Helvetica, sans-serif;
    background: #e0e0e0;               /* light‑grey page background */
    color: #333;
}

/* -------------------------------------------------
   2️⃣ OUTER GRID – three columns (left gutter, centre, right gutter)
   ------------------------------------------------- */
.outer-grid {
    display: grid;
    grid-template-columns: 1fr minmax(320px, 800px) 1fr;
    height: 100%;
}
.gutter {
    background: #e0e0e0;               /* same colour as page bg – looks like a margin */
}

/* -------------------------------------------------
   3️⃣ CENTRAL GAME CARD
   ------------------------------------------------- */
.game-box {
    background: #fff;                  /* white card */
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
    margin: 20px;
   display: flex;
    flex-direction: column;
    /* Allow the card to scroll vertically if its content grows */
    overflow-y: auto;
}

/* -------------------------------------------------
   4️⃣ HEADER INSIDE THE CARD
   ------------------------------------------------- */
.box-header {
    background: #f5f5f5;
   padding: 12px 20px;
    border-bottom: 1px solid #ddd;
    text-align: center;
}
.box-header .word-number {
    font-size: 1rem;
    color: #555;
    margin-bottom: 4px;
}
.box-header .title {
    font-size: 1.8rem;
    color: #212121;
}

/* -------------------------------------------
   5️⃣ BODY (canvas, riddles, buttons, messages)
   ------------------------------------------------- */
.box-body {
    padding: 20px;
    flex: 1;                               /* take remaining vertical space */
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Canvas */
#hangCanvas {
    background: #fafafa;
    border: 1px solid #ddd;
    margin-bottom: 15px;
}

/* Full‑word reference line */
.word {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    letter-spacing: .4rem;
    margin: 12px 0;
}

/* -------------------------------------------------
   6️⃣ SYLLABLE BLOCKS
   ------------------------------------------------- */
.syllableBlock {
    margin-bottom: 22px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
}
.riddle {
    font-size: .95rem;
    color: #555;
    margin-bottom: 6px;
    text-align: left;
}
.syllableDisplay {
    font-size: 1.6rem;
    letter-spacing: .35rem;
    color: #222;
    display: block;
    margin-bottom: 8px;
}

/* -------------------------------------------------
   7️⃣ LETTER ROWS (one per syllable)
   ------------------------------------------------- */
.lettersRow {
    display: grid;
    grid-template-columns: repeat(13,1fr);
    gap: 5px;
    justify-items: center;
    margin-top: 6px;
}
.lettersRow button {
    width: 28px;
   height: 28px;
    font-size: .9rem;
    cursor: pointer;
    border: none;
    border-radius: 4px;
    background: #e0e0e0;
    transition: background .2s;
}
.lettersRow button:hover:not(:disabled) {
    background: #c0c0c0;
}
.lettersRow button:disabled {
    background: #8bc34a;
    color: #fff;
    cursor: default;
}

/* -------------------------------------------------
   8️⃣ GLOBAL MESSAGE (Game‑Over overlay)
   ------------------------------------------------- */
.msg {
    display: none;                     /* hidden until we need it */
    flex-direction: column;
    align-items: center;
    background: rgba(255,255,255,.9);
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
    margin-top: 15px;
}
.game-over-media {
    max-width: 90vw;
    max-height: 70vh;
    display: block;
    margin: 0 auto 12px;
}

/* -------------------------------------------------
   9️⃣ RESTART BUTTON
   ------------------------------------------------- */
.btn {
    padding: 8px 16px;
    font-size: 1rem;
    background: #2196f3;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 12px;
}
.btn:hover { background: #1976d2; }

/* -------------------------------------------------
   10️⃣ RESPONSIVE tweak (optional)
   ------------------------------------------------- */
@media (max-width: 480px) {
    .outer-grid { grid-template-columns: 0.5fr 1fr 0.5fr; }
    .box-header .title { font-size: 1.5rem; }
    .word { font-size: 1.6rem; }
}
/* -------------------------------------------------
   Button colour feedback
   ------------------------------------------------- */
.btn-correct {
    background-color: #28a745 !important;   /* green */
    color: white;
}
.btn-wrong {
    background-color: #ff69b4 !important;   /* hot‑pink */
    color: white;
}
