:root{--ink:#faf1db;--muted:#c1c8b5;--gold:#f3ce8c;--line:#b69f704f;--panel:#203d32;--deep:#102a22;color-scheme:dark}
html{min-height:100%;background:#11291f}body{min-height:100vh;margin:0;background:radial-gradient(ellipse at 80% 0%,#315344 0,transparent 43rem),#10281f;color:var(--ink);font-family:Tahoma,Arial,sans-serif;-webkit-text-size-adjust:100%}*,*:before,*:after{box-sizing:border-box}main{padding-bottom:max(24px,env(safe-area-inset-bottom))}h1,h2{line-height:1.35;text-wrap:balance}a{color:var(--gold);text-underline-offset:.22em}button,input,select{font-family:inherit}button,a,input,select,summary{-webkit-tap-highlight-color:transparent}a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline:3px solid #ffe4a5;outline-offset:2px}input:not([type=checkbox]),select{background:#162e25;color:var(--ink);border:1px solid #9ca98c;border-radius:10px;font-size:max(16px,1em);min-width:0}input::placeholder{color:#c4cfbf}button:not(:disabled),summary{cursor:pointer}
.brand{position:relative;background:#112a21;border-bottom:1px solid var(--line);padding:12px 16px}.brand strong{color:#f1dab0}.game,section:is(#setup,#room),.category,.gamecard{border-color:var(--line);box-shadow:0 6px 20px #07181030}footer{color:var(--muted);border-color:var(--line)}[hidden]{display:none!important}
body.home main{max-width:1020px}.home .hero{text-align:start;padding:clamp(22px,5vw,46px);border-radius:18px;border:1px solid #ac956252;background:repeating-linear-gradient(135deg,transparent 0 18px,#b7a8750b 18px 19px),linear-gradient(110deg,#162e26,#355744);box-shadow:inset 0 0 0 5px #162d2226}.home .hero h1{font-size:clamp(26px,5vw,44px);color:#fff1cc;margin:0}.home .hero p{margin:5px 0 0}.quickplay{display:grid;grid-template-columns:1.5fr 1fr 1fr;gap:12px;margin:16px 0}.quickplay a{display:grid;grid-template-rows:1fr auto;text-decoration:none;border-radius:14px;padding:14px;min-height:128px;border:1px solid var(--line);background:#223d32;color:#fff0cf;text-align:start}.quickplay a:first-child{background:#4a3228}.quickplay a:hover,.quickplay a:focus-visible{border-color:var(--gold)}.quickplay strong{font-size:18px}.mini-board,.mini-four,.mini-xo{justify-self:center;align-self:center;display:block;direction:ltr;margin-bottom:8px}.mini-board{width:98px;height:48px;background:repeating-conic-gradient(from 167deg at 50% 100%,#7d3526 0 26deg,transparent 0 360deg) 0 0/16.66% 50% repeat-x,repeating-conic-gradient(from -13deg at 50% 0%,#8c402e 0 26deg,transparent 0 360deg) 0 100%/16.66% 50% repeat-x,#ebc58f;border:4px solid #9d714a;box-shadow:0 2px 4px #0005;border-radius:4px;position:relative}.mini-board:after{content:'';position:absolute;inset:0 47%;background:#744429}.mini-four{width:57px;height:43px;border:3px solid #c59a66;border-radius:5px;background:radial-gradient(circle,#f2d18b 32%,transparent 36%) 0 0/13px 12px,#9b673a}.mini-xo{color:#dcb879;font:700 28px/1.2 monospace;letter-spacing:-2px}.quickplay span:last-child{align-self:end}.home .search{margin-top:0}.home main>a[href="/profile.html"]{text-align:end!important}.category,.gamecard{border-radius:14px}.home .tag{display:none}
.bg main{max-width:800px;margin:auto;padding:10px clamp(8px,2.8vw,22px) 28px}.bg .mast{display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);padding:4px 2px 9px;margin-bottom:10px}.bg .mast h1{font-size:clamp(23px,4vw,32px);margin:0}.bg .mast a{font-size:15px;text-decoration:none}.bg #onlineRoom{padding:10px 12px;background:#203d32;border:1px solid var(--line);border-radius:14px;margin:0 auto 8px}.bg #onlineRoom h2{font-size:19px;margin:0 0 6px}.bg p{margin:5px 0;line-height:1.45}.bg #roomMessage{color:#ece3ca;font-size:14px}.bg #inviteBox{display:flex;align-items:center;justify-content:center;gap:6px;flex-wrap:wrap;font-size:13px}.bg #inviteBox br{display:none}.bg #inviteCode{direction:ltr;unicode-bidi:isolate;letter-spacing:1px;color:#ffe3a8}.bg #whats,.bg #copyRoom{display:inline-flex;align-items:center;justify-content:center;min-height:40px;font:700 14px Tahoma,Arial;border-radius:9px;text-decoration:none;padding:6px 9px;margin:0}.bg #whats{color:#193529;background:#f0d091}.bg #copyRoom{background:#2c4c3c;border:1px solid #839579;color:#fff0cf}.bg .extras{font-size:14px;margin:12px auto;color:#e3cd9f}.bg .extras summary{padding:8px}.bg .names{justify-content:center}.bg .names input{width:48%;text-align:center;padding:7px;margin:1px}.bg .names:has(input[readonly]):has(#a[readonly]){display:none}.bg #modeLabel{font-size:14px;color:#decba6}.bg #status{margin:4px 0;font-size:clamp(19px,3.6vw,23px)}.bg .tablewrap{margin:6px 0}.bg .tablewrap .board{border-color:#986e42;box-shadow:0 4px 18px #06190f66,inset 0 0 0 2px #b98345;grid-template-rows:repeat(2,clamp(113px,32vw,210px))}.bg .tablewrap #dice:empty{min-height:0;margin:0}.bg .actions{display:flex;justify-content:center;align-items:stretch;gap:6px}.bg .actions button{margin:2px 0;min-height:42px;padding:8px 10px;font-size:15px}.bg #score{border-top:1px solid var(--line);padding-top:7px}.bg #lobby p{font-size:14px}.bg #lobby input{max-width:100%;padding:8px}.bg #clockNotice:empty{display:none}.bg #onlineRoom:has(#lobby:not([hidden]))~.tablewrap{opacity:.85}
@media(max-width:600px){.home main{padding:12px}.quickplay{grid-template-columns:1.2fr 1fr 1fr;gap:6px;margin:10px 0}.quickplay a{padding:8px 5px;min-height:96px;text-align:center}.quickplay strong{font-size:15px}.mini-board{width:70px;height:40px}.mini-xo{font-size:23px}.home .hero{padding:16px}.bg #inviteBox{row-gap:4px}.bg #inviteBox .codeLine{width:100%}.brand{padding:9px 12px}.bg #onlineRoom{padding:7px 9px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;animation-duration:.01ms!important;transition-duration:.01ms!important}}

.coffeeNav{direction:rtl;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;max-width:960px;margin:0 auto;padding:2px 12px;border-bottom:1px solid var(--line);background:#122c23;line-height:1.3}
.coffeeNav>a,.coffeeNav>button{display:inline-flex;justify-content:center;align-items:center;justify-self:start;min-height:44px;width:auto;margin:0;padding:4px 2px;border:0;background:transparent;color:#f2d498;font:600 15px/1.3 Tahoma,Arial,sans-serif;white-space:nowrap;text-decoration:none}
.coffeeNav>:first-child{grid-column:1;grid-row:1}.coffeeNav>:last-child{grid-column:3;grid-row:1;justify-self:end}.coffeeNav>#homeShare{grid-column:2;grid-row:1;justify-self:center;color:#ced9c9;font-size:13px}

.coffeeNav{display:flex;align-items:center;gap:clamp(5px,1.8vw,14px);justify-content:flex-start}.coffeeNav>#siteBack{font-size:14px;color:#fff1ce}.coffeeNav>#siteBack:disabled{opacity:.42}.coffeeNav>:last-child{margin-inline-start:auto}.coffeeNav>#homeShare{margin-inline-start:auto}.coffeeNav>#homeShare+:last-child{margin-inline-start:0}@media(max-width:440px){.coffeeNav{padding-inline:8px}.coffeeNav>a,.coffeeNav>button{font-size:13px}}
.bg .tablewrap .board {
  --point-height: clamp(132px, 36vw, 220px);
  grid-template-rows: repeat(2, var(--point-height));
}
.bg .point { gap: 1px; }
.bg .point > .piece {
  width: min(95%, 36px, calc((var(--point-height) - 42px) / 5));
  aspect-ratio: 1;
}
.bg .point > span:last-child:not(.piece):not(:first-child) {
  line-height: 12px;
  font-size: 11px;
}

main .cafePageTitle{font-size:clamp(22px,4vw,30px);line-height:1.35;margin:8px 0 12px;color:var(--ink)}.coffeeNav{width:100%;box-sizing:border-box}.coffeeNav>a,.coffeeNav>button{flex-shrink:0}@media(max-width:360px){.coffeeNav{gap:4px;padding-inline:5px}.coffeeNav>a,.coffeeNav>button,.coffeeNav>#siteBack{font-size:12px}}

.coffeeNav #changeLanguage{margin-inline-start:0;font:600 13px/1.25 Tahoma,Arial,sans-serif;flex-shrink:0;min-height:44px}
.coffeeNav a[href$="profile.html"]{margin-inline-start:auto}
html[lang=en] .coffeeNav{direction:ltr}html[lang=en] .coffeeNav>a,html[lang=en] .coffeeNav>button{font-family:Arial,sans-serif}
@media(max-width:520px){.coffeeNav{flex-wrap:wrap;column-gap:8px;row-gap:0}.coffeeNav>a,.coffeeNav>button,.coffeeNav>#siteBack{font-size:13px}.coffeeNav #homeShare{margin-inline-start:0}}

.coffeeNav .navShort{display:none}
@media(max-width:600px){
 .coffeeNav,html[lang=en] .coffeeNav{display:flex;flex-wrap:nowrap;justify-content:space-between;gap:2px;padding:2px 6px;align-items:center}
 .coffeeNav>:is(a,button),.coffeeNav>#homeShare,.coffeeNav>#siteBack,.coffeeNav>#changeLanguage,.coffeeNav>a[href$="profile.html"]{margin:0;padding:0 3px;min-width:42px;height:44px;min-height:44px;flex:0 0 auto;font-size:14px;line-height:1.2}
 .coffeeNav .navWide{display:none}.coffeeNav .navShort{display:inline}
 .coffeeNav #siteBack .navShort{font-size:23px}.coffeeNav #homeShare svg{width:20px;height:20px}
 .coffeeNav #changeLanguage{border:1px solid #b69f705e;border-radius:8px;padding:0 6px;min-height:36px;height:36px}
}
/* Shared café palette and controls */
:root {
  --ink:#faf2df; --muted:#bdcfc2; --gold:#f3cf8e; --line:#90aa9361;
  --deep:#0d241e; --panel:#1a382e; --raised:#234637;
  --cafe-font:system-ui,-apple-system,"Segoe UI",Tahoma,Arial,sans-serif;
}
html body {
  background:radial-gradient(ellipse at 78% 0%,#254c3b 0,transparent 42rem),#0d241e;
  color:var(--ink);font-family:var(--cafe-font);line-height:1.5;
}
html[lang=ar] body {font-family:"Geeza Pro","Noto Sans Arabic",Tahoma,var(--cafe-font)}
body .coffeeNav {
  background:#102a22;border-block-end:1px solid #b69a605c;
  box-shadow:0 3px 14px #081b141c;max-width:1020px;
}
body .coffeeNav>a,body .coffeeNav>button {font-family:inherit;border-radius:9px}
.coffeeNav a:not(#changeLanguage):is([href="/"],[href="/en-index.html"],[href="/index.html"])::before {
  content:"";width:27px;height:27px;flex:none;background:url("/cafe-icon-180.png") center/cover;
  border-radius:7px;margin-inline-end:6px;
}
body .coffeeNav #changeLanguage {color:var(--ink);border:1px solid var(--line);border-radius:8px;padding-inline:9px}
body main :is(h1,h2,h3) {color:var(--ink);line-height:1.35}
body main :is(.cafePageTitle,.arenaTitle),body main.dom>h1 {font-size:clamp(23px,3.6vw,33px);text-align:start;margin:12px 0 16px}
body main :is(.game,.gamecard,.category,.players),body main>section:not(.mast),body main.dom>details {
  border:1px solid var(--line);border-radius:15px;background:var(--panel);
  box-shadow:0 4px 14px #04160e24;
}
body main :is(input:not([type=checkbox]):not([type=radio]),select) {
  font-family:inherit;color:var(--ink);background-color:#102d24;border:1px solid #728e7d;border-radius:9px;max-width:100%;
}
body main :is(button,input,select,summary) {font-family:inherit}
body main :is(.controls,.players,#setup,#dash) button:not(.secondary),
body main :is(#save,#create,#join,#again,#reset,#make,#draw,#upgrade) {
  border-radius:10px;background-color:#ebc98e;color:#193228;font-weight:700;
}
body main button.secondary,body main :is(#clear,#clearScore,#copy,#copyRoom) {
  background-color:#244437;color:#f2e8cd;border:1px solid var(--line);border-radius:10px;
}
body main .controls button[aria-pressed=true] {box-shadow:inset 0 0 0 2px var(--gold)}
body main :is(.scores>div,.scorebox),body main.dom #score li {
  background:#122e25;border:1px solid var(--line);border-radius:10px;color:var(--ink);
}
body main.dom #score .own-score {border-color:var(--gold)}
body main :is(.scores,.scorebox) strong,body main.dom #score strong {color:var(--gold);font-variant-numeric:tabular-nums}
body main.dom #stats {color:var(--muted);line-height:1.6}
body main.dom details>summary,body main .xoSettings>summary {font-weight:650;color:var(--ink)}
body main.dom label select {margin-inline-start:3px}
body main :is(.category,.gamecard) {text-align:start;background:linear-gradient(145deg,#294c3b,#19382d);padding:14px}
body.home .catalog .category strong,body .catalog .gamecard strong {line-height:1.4}
body .catalog :is(.category,.gamecard) small {color:#c8d8c9}
body.home .category .art,body .catalog .gamecard .art {
  background:#102d2580;border:1px solid #b5aa7d38;border-radius:12px;width:52px;height:52px;
  margin:0 0 10px;font-size:30px;
}
body.home main>.search {background-color:#102d24;min-height:46px;border-color:#6c8977}
body.home main>a[href$="competitions.html"] {box-shadow:inset 3px 0 #c4a56b,0 4px 14px #061e1426}
body footer {font-family:inherit;font-size:.85rem;color:var(--muted);background:transparent;border-color:var(--line)}
@media(hover:hover) {
  .coffeeNav :is(a,button:not(:disabled)):hover {background:#294a3b}
  body .catalog .category:hover,body .catalog .gamecard:focus-within {border-color:var(--gold)}
}
@media(max-width:600px) {
  body .coffeeNav a:not(#changeLanguage)::before {width:22px;height:22px;margin-inline-end:3px}
  body.home main .catalog {gap:9px}
  body.home main .catalog .category,body main .catalog .gamecard {padding:11px}
  body.home .category .art,body .catalog .gamecard .art {height:38px;width:38px;font-size:23px;margin-bottom:6px}
  body main :is(.cafePageTitle,.arenaTitle),body main.dom>h1 {margin:8px 0 10px}
}

/* ALAHWA HEADER REFINEMENT V1 */
body .coffeeNav,html[lang=en] body .coffeeNav{position:relative;direction:rtl;display:flex;flex-wrap:nowrap;align-items:center;justify-content:space-between;gap:clamp(6px,1.3vw,14px);width:100%;max-width:1020px;margin:0 auto;padding:10px clamp(10px,2.2vw,22px);min-height:66px;background:linear-gradient(110deg,#0c241d,#193d30);border-bottom:1px solid #d2ad6b65;box-shadow:0 6px 20px #06171035;overflow:visible}
html[lang=en] body .coffeeNav{direction:ltr}
body .coffeeNav>a,body .coffeeNav>button,body .coffeeNav>#siteBack,body .coffeeNav>#changeLanguage{display:inline-flex;align-items:center;justify-content:center;gap:5px;flex:0 0 auto;margin:0;min-height:44px;padding:7px 10px;color:#f5dfae;font:700 14px/1.3 inherit;text-decoration:none;border:1px solid transparent;border-radius:12px;white-space:nowrap;box-shadow:none;max-width:none}
body .coffeeNav a[href="/"],body .coffeeNav a[href="/index.html"],body .coffeeNav a[href="/en-index.html"]{color:#ffe9b9;font-weight:800}
body .coffeeNav a[href="/"]::before,body .coffeeNav a[href="/index.html"]::before,body .coffeeNav a[href="/en-index.html"]::before{width:30px;height:30px;margin-inline-end:4px;border-radius:9px;box-shadow:0 0 0 1px #e2c38c55}
body .coffeeNav #siteBack{background:#ffffff0b;border-color:#d5b67b30;min-width:44px}
body .coffeeNav #changeLanguage{background:#ffffff0a;border:1px solid #cda96d70;padding-inline:12px;color:#f6e6c7}
body .coffeeNav>a:hover,body .coffeeNav>button:hover{background:#f3ce8a16;border-color:#f3ce8a55}
body .coffeeNav #homeShare{margin:0;min-width:44px}
@media(max-width:600px){body .coffeeNav,html[lang=en] body .coffeeNav{display:grid;grid-template-columns:44px minmax(0,1fr) auto auto;gap:5px;min-height:62px;padding:7px 9px}body .coffeeNav:has(#homeShare){grid-template-columns:44px minmax(0,1fr) 44px auto auto}body .coffeeNav>a,body .coffeeNav>button,body .coffeeNav>#siteBack,body .coffeeNav>#changeLanguage{height:44px;min-height:44px;min-width:0;padding:5px 7px;font-size:13px;justify-self:stretch}body .coffeeNav #siteBack{grid-column:1;grid-row:1;min-width:44px}body .coffeeNav a[href="/"],body .coffeeNav a[href="/index.html"],body .coffeeNav a[href="/en-index.html"]{grid-column:2;grid-row:1;min-width:0;justify-content:center;gap:3px;font-size:14px}body .coffeeNav a[href="/"]::before,body .coffeeNav a[href="/index.html"]::before,body .coffeeNav a[href="/en-index.html"]::before{width:27px;height:27px;margin-inline-end:3px}body .coffeeNav #homeShare{grid-column:3;grid-row:1;min-width:44px}body .coffeeNav a[href$="profile.html"]{grid-column:3;grid-row:1}body .coffeeNav:has(#homeShare) a[href$="profile.html"]{grid-column:4}body .coffeeNav #changeLanguage{grid-column:4;grid-row:1;padding:4px 7px;font-size:12px}body .coffeeNav:has(#homeShare) #changeLanguage{grid-column:5}body .coffeeNav .navShort{display:inline}body .coffeeNav .navWide{display:none}body .coffeeNav #siteBack .navShort{font-size:24px}body .coffeeNav #homeShare svg{width:22px;height:22px}}
@media(max-width:365px){body .coffeeNav,html[lang=en] body .coffeeNav{gap:3px;padding-inline:5px;grid-template-columns:40px minmax(0,1fr) auto auto}body .coffeeNav:has(#homeShare){grid-template-columns:40px minmax(0,1fr) 40px auto auto}body .coffeeNav>a,body .coffeeNav>button,body .coffeeNav>#changeLanguage{font-size:12px;padding-inline:4px}body .coffeeNav a[href="/"]::before{width:23px;height:23px}}

/* ALAHWA LOGO HEADER V2 */
body .coffeeNav a[href="/"],body .coffeeNav a[href="/index.html"],body .coffeeNav a[href="/en-index.html"]{display:inline-flex;align-items:center;gap:9px;font-weight:800;letter-spacing:.1px;color:#ffe8b6}
body .coffeeNav a[href="/"]::before,body .coffeeNav a[href="/index.html"]::before,body .coffeeNav a[href="/en-index.html"]::before{content:"";display:block;width:42px;height:42px;flex:0 0 42px;background:#15392b url('/cafe-icon-180.png') center/contain no-repeat;border:1px solid #d9b875a3;border-radius:13px;box-shadow:0 2px 8px #0005,0 0 0 3px #eac88a14;margin-inline-end:2px}
@media(max-width:600px){body .coffeeNav a[href="/"],body .coffeeNav a[href="/index.html"],body .coffeeNav a[href="/en-index.html"]{gap:5px;padding:3px 2px;font-size:15px}body .coffeeNav a[href="/"]::before,body .coffeeNav a[href="/index.html"]::before,body .coffeeNav a[href="/en-index.html"]::before{width:36px;height:36px;flex-basis:36px;border-radius:11px}}
@media(max-width:365px){body .coffeeNav a[href="/"]::before,body .coffeeNav a[href="/index.html"]::before,body .coffeeNav a[href="/en-index.html"]::before{width:30px;height:30px;flex-basis:30px}}

/* V3 VISIBLE APP NAME IN HEADER */
@media(max-width:600px){body .coffeeNav a[href="/"] .navShort,body .coffeeNav a[href="/index.html"] .navShort,body .coffeeNav a[href="/en-index.html"] .navShort{font-size:0!important;line-height:1}body .coffeeNav a[href="/"] .navShort::after,body .coffeeNav a[href="/index.html"] .navShort::after{content:"عالقهوة";font-size:clamp(15px,4.2vw,19px);font-weight:900;line-height:1.3;white-space:nowrap}body .coffeeNav a[href="/en-index.html"] .navShort::after{content:"3ALAHWA";font-size:clamp(13px,3.8vw,17px);font-weight:900;line-height:1.3;white-space:nowrap}}
