body {
    background-color: #000;
    color: #bbbbbb;
    font-family: 'Pirata One', cursive;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

.OuijaSentence-board {
  /* 2026-09-05: viewport-relative (this page centers with a flex body that
     shrink-wraps its shell, so a % width would resolve against the board's
     own content) — stays 800px on a wide window, shrinks when squeezed. */
  width: min(800px, calc(100vw - 20px));
  max-width: 100%;
  box-sizing: border-box;
  height: 600px;
  background-image: url('images/stardust.jpeg');
  background-color: #1a1a1a;
  background-size: cover;
  background-position: center;
  border: 5px solid #000000;
  border-radius: 38px;
  position: relative;
    overflow: hidden; /* Clip glass highlights to rounded edges */
  flex-shrink: 0; /* Prevent board from shrinking */

  /* Outer glow */
  box-shadow:
    0 0 50px #ffffff49,
    0 0 10px #ffffff6b,
    0 0 0px #fefefe5c,

    /* Inner glow */
    inset 0 0 3px #999a9a,
    inset 0 0 7px #bebebee8;
}

/* Glass overlay sitting above board contents (except the planchette) */
.OuijaSentence-board::after {
    content: "";
    position: absolute;
    inset: 0; /* cover entire board area */
    border-radius: 35px;
    pointer-events: none; /* don't block clicks */
    /* Subtle glass tint and soft reflections */
    background:
        linear-gradient(180deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.04) 38%, rgba(255,255,255,0.00) 60%),
        radial-gradient(120% 80% at 20% -10%, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0.00) 60%),
        radial-gradient(120% 80% at 80% 110%, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.00) 60%);
    box-shadow:
        inset 0 0 0 3px rgba(255,255,255,0.18), /* rim highlight */
        inset 0 12px 30px rgba(255,255,255,0.06), /* soft inner sheen */
        0 8px 20px rgba(0,0,0,0.35); /* subtle lifted depth */
    z-index: 7; /* glass sheen: above decorations (z=5), below the glare (z=8) and planchette (z=10) */
}

/* Angled glare streak for realism */
.OuijaSentence-board::before {
    content: "";
    position: absolute;
    top: -12%;
    left: -10%;
    width: 130%;
    height: 42%;
    transform: rotate(-10deg);
    border-radius: 35px;
    pointer-events: none;
    background: linear-gradient(
        to bottom,
        rgba(255,255,255,0.35) 0%,
        rgba(255,255,255,0.18) 32%,
        rgba(255,255,255,0.06) 60%,
        rgba(255,255,255,0.00) 100%
    );
    filter: blur(1px);
    opacity: 0.75;
    z-index: 8; /* angled glare: above the sheen (z=7), below the planchette (z=10) */
}

.board-title {
    font-size: 55px;
    font-weight: normal;
    text-align: center;
    margin-top: 11px;
    margin-bottom: 0;
    color: #ffffff;
}

.cursive-title {
    font-family: 'Dancing Script', cursive;
    font-weight: 700;
    color: rgb(255, 187, 0);
}

.letters, .options {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 8px;
}

.letter, .option {
    font-size: 29px;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: relative;
    border: 3px solid #262626;
    border-radius: 10px;
    background-color: #000000;
    box-shadow: -1px 2px .2px #bdbdbd;
    transition: color 1.7s cubic-bezier(0.4, 0, 0.6, 0.4), text-shadow 0.45s ease, background-color 0.3s ease, box-shadow 0.25s ease, transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Common words styling */
.common-words-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 4px;
}

.common-word {
    font-size: 20px;
    padding: 8px 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: relative;
    border: 3px solid #262626;
    border-radius: 10px;
    background-color: #000000;
    box-shadow: -1px 2px .2px #bdbdbd;
    transition: color 1.7s cubic-bezier(0.4, 0, 0.6, 0.4), text-shadow 0.45s ease, background-color 0.3s ease, box-shadow 0.25s ease, transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: #bbbbbb;
}

/* 2026-09-05 (owner ruling): the board must contain its keys at ANY narrow
   size (a phone OR a squeezed desktop window). Lifting the flex minimum lets
   a letter row squeeze below its fixed 50px key size when the board itself
   is narrower than its 800px design — the keys then shrink (never overflow)
   instead of spilling out of the board edges. At full width nothing changes. */
.letter, .option, .option-small, .common-word {
    min-width: 0;
}


/* Removed .letter.planchette-hovered, .option.planchette-hovered */
/*.options are the yes no buttons*/
.options {
    margin-top: 40px;
}

.option {
    width: 100px;
}

/* YES/NO row under the letters */
.yes-no-row {
    display: flex;
    justify-content: space-between;
    margin-top: 2px;
    padding: 0 50px;
}

.option-small {
    font-size: 20px;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: relative;
    border: 3px solid #262626;
    border-radius: 10px;
    background-color: #000000;
    box-shadow: -1px 2px .2px #bdbdbd;
    transition: color 1.7s cubic-bezier(0.4, 0, 0.6, 0.4), text-shadow 0.45s ease, background-color 0.3s ease, box-shadow 0.25s ease, transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: #bbbbbb;
}

/* A10 ergonomic shadow fan: light source at the board's top-center — left-half
   keys keep the bottom-left drop shadow, right-half keys cast bottom-right, and
   the center-column keys cast straight down. (Pressed keys show inset shadows
   instead, so the divining choreography is unaffected.) */
.key-shadow-right {
    box-shadow: 1px 2px .2px #bdbdbd;
}

.key-shadow-center {
    box-shadow: 0 2px .2px #bdbdbd;
}


/* ===== Selection choreography: press → red-under-glass → bloom → drain ===== */

/* Parked state: key presses down, magnifies slightly under the planchette lens,
   and snaps red (visible through the clear glass window) */
.key-selected {
    color: #ff2020;
    transform: translateY(2px) scale(1.13);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.85), inset 0 -1px 1px rgba(255, 255, 255, 0.06);
    background-color: #0c0c0c;
    transition: color 0.12s ease-out, transform 0.1s ease-in, box-shadow 0.12s ease-in, background-color 0.12s ease-in;
}

/* Brief red bloom on selection — refracts through the planchette glass */
.key-bloom {
    text-shadow: 0 0 6px rgba(255, 0, 0, 0.268), 0 0 16px rgba(255, 0, 0, 0.75);
    transition: text-shadow 0.25s ease;
}

/* Drain: a white copy of the glyph sweeps down over the red one as the planchette
   slides away — the reveal is a soft-gradient mask (no hard boundary; the key itself
   is never transparent because the mask lives only on the pseudo-element) */
.key-draining::after {
    content: attr(data-letter);
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbbbbb;
    pointer-events: none;
    z-index: 1;
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 45%, rgba(0, 0, 0, 0) 65%, rgba(0, 0, 0, 0) 100%);
    mask-image: linear-gradient(to bottom, #000 0%, #000 45%, rgba(0, 0, 0, 0) 65%, rgba(0, 0, 0, 0) 100%);
    -webkit-mask-size: 100% 300%;
    mask-size: 100% 300%;
    -webkit-mask-position: 0% 100%;
    mask-position: 0% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    animation: key-drain-sweep 1.6s cubic-bezier(0.45, 0, 0.55, 1) forwards;
}

@keyframes key-drain-sweep {
    from {
        -webkit-mask-position: 0% 100%;
        mask-position: 0% 100%;
    }
    to {
        -webkit-mask-position: 0% 0%;
        mask-position: 0% 0%;
    }
}

/* Planchette glass picks up a red inner glow while parked on a divined key */
#planchette-body.planchette-glass-divining {
    background-color: rgba(255, 0, 0, 0.322);
    box-shadow: inset 0 0 22px rgba(86, 0, 0, 0.92), inset 0 0 8px rgba(255, 0, 0, 0.185);
}

/* On departure the red glass glow drains toward the trailing edge (the glow lingers
   near the pressed key — opposite the travel vector from --drain-x/--drain-y) */
#planchette-body.planchette-glass-draining {
    transition: box-shadow 1.7s ease-out, background-color 1.7s ease-out;
    box-shadow:
        inset calc(var(--drain-x, 0) * 54px) calc(var(--drain-y, 0) * 54px) 46px -14px rgba(255, 42, 42, 0),
        inset calc(var(--drain-x, 0) * 24px) calc(var(--drain-y, 0) * 24px) 14px -4px rgba(255, 70, 70, 0);
    background-color: rgba(255, 96, 96, 0);
}


#planchette-wrapper {
    width: 90px;
    height: 78px; /* Equilateral height */
    position: absolute;
    top: 50%;
    left: 50%;
    /* Centering + the owner-blessed bias: -53% is the owner's nudge (~3px left of
       key center horizontally), +9px below it vertically (classic look, every size). */
    transform: translate(-53%, calc(-53% + 9px));
    transition: left 2s ease-in-out, top 2s ease-in-out;
    /* Planchette rides ABOVE the board's glass overlays (sheen z=7, glare z=8):
       the angled top-left glare must never wash out the red under the glass. */
    z-index: 10;
}



#planchette-body {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    clip-path: polygon(0% 0%, 100% 0%, 50% 100%); /* Flipped Triangle shape */
    background-color:rgba(181, 181, 181, 0.33); /* Solid translucent color */
    border: 3px solid rgb(255, 255, 255);
    z-index: 7;
    transition: background-color 0.25s ease, box-shadow 0.3s ease;
}

#planchette-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 1px;
    width: 110%;
    height: 100%;
    background-color:rgb(255, 255, 255);
    transform-origin: top left;
    transform: rotate(59.4deg); /* diagonal is 59.7°; sits just inside so the trim line shows */
    z-index: 7;
}

#planchette-body::after {
    content: '';
    position: absolute;
    top: 0;
    right: 2px; /* 2px inset to avoid the right border, I made this change.*/
    width: 110%;
    height: 100%;
    background-color: rgb(255, 255, 255);
    transform-origin: top right;
    transform: rotate(-61.1deg); /* mirror of the left bar's 59.4° about the 60.26° diagonal (96×84 glass) */
    z-index: 7;
}

/* The glass triangle itself is the lens — a gentle frost and slight brightness
   boost over the ENTIRE glass, so the pressed letter reads magnified through it.
   The glass box is 96×84 (body = 100% + 3px border, content-box), so the frost
   layer and its SVG mask match that size exactly — otherwise the frost ends ~3px
   short of the glass edge (a clear strip, widest on the right). The SVG mask
   clips BOTH the glass paint and the backdrop-filter region (clip-path alone does
   NOT clip the backdrop — the frost would leak outside the triangle). */
#planchette-glow {
    position: absolute;
    top: 0px;
    left: 0px;
    width: calc(100% + 5px);
    height: calc(100% + 5px);
    z-index: 7;
    pointer-events: none;
    -webkit-mask-image: url("data:image/svg+xml;utf8,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='96'%20height='84'%3E%3Cpolygon%20points='0,0%2096,0%2048,84'%20fill='white'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml;utf8,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='96'%20height='84'%3E%3Cpolygon%20points='0,0%2096,0%2048,84'%20fill='white'/%3E%3C/svg%3E");
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    background:
        radial-gradient(90% 90% at 50% 48%, rgba(255, 255, 255, 0.10) 0%, rgba(210, 225, 235, 0.05) 55%, rgba(150, 165, 180, 0.19) 100%);
    box-shadow:
        inset 0 0 16px rgba(255, 255, 255, 0.10),
        inset 0 -8px 16px rgba(120, 140, 160, 0.28);
    backdrop-filter: blur(0.7px) brightness(1.08);
    -webkit-backdrop-filter: blur(0.7px) brightness(1.08);
    transition: background-color 0.5s ease;
}


/* The whole glass picks up the red under it while divining — the refraction */
#planchette-wrapper:has(#planchette-body.planchette-glass-divining) #planchette-glow {
    background-color: rgba(255, 70, 70, 0.12);
}



#divinated-word-container {
    text-align: center;
    margin-top: 15px;
    /* 2026-09-05: min-height (was a fixed 60px) so a wrapped second line of
       the reactive sentence has room inside the blank space. */
    min-height: 60px;
    padding-bottom: 30px; /* Added padding */
    box-sizing: border-box; /* the corner-reserve padding stays INSIDE */
    /* 2026-09-05: keep the sentence BETWEEN the goat (left) and skull (right)
       corner art — the fit logic now measures this narrower central gap, so
       the font shrinks further and the sentence never runs under the art. */
    padding-left: 180px;
    padding-right: 180px;
}

#divinated-word {
    font-size: 40px;
    /* 2026-09-05: letter-spacing in em so it scales with the (reactive)
       font size — a fixed px would bloat the line spacing when the font
       shrinks and push a long sentence past 2 lines. */
    letter-spacing: 0.0625em;
    color: rgb(255, 255, 255);
    text-shadow: 2.5px 2.5px 3px #000000, 1.5px -1px 1px #ffffff;
    -webkit-text-stroke:1.2px rgb(57, 57, 57);
    text-decoration: wavy underline 4.5px rgb(0, 0, 0);
    /* 2026-09-05: multi-line sentences need an explicit line-height so the
       wrapped lines read cleanly and the fit logic can measure them. */
    line-height: 1.15;
}

#skull-decoration {
    position: absolute;
    bottom: 10px;
    right: 20px;
    width: 150px;
    height: 150px;
    z-index: 5;
}

#goat-decoration {
    position: absolute;
    bottom: 25px;
    left: 20px;
    width: 150px;
    height: 150px;
    z-index: 5;
}

/* Media Queries for Responsive Design */
@media (max-width: 768px) {
    body {
        height: 100vh;
        min-height: 100vh;
        overflow: hidden;
        justify-content: center;
        padding: 10px;
        padding-bottom: 0px;
    }

    .OuijaSentence-board {
        width: calc(100vw - 30px);
        box-sizing: border-box;
        height: auto;
        padding: 5px 10px;
        margin-bottom: 40px;
       
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* 2026-09-05 (owner ruling): inside this centered flex column the rows
       would shrink-wrap to their content and spill out of the board. Keep
       them full-width so the keys flex to fit the board at any narrow size. */
    .letters,
    .common-words-row,
    .yes-no-row,
    #divinated-word-container {
        width: 100%;
    }

    #divinated-word {
        font-size: 38px;
    }
}

@media (max-width: 480px) {
    .OuijaSentence-board {
        padding: 4px 8px;
        border-width: 5px;
        border-radius: 40px;
    }

    .letters, .options {
        gap: 3px;
    }

    .letter, .option {
        font-size: 14px;
        width: 26px;
        height: 26px;
    }

    .option {
        width: 60px;
    }

    .option-small {
        font-size: 12px;
        width: 26px;
        height: 26px;
    }

    .yes-no-row {
        padding: 0 10px;
    }

    .common-word {
        font-size: 12px;
        padding: 4px 8px;
    }

    .board-title {
        font-size: 30px;
    }

    #divinated-word {
        font-size: 30px;
    }

    /* 2026-09-05: the goat/skull shrink to 80px on phones — shrink the
       sentence's reserved corner space to match so it stays between them. */
    #divinated-word-container {
        padding-left: 96px;
        padding-right: 96px;
    }

    #planchette-wrapper {
        width: 50px;
        height: 43px;
    }

    #skull-decoration, #goat-decoration {
        width: 80px;
        height: 80px;
    }
    .decorations-container {
        margin-top: 5px;
        margin-bottom: 3px;
    }
}

/* Extra small screens - prevent letter wrapping */
@media (max-width: 400px) {
    .OuijaSentence-board {
        padding: 3px 6px;
    }

    .letters, .options {
        gap: 2px;
    }

    .letter, .option {
        font-size: 15px;
        width: 24px;
        height: 24px;
        border-width: 3px;
    }

    .option {
        width: 55px;
    }

    .option-small {
        font-size: 11px;
        width: 24px;
        height: 24px;
    }

    .yes-no-row {
        padding: 0 8px;
    }

    .common-word {
        font-size: 10px;
        padding: 3px 6px;
    }

    .board-title {
        font-size: 26px;
        margin-top: 5px;
    }

    #divinated-word {
        font-size: 22px;
    }
}

/* Footer Styles */
footer {
    text-align: center;
    padding: 15px 20px;
    margin-top: 100px;
    font-size: 14px;
    color: #bbbbbb;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1;
}

footer a {
    color: #8233e9;
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: #ffffff;
    text-decoration: underline;
}
