/* demo.css — the playable web demo (issue #125).
 *
 * Tile colours match apps/ios/PathWords/DesignSystem/Palette.swift's light
 * appearance (TileFill/TileStart/TileMatch/TileInvalid/Ink), the same source
 * tools/marketing/tile_render.py draws the app icons from — see the repo-root
 * CLAUDE.md. The page around the tiles stays in styles.css's existing dark
 * theme so the demo still looks like the rest of the site.
 */

:root {
    --demo-tile-fill: #C7CBD1;   /* TileFill, light */
    --demo-tile-start: #EF8733;  /* the icon's brand orange, not the app's #FF6600 —
                                     see tools/marketing/CLAUDE.md */
    --demo-tile-match: #2FA96A;  /* TileMatch, light */
    --demo-tile-invalid: #D9463E;/* TileInvalid, light */
    --demo-ink: #14161A;         /* Ink, light */
}

.demo-back-link {
    display: inline-block;
    color: #ff6600;
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    margin-bottom: 8px;
}

.demo-back-link:hover,
.demo-back-link:focus-visible {
    text-decoration: underline;
}

.demo-container {
    padding-bottom: 40px;
}

.demo-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    justify-content: center;
    align-items: flex-start;
    margin-top: 16px;
}

.demo-board-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* The 5x5 board itself. Sized in a CSS grid so it reflows from a wide desktop
   layout down to a narrow phone one without any JS involved. */
.demo-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    width: min(90vw, 340px);
    aspect-ratio: 1 / 1;
    background-color: #000;
    border: 2px solid #ff6600;
    border-radius: 8px;
    padding: 10px;
    box-sizing: border-box;
}

.demo-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--demo-tile-fill);
    color: var(--demo-ink);
    border: 3px solid transparent;
    border-radius: 8px; /* squareCornerRadius in TileCell.swift */
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: clamp(14px, 4.5vw, 22px);
    padding: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: border-color 120ms ease-out, background-color 120ms ease-out;
}

.demo-cell:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Vowel cells render as circles instead of rounded squares, same rule as
   TileCell.swift's `cornerRadius = cellSize / 2`. */
.demo-cell.is-vowel {
    border-radius: 50%;
}

.demo-cell.is-start {
    background-color: var(--demo-tile-start);
}

.demo-cell.is-revealed {
    font-weight: 700;
}

.demo-cell.is-active-path {
    border-color: var(--demo-tile-match);
}

.demo-cell.is-invalid {
    border-color: var(--demo-tile-invalid);
}

.demo-cell:disabled {
    cursor: default;
}

.demo-message {
    min-height: 1.4em;
    text-align: center;
    max-width: 340px;
    font-size: 14px;
}

.demo-message.is-invalid {
    color: var(--demo-tile-invalid);
}

.demo-message.is-success {
    color: var(--demo-tile-match);
}

.demo-controls {
    display: flex;
    gap: 12px;
}

.demo-secondary-button {
    background: transparent;
    border: 2px solid #ff6600;
    color: #ff6600;
    padding: 8px 16px;
    border-radius: 5px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    cursor: pointer;
}

.demo-secondary-button:hover,
.demo-secondary-button:focus-visible {
    background: #ff6600;
    color: #000;
}

.demo-secondary-button:disabled {
    opacity: 0.4;
    cursor: default;
    background: transparent;
    color: #ff6600;
}

.demo-word-column {
    min-width: 220px;
}

.demo-word-column h2 {
    margin-top: 0;
    text-align: center;
}

.demo-word-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.demo-word-item {
    width: 100%;
    text-align: left;
    background-color: #111;
    border: 2px solid #444;
    color: #fff;
    border-radius: 6px;
    padding: 10px 14px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
}

.demo-word-item:hover,
.demo-word-item:focus-visible {
    border-color: #ff6600;
}

.demo-word-item.is-active {
    border-color: #ff6600;
    background-color: #2a1a0d;
}

.demo-word-item.is-solved {
    border-color: var(--demo-tile-match);
    color: var(--demo-tile-match);
    text-decoration: line-through;
    cursor: default;
}

.demo-complete-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 10;
}

.demo-complete-card {
    background: #111;
    border: 2px solid #ff6600;
    border-radius: 10px;
    max-width: 380px;
    width: 100%;
    padding: 32px 24px;
    text-align: center;
}

.demo-complete-card h2 {
    margin-top: 0;
    color: #ff6600;
}

.demo-app-store-button {
    display: inline-block;
    margin: 16px 0 8px;
}

.demo-complete-secondary {
    font-size: 13px;
    margin-top: 4px;
}

@media (max-width: 640px) {
    .demo-layout {
        flex-direction: column;
        align-items: center;
    }

    .demo-word-column {
        width: 100%;
        max-width: 340px;
    }
}
