/* Dara — pits scooped in sand, pebbles against seeds, inside a woven zigzag border. */
.da-col { padding: 4px 8px 6px; gap: 6px; }
.da-wrap { direction: ltr; flex: none; }
.da-frame {
  flex: none; padding: 11px; border-radius: 20px;
  background:
    linear-gradient(135deg, #C4532D 25%, transparent 25%) -9px 0 / 18px 18px,
    linear-gradient(225deg, #C4532D 25%, transparent 25%) -9px 0 / 18px 18px,
    linear-gradient(315deg, #1C1009 25%, transparent 25%) 0 0 / 18px 18px,
    linear-gradient(45deg, #1C1009 25%, transparent 25%) 0 0 / 18px 18px,
    #E8B04A;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5), inset 0 0 0 2px #1C1009;
}
.da-board {
  position: relative; display: grid; grid-template-columns: repeat(6, 1fr); grid-template-rows: repeat(5, 1fr);
  width: 300px; height: 250px; border-radius: 12px; overflow: hidden;
  background:
    radial-gradient(120% 90% at 30% 15%, rgba(255, 240, 200, 0.5), rgba(255, 240, 200, 0) 60%),
    repeating-linear-gradient(172deg, rgba(120, 72, 24, 0.09) 0 3px, rgba(255, 236, 190, 0.07) 3px 9px, transparent 9px 17px),
    linear-gradient(160deg, #EBC583, #D9A55C 60%, #C98E48);
  box-shadow: inset 0 0 0 2px #1C1009, inset 0 0 26px rgba(110, 60, 15, 0.45);
}
.da-pit {
  position: relative; margin: 0; padding: 0; border: 0; background: none; cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.da-pit::before {
  content: ""; position: absolute; top: 11%; right: 11%; bottom: 11%; left: 11%; border-radius: 50%;
  background: radial-gradient(circle at 50% 30%, #8C5A28, #A87238 48%, #C39050 76%, #D6A866);
  box-shadow: inset 0 5px 9px rgba(58, 28, 6, 0.6), inset 0 -3px 5px rgba(255, 232, 180, 0.35), 0 1.5px 0 rgba(255, 238, 196, 0.6);
}
.da-pit::after {
  content: ""; position: absolute; top: 39%; right: 39%; bottom: 39%; left: 39%; border-radius: 50%;
  background: #FBEFD9; box-shadow: 0 0 0 4px rgba(251, 239, 217, 0.3); opacity: 0; transform: scale(0.4);
  transition: opacity 0.15s linear, transform 0.15s ease-out;
}
.da-pit.is-go::after { opacity: 0.95; transform: scale(1); }
.da-pit.is-last::before { box-shadow: inset 0 5px 9px rgba(58, 28, 6, 0.6), inset 0 -3px 5px rgba(255, 232, 180, 0.35), 0 0 0 2.5px rgba(196, 83, 45, 0.85); }
.da-pit:focus-visible { outline: 3px solid #1C1009; outline-offset: -4px; border-radius: 50%; }

.da-stones { position: absolute; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; }
.da-stone {
  position: absolute; width: 16.6667%; height: 20%;
  transition: left 0.26s cubic-bezier(0.3, 0.9, 0.4, 1), top 0.26s cubic-bezier(0.3, 0.9, 0.4, 1), transform 0.2s ease-out, opacity 0.3s linear;
}
.da-stone i { position: absolute; display: block; }
/* a river pebble */
.da-stone--a i {
  top: 22%; right: 20%; bottom: 22%; left: 20%; border-radius: 52% 48% 45% 55% / 56% 50% 50% 44%;
  background: radial-gradient(circle at 34% 26%, #FFFFFF, #E9E1D0 38%, #B3A68D 78%, #8B7D63);
  box-shadow: 0 3px 4px rgba(40, 18, 4, 0.6), inset 0 -3px 5px rgba(80, 62, 36, 0.35);
}
/* a dark, glossy seed */
.da-stone--b i {
  top: 16%; right: 28%; bottom: 16%; left: 28%; border-radius: 50% 50% 48% 52% / 58% 58% 42% 42%;
  background: radial-gradient(ellipse at 36% 24%, #D9744A, #8E2C14 42%, #4A1208 82%);
  box-shadow: 0 3px 4px rgba(40, 18, 4, 0.65), inset 0 -2px 4px rgba(0, 0, 0, 0.4);
}
.da-stone--b i::after {
  content: ""; position: absolute; top: 18%; bottom: 18%; left: 48%; width: 5%; border-radius: 3px; background: rgba(28, 8, 3, 0.55);
}
.da-stone.is-sel { transform: translateY(-9%) scale(1.14); z-index: 2; }
.da-stone.is-sel i { box-shadow: 0 7px 8px rgba(40, 18, 4, 0.55), 0 0 0 3px #FBEFD9; }
.da-stone.is-row i { box-shadow: 0 3px 4px rgba(40, 18, 4, 0.6), 0 0 0 3px #F28C28, 0 0 14px 4px rgba(255, 214, 120, 0.9); }
.da-stone.is-prey i { box-shadow: 0 3px 4px rgba(40, 18, 4, 0.6), 0 0 0 3px #1C1009, 0 0 0 5px #FBEFD9; animation: da-prey 0.9s ease-in-out infinite alternate; }
.da-stone.is-out { transform: translateY(-40%) scale(0.2); opacity: 0; transition: transform 0.36s ease-in, opacity 0.36s linear; }
.da-stone.is-drop { animation: da-drop 0.28s ease-out; }
@keyframes da-drop { from { transform: translateY(-34%) scale(1.3); opacity: 0.2; } to { transform: none; opacity: 1; } }
@keyframes da-prey { from { transform: scale(0.92); } to { transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) {
  .da-stone, .da-stone.is-out { transition-duration: 0.01s; }
  .da-stone.is-drop, .da-stone.is-prey i { animation: none; }
}

/* the two sides: stones in hand while placing, stones on the board afterwards */
.da-sides { direction: ltr; flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; max-width: 640px; }
.da-side {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; column-gap: 8px; min-width: 0; padding: 5px 11px; border-radius: 14px;
  border: 1px solid transparent; opacity: 0.66; transition: opacity 0.2s linear, border-color 0.2s linear, background-color 0.2s linear;
}
.da-side.is-turn { opacity: 1; border-color: var(--gold); background: rgba(242, 160, 61, 0.12); }
.da-side .da-pip { grid-row: 1 / 3; }
.da-side__name { grid-column: 2; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; line-height: 1.2; color: var(--parchment); }
.da-side b { grid-column: 3; grid-row: 1 / 3; font-size: 1.5rem; line-height: 1; font-variant-numeric: tabular-nums; color: var(--gold-soft); }
.da-side.is-low b { color: #FF8A5C; }
.da-side small { grid-column: 2; grid-row: 2; font-size: 11.5px; line-height: 1.2; color: var(--mist-dim); white-space: nowrap; }
html[lang="ar"] .da-sides { direction: rtl; }
html[lang="ar"] .da-side small { font-size: 12.5px; }
.da-pip { flex: none; display: inline-block; width: 17px; height: 17px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); }
.da-pip--a { border-radius: 52% 48% 45% 55% / 56% 50% 50% 44%; background: radial-gradient(circle at 34% 26%, #FFFFFF, #E9E1D0 40%, #9C8E73); }
.da-pip--b { width: 12px; border-radius: 50% 50% 48% 52% / 58% 58% 42% 42%; background: radial-gradient(ellipse at 36% 24%, #D9744A, #8E2C14 45%, #4A1208); }

.da-status { flex: none; gap: 8px; min-height: 30px; font-size: 0.97rem; line-height: 1.2; }
.da-hot { color: var(--gold-soft); }

/* the new-game panel */
.da-opts { display: grid; gap: 12px; text-align: start; }
.da-opt { transition: opacity 0.2s linear; }
.da-opt.is-off { opacity: 0.35; pointer-events: none; }
.da-opt__label { margin: 0 0 5px; font-size: 12px; font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mist); }
html[lang="ar"] .da-opt__label { letter-spacing: 0; font-size: 13px; }
.da-opts .fa-seg { display: flex; width: 100%; border-radius: 16px; }
.da-opts .fa-seg button { flex: 1 1 0; min-width: 0; min-height: 44px; padding: 4px 6px; border-radius: 13px; line-height: 1.15; }

@media (max-width: 350px) {
  .da-side { padding: 4px 8px; column-gap: 6px; }
}
/* a phone on its side: the two sides to the left of the board, whose turn to the right */
@media (orientation: landscape) and (max-height: 500px) {
  .da-col { flex-direction: row; gap: 10px; padding: 4px 10px; }
  .da-wrap { width: auto; }
  .da-sides { grid-template-columns: 1fr; width: 150px; }
  .da-status { width: 150px; flex-direction: column; padding: 0; }
}
