/* FULL-SCREEN ADVERTISEMENT SYSTEM */

[hidden] {
  display: none !important;
}

.ad-fullscreen {
  position: fixed;
  inset: 0;

  z-index: 99999;

  width: 100%;
  height: 100vh;
  height: 100dvh;

  background: rgba(5, 16, 10, 0.97);
  color: #ffffff;

  display: flex;
  flex-direction: column;

  align-items: center;
  justify-content: center;

  padding: 20px;
  gap: 15px;

  overflow-y: auto;
}

.ad-choice-card {
  width: 100%;
  max-width: 430px;

  padding: 30px 22px;

  background: #173c29;

  border: 1px solid #398659;
  border-radius: 20px;

  text-align: center;

  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4);
}

.ad-choice-card h2 {
  margin: 0 0 15px;
  color: #a3f596;
}

.ad-choice-card p {
  line-height: 1.6;
}

.ad-choice-card button {
  display: block;

  width: 100%;
  min-height: 52px;

  margin: 14px 0;
  padding: 13px;

  border: 0;
  border-radius: 11px;

  font-size: 15px;
  font-weight: bold;

  cursor: pointer;
}

.ad-primary-btn {
  background: #83ed78;
  color: #102215;
}

.ad-secondary-btn {
  background: #ffffff;
  color: #176b43;
}

.ad-choice-card button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* FULL-SCREEN ADVERTISEMENT VIEWER */

.ad-screen-viewer {
  background: #050505;
  text-align: center;
}

.ad-screen-viewer h2 {
  color: #ffffff;
  margin: 0;
  font-size: 18px;
}

.ad-media-container {
  width: 100%;
  max-width: 1100px;

  min-height: 0;

  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-media-container a {
  display: flex;
  align-items: center;
  justify-content: center;

  max-width: 100%;
  max-height: 100%;
}

.ad-media-container img,
.ad-media-container video {
  display: block;

  max-width: 100%;
  max-height: calc(100dvh - 140px);

  width: auto;
  height: auto;

  object-fit: contain;

  border-radius: 8px;
}

#adViewerStatus,
#adBreakStatus {
  font-size: 13px;
  line-height: 1.5;
  color: #c9d9ce;
}

#playVideoWithSound {
  padding: 14px 24px;
  border: 0;
  border-radius: 10px;
  background: #89ec72;
  color: #102515;
  font-weight: 700;
  cursor: pointer;
}

/* HIDE FOOTER DURING GAMEPLAY */

body.playing footer {
  display: none !important;
}

/* =====================================
   NAGRAJ GAME - GAMEPLAY HUD FIX
   Score & Pause outside playing border
   ===================================== */

/* Score and Pause on a separate top row */

.playing .game-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;

  width: 100%;
  height: 50px;
  min-height: 50px;

  margin: 0 0 8px;
  padding: 0 4px;

  position: relative;
  z-index: 4;
}

/* Keep both controls outside the canvas */

.playing .game-hud .game-score,
.playing .game-hud .pause-game-btn {
  position: static !important;
  inset: auto !important;
  transform: none !important;
  margin: 0 !important;
}

/* Pause always stays on the right */

.playing .game-hud .pause-game-btn {
  margin-left: auto !important;
}

/* Reduce game border height to create HUD space */

.playing .arena {
  height: calc(
    100dvh - 85px - env(safe-area-inset-bottom, 0px)
  );

  margin: 0;
}

/* NAGRAJ GAME - COMPACT APP ACTIONS */

.app-quick-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: -5px 0 12px;
}

.app-quick-actions button {
  width: auto;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--fg);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* Hide homepage actions during active gameplay */

body.playing .app-quick-actions {
  display: none !important;
}

#adViewerTitle,
#adViewerStatus {
  display: none !important;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  position: relative;
  min-height: 74px;
}

.menu-trigger,
.theme-btn {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}

.site-brand {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255,255,255,.98), rgba(241,248,244,.98));
  box-shadow: 0 10px 28px rgba(10, 63, 40, 0.10);
  border: 1px solid rgba(7, 155, 97, 0.10);
  max-width: calc(100% - 150px);
  white-space: nowrap;
}

.site-brand-icon {
  font-size: 30px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.12));
}

.site-brand-text {
  font-size: 31px;
  font-weight: 900;
  letter-spacing: 2px;
  line-height: 1;
  text-transform: uppercase;
  background: linear-gradient(135deg, #0d3e2b, #118051, #0a5f3d);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body.dark .site-brand {
  background: linear-gradient(135deg, rgba(29,41,59,.96), rgba(20,33,47,.96));
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 10px 28px rgba(0,0,0,.25);
}

body.dark .site-brand-text {
  background: linear-gradient(135deg, #8ef0b4, #57d98f, #c8ffe0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@media (max-width: 650px) {
  .topbar {
    min-height: 68px;
  }

  .site-brand {
    max-width: calc(100% - 118px);
    padding: 7px 14px;
    gap: 10px;
  }

  .site-brand-icon {
    font-size: 26px;
  }

  .site-brand-text {
    font-size: 22px;
    letter-spacing: 1.2px;
  }
}

/* NAGRAJ - ADVERTISEMENT COUNTDOWN */

/* Hide advertisement title and playback messages */

#adViewerTitle,
#adViewerStatus {
  display: none !important;
}

/* Compact countdown at top-right */

.ad-countdown {
  position: fixed;

  top: calc(
    14px + env(safe-area-inset-top, 0px)
  );

  right: 15px;

  z-index: 3010;

  padding: 8px 13px;

  background: rgba(0, 0, 0, 0.78);
  color: #ffffff;

  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9px;

  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;

  pointer-events: none;
}

.ad-countdown[hidden] {
  display: none !important;
}

/* ==========================================
   NAGRAJ PREMIUM AD-FREE SUBSCRIPTION UI
   ========================================== */

/* Subscription popup */

.modal:has(.subscription-premium),
.modal:has(.premium-plan-card) {
  width: min(100%, 480px);
  max-height: min(88dvh, 850px);
  padding: 18px;
  border-radius: 20px;
  overflow-y: auto;
  background: #ffffff;
  color: #182b23;
  box-shadow: 0 22px 65px rgba(0,0,0,.22);
}

/* Premium header */

.sub-premium-header {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px;
  margin-bottom: 17px;
  border-radius: 14px;
  background: linear-gradient(120deg,#06452e,#078755);
  color: #fff;
}

.sub-premium-header h2 {
  margin: 0 0 5px;
  font-size: 18px;
  color: #fff;
}

.sub-premium-header p {
  margin: 0;
  font-size: 12px;
  color: #d9fce8;
}

.sub-crown {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: #eaffef;
  color: #087b48;
  border-radius: 12px;
  font-size: 27px;
}

.sub-section-heading {
  font-size: 16px;
  font-weight: 800;
  margin: 17px 0 11px;
  color: #18382a;
}

/* Premium subscription cards */

.modal-content .premium-plan-card {
  padding: 15px;
  margin: 11px 0;
  border: 1px solid #dbe8e0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 4px 15px rgba(10,65,39,.045);
}

.premium-plan-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.premium-plan-top h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #18382a;
}

.premium-plan-badge {
  flex-shrink: 0;
  background: #e1f8e9;
  color: #087d49;
  border-radius: 20px;
  padding: 5px 9px;
  font-size: 10px;
  font-weight: 800;
}

.premium-price-row {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin: 12px 0 8px;
}

.premium-price {
  color: #102c20;
  font-size: 26px;
  font-weight: 900;
}

.premium-duration {
  color: #718076;
  font-size: 12px;
}

.premium-benefits {
  color: #587166;
  font-size: 12px;
  margin: 8px 0 13px;
}

/* Payment button */

.modal-content .premium-pay-button {
  display: block;
  width: 100%;
  min-height: 45px;
  padding: 12px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(110deg,#07864e,#08a361);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.modal-content .premium-pay-button:disabled {
  background: #e5eae7;
  color: #78877e;
  cursor: not-allowed;
}

/* Loading skeleton */

.sub-loading-card {
  padding: 16px;
  background: #f7faf8;
  border: 1px solid #e9f0eb;
  border-radius: 13px;
  margin: 11px 0;
}

.sub-skeleton {
  background: linear-gradient(
    90deg,
    #e6ede8 25%,
    #f8fbf9 50%,
    #e6ede8 75%
  );
  background-size: 200% 100%;
  animation: subShimmer 1.3s infinite linear;
  border-radius: 7px;
  margin-bottom: 11px;
}

.sub-skeleton-title {
  width: 65%;
  height: 18px;
}

.sub-skeleton-text {
  width: 45%;
  height: 12px;
}

.sub-skeleton-button {
  width: 100%;
  height: 42px;
  margin-top: 17px;
}

@keyframes subShimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* Mobile */

@media (max-width: 480px) {

  .modal:has(.subscription-premium),
  .modal:has(.premium-plan-card) {
    padding: 15px;
    border-radius: 17px;
  }

  .modal-content .premium-plan-card {
    padding: 13px;
  }

  .premium-price {
    font-size: 24px;
  }

  .sub-premium-header {
    padding: 13px;
  }
}

/* ====================================
   COMPACT PREMIUM SUBSCRIPTION STATUS
   ==================================== */

.sub-status-card {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 11px;

  padding: 11px 13px;
  margin: 0 0 13px;

  background: #f2f9f5;
  border: 1px solid #dceee2;
  border-radius: 11px;
}

.sub-status-badge {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;

  padding: 5px 9px;
  border-radius: 6px;

  font-size: 10px;
  font-weight: 800;
  letter-spacing: .3px;
}

.sub-status-badge.free {
  background: #e3eaf0;
  color: #48596b;
}

.sub-status-badge.active {
  background: #d8f7e4;
  color: #087a43;
}

.sub-status-description {
  flex: 1;
  min-width: 155px;

  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  color: #355b45;
}

.sub-status-expiry {
  flex-basis: 100%;
  font-size: 11px;
  color: #52725f;
}

/* ==========================================================
   NAGRAJ GAME — NEW GAME SETUP UI
   ADD THIS COMPLETE BLOCK AT THE END OF snake-style.css
   Existing CSS remains untouched.
   ========================================================== */

/* ----------------------------------------------------------
   GAME SETUP CONTAINER
   ---------------------------------------------------------- */

.game-setup {
  width: 100%;
  margin: 17px 0 5px;
}

.setup-section {
  width: 100%;
  margin-bottom: 17px;
}

.setup-title {
  margin: 0 0 10px;
  color: var(--fg);
  font-size: 17px;
  font-weight: 800;
}

/* ----------------------------------------------------------
   SELECT TIME
   ---------------------------------------------------------- */

.time-options {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.time-card {
  min-width: 0;
  min-height: 52px;

  padding: 10px 5px;

  border: 2px solid transparent;
  border-radius: 13px;

  background: var(--panel);
  color: var(--fg);

  box-shadow: var(--shadow);

  font-size: 14px;
  font-weight: 800;

  transition:
    transform .15s ease,
    border-color .15s ease,
    background .15s ease;

  -webkit-tap-highlight-color: transparent;
}

.time-card:hover {
  transform: translateY(-1px);
}

.time-card.selected {
  border-color: #079b61;
  background: #e2faef;
  color: #075c3c;

  box-shadow:
    0 0 0 2px rgba(7, 155, 97, .12),
    var(--shadow);
}

/* Individual time shades */

.time-card:nth-child(1) {
  background: #eff9ff;
}

.time-card:nth-child(2) {
  background: #e5faef;
}

.time-card:nth-child(3) {
  background: #fff8e6;
}

.time-card:nth-child(4) {
  background: #fff0f3;
}

.time-card.selected {
  background: #dcf8e9;
}

/* ----------------------------------------------------------
   GAME MODE SELECTION
   ---------------------------------------------------------- */

.mode-options {
  width: 100%;

  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));

  gap: 10px;
}

.mode-card {
  min-width: 0;
  min-height: 120px;

  padding: 13px 7px;

  border: 2px solid transparent;
  border-radius: 15px;

  color: #182536;

  display: flex;
  flex-direction: column;

  align-items: center;
  justify-content: center;

  gap: 6px;

  text-align: center;

  box-shadow: var(--shadow);

  transition:
    transform .15s ease,
    border-color .15s ease,
    box-shadow .15s ease;

  -webkit-tap-highlight-color: transparent;
}

.mode-card:hover {
  transform: translateY(-2px);
}

/* Single */

.mode-card:nth-child(1) {
  background: #dff8eb;
}

/* Computer */

.mode-card:nth-child(2) {
  background: #fff4d9;
}

/* Friend */

.mode-card:nth-child(3) {
  background: #ffe8ee;
}

.mode-card.selected {
  border-color: #079b61;

  box-shadow:
    0 0 0 2px rgba(7, 155, 97, .14),
    0 5px 18px rgba(7, 155, 97, .08);
}

.mode-icon {
  display: block;

  font-size: 29px;
  line-height: 1;

  margin-bottom: 3px;
}

.mode-card strong {
  display: block;

  width: 100%;

  font-size: 13px;
  line-height: 1.25;

  overflow-wrap: break-word;
}

.mode-card small {
  display: block;

  color: #68796f;

  font-size: 10px;
  line-height: 1.25;
}

/* ----------------------------------------------------------
   DIFFICULTY SECTION
   Keep original cards but visually match new setup.
   ---------------------------------------------------------- */

.level-title {
  margin-top: 16px;
}

/* ----------------------------------------------------------
   GAME HUD
   YOU + TIMER + FRIEND + PAUSE
   ---------------------------------------------------------- */

.game-hud {
  width: 100%;

  display: flex;
  align-items: center;

  gap: 8px;

  min-height: 50px;

  margin: 10px 0;

  position: relative;
  z-index: 4;
}

.game-hud .game-score,
.game-hud .game-timer,
.game-hud .opponent-score,
.game-hud .pause-game-btn {

  position: static !important;

  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;

  transform: none !important;

  margin: 0 !important;
}

/* Player score */

.game-hud .game-score {
  flex: 0 1 auto;

  padding: 10px 12px;

  border-radius: 10px;

  background: #17251d;
  color: #ffffff;

  font-size: 13px;
  font-weight: 700;

  white-space: nowrap;

  pointer-events: none;
}

.game-hud .game-score b {
  display: inline;
  font-size: 16px;
}

/* Timer */

.game-timer {
  flex: 0 0 auto;

  padding: 10px 11px;

  border-radius: 10px;

  background: #e9f7ef;
  color: #075c3c;

  border: 1px solid #c9ead7;

  font-size: 13px;
  font-weight: 800;

  font-variant-numeric: tabular-nums;

  white-space: nowrap;
}

/* Opponent score */

.opponent-score {
  flex: 0 1 auto;

  padding: 10px 11px;

  border-radius: 10px;

  background: #fff0f3;
  color: #8b2740;

  border: 1px solid #f3ced7;

  font-size: 13px;
  font-weight: 700;

  white-space: nowrap;
}

/* Pause */

.game-hud .pause-game-btn {
  flex: 0 0 auto;

  margin-left: auto !important;

  padding: 10px 13px;

  border: 0;
  border-radius: 10px;

  background: #17251d;
  color: #ffffff;

  font-size: 13px;
  font-weight: 800;

  white-space: nowrap;
}

/* ----------------------------------------------------------
   ACTIVE GAME — FULLSCREEN HUD
   ---------------------------------------------------------- */

.playing .game-hud {

  display: flex !important;

  width: 100%;

  min-height: 50px;
  height: auto;

  margin: 0 0 7px;

  padding: 0 2px;

  gap: 6px;

  flex-wrap: nowrap;
}

.playing .game-hud .game-score,
.playing .game-hud .game-timer,
.playing .game-hud .opponent-score,
.playing .game-hud .pause-game-btn {

  position: static !important;

  inset: auto !important;

  transform: none !important;
}

/* ----------------------------------------------------------
   GAME ARENA HEIGHT WITH HUD
   ---------------------------------------------------------- */

.playing .arena {

  height: calc(
    100dvh - 84px - env(safe-area-inset-bottom, 0px)
  );

  margin: 0;
}

/* ----------------------------------------------------------
   DARK MODE — NEW COMPONENTS
   ---------------------------------------------------------- */

body.dark .time-card {
  background: #1d293b;
  color: #f1f6ff;

  border-color: #35445a;
}

body.dark .time-card.selected {
  background: #153d2d;
  color: #a8f4ca;

  border-color: #16b978;
}

body.dark .mode-card {
  color: #f1f6ff;
}

body.dark .mode-card:nth-child(1) {
  background: #18392e;
}

body.dark .mode-card:nth-child(2) {
  background: #3a3320;
}

body.dark .mode-card:nth-child(3) {
  background: #3b252d;
}

body.dark .mode-card.selected {
  border-color: #16b978;
}

body.dark .mode-card small {
  color: #b8c7bd;
}

body.dark .game-timer {
  background: #153d2d;
  color: #a8f4ca;

  border-color: #28684b;
}

body.dark .opponent-score {
  background: #3b252d;
  color: #ffbdcb;

  border-color: #67404d;
}

/* ----------------------------------------------------------
   MOBILE
   ---------------------------------------------------------- */

@media (max-width: 650px) {

  .game-setup {
    margin-top: 14px;
  }

  .setup-section {
    margin-bottom: 14px;
  }

  .setup-title {
    margin-bottom: 8px;

    font-size: 15px;
  }

  /* TIME */

  .time-options {
    gap: 6px;
  }

  .time-card {
    min-height: 46px;

    padding: 8px 3px;

    border-radius: 11px;

    font-size: 12px;
  }

  /* MODES */

  .mode-options {
    gap: 7px;
  }

  .mode-card {
    min-height: 105px;

    padding: 10px 4px;

    border-radius: 12px;
  }

  .mode-icon {
    font-size: 25px;
  }

  .mode-card strong {
    font-size: 11px;
  }

  .mode-card small {
    font-size: 9px;
  }

  /* HUD */

  .game-hud {
    gap: 5px;
  }

  .game-hud .game-score,
  .game-hud .game-timer,
  .game-hud .opponent-score,
  .game-hud .pause-game-btn {

    padding: 9px 7px;

    border-radius: 8px;

    font-size: 11px;
  }

  .game-hud .game-score b {
    font-size: 13px;
  }

  /* Active gameplay */

  .playing .game-hud {
    min-height: 48px;

    gap: 4px;

    overflow: hidden;
  }

  .playing .arena {

    height: calc(
      100dvh - 82px - env(safe-area-inset-bottom, 0px)
    );
  }
}

/* ----------------------------------------------------------
   EXTRA SMALL MOBILE
   ---------------------------------------------------------- */

@media (max-width: 370px) {

  .time-options {
    grid-template-columns: repeat(2, 1fr);
  }

  .mode-options {
    grid-template-columns: 1fr;
  }

  .mode-card {
    min-height: 80px;
  }

  .playing .game-hud .game-score,
  .playing .game-hud .game-timer,
  .playing .game-hud .opponent-score,
  .playing .game-hud .pause-game-btn {

    padding: 8px 5px;

    font-size: 10px;
  }
}

/* ==========================================================
   NAGRAJ GAME — FINAL MODULE UI COMPATIBILITY
   Keep this block LAST in snake-style.css
   ========================================================== */

/* ==========================================================
   GAME SETUP
   ========================================================== */

.game-setup {
  width: 100%;
  margin: 17px 0 5px;
}

.setup-section {
  width: 100%;
  margin-bottom: 17px;
}

.setup-title {
  margin: 0 0 10px;
  color: var(--fg);
  font-size: 17px;
  font-weight: 800;
}

/* ==========================================================
   TIME SELECTION
   ========================================================== */

.time-options {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.time-card {
  min-width: 0;
  min-height: 52px;
  padding: 10px 5px;

  border: 2px solid transparent;
  border-radius: 13px;

  background: var(--panel);
  color: var(--fg);

  box-shadow: var(--shadow);

  font-size: 14px;
  font-weight: 800;

  transition:
    transform .15s ease,
    border-color .15s ease,
    background .15s ease,
    box-shadow .15s ease;

  -webkit-tap-highlight-color: transparent;
}

.time-card:nth-child(1) {
  background: #eff9ff;
}

.time-card:nth-child(2) {
  background: #e5faef;
}

.time-card:nth-child(3) {
  background: #fff8e6;
}

.time-card:nth-child(4) {
  background: #fff0f3;
}

.time-card:hover {
  transform: translateY(-1px);
}

.time-card.selected,
.time-card.active {
  border-color: #079b61;
  background: #dcf8e9;
  color: #075c3c;

  box-shadow:
    0 0 0 2px rgba(7, 155, 97, .12),
    var(--shadow);
}

/* ==========================================================
   GAME MODES — 4 MODES
   ========================================================== */

.mode-options {
  width: 100%;

  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));

  gap: 10px;
}

.mode-card {
  min-width: 0;
  min-height: 120px;

  padding: 13px 7px;

  border: 2px solid transparent;
  border-radius: 15px;

  color: #182536;

  display: flex;
  flex-direction: column;

  align-items: center;
  justify-content: center;

  gap: 6px;

  text-align: center;

  box-shadow: var(--shadow);

  transition:
    transform .15s ease,
    border-color .15s ease,
    box-shadow .15s ease;

  -webkit-tap-highlight-color: transparent;
}

.mode-card:hover {
  transform: translateY(-2px);
}

/* Single Play */

.mode-card:nth-child(1) {
  background: #dff8eb;
}

/* Computer */

.mode-card:nth-child(2) {
  background: #fff4d9;
}

/* Friend */

.mode-card:nth-child(3) {
  background: #ffe8ee;
}

/* Time Challenge */

.mode-card:nth-child(4) {
  background: #e9efff;
}

.mode-card.selected,
.mode-card.active {
  border-color: #079b61;

  box-shadow:
    0 0 0 2px rgba(7, 155, 97, .14),
    0 5px 18px rgba(7, 155, 97, .08);
}

.mode-icon {
  display: block;

  font-size: 29px;
  line-height: 1;

  margin-bottom: 3px;
}

.mode-card strong {
  display: block;
  width: 100%;

  font-size: 13px;
  line-height: 1.25;

  overflow-wrap: break-word;
}

.mode-card small {
  display: block;

  color: #68796f;

  font-size: 10px;
  line-height: 1.25;
}

/* ==========================================================
   DIFFICULTY
   ========================================================== */

.level-title {
  margin-top: 16px;
}

.level-card.selected,
.level-card.active {
  border-color: #069b61;

  box-shadow:
    0 0 0 2px rgba(7, 155, 97, .18);
}

/* ==========================================================
   LEADERBOARD SUMMARY
   ========================================================== */

.leaderboard-summary {
  margin-top: 16px;

  padding: 15px;

  background: var(--panel);

  border: 1px solid var(--line);
  border-radius: 16px;

  box-shadow: var(--shadow);
}

.leaderboard-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 10px;

  margin-bottom: 10px;
}

.leaderboard-summary-head h3 {
  margin: 0;
}

#refreshRank,
#seeAll {
  border: 0;

  border-radius: 9px;

  padding: 9px 11px;

  background: #e8f6ef;
  color: #087447;

  font-weight: 700;
}

#seeAll {
  width: 100%;
  margin-top: 10px;
}

.leaderboard-mini-stats {
  display: flex;
  flex-wrap: wrap;

  gap: 7px;

  margin-bottom: 10px;
}

.leaderboard-mini-stat {
  padding: 7px 9px;

  border-radius: 9px;

  background: var(--bg);

  color: var(--fg);

  font-size: 12px;
}

#topPlayers {
  display: grid;
  gap: 3px;
}

/* ==========================================================
   GAME HUD
   ========================================================== */

.game-hud {
  width: 100%;

  display: flex;
  align-items: center;

  gap: 8px;

  min-height: 50px;

  margin: 10px 0;

  position: relative;
  z-index: 4;
}

.game-hud .game-score,
.game-hud .game-timer,
.game-hud .opponent-score,
.game-hud .pause-game-btn {
  position: static !important;

  inset: auto !important;
  transform: none !important;

  margin: 0 !important;
}

/* PLAYER */

.game-hud .game-score {
  flex: 0 1 auto;

  padding: 10px 12px;

  border-radius: 10px;

  background: #17251d;
  color: #fff;

  font-size: 13px;
  font-weight: 700;

  white-space: nowrap;

  pointer-events: none;
}

.game-hud .game-score b {
  display: inline;
  font-size: 16px;
}

/* TIMER */

.game-hud .game-timer {
  flex: 0 0 auto;

  padding: 10px 11px;

  border-radius: 10px;

  background: #e9f7ef;
  color: #075c3c;

  border: 1px solid #c9ead7;

  font-size: 13px;
  font-weight: 800;

  font-variant-numeric: tabular-nums;

  white-space: nowrap;
}

/* OPPONENT */

.game-hud .opponent-score {
  flex: 0 1 auto;

  padding: 10px 11px;

  border-radius: 10px;

  background: #fff0f3;
  color: #8b2740;

  border: 1px solid #f3ced7;

  font-size: 13px;
  font-weight: 700;

  white-space: nowrap;
}

/* PAUSE */

.game-hud .pause-game-btn {
  flex: 0 0 auto;

  margin-left: auto !important;

  padding: 10px 13px;

  border: 0;
  border-radius: 10px;

  background: #17251d;
  color: #fff;

  font-size: 13px;
  font-weight: 800;

  white-space: nowrap;
}

/* ==========================================================
   ACTIVE GAME
   ========================================================== */

.playing .game-hud {
  display: flex !important;

  width: 100%;

  min-height: 50px;
  height: auto;

  margin: 0 0 7px;

  padding: 0 2px;

  gap: 6px;

  flex-wrap: nowrap;
}

.playing .game-hud .game-score,
.playing .game-hud .game-timer,
.playing .game-hud .opponent-score,
.playing .game-hud .pause-game-btn {
  position: static !important;

  inset: auto !important;

  transform: none !important;
}

.playing .arena {
  height: calc(
    100dvh - 84px - env(safe-area-inset-bottom, 0px)
  );

  margin: 0;
}

/* ==========================================================
   DARK MODE
   ========================================================== */

body.dark .time-card {
  background: #1d293b;
  color: #f1f6ff;

  border-color: #35445a;
}

body.dark .time-card:nth-child(1) {
  background: #1c3040;
}

body.dark .time-card:nth-child(2) {
  background: #18392e;
}

body.dark .time-card:nth-child(3) {
  background: #3a3320;
}

body.dark .time-card:nth-child(4) {
  background: #3b252d;
}

body.dark .time-card.selected,
body.dark .time-card.active {
  background: #153d2d;
  color: #a8f4ca;

  border-color: #16b978;
}

/* MODE DARK */

body.dark .mode-card {
  color: #f1f6ff;
}

body.dark .mode-card:nth-child(1) {
  background: #18392e;
}

body.dark .mode-card:nth-child(2) {
  background: #3a3320;
}

body.dark .mode-card:nth-child(3) {
  background: #3b252d;
}

body.dark .mode-card:nth-child(4) {
  background: #242f4a;
}

body.dark .mode-card.selected,
body.dark .mode-card.active {
  border-color: #16b978;
}

body.dark .mode-card small {
  color: #b8c7bd;
}

/* HUD DARK */

body.dark .game-hud .game-timer {
  background: #153d2d;
  color: #a8f4ca;

  border-color: #28684b;
}

body.dark .game-hud .opponent-score {
  background: #3b252d;
  color: #ffbdcb;

  border-color: #67404d;
}

body.dark #refreshRank,
body.dark #seeAll {
  background: #18392e;
  color: #9af1c2;
}

/* ==========================================================
   TABLET
   ========================================================== */

@media (max-width: 900px) {

  .mode-options {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .mode-card {
    min-height: 105px;
  }
}

/* ==========================================================
   MOBILE
   ========================================================== */

@media (max-width: 650px) {

  .game-setup {
    margin-top: 14px;
  }

  .setup-section {
    margin-bottom: 14px;
  }

  .setup-title {
    margin-bottom: 8px;

    font-size: 15px;
  }

  /* TIME */

  .time-options {
    grid-template-columns:
      repeat(4, minmax(0, 1fr));

    gap: 6px;
  }

  .time-card {
    min-height: 46px;

    padding: 8px 3px;

    border-radius: 11px;

    font-size: 12px;
  }

  /* MODES */

  .mode-options {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));

    gap: 7px;
  }

  .mode-card {
    min-height: 98px;

    padding: 10px 5px;

    border-radius: 12px;
  }

  .mode-icon {
    font-size: 25px;
  }

  .mode-card strong {
    font-size: 12px;
  }

  .mode-card small {
    font-size: 9px;
  }

  /* LEADERBOARD */

  .leaderboard-summary {
    padding: 12px;
  }

  .leaderboard-mini-stats {
    gap: 5px;
  }

  /* HUD */

  .game-hud {
    gap: 5px;
  }

  .game-hud .game-score,
  .game-hud .game-timer,
  .game-hud .opponent-score,
  .game-hud .pause-game-btn {
    padding: 9px 7px;

    border-radius: 8px;

    font-size: 11px;
  }

  .game-hud .game-score b {
    font-size: 13px;
  }

  /* ACTIVE GAME */

  .playing .game-hud {
    min-height: 48px;

    gap: 4px;

    overflow: hidden;
  }

  .playing .arena {
    height: calc(
      100dvh - 82px - env(safe-area-inset-bottom, 0px)
    );
  }
}

/* ==========================================================
   EXTRA SMALL PHONE
   ========================================================== */

@media (max-width: 370px) {

  .time-options {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .mode-options {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .mode-card {
    min-height: 92px;
  }

  .playing .game-hud {
    flex-wrap: wrap;
    overflow: visible;
  }

  .playing .game-hud .game-score,
  .playing .game-hud .game-timer,
  .playing .game-hud .opponent-score,
  .playing .game-hud .pause-game-btn {
    padding: 8px 5px;
    font-size: 10px;
  }

  .playing .arena {
    height: calc(
      100dvh - 120px - env(safe-area-inset-bottom, 0px)
    );
  }
}

/* NAGRAJ start countdown */

.game-start-countdown {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 25;
  font-size: clamp(64px,18vw,140px);
  font-weight: 900;
  color: var(--snake,#111);
  background: rgba(255,255,255,.35);
  backdrop-filter: blur(1px);
  pointer-events: none;
}

.game-start-countdown[hidden] {
  display: none !important;
}

body.dark .game-start-countdown {
  background: rgba(0,0,0,.28);
}

/* ==========================================================
   NAGRAJ — THIRD-PARTY AD COUNTDOWN
   ========================================================== */

#adCountdown {
  position: fixed;

  top: calc(
    14px + env(safe-area-inset-top, 0px)
  );

  left: 50%;
  right: auto;

  transform: translateX(-50%);

  z-index: 100000;

  min-width: 190px;

  padding: 10px 16px;

  background: rgba(0, 0, 0, 0.88);
  color: #ffffff;

  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;

  text-align: center;

  font-size: 15px;
  font-weight: 800;

  line-height: 1.2;

  font-variant-numeric: tabular-nums;

  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.28);

  pointer-events: none;
}

#adCountdown[hidden] {
  display: none !important;
}
/* =====================================================
   NAGRAJ GAME — CONSOLIDATED RESPONSIVE GAMEPLAY
   Mobile | Tablet | Desktop
   UI ONLY — NO GAME LOGIC CHANGES
   ===================================================== */

body.playing {
  --nagraj-arena-bg: #ffffff;

  background: radial-gradient(
    ellipse at 50% 20%,
    #086a43 0%,
    #00432e 55%,
    #002b22 100%
  ) !important;

  overflow-x: hidden;
}

/* Hide home-only components */

body.playing .sidebar,
body.playing .topbar,
body.playing .profile,
body.playing .stats,
body.playing .banner,
body.playing #gameSetup,
body.playing #snakeCustomization,
body.playing .snake-customization,
body.playing .levels,
body.playing .level-title,
body.playing .food-guide,
body.playing .leaderboard,
body.playing .leaderboard-summary,
body.playing .app-quick-actions,
body.playing #start,
body.playing #status,
body.playing footer {
  display: none !important;
}

/* =====================================================
   MAIN GAME CONTAINERS
   ===================================================== */

body.playing .app {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  min-height: 100dvh !important;
}

body.playing .content {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;

  padding: 8px !important;
  margin: 0 !important;

  background: transparent !important;
  box-sizing: border-box !important;
}

body.playing .dashboard-grid {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 !important;
}

body.playing .dashboard-grid > :not(.game-column) {
  display: none !important;
}

body.playing .dashboard-grid > .game-column {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;

  width: 100% !important;
  max-width: 1100px !important;
  min-width: 0 !important;

  height: calc(
    100dvh - 16px -
    env(safe-area-inset-bottom, 0px)
  ) !important;

  min-height: 0 !important;

  margin: 0 auto !important;
  padding: 0 !important;

  gap: 9px !important;

  position: relative !important;
  box-sizing: border-box !important;
}

/* =====================================================
   TOP GAME HUD
   ===================================================== */

html body.playing #gameHud.game-hud {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;

  align-items: center !important;
  justify-content: space-between !important;

  order: 0 !important;
  flex: 0 0 auto !important;

  position: relative !important;
  inset: auto !important;

  width: 100% !important;
  min-width: 0 !important;

  height: auto !important;
  min-height: 65px !important;

  padding: 3px 2px !important;
  margin: 0 !important;

  gap: 6px !important;

  overflow: visible !important;
  box-sizing: border-box !important;
}

body.playing #gameHud [hidden] {
  display: none !important;
}

/* Logo */

body.playing #gameHud .nagraj-live-brand {
  display: flex !important;
  flex: 0 0 auto !important;

  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;

  width: auto !important;
  min-width: 43px !important;

  color: #ffffff;
  text-align: center;

  font-size: 11px;
  font-weight: 900;
  line-height: 1.05;

  position: relative !important;
  inset: auto !important;
  transform: none !important;
}

body.playing #gameHud .nagraj-live-brand img {
  display: block;
  width: 42px;
  height: 42px;
  object-fit: contain;
}

body.playing #gameHud .nagraj-live-brand span {
  display: flex;
  flex-direction: column;
  align-items: center;
}

body.playing #gameHud .nagraj-live-brand small {
  color: #ffdb27;
  font-size: 9px;
  font-weight: 900;
}

/* Score pill */

html body.playing
#gameHud #gameScoreDisplay.nagraj-score-pill {
  display: inline-flex !important;
  flex: 0 1 auto !important;

  align-items: center !important;
  justify-content: center !important;

  position: static !important;
  transform: none !important;

  width: auto !important;
  min-width: 94px !important;
  max-width: 190px !important;
  min-height: 49px !important;

  padding: 5px 10px !important;
  margin: 0 !important;

  border: 2px solid #0ad98b !important;
  border-radius: 999px !important;

  background: linear-gradient(
    145deg,
    #07593b,
    #002b21
  ) !important;

  color: #ffffff !important;

  box-shadow:
    inset 0 2px 4px #ffffff22,
    0 0 9px #00f6a744 !important;
}

body.playing #gameHud .nagraj-score-snake {
  flex: 0 0 auto !important;
  width: auto !important;
  font-size: 25px !important;
}

body.playing #gameHud .nagraj-score-divider {
  flex: 0 0 1px;
  height: 29px;
  margin: 0 8px;
}

body.playing #gameHud .nagraj-score-label {
  font-size: 12px !important;
  color: #ffffff !important;
}

body.playing #gameHud #score {
  font-size: 25px !important;
  color: #ffffff !important;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

/* Opponent — visible in Computer mode */

html body.playing #gameHud #opponentScoreDisplay {
  position: static !important;
  transform: none !important;

  flex: 0 1 auto !important;
  min-width: 0 !important;

  padding: 9px 8px !important;
  margin: 0 !important;

  border: 1px solid #b7f878;
  border-radius: 999px;

  background: linear-gradient(
    120deg,
    #e5ff9f,
    #8bf4be
  );

  color: #073e2d;

  font-size: 12px !important;
  font-weight: 800;
  white-space: nowrap;
}

/* Timer */

body.playing #gameHud #gameTimerDisplay {
  position: static !important;
  transform: none !important;

  min-width: 0;
  margin: 0 !important;

  border-radius: 999px;
  white-space: nowrap;
}

/* Pause button */

html body.playing
#gameHud #pauseGame.nagraj-pause-pill {
  display: inline-flex !important;

  position: static !important;
  transform: none !important;

  flex: 0 0 auto !important;

  align-items: center !important;
  justify-content: center !important;

  width: auto !important;
  min-width: 88px !important;
  min-height: 46px !important;

  padding: 8px 11px !important;
  margin: 0 !important;

  gap: 6px !important;

  border: 2px solid #ffda2d !important;
  border-radius: 999px !important;

  background: linear-gradient(
    145deg,
    #07593b,
    #002c22
  ) !important;

  color: #ffffff !important;

  font-size: 13px !important;
  font-weight: 900 !important;

  white-space: nowrap;
}

body.playing #gameHud .nagraj-pause-icon {
  flex: 0 0 18px !important;
  width: 18px !important;
  height: 18px !important;
}

/* =====================================================
   GAME ARENA — FIX COLLAPSED WIDTH
   ===================================================== */

html body.playing
.dashboard-grid .game-column #arena {
  display: block !important;

  order: 1 !important;

  position: relative !important;
  inset: auto !important;
  transform: none !important;

  flex: 1 1 0% !important;
  align-self: stretch !important;

  width: 100% !important;
  min-width: 100% !important;
  max-width: none !important;

  height: auto !important;
  min-height: 200px !important;
  max-height: none !important;

  margin: 0 !important;
  padding: 0 !important;

  border: 4px solid #3ee9ac !important;
  border-radius: 22px !important;

  background: #ffffff !important;

  box-shadow:
    0 0 0 2px #00583a,
    0 0 15px #00e89f55 !important;

  overflow: hidden !important;
  box-sizing: border-box !important;
}

/* Canvas fills the available white arena */

html body.playing #arena #canvas {
  display: block !important;

  position: static !important;

  width: 100% !important;
  height: 100% !important;

  min-width: 0 !important;
  min-height: 0 !important;

  margin: 0 !important;
  padding: 0 !important;

  background: #ffffff !important;
  box-sizing: border-box !important;
}

/* =====================================================
   BOTTOM CONTROLS
   ===================================================== */

body:not(.playing) #nagrajGameControls {
  display: none !important;
}

html body.playing #nagrajGameControls {
  display: grid !important;

  order: 2 !important;
  flex: 0 0 auto !important;

  position: relative !important;

  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;

  transform: none !important;

  grid-template-columns:
    minmax(68px, 1fr)
    minmax(136px, 1.8fr)
    minmax(68px, 1fr);

  align-items: center !important;
  justify-items: center !important;

  width: 100% !important;
  min-width: 0 !important;
  min-height: 157px !important;

  padding: 7px 2px !important;
  margin: 0 !important;

  gap: 5px !important;
  box-sizing: border-box !important;
}

/* Help and Restart */

body.playing .nagraj-side-control {
  display: flex !important;
  flex-direction: column !important;

  align-items: center !important;
  justify-content: center !important;

  position: static !important;
  transform: none !important;

  width: 100% !important;
  max-width: 105px !important;
  min-height: 82px !important;

  padding: 8px 4px !important;

  gap: 5px !important;

  border: 3px solid #ffda29 !important;
  border-radius: 22px !important;

  background: linear-gradient(
    145deg,
    #07613e,
    #002f25
  ) !important;

  color: #ffffff !important;

  font-size: 12px !important;
  font-weight: 900 !important;

  text-align: center;

  box-shadow:
    inset 0 2px 3px #ffffff3d,
    0 4px 8px #0006 !important;

  cursor: pointer;
  touch-action: manipulation;
}

body.playing .nagraj-side-icon {
  color: #ffdf2c !important;
  font-size: 30px !important;
  line-height: 1;
}

/* Direction D-Pad */

body.playing .nagraj-dpad {
  display: grid !important;

  position: static !important;
  transform: none !important;

  grid-template-columns: repeat(3, 44px);
  grid-template-rows: repeat(3, 44px);

  align-items: center;
  justify-items: center;

  width: max-content !important;
  max-width: 100% !important;

  gap: 4px !important;
  margin: 0 auto !important;
  padding: 0 !important;
}

body.playing .nagraj-direction-button {
  display: grid !important;
  place-items: center !important;

  position: static !important;

  width: 44px !important;
  height: 44px !important;

  padding: 0 !important;

  border: 3px solid #5bff94 !important;
  border-radius: 14px !important;

  background: linear-gradient(
    145deg,
    #24f34d,
    #00ab31 52%,
    #006b23
  ) !important;

  color: #ffffff !important;

  font-size: 27px !important;
  font-weight: 900 !important;

  box-shadow:
    inset 0 2px 4px #ffffff88,
    0 0 10px #00ff6288,
    0 4px 6px #002d24 !important;

  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
}

body.playing .nagraj-up {
  grid-column: 2;
  grid-row: 1;
}

body.playing .nagraj-left {
  grid-column: 1;
  grid-row: 2;
}

body.playing .nagraj-right {
  grid-column: 3;
  grid-row: 2;
}

body.playing .nagraj-down {
  grid-column: 2;
  grid-row: 3;
}

body.playing .nagraj-direction-button:active,
body.playing .nagraj-side-control:active {
  filter: brightness(1.12);
}

/* =====================================================
   MOBILE
   ===================================================== */

@media (max-width: 480px) {

  body.playing .content {
    padding: 6px !important;
  }

  body.playing .dashboard-grid > .game-column {
    height: calc(
      100dvh - 12px -
      env(safe-area-inset-bottom, 0px)
    ) !important;

    gap: 7px !important;
  }

  html body.playing #gameHud.game-hud {
    min-height: 59px !important;
    gap: 4px !important;
  }

  body.playing #gameHud .nagraj-live-brand {
    font-size: 9px;
  }

  body.playing #gameHud .nagraj-live-brand img {
    width: 36px;
    height: 36px;
  }

  body.playing #gameHud .nagraj-live-brand small {
    font-size: 8px;
  }

  html body.playing
  #gameHud #gameScoreDisplay.nagraj-score-pill {
    min-width: 86px !important;
    min-height: 45px !important;
    padding: 4px 6px !important;
  }

  body.playing #gameHud .nagraj-score-snake {
    font-size: 20px !important;
  }

  body.playing #gameHud .nagraj-score-divider {
    margin: 0 5px;
  }

  body.playing #gameHud #score {
    font-size: 21px !important;
  }

  html body.playing
  #gameHud #pauseGame.nagraj-pause-pill {
    min-width: 76px !important;
    min-height: 42px !important;
    padding: 6px 7px !important;
    font-size: 11px !important;
  }

  html body.playing #gameHud #opponentScoreDisplay {
    padding: 7px 5px !important;
    font-size: 10px !important;
  }

  html body.playing
  .dashboard-grid .game-column #arena {
    min-height: 190px !important;
    border-radius: 17px !important;
  }

  html body.playing #nagrajGameControls {
    min-height: 150px !important;
    gap: 3px !important;
  }

  body.playing .nagraj-side-control {
    font-size: 10px !important;
    min-height: 75px !important;
    border-radius: 17px !important;
  }

  body.playing .nagraj-side-icon {
    font-size: 25px !important;
  }
}

/* =====================================================
   TABLET / DESKTOP
   ===================================================== */

@media (min-width: 700px) {

  html body.playing #gameHud.game-hud {
    min-height: 76px !important;
  }

  body.playing #gameHud .nagraj-live-brand img {
    width: 55px;
    height: 55px;
  }

  html body.playing #nagrajGameControls {
    grid-template-columns:
      minmax(100px, 1fr)
      minmax(195px, 1.7fr)
      minmax(100px, 1fr);

    min-height: 180px !important;
  }

  body.playing .nagraj-dpad {
    grid-template-columns: repeat(3, 53px);
    grid-template-rows: repeat(3, 53px);
  }

  body.playing .nagraj-direction-button {
    width: 53px !important;
    height: 53px !important;
    font-size: 31px !important;
  }
}

/* Short landscape screens: allow scrolling */

@media (max-height: 500px) and (orientation: landscape) {

  body.playing .dashboard-grid > .game-column {
    height: auto !important;
    min-height: 100dvh !important;
  }

  html body.playing
  .dashboard-grid .game-column #arena {
    flex: 0 0 auto !important;
    height: 240px !important;
    min-height: 240px !important;
  }
}
/* ==================================================
   NAGRAJ — PORTRAIT GAMEPLAY LAYOUT FIX
   MOBILE / TABLET / DESKTOP
   UI ONLY
   ================================================== */

body.playing {
  --ng-gap: 7px;
  --ng-edge: 7px;
  --ng-header-height: 62px;
  --ng-controls-height: 158px;

  --nagraj-arena-bg: #ffffff;

  background: radial-gradient(
    ellipse at 50% 25%,
    #08714a,
    #00432e 62%,
    #002c23
  ) !important;

  overflow-x: hidden !important;
}

/* Prevent old layout constraints */

html body.playing .app,
html body.playing .content,
html body.playing .dashboard-grid,
html body.playing .game-column {
  min-width: 0 !important;
  max-width: none !important;
  transform: none !important;
  overflow: visible !important;
}

html body.playing .dashboard-grid {
  display: block !important;
  width: 100% !important;
}

html body.playing .game-column {
  display: block !important;
  width: 100% !important;
  height: auto !important;
}

/* ==================================================
   TOP — LOGO / SCORE / OPPONENT / PAUSE
   ================================================== */

html body.playing #gameHud.game-hud {
  display: flex !important;
  position: fixed !important;

  top: calc(
    var(--ng-edge) +
    env(safe-area-inset-top, 0px)
  ) !important;

  left: 50% !important;
  right: auto !important;
  bottom: auto !important;

  transform: translateX(-50%) !important;

  width: min(
    calc(100vw - 14px),
    1100px
  ) !important;

  max-width: 1100px !important;

  height: var(--ng-header-height) !important;
  min-height: 0 !important;

  padding: 3px 2px !important;
  margin: 0 !important;

  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: space-between !important;

  gap: 5px !important;

  overflow: visible !important;
  z-index: 40 !important;
  box-sizing: border-box !important;
}

html body.playing #gameHud [hidden] {
  display: none !important;
}

html body.playing
#gameHud .nagraj-live-brand {
  display: flex !important;
  flex: 0 0 auto !important;
  position: static !important;

  flex-direction: column !important;
  align-items: center !important;

  width: 47px !important;
  min-width: 0 !important;

  transform: none !important;

  color: #ffffff;
  font-size: 10px !important;
  font-weight: 900;
  text-align: center;
}

html body.playing
#gameHud .nagraj-live-brand img {
  width: 40px !important;
  height: 40px !important;
  object-fit: contain;
}

html body.playing
#gameHud .nagraj-live-brand small {
  color: #ffdb29;
  font-size: 9px !important;
}

html body.playing
#gameHud #gameScoreDisplay {
  position: static !important;
  display: inline-flex !important;

  flex: 0 1 auto !important;
  align-items: center !important;
  justify-content: center !important;

  width: auto !important;
  min-width: 84px !important;
  max-width: 180px !important;
  min-height: 47px !important;

  padding: 5px 8px !important;
  margin: 0 !important;

  transform: none !important;

  border: 2px solid #14e39c !important;
  border-radius: 999px !important;

  background: linear-gradient(
    145deg,
    #075e3e,
    #002a21
  ) !important;

  color: #ffffff !important;
  box-shadow: 0 0 9px #00e99955 !important;
}

html body.playing
#gameHud .nagraj-score-snake {
  flex: 0 0 auto !important;
  width: auto !important;
  font-size: 22px !important;
}

html body.playing
#gameHud .nagraj-score-divider {
  height: 27px !important;
  margin: 0 6px !important;
}

html body.playing
#gameHud .nagraj-score-label {
  font-size: 11px !important;
}

html body.playing
#gameHud #score {
  font-size: 22px !important;
  font-weight: 900 !important;
  color: #ffffff !important;
}

html body.playing
#gameHud #opponentScoreDisplay:not([hidden]) {
  display: inline-flex !important;
  align-items: center !important;

  position: static !important;
  flex: 0 1 auto !important;

  min-width: 0 !important;
  padding: 8px 7px !important;
  margin: 0 !important;

  transform: none !important;

  background: linear-gradient(
    120deg,
    #e4ff9e,
    #8af5bb
  ) !important;

  border: 1px solid #bdf989 !important;
  border-radius: 999px !important;

  color: #063d2a !important;

  font-size: 11px !important;
  font-weight: 800 !important;
  white-space: nowrap;
}

html body.playing
#gameHud #gameTimerDisplay:not([hidden]) {
  position: static !important;
  flex: 0 1 auto !important;
  min-width: 0 !important;

  padding: 7px 5px !important;
  margin: 0 !important;

  transform: none !important;
  font-size: 11px !important;
  white-space: nowrap;
}

html body.playing
#gameHud #pauseGame:not([hidden]) {
  display: inline-flex !important;

  position: static !important;

  flex: 0 0 auto !important;
  align-items: center !important;
  justify-content: center !important;

  min-width: 78px !important;
  min-height: 44px !important;

  padding: 7px 9px !important;
  margin: 0 !important;

  gap: 5px !important;
  transform: none !important;

  border: 2px solid #ffdd31 !important;
  border-radius: 999px !important;

  background: linear-gradient(
    145deg,
    #075c3d,
    #002b22
  ) !important;

  color: #ffffff !important;

  font-size: 12px !important;
  font-weight: 900 !important;
}

html body.playing
#gameHud .nagraj-pause-icon {
  flex: 0 0 17px !important;
  width: 17px !important;
  height: 17px !important;
}

/* ==================================================
   MIDDLE — WHITE GAME ARENA
   ================================================== */

html body.playing
.dashboard-grid .game-column #arena {
  display: block !important;
  position: fixed !important;

  top: calc(
    var(--ng-edge) +
    env(safe-area-inset-top, 0px) +
    var(--ng-header-height) +
    var(--ng-gap)
  ) !important;

  bottom: calc(
    var(--ng-edge) +
    env(safe-area-inset-bottom, 0px) +
    var(--ng-controls-height) +
    var(--ng-gap)
  ) !important;

  left: 50% !important;
  right: auto !important;

  transform: translateX(-50%) !important;

  width: min(
    calc(100vw - 14px),
    1100px
  ) !important;

  min-width: 0 !important;
  max-width: 1100px !important;

  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;

  flex: none !important;
  align-self: auto !important;

  padding: 0 !important;
  margin: 0 !important;

  border: 4px solid #38eaaa !important;
  border-radius: 19px !important;

  background: #ffffff !important;

  box-shadow:
    0 0 0 2px #005739,
    0 0 14px #00e89a55 !important;

  overflow: hidden !important;
  box-sizing: border-box !important;
  z-index: 5 !important;
}

html body.playing #arena #canvas {
  display: block !important;

  position: static !important;

  width: 100% !important;
  height: 100% !important;

  min-width: 0 !important;
  min-height: 0 !important;

  padding: 0 !important;
  margin: 0 !important;

  background: #ffffff !important;
  box-sizing: border-box !important;
}

/* ==================================================
   BOTTOM — HELP / D-PAD / RESTART
   ================================================== */

html body.playing #nagrajGameControls {
  display: grid !important;
  position: fixed !important;

  top: auto !important;
  right: auto !important;

  bottom: calc(
    var(--ng-edge) +
    env(safe-area-inset-bottom, 0px)
  ) !important;

  left: 50% !important;

  transform: translateX(-50%) !important;

  width: min(
    calc(100vw - 14px),
    1100px
  ) !important;

  height: var(--ng-controls-height) !important;
  min-height: 0 !important;

  flex: none !important;

  grid-template-columns:
    minmax(0, 1fr)
    minmax(0, 1.6fr)
    minmax(0, 1fr) !important;

  align-items: center !important;
  justify-items: center !important;

  gap: 4px !important;
  padding: 4px 0 !important;
  margin: 0 !important;

  box-sizing: border-box !important;
  z-index: 30 !important;
}

html body.playing
#nagrajGameControls .nagraj-dpad {
  display: grid !important;
  position: static !important;

  grid-template-columns: repeat(3, 43px) !important;
  grid-template-rows: repeat(3, 43px) !important;

  align-items: center !important;
  justify-items: center !important;

  width: max-content !important;
  max-width: 100% !important;

  gap: 3px !important;
  padding: 0 !important;
  margin: 0 auto !important;

  transform: none !important;
}

html body.playing
#nagrajGameControls .nagraj-direction-button {
  position: static !important;

  width: 43px !important;
  height: 43px !important;

  padding: 0 !important;

  border: 3px solid #5fff99 !important;
  border-radius: 13px !important;

  background: linear-gradient(
    145deg,
    #29f34f,
    #00aa32 55%,
    #006520
  ) !important;

  color: #ffffff !important;
  font-size: 27px !important;

  box-shadow:
    inset 0 2px 3px #ffffff88,
    0 0 10px #00ff6090,
    0 4px 6px #002e24 !important;
}

html body.playing
#nagrajGameControls .nagraj-side-control {
  display: flex !important;

  position: static !important;
  flex-direction: column !important;

  align-items: center !important;
  justify-content: center !important;

  width: 100% !important;
  max-width: 105px !important;
  min-height: 77px !important;

  padding: 8px 4px !important;
  margin: 0 !important;

  transform: none !important;

  border: 3px solid #ffda2c !important;
  border-radius: 20px !important;

  background: linear-gradient(
    145deg,
    #07613f,
    #002e25
  ) !important;

  color: white !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  text-align: center;
}

html body.playing
#nagrajGameControls .nagraj-side-icon {
  color: #ffdf29 !important;
  font-size: 27px !important;
}

/* Keep existing direction positions */

html body.playing .nagraj-up {
  grid-column: 2 !important;
  grid-row: 1 !important;
}

html body.playing .nagraj-left {
  grid-column: 1 !important;
  grid-row: 2 !important;
}

html body.playing .nagraj-right {
  grid-column: 3 !important;
  grid-row: 2 !important;
}

html body.playing .nagraj-down {
  grid-column: 2 !important;
  grid-row: 3 !important;
}

/* ==================================================
   SMALL MOBILE
   ================================================== */

@media (max-width: 480px) {
  body.playing {
    --ng-header-height: 56px;
    --ng-controls-height: 148px;
    --ng-gap: 6px;
    --ng-edge: 6px;
  }

  html body.playing
  #gameHud .nagraj-live-brand {
    width: 35px !important;
  }

  html body.playing
  #gameHud .nagraj-live-brand img {
    width: 35px !important;
    height: 35px !important;
  }

  html body.playing
  #gameHud .nagraj-live-brand span {
    display: none !important;
  }

  html body.playing
  #gameHud #gameScoreDisplay {
    min-width: 76px !important;
    padding: 4px 5px !important;
  }

  html body.playing
  #gameHud #pauseGame:not([hidden]) {
    min-width: 68px !important;
    padding: 6px 6px !important;
    font-size: 11px !important;
  }

  html body.playing
  #gameHud #opponentScoreDisplay:not([hidden]) {
    padding: 5px 4px !important;
    font-size: 9px !important;
  }

  html body.playing
  #nagrajGameControls .nagraj-side-control {
    min-height: 72px !important;
    font-size: 10px !important;
  }
}

/* ==================================================
   VERY NARROW PHONE
   ================================================== */

@media (max-width: 350px) {
  html body.playing
  #nagrajGameControls .nagraj-dpad {
    grid-template-columns: repeat(3, 38px) !important;
    grid-template-rows: repeat(3, 38px) !important;
  }

  html body.playing
  #nagrajGameControls .nagraj-direction-button {
    width: 38px !important;
    height: 38px !important;
    font-size: 23px !important;
  }

  html body.playing #gameHud.game-hud {
    gap: 2px !important;
  }
}

/* ==================================================
   TABLET / DESKTOP
   ================================================== */

@media (min-width: 700px) {
  body.playing {
    --ng-header-height: 78px;
    --ng-controls-height: 185px;
    --ng-edge: 12px;
    --ng-gap: 10px;
  }

  html body.playing
  #gameHud .nagraj-live-brand img {
    width: 55px !important;
    height: 55px !important;
  }

  html body.playing
  #nagrajGameControls .nagraj-dpad {
    grid-template-columns: repeat(3, 53px) !important;
    grid-template-rows: repeat(3, 53px) !important;
  }

  html body.playing
  #nagrajGameControls .nagraj-direction-button {
    width: 53px !important;
    height: 53px !important;
    font-size: 31px !important;
  }
}
/* ==========================================
   NAGRAJ — FINAL FULL SCREEN GAMEPLAY
   Hide bottom controls and enlarge arena
   ========================================== */

/* Hide Help, Restart and Arrow controls */

html body.playing #nagrajGameControls {
  display: none !important;
}

/* Expand the arena into freed bottom space */

html body.playing
.dashboard-grid .game-column #arena {

  bottom: calc(
    var(--ng-edge, 7px) +
    env(safe-area-inset-bottom, 0px)
  ) !important;

  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;

  flex: none !important;
}

/* Preserve full-size drawing canvas */

html body.playing #arena #canvas {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
}