/* RakibDigital — Carrom Game page */
.game-wrap { padding: 150px 0 60px; }
.game-hero p { color: var(--muted); max-width: 640px; }
.game-hero .crumb { color: var(--muted); font-size: .88rem; margin-bottom: 14px; }
.game-hero .crumb a { color: var(--acc2); }

.game-shell {
  max-width: 680px;
  margin: 28px auto 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 16px 16px 20px;
}

/* ---- HUD ---- */
.hud {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 14px;
}
.hud-card {
  flex: 1;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  text-align: center;
  transition: border-color .25s, box-shadow .25s;
}
.hud-card.active {
  border-color: var(--acc1);
  box-shadow: 0 0 0 1px var(--acc1), 0 6px 22px rgba(255,107,53,.25);
}
.hud-card .hud-label { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.hud-card .hud-name { font-family: var(--font-d); font-weight: 700; font-size: 1rem; margin-top: 2px; }
.hud-card .hud-name .coin-dot {
  display: inline-block; width: 11px; height: 11px; border-radius: 50%;
  margin-right: 6px; vertical-align: -1px; border: 1px solid rgba(0,0,0,.35);
}
.coin-dot.white { background: #FFF8E7; }
.coin-dot.black { background: #222; }
.hud-card .hud-score { font-family: var(--font-d); font-weight: 800; font-size: 1.7rem; line-height: 1.1; color: var(--acc2); }
.hud-card .hud-coins { font-size: .78rem; color: var(--muted); }
.hud-vs {
  align-self: center;
  font-family: var(--font-d); font-weight: 800; font-size: .95rem; color: var(--muted);
  flex: 0 0 auto;
}

.turn-bar {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 16px; margin-bottom: 14px;
  font-weight: 600; font-size: .95rem;
}
.turn-bar .turn-dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--acc1);
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.5); opacity: .55; } }

/* ---- Board ---- */
.board-zone { position: relative; width: 100%; }
#carromCanvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  cursor: crosshair;
}
#carromCanvas.dragging { cursor: grabbing; }

/* power meter */
.power-wrap { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.power-wrap .power-label { font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); flex: 0 0 auto; font-weight: 600; }
.power-track {
  flex: 1; height: 14px; border-radius: 999px;
  background: var(--bg2); border: 1px solid var(--line); overflow: hidden;
}
.power-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #37c978, #ffd23e 55%, #ff5a3c);
  border-radius: 999px;
  transition: width .06s linear;
}
.power-val { font-family: var(--font-d); font-weight: 700; width: 44px; text-align: right; flex: 0 0 auto; }

/* message line */
.game-msg {
  min-height: 26px; text-align: center; color: var(--acc2);
  font-weight: 600; margin-top: 12px; font-size: .98rem;
}

/* controls */
.game-controls {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 12px;
}
.game-controls .btn { min-height: 46px; padding: 0 22px; font-size: .98rem; }
.btn-sound[aria-pressed="false"] { opacity: .65; }

/* hint */
.game-hint { text-align: center; color: var(--muted); font-size: .85rem; margin-top: 14px; line-height: 1.6; }
.game-hint kbd {
  background: var(--bg2); border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 6px; padding: 1px 7px; font-family: inherit; font-size: .82rem; color: var(--white);
}

/* ---- Rules modal ---- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(4,8,18,.78);
  display: none; align-items: center; justify-content: center;
  z-index: 200; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  max-width: 520px; width: 100%; max-height: 86vh; overflow-y: auto;
  padding: 26px 26px 22px; box-shadow: var(--shadow);
}
.modal-card h3 { font-family: var(--font-d); font-size: 1.35rem; margin-bottom: 12px; }
.modal-card h3 span { color: var(--acc2); }
.modal-card ol { margin: 0 0 6px 20px; color: #d6dcee; line-height: 1.75; font-size: .95rem; }
.modal-card .btn { margin-top: 16px; width: 100%; }

/* ---- Win overlay (over the board) ---- */
.win-overlay {
  position: absolute; inset: 0; border-radius: 10px;
  background: rgba(6,10,22,.82);
  display: none; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; text-align: center; z-index: 5; padding: 20px;
}
.win-overlay.open { display: flex; }
.win-overlay .win-emoji { font-size: 3rem; line-height: 1; }
.win-overlay h2 { font-family: var(--font-d); font-size: 1.8rem; }
.win-overlay h2 span { color: var(--acc2); }
.win-overlay p { color: var(--muted); }
.win-overlay .btn { margin-top: 12px; }

/* ---- Mode picker / online ---- */
.modal-card { position: relative; }
.modal-x {
  position: absolute; top: 10px; right: 14px;
  background: none; border: none; color: var(--muted);
  font-size: 1.8rem; line-height: 1; cursor: pointer; padding: 4px 8px;
}
.modal-x:hover { color: var(--white); }
.mode-card { text-align: center; }
.mode-note { color: var(--acc2); font-weight: 600; min-height: 0; margin-bottom: 6px; }
.mode-note:empty { display: none; }
.mode-sub { color: var(--muted); margin-bottom: 18px; }
.mode-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mode-choice {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 14px;
  padding: 20px 12px; cursor: pointer; color: var(--white);
  font-family: inherit; transition: border-color .2s, transform .15s;
}
.mode-choice:hover { border-color: var(--acc1); transform: translateY(-2px); }
.mode-emoji { font-size: 2.2rem; line-height: 1; }
.mode-choice strong { font-family: var(--font-d); font-size: 1.05rem; }
.mode-desc { font-size: .82rem; color: var(--muted); line-height: 1.45; }

.online-panel { text-align: left; margin-top: 4px; }
.online-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.online-tab {
  flex: 1; padding: 10px; border-radius: 10px; cursor: pointer;
  background: var(--bg2); border: 1px solid var(--line);
  color: var(--muted); font-family: inherit; font-weight: 600; font-size: .95rem;
}
.online-tab.active { background: var(--acc1); border-color: var(--acc1); color: #fff; }
.online-help { color: var(--muted); font-size: .92rem; line-height: 1.6; margin-bottom: 12px; }
.room-code {
  font-family: var(--font-d); font-weight: 800; font-size: 2rem; letter-spacing: .35em;
  text-align: center; background: var(--bg2); border: 1px dashed var(--acc1);
  border-radius: 12px; padding: 12px 8px 12px 16px; margin-bottom: 14px; color: var(--acc2);
}
.online-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.online-actions .btn { min-height: 46px; }
#joinCode {
  flex: 1 1 140px; min-width: 0; min-height: 46px; text-align: center;
  font-family: var(--font-d); font-weight: 700; font-size: 1.25rem; letter-spacing: .3em; text-transform: uppercase;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; color: var(--white);
  padding: 8px 10px;
}
#joinCode:focus { outline: none; border-color: var(--acc1); }
.online-status { min-height: 24px; text-align: center; color: var(--acc2); font-weight: 600; font-size: .92rem; margin: 12px 0; }
#btnOnlineBack { width: 100%; }
.btn.disabled { opacity: .45; pointer-events: none; }

.online-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--bg2); border: 1px solid var(--acc1); border-radius: 999px;
  padding: 6px 8px 6px 16px; margin-bottom: 14px;
  font-weight: 600; font-size: .9rem;
}
.online-bar .btn { min-height: 34px; padding: 0 14px; font-size: .85rem; }

@media (max-width: 560px) {
  .game-wrap { padding-top: 120px; }
  .game-shell { padding: 10px 10px 14px; border-radius: 14px; }
  .hud-card .hud-score { font-size: 1.4rem; }
  .hud-card .hud-name { font-size: .88rem; }
  .hud-card { padding: 8px 6px; }
  .game-controls .btn { flex: 1 1 40%; padding: 0 10px; }
  .win-overlay h2 { font-size: 1.45rem; }
  /* the floating WhatsApp button would cover the board's bottom-right
     pocket on phones — hide it on this page only (contact links stay in
     the footer and the Hire Me button) */
  .wa-float { display: none; }
  .mode-choices { grid-template-columns: 1fr; }
  .room-code { font-size: 1.6rem; }
}
