/* RibhLab Games: accessible local-only games in three languages */
.games-site{--game-ink:#172a44;--game-aqua:#9ce4d6;--game-dark:#10223a;color:var(--game-ink);padding-bottom:76px}
.games-hero{padding-top:46px;padding-bottom:38px}
.games-hero h1{font-family:Outfit,"DM Sans",sans-serif;font-size:clamp(2.4rem,5vw,4.4rem);font-weight:850;letter-spacing:-.045em;line-height:1.12;margin:12px 0 14px;color:#17283d}
html[dir=rtl] .games-hero h1{font-family:"IBM Plex Sans Arabic",sans-serif;letter-spacing:0}
.games-hero>p{max-width:760px;font-size:1.06rem;line-height:1.9;color:#587084;margin:0}
.games-kicker{display:inline-block;font-size:.72rem;font-weight:850;letter-spacing:.15em;text-transform:uppercase;color:#246c80;margin-top:24px}
.games-crumb{font-size:.8rem;color:#657789}.games-crumb a{text-decoration:underline;color:#345976}
.games-gallery{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:22px;padding-bottom:32px}
.games-card{display:flex;gap:24px;align-items:flex-start;padding:34px;border:1px solid #cbdce4;border-radius:23px;background:linear-gradient(142deg,#fff 30%,#f1f8fa);box-shadow:0 14px 35px rgba(12,40,67,.05);text-decoration:none;color:inherit;min-height:230px;transition:transform .15s,box-shadow .15s}
.games-card:hover,.games-card:focus-visible{transform:translateY(-3px);box-shadow:0 18px 42px rgba(12,40,67,.12);outline-color:#2c87a4}
.games-card-symbol{display:grid;place-items:center;flex:0 0 92px;height:92px;border-radius:22px;background:#152c44;color:#b9f1e5;font-size:3.5rem;line-height:1}
.games-card:nth-child(2) .games-card-symbol{background:#284b6b;color:#fff0bc}
.games-card h2{font-size:1.65rem;margin:0 0 8px;color:#17304a}
.games-card p{font-size:.93rem;line-height:1.85;color:#5b7082;margin:0 0 18px}
.games-cta{font-weight:800;font-size:.9rem;color:#16748b}
.games-privacy,.games-instructions,.games-muted{color:#627684;font-size:.84rem;line-height:1.8}
.games-inner{padding-top:27px;padding-bottom:25px}
.games-play-layout,.games-words-layout{display:grid;grid-template-columns:minmax(0,550px) minmax(250px,1fr);gap:27px;align-items:start}
.games-words-layout{grid-template-columns:minmax(0,580px) minmax(250px,1fr)}
.chess-area{min-width:0}
.games-status{font-size:1.02rem;font-weight:800;color:#1e5571;min-height:1.8em;margin:0 0 12px}
.chess-board{width:100%;max-width:550px;display:grid;grid-template-columns:repeat(8,minmax(0,1fr));aspect-ratio:1;overflow:hidden;border:8px solid #293e51;border-radius:11px;box-shadow:0 13px 32px #0c27352c;direction:ltr}
.chess-square{border:0;border-radius:0;min-width:0;min-height:0;aspect-ratio:1;display:grid;place-items:center;position:relative;font-family:"DejaVu Sans","Segoe UI Symbol",serif;font-size:clamp(23px,4.7vw,51px);line-height:1;cursor:pointer;padding:0;text-shadow:0 1px 1px #0002;touch-action:manipulation;user-select:none}
.chess-square.light{background:#f2e2c6}.chess-square.dark{background:#9c7560}
.chess-square:focus-visible{outline:4px solid #2c8fb6;outline-offset:-4px;z-index:2}
.chess-square.selected{box-shadow:inset 0 0 0 100px #f6cc4990}
.chess-square.target::after{content:"";position:absolute;pointer-events:none;border-radius:50%;width:24%;height:24%;background:#1a8b67a6;z-index:1}
.chess-square.target:not(:empty)::after{border:5px solid #14865d80;width:78%;height:78%;background:transparent}
.chess-square:disabled{cursor:default}
.chess-rank,.chess-file{position:absolute;font:bold 10px "DM Sans",sans-serif;color:#233441;pointer-events:none}
.chess-rank{top:3px;left:3px}.chess-file{bottom:2px;right:4px}
.games-panel{background:#fff;border:1px solid #d9e4eb;border-radius:20px;padding:24px;box-shadow:0 10px 30px #0e30420d}
.games-panel h2{font-size:1.15rem;margin:21px 0 13px;color:#173c58}
.games-panel>label,.word-form>label{display:block;font-size:.82rem;font-weight:800;margin-bottom:9px}
.games-panel select,.word-form input{font:inherit;color:#263d4e;border:1px solid #b7cfdc;background:#f9fcfd;border-radius:9px;padding:11px;width:100%;min-width:0}
.games-actions{display:flex;flex-wrap:wrap;gap:9px;margin-top:15px}
.games-actions button,.chess-promotion button,.words-top button,.word-form button{background:#1c5d74;color:#fff;border:0;border-radius:9px;padding:10px 16px;cursor:pointer;font-weight:750;font:inherit;min-height:43px}
.games-actions button:disabled{opacity:.45;cursor:not-allowed}
.games-actions button:hover:not(:disabled),.words-top button:hover,.word-form button:hover{background:#17475b}
.games-actions button:focus-visible,.word-form button:focus-visible{outline:3px solid #e7ad55;outline-offset:2px}
.chess-moves{display:grid;gap:5px;max-height:240px;overflow-y:auto;font-family:"DM Sans",monospace;direction:ltr;text-align:left;padding-left:29px}
.chess-moves li{padding:3px 6px;border-bottom:1px solid #ecf0f2;font-size:.88rem}
.chess-promotion{padding:12px;margin-top:16px;border-radius:9px;background:#e7f6f3}
.chess-promotion[hidden]{display:none}
.chess-promotion h3{font-size:1rem;margin:0 0 8px}
#chess-promotion-options{display:flex;gap:7px;flex-wrap:wrap}
.chess-promotion button{background:#294c75}
.word-grid{display:grid;gap:7px;margin:25px auto;max-width:390px;direction:ltr}
.word-row{display:grid;grid-template-columns:repeat(5,1fr);gap:7px;direction:ltr}
.tile{display:grid;place-items:center;min-width:0;aspect-ratio:1;border:2px solid #b7cbd0;border-radius:8px;font:bold clamp(1rem,4vw,1.8rem) "IBM Plex Sans Arabic","DM Sans",sans-serif;color:#273b52;background:#fbfdfd;line-height:1.1}
.tile.correct{background:#268065;border-color:#268065;color:#fff}
.tile.present{background:#c28a22;border-color:#c28a22;color:#fff}
.tile.absent{background:#647483;border-color:#647483;color:#fff}
.word-form{max-width:460px;margin:auto}.word-form>div{display:flex;gap:9px}
.word-form input{flex:1;font-size:1.05rem;letter-spacing:.07em}
.word-form button{flex:0 0 auto}
.word-clue{font-weight:700;color:#2e5f75;background:#eaf5f7;padding:10px 14px;border-radius:9px}
.words-top{display:flex;justify-content:space-between;align-items:center;gap:10px}
.word-count{font-weight:850;color:#315d76}
.word-legend{padding:0;list-style:none;display:grid;gap:10px}
.word-legend li{display:flex;align-items:center;gap:12px;font-size:.9rem}
.word-legend .tile{flex:0 0 37px;width:37px;height:37px;font-size:1rem;border-radius:6px}
.games-words-layout .games-status{margin:17px 0 0}
@media(max-width:980px){.games-gallery,.games-play-layout,.games-words-layout{grid-template-columns:minmax(0,1fr)}.games-play-layout{max-width:750px}.games-panel{max-width:750px}}
@media(max-width:620px){.games-card{padding:23px;gap:15px;min-height:0}.games-card-symbol{flex-basis:62px;height:62px;font-size:2.4rem}.games-card h2{font-size:1.3rem}.games-hero{padding-top:24px}.games-play-layout{gap:18px}.chess-board{border-width:4px}.chess-square{font-size:clamp(22px,9vw,41px)}.chess-rank,.chess-file{font-size:8px}.games-panel{padding:18px}.word-form>div{gap:6px}.word-form button{padding-inline:13px}}
@media(prefers-reduced-motion:reduce){.games-card{transition:none}}


/* Direct online chess, peer-to-peer via invitation link */
.chess-online{margin-top:16px;padding:17px;border:1px solid #b7d5e0;background:#f1f9fa;border-radius:14px}
.chess-online[hidden]{display:none}.chess-online>p{line-height:1.8;color:#44657a;font-size:.86rem}
.chess-online-actions{display:flex;flex-wrap:wrap;gap:9px;align-items:center}
.chess-online-actions label{font-weight:800;font-size:.82rem;flex-basis:100%}
.chess-online-actions input{width:100%;min-width:0;border:1px solid #90adba;border-radius:9px;padding:12px;font-family:monospace;font-size:1rem;direction:ltr;letter-spacing:.06em}
.chess-online-actions button{background:#17667e;color:white;border:0;border-radius:9px;padding:10px 13px;font:inherit;font-weight:750;min-height:42px;cursor:pointer}
.chess-online-actions button:hover{background:#124d61}
.chess-online-status{color:#135b58!important;font-weight:800}
.chess-online button[hidden]{display:none}
/* Genuine shared-letter crossword: one input per square, numbered across/down clues */
.games-crossword-layout{grid-template-columns:minmax(0,650px) minmax(260px,1fr)}
.crossword-panel{min-width:0}
.crossword-scroll{max-width:100%;overflow:auto;padding:3px 2px 14px;overscroll-behavior-x:contain}
.crossword-grid{display:grid;width:max-content;min-width:100%;max-width:650px;direction:ltr;gap:2px;background:#263d53;padding:5px;border:4px solid #263d53;border-radius:9px;box-shadow:0 10px 24px #0a26351d}
.crossword-square{width:clamp(25px,2.55vw,35px);aspect-ratio:1;position:relative;background:#fff;display:flex;align-items:center;justify-content:center}
.crossword-square.blocked{background:#263d53}
.crossword-square>input{width:100%;height:100%;min-width:0;border:0;border-radius:0;padding:8px 1px 0;text-align:center;background:transparent;font-family:"IBM Plex Sans Arabic","DM Sans",sans-serif;font-weight:850;font-size:clamp(14px,1.7vw,23px);text-transform:uppercase;color:#163851;outline:none;direction:ltr}
.crossword-square>input.active{background:#daecff}
.crossword-square>input:focus{background:#e9f7ca!important;outline:3px solid #46a189;outline-offset:-3px;z-index:1}
.crossword-square>input.verified-good{box-shadow:inset 0 -5px #41a57e}
.crossword-square>input.verified-bad{box-shadow:inset 0 -5px #d35b5b}
.crossword-number{position:absolute;top:1px;left:2px;font-size:9px;font-weight:900;color:#31627b;line-height:1;z-index:2;pointer-events:none;font-family:sans-serif}
.crossword-clues{display:grid;gap:24px}
.crossword-clues h3{margin:0 0 10px;color:#1a5b72;font-size:1.05rem}
.crossword-clue-list{list-style:none;padding:0;margin:0;display:grid;gap:7px}
.crossword-clue-list button{width:100%;border:1px solid #e0eaf1;border-radius:9px;text-align:start;background:#f7fafb;padding:10px 13px;font:inherit;font-size:.85rem;line-height:1.55;color:#344b61;cursor:pointer}
.crossword-clue-list button:hover,.crossword-clue-list button.active{background:#e7f5eb;border-color:#68ad87}
.crossword-clue-list button.solved{border-inline-start:4px solid #269b68}
.crossword-active-clue{border-radius:10px;background:#e9f4f3;color:#225c62;padding:12px 14px;font-weight:800;min-height:50px}
.crossword-progress{font-size:.84rem;font-weight:800;color:#2a6576}
.crossword-actions{gap:7px;margin:11px 0 16px}
.crossword-actions button{padding:9px 12px;font-size:.8rem}
@media(max-width:1100px){.games-crossword-layout{grid-template-columns:1fr}.crossword-grid{max-width:none}}
@media(max-width:650px){.crossword-grid{min-width:max-content}.crossword-square{width:26px}.crossword-square>input{font-size:16px}.crossword-number{font-size:8px}.crossword-scroll{margin-inline:-6px}}
