/* Simblrloom SIMGO: frontend card.
   Colors come from Settings as custom properties on .simgo. Body text
   follows the theme (Open Sans on the owner's sites); the SIMGO letters use
   the display font from Settings, then Simlish if the theme loads it. */

.simgo {
    --simgo-header: #b2f22b;
    --simgo-header-text: #2e2e2e;
    --simgo-free: #b2f22b;
    --simgo-accent: #f51aa4;
    --simgo-accent-hover: #f985ca;
    --simgo-ink: #2e2e2e;
    --simgo-line: rgba(46, 46, 46, 0.6);
    --simgo-radius: 6px;
    --simgo-font: "Open Sans", sans-serif;
    --simgo-display: "Simblrloom SIMGO Display", "Simlish Noostrasim Bold", "Simlish", var(--simgo-font);
    position: relative;
    max-width: 640px;
    margin: 0 auto;
    color: var(--simgo-ink);
    font-family: var(--simgo-font);
    text-align: center;
}

.simgo *,
.simgo *::before,
.simgo *::after {
    box-sizing: border-box;
}

/* ---------- Card picker ---------- */

.simgo-picker {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 0 0 16px;
}

.simgo .simgo-pick {
    margin: 0;
    padding: 8px 16px;
    border: 2px solid var(--simgo-accent);
    border-radius: 999px;
    background: #ffffff;
    color: var(--simgo-ink);
    font-family: var(--simgo-font);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-transform: none;
    cursor: pointer;
}

.simgo .simgo-pick[aria-pressed="true"] {
    background: var(--simgo-accent);
    color: #ffffff;
}

.simgo .simgo-pick:focus-visible,
.simgo .simgo-btn:focus-visible,
.simgo .simgo-cell:focus-visible {
    outline: 3px solid var(--simgo-ink);
    outline-offset: 2px;
}

/* ---------- Board ---------- */

.simgo-board {
    position: relative;
    padding: 16px;
    border: 1px solid var(--simgo-line);
    border-radius: var(--simgo-radius) var(--simgo-radius) 0 0;
    background: #ffffff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.simgo .simgo-title {
    margin: 0 0 12px;
    font-family: var(--simgo-font);
    font-size: 1.25em;
    font-weight: 700;
    line-height: 1.3;
}

.simgo-grid {
    display: grid;
    gap: 6px;
}

.simgo-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
}

.simgo-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 0.85;
    background: var(--simgo-header);
    color: var(--simgo-header-text);
    font-family: var(--simgo-display);
    font-size: clamp(28px, 9vw, 64px);
    font-weight: 700;
    line-height: 1;
}

.simgo-cell-wrap {
    display: block;
    min-width: 0;
}

.simgo .simgo-cell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1 / 1;
    margin: 0;
    padding: 4px;
    border: 1px solid var(--simgo-ink);
    border-radius: 0;
    background: #ffffff;
    color: var(--simgo-ink);
    font-family: var(--simgo-font);
    font-size: clamp(9px, 2.4vw, 13px);
    font-weight: 600;
    line-height: 1.2;
    text-transform: none;
    letter-spacing: 0;
    overflow: hidden;
    overflow-wrap: break-word;
    cursor: default;
}

.simgo .simgo-cell-text {
    position: relative;
    z-index: 1;
}

.simgo .simgo-cell.is-free {
    background: var(--simgo-free);
    font-size: clamp(12px, 3.4vw, 18px);
    font-weight: 700;
    opacity: 1;
    cursor: default;
}

/* Deal: squares flip in one after another. */
.simgo-board.is-dealing .simgo-cell {
    animation: simgo-deal 0.45s ease both;
    animation-delay: calc(var(--i, 0) * 22ms);
}

@keyframes simgo-deal {
    0%   { transform: rotateY(90deg); opacity: 0; }
    100% { transform: rotateY(0deg); opacity: 1; }
}

/* ---------- Buttons, help, credit ---------- */

.simgo-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 18px 0 8px;
}

.simgo .simgo-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 10px 20px;
    border: 2px solid var(--simgo-accent);
    border-radius: var(--simgo-radius);
    background: var(--simgo-accent);
    color: #ffffff;
    font-family: var(--simgo-font);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    text-transform: none;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.simgo .simgo-btn:hover {
    border-color: var(--simgo-accent-hover);
    background: var(--simgo-accent-hover);
}

.simgo .simgo-btn[disabled] {
    opacity: 0.6;
    cursor: progress;
}

.simgo .simgo-help {
    max-width: 520px;
    margin: 8px auto 0;
    font-size: 14px;
    line-height: 1.5;
    opacity: 0.85;
}

.simgo .simgo-credit {
    margin: 12px 0 0;
    font-size: 12px;
    opacity: 0.8;
}

.simgo .simgo-credit a {
    color: inherit;
}

.simgo .screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 480px) {
    .simgo-board {
        padding: 8px;
    }

    .simgo-grid,
    .simgo-row {
        gap: 3px;
    }

    .simgo .simgo-cell {
        padding: 2px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .simgo-board.is-dealing .simgo-cell {
        transition: none;
        animation: none;
    }
}
