/* Owlypia Anagram Race */

.ar-root {
    --ar-orange: #ff9f1c;
    position: relative;
    overflow: hidden;
    max-width: none;
    margin: 0 auto;
    padding: 20px 14px 26px;
    border-radius: 24px;
    background: var(--wpg-card-gradient, linear-gradient(135deg, #4c03be 0%, #d02878 50%, #ff5630 100%));
    box-shadow: 0 12px 34px rgba(20, 8, 46, 0.45);
    font-family: 'Segoe UI', system-ui, sans-serif;
}

.ar-header { text-align: center; margin-bottom: 12px; }
.ar-title { font-size: clamp(22px, 5vw, 32px); font-weight: 800; color: var(--ar-orange); text-shadow: 0 2px 0 rgba(0,0,0,.35); }
.ar-subtitle { color: #e8ddff; font-size: 14px; }

.ar-levels { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.ar-level-btn {
    border: 2px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08);
    color: #f1e9ff; padding: 7px 16px; border-radius: 999px; font-weight: 700;
    cursor: pointer;
}
.ar-level-btn small { font-size: 11px; opacity: .8; }
.ar-level-btn.ar-level-active { background: var(--ar-orange); border-color: var(--ar-orange); color: #34145e; }

.ar-hud { display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; color: #fff; }
.ar-hud-item strong { color: #ffd166; font-variant-numeric: tabular-nums; }
.ar-new-btn { border: 0; background: #e63946; color: #fff; font-weight: 700; padding: 7px 14px; border-radius: 999px; cursor: pointer; }
.ar-challenge-btn {
    border: 0; background: var(--ar-orange); color: #34145e; font-weight: 800;
    padding: 7px 14px; border-radius: 999px; cursor: pointer;
}
.ar-challenge-btn:disabled,
.ar-new-btn:disabled {
    opacity: .45; cursor: not-allowed;
}
.ar-levels.ar-locked { opacity: .55; pointer-events: none; }

.ar-versus {
    display: flex; align-items: stretch; justify-content: center; gap: 10px;
    flex-wrap: wrap;
    margin: 0 0 12px; padding: 10px 12px;
    background: rgba(0,0,0,.28); border-radius: 16px;
    border: 1px solid rgba(255,209,102,.28);
}
.ar-versus.ar-hidden { display: none; }
.ar-vs-player {
    flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0;
}
.ar-vs-player.ar-vs-you { justify-content: flex-end; text-align: right; }
.ar-vs-player.ar-vs-opp { justify-content: flex-start; text-align: left; }
.ar-vs-av {
    width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
    border: 2px solid rgba(255,209,102,.7); flex-shrink: 0;
}
.ar-vs-meta { min-width: 0; }
.ar-vs-name {
    color: #fff; font-weight: 800; font-size: 13px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px;
}
.ar-vs-score { color: #ffd166; font-weight: 800; font-variant-numeric: tabular-nums; font-size: 18px; }
.ar-vs-found { color: #cbb8ee; font-size: 11px; font-weight: 700; }
.ar-vs-mid {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: var(--ar-orange); font-weight: 900; letter-spacing: 1px; font-size: 14px;
    padding: 0 6px;
}
.ar-vs-lead { font-size: 11px; color: #7bd389; font-weight: 800; letter-spacing: 0; }
.ar-vs-trail { color: #ff8fa3; }

.ar-search-card { text-align: center; }
.ar-search-pulse {
    width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 50%;
    border: 4px solid rgba(255,159,28,.25); border-top-color: var(--ar-orange);
    animation: ar-spin 0.9s linear infinite;
}
@keyframes ar-spin { to { transform: rotate(360deg); } }
.ar-search-title { color: var(--ar-orange); font-size: 22px; font-weight: 800; }
.ar-search-copy { color: #e8ddff; margin: 8px 0 16px; font-size: 14px; }
.ar-cancel-btn {
    border: 0; background: #e63946; color: #fff; font-weight: 800;
    padding: 10px 20px; border-radius: 999px; cursor: pointer;
}
.ar-duel-result { color: #e8ddff; font-weight: 700; margin: 6px 0 10px; }
.ar-win-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.ar-win-btn-alt { background: var(--ar-orange); color: #34145e; }

.ar-stage {
    background: rgba(0,0,0,.22);
    border-radius: 16px;
    padding: 16px 12px;
}
.ar-tiles { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.ar-tile {
    box-sizing: border-box;
    width: 42px; height: 48px;
    margin: 0; padding: 0; border: 0;
    background: #f6efe3; color: #34145e;
    border-radius: 10px; font-weight: 800; font-size: 22px;
    font-family: inherit; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 3px 0 #cbb8a0;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: transform .12s ease, box-shadow .12s ease, opacity .15s ease, background .15s ease;
}
.ar-tile:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 0 #cbb8a0;
}
.ar-tile:active:not(:disabled) {
    transform: translateY(2px);
    box-shadow: 0 1px 0 #cbb8a0;
}
.ar-tile-used {
    opacity: .45;
    background: #cfc6b8;
    color: #6d5b80;
    box-shadow: 0 1px 0 #b5ab9c;
    transform: none;
}
.ar-tile:disabled {
    cursor: default;
    pointer-events: none;
}
.ar-input:focus {
    outline: 3px solid rgba(255, 159, 28, .85);
    outline-offset: 2px;
}
.ar-go:focus {
    outline: 3px solid rgba(255, 209, 102, .7);
    outline-offset: 2px;
}

.ar-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 8px;
    margin: 12px 0 0;
    padding: 0;
}
.ar-input {
    flex: 1; border: 0; border-radius: 12px; padding: 10px 12px;
    font-size: 18px; font-weight: 700; text-transform: uppercase;
    color: #34145e;
}
.ar-go {
    border: 0; background: #2a9d8f; color: #fff; font-weight: 800;
    padding: 10px 16px; border-radius: 12px; cursor: pointer;
}

.ar-hint {
    flex: 1 0 100%;
    box-sizing: border-box;
    min-height: 18px;
    text-align: left;
    color: #ffd166;
    font-weight: 600;
    margin: 7px 0 0;
    padding: 0;
    font-size: 13px;
    line-height: 1.25;
}

.ar-found { margin-top: 8px; min-height: 64px; text-align: center; }
.ar-found-title { color: #ffd166; font-size: 13px; font-weight: 800; margin-bottom: 8px; }
.ar-found-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.ar-word {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 4px 5px;
    border-radius: 8px;
    background: rgba(255,255,255,.07);
}
.ar-word-got { background: rgba(42, 157, 143, .35); }
.ar-slot {
    box-sizing: border-box;
    width: 18px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    color: #fff;
    background: rgba(255,255,255,.16);
    border: 1.5px solid rgba(255,255,255,.28);
}
.ar-slot-empty {
    background: transparent;
    border: 1.5px solid rgba(255,255,255,.38);
    color: transparent;
}
.ar-word-got .ar-slot {
    background: #2a9d8f;
    border-color: #2a9d8f;
    color: #fff;
}
.ar-chip {
    background: rgba(255,255,255,.12); color: #fff; font-weight: 700;
    padding: 4px 8px; border-radius: 8px; font-size: 13px; letter-spacing: .5px;
}

.ar-help { margin-top: 12px; background: rgba(12, 6, 28, 0.34); border-radius: 12px; padding: 10px 14px; color: #e8ddff; font-size: 14px; }
.ar-help summary { cursor: pointer; font-weight: 700; color: #fff; }
.ar-help ul { margin: 8px 0 4px; padding-left: 20px; }

.ar-overlay {
    position: absolute; inset: 0; background: rgba(24,8,50,.82);
    display: flex; align-items: center; justify-content: center;
    z-index: 10; border-radius: 24px; padding: 16px 16px;
    overflow: auto;
}
.ar-overlay.ar-hidden { display: none; }
.ar-win-card {
    box-sizing: border-box;
    text-align: center; padding: 18px 22px 20px;
    background: linear-gradient(160deg, #3d1670, #5b2a92);
    border: 2px solid rgba(255,209,102,.5); border-radius: 20px;
    width: min(100%, 880px);
    max-height: 100%;
    overflow: auto;
}
.ar-win-title { color: var(--ar-orange); font-size: 22px; font-weight: 800; }
.ar-stars { font-size: 40px; margin: 4px 0; }
.ar-star { color: rgba(255,255,255,.22); }
.ar-star-on { color: #ffd166; }
.ar-win-score { color: #fff; font-size: 20px; font-weight: 800; }
.ar-win-meta { color: #cbb8ee; margin-bottom: 10px; }
.ar-answers { text-align: left; margin: 4px 0 14px; }
.ar-answers-label {
    color: #ffd166; font-size: 12px; font-weight: 800;
    letter-spacing: .4px; margin: 8px 0 6px; text-transform: uppercase;
}
.ar-answers-row { display: flex; flex-wrap: wrap; gap: 6px; }
.ar-chip-found { background: #2a9d8f; color: #fff; }
.ar-chip-bonus { background: var(--ar-orange); color: #34145e; }
.ar-chip-missed {
    background: rgba(255,255,255,.08); color: #e8ddff;
    border: 1px dashed rgba(255,255,255,.28);
}
.ar-answers-all { color: #7bd389; font-weight: 700; text-align: center; padding: 6px 0; }
.ar-win-btn { border: 0; padding: 10px 20px; border-radius: 999px; font-weight: 800; cursor: pointer; background: #e63946; color: #fff; }
