/* ====== Brick Breaker – Neon Pro (mobile centering + colorful Gamezappy + mobile meters) ====== */
.gh-brick *{ box-sizing:border-box; } /* prevent Elementor/Theme shifts */

.gh-brick{
  --panel: rgba(16,22,46,.6);
  --stroke: rgba(255,255,255,.08);
  --text: #e8ecff;
  --muted: #a9b7ff;
  --accent: #6c7cff;
  --accent2: #33e0ff;
  --success: #17d490;
  --danger: #ff557a;
  --radius: 16px;
  --glow: 0 10px 30px rgba(51,224,255,.25);
  --inner: inset 0 0 0 1px rgba(255,255,255,.05);
  --glass: blur(10px) saturate(120%);
  --speed: .16s;
  color: var(--text);
  font-family: system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  position: relative;
  overflow: hidden;
}

.gh-brick .bb-aurora{
  position:absolute; inset:-20% -10% -20% -10%; z-index:0;
  background:
    radial-gradient(800px 600px at 20% 10%, rgba(108,124,255,.35), transparent 60%),
    radial-gradient(800px 600px at 80% 20%, rgba(51,224,255,.35), transparent 60%),
    radial-gradient(700px 700px at 50% 90%, rgba(255,183,3,.20), transparent 65%),
    linear-gradient(180deg,#070c1b 0%, #060912 100%);
  pointer-events:none;
}

/* Shell — force true centering even inside Elementor columns */
.gh-brick .bb-shell{
  position:relative; z-index:1;
  width:min(1100px, 100%); max-width:1100px;
  margin:22px auto 44px !important;  /* hard center */
  background:var(--panel); backdrop-filter:var(--glass);
  border:1px solid var(--stroke); border-radius:var(--radius);
  box-shadow:var(--glow), var(--inner);
  padding:16px 16px 22px;
}

/* Header */
.gh-brick .bb-header{
  display:grid; grid-template-columns:auto 1fr auto; gap:12px; align-items:center;
}

/* Colorful Gamezappy pill */
.gh-brick .bb-home{
  --pillGrad: linear-gradient(90deg, #7bffb6, #33e0ff 45%, #7e6cff 85%);
  display:inline-flex; align-items:center; gap:10px;
  padding:8px 14px; border-radius:999px;
  background:var(--pillGrad);
  color:#0a0e21; text-decoration:none; font-weight:900; letter-spacing:.2px;
  box-shadow:0 10px 26px rgba(51,224,255,.35), inset 0 0 0 1px rgba(255,255,255,.28);
}
.gh-brick .bb-home .chev{
  display:inline-grid; place-items:center;
  width:22px; height:22px; background:#eafff5; color:#0a0e21; border-radius:999px; font-weight:900;
}
.gh-brick .bb-home:hover{ filter:brightness(1.06); }

.gh-brick .bb-title{
  margin:0; font-size:28px; font-weight:900; justify-self:left;
  background:linear-gradient(90deg,var(--accent),var(--accent2));
  -webkit-background-clip:text; background-clip:text; color:transparent;
}

/* Meters */
.gh-brick .bb-meters{ display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end; }
.gh-brick .bb-meter{
  background:rgba(255,255,255,.06); border:1px solid var(--stroke);
  border-radius:12px; padding:8px 12px; min-width:90px; text-align:center;
  box-shadow:var(--inner);
}
.gh-brick .bb-meter .label{ display:block; color:var(--muted); font-size:12px; }
.gh-brick .bb-meter .value{ display:block; font-size:18px; font-weight:900; color:#fff; }

/* Controls */
.gh-brick .bb-controls{ display:grid; grid-template-columns:1fr auto; gap:12px; align-items:center; margin:16px 0 18px; }
.gh-brick .bb-selects{ display:flex; gap:10px; flex-wrap:wrap; }
.gh-brick .bb-field{ display:flex; flex-direction:column; gap:6px; color:var(--muted); font-size:13px; }
.gh-brick .select-wrap{ position:relative; }
.gh-brick .select-wrap .chev{ position:absolute; right:12px; top:50%; transform:translateY(-50%); font-size:12px; color:var(--muted); pointer-events:none; }

.gh-brick select{
  appearance:none; width:190px; color-scheme: dark;
  background:rgba(255,255,255,.06); border:1px solid var(--stroke); border-radius:12px;
  color:#fff; padding:10px 34px 10px 12px; outline:none; box-shadow:var(--inner);
}
.gh-brick select option, .gh-brick select optgroup{ background-color:#0e1537; color:#fff; }

.gh-brick .bb-actions{ display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end; }
.gh-brick .bb-btn{
  background:linear-gradient(90deg,var(--accent),var(--accent2));
  color:#0a0e21; border:none; border-radius:12px; padding:10px 16px; font-weight:900; letter-spacing:.2px; cursor:pointer;
  box-shadow:var(--glow); transition:transform .08s ease, filter var(--speed);
}
.gh-brick .bb-btn:hover,.gh-brick .bb-btn:focus{ transform:translateY(-1px); filter:brightness(1.06); }
.gh-brick .bb-btn.ghost{ background:transparent; color:#fff; border:1px solid rgba(255,255,255,.16); }

/* Sound */
.gh-brick .bb-sound{
  width:42px; height:42px; border-radius:12px; border:1px solid rgba(255,255,255,.16);
  background:rgba(255,255,255,.06); color:#fff; cursor:pointer; outline:none;
  display:grid; place-items:center; box-shadow:var(--inner); transition:filter .16s, transform .08s;
}
.gh-brick .bb-sound .ico{ width:22px; height:22px; display:block; }
.gh-brick .bb-sound .off{ display:none; }
.gh-brick .bb-sound.is-muted .on{ display:none; }
.gh-brick .bb-sound.is-muted .off{ display:block; }

/* Stage — rock-solid centering */
.gh-brick .bb-stage{
  position:relative; border-radius:var(--radius);
  padding:14px clamp(10px, 3vw, 16px);
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px;
}

/* Board wrapper */
.gh-brick .bb-canvas-wrap{
  position:relative;
  width:min(900px, 96vw);           /* desktop/tablet width */
  margin-left:auto !important;      /* hard center */
  margin-right:auto !important;     /* hard center */
  left:0 !important; right:0 !important;
  aspect-ratio: 3 / 2;
  border-radius:18px; padding:12px; background:transparent;
  display:grid; place-items:center;
}
.gh-brick .bb-canvas-wrap::before{
  content:""; position:absolute; inset:-6px; border-radius:22px;
  background:linear-gradient(90deg,var(--accent),var(--accent2));
  filter:blur(22px); opacity:.28; z-index:-1;
}
.gh-brick .bb-canvas-wrap::after{
  content:""; position:absolute; inset:0; border-radius:18px;
  box-shadow:0 0 0 1px rgba(255,255,255,.12), inset 0 0 28px rgba(0,0,0,.28); pointer-events:none;
}
.gh-brick .bb-canvas{
  width:100% !important; height:auto !important;
  display:block; border-radius:12px;
  background:radial-gradient(100% 120% at 50% 0%, rgba(255,255,255,.05), rgba(0,0,0,.35));
}

/* Touchpad — same centering as board */
.gh-brick .bb-touchpad{
  display:none;
  width:min(900px, 96vw);
  margin-left:auto !important;
  margin-right:auto !important;
  left:0 !important; right:0 !important;
  user-select:none; -webkit-user-select:none; touch-action:none;
}
.gh-brick .bb-touchpad .pad-track{
  position:relative; height:74px; border-radius:16px;
  background:linear-gradient(180deg, rgba(255,255,255,.06), rgba(0,0,0,.25));
  border:1px solid rgba(255,255,255,.12); box-shadow:var(--inner);
  overflow:hidden;
}
.gh-brick .bb-touchpad .pad-thumb{
  position:absolute; top:8px; left:50%; transform:translateX(-50%);
  width:92px; height:58px; border-radius:14px;
  background:linear-gradient(90deg, var(--accent), var(--accent2));
  box-shadow:0 6px 18px rgba(51,224,255,.35);
}
.gh-brick .bb-touchpad .pad-hint{
  position:absolute; inset:0; display:grid; place-items:center;
  color:var(--muted); font-weight:700; letter-spacing:.2px;
}

/* Mobile display rules */
@media (pointer:coarse), (max-width:680px){
  /* meters in one line (3 columns) */
  .gh-brick .bb-header{ grid-template-columns:1fr; row-gap:10px; }
  .gh-brick .bb-title{ order:2; justify-self:center; }
  .gh-brick .bb-meters{
    order:3; width:min(560px, 96vw); margin:0 auto;
    display:grid; grid-template-columns:repeat(3,1fr); gap:8px;
    justify-content:stretch;
  }
  .gh-brick .bb-meter{ min-width:auto; padding:8px 6px; }

  /* controls stack */
  .gh-brick .bb-controls{ grid-template-columns:1fr; }
  .gh-brick select{ width:100%; }

  /* always show touchpad on phones */
  .gh-brick .bb-touchpad{ display:block; }

  /* enforce board/touchpad centering and safe width on phones */
  .gh-brick .bb-canvas-wrap,
  .gh-brick .bb-touchpad{
    width: clamp(280px, 94vw, 720px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    left: 0 !important; right: 0 !important;
  }
}

/* Fullscreen on mobile */
.gh-brick.bb-fullscreen .bb-shell{
  width:100vw; height:100dvh; margin:0 !important; border-radius:0; padding:12px 10px;
}
.gh-brick.bb-fullscreen .bb-canvas-wrap{ width:min(1100px, 98vw); }
.gh-brick.bb-fullscreen .bb-touchpad{ display:block; }

/* Overlay & how-to */
.gh-brick .bb-confetti{ position:absolute; inset:0; pointer-events:none; z-index:2; }
.gh-brick .bb-overlay{ position:absolute; inset:0; z-index:4; display:grid; place-items:center; background:rgba(5,10,22,.55); }
.gh-brick .bb-card{
  width:min(460px,92vw); background:rgba(19,26,56,.85); border:1px solid var(--stroke); border-radius:18px;
  backdrop-filter:var(--glass); box-shadow:var(--glow), var(--inner); padding:16px 16px 18px; text-align:center;
}
.gh-brick .bb-card-title{
  margin:0 0 8px; font-size:26px; font-weight:900;
  background:linear-gradient(90deg,var(--accent),var(--accent2)); -webkit-background-clip:text; background-clip:text; color:transparent;
}
.gh-brick .bb-summary{ color:var(--muted); display:grid; gap:6px; margin:10px 0 14px; }
.gh-brick .bb-card-actions{ display:flex; justify-content:center; gap:10px; }

.gh-brick .bb-howto{ margin-top:14px; background:rgba(255,255,255,.06); border:1px solid var(--stroke); border-radius:12px; padding:10px 12px; }
.gh-brick .bb-inline-toggle{ background:transparent; color:#33e0ff; font-weight:900; border:none; cursor:pointer; }
.gh-brick .bb-howto-content{ display:none; color:#a9b7ff; margin-top:6px; }

/* ==== FINAL CENTERING PATCH (override any parent gutters) ==== */

/* make stage a centering grid so children can't drift */
.gh-brick .bb-stage{
  display: grid !important;
  grid-auto-flow: row;
  justify-items: center;   /* horizontal center */
  align-items: center;     /* vertical comfort */
}

/* force canvas wrapper + touchpad to be perfectly centered */
.gh-brick .bb-canvas-wrap,
.gh-brick .bb-touchpad{
  width: clamp(280px, 94vw, 720px) !important; /* safe phone width */
  max-width: 720px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  left: 0 !important;
  right: 0 !important;
}

/* make sure no parent padding shifts only one side */
.gh-brick,
.gh-brick .bb-shell,
.gh-brick .bb-stage{
  padding-left: max(10px, env(safe-area-inset-left)) !important;
  padding-right: max(10px, env(safe-area-inset-right)) !important;
}

/* canvas fills wrapper exactly */
.gh-brick .bb-canvas{
  width: 100% !important;
  height: auto !important;
  margin: 0 auto !important;
}

/* elementor columns sometimes add inner paddings—neutralize for our row */
.gh-brick .elementor-container,
.gh-brick .elementor-column,
.gh-brick .elementor-widget-wrap{
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* keep same rules in fullscreen */
.gh-brick.bb-fullscreen .bb-canvas-wrap,
.gh-brick.bb-fullscreen .bb-touchpad{
  width: clamp(280px, 98vw, 1100px) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
/* ==== MOBILE HEADER/CONTROLS ALIGNMENT PATCH ==== */
@media (pointer:coarse), (max-width:680px){
  /* Make header and controls use the same rail as the board */
  .gh-brick .bb-header,
  .gh-brick .bb-controls,
  .gh-brick .bb-howto{
    width: clamp(280px, 94vw, 720px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  /* Center the actions row (New Game / Pause / Fullscreen) */
  .gh-brick .bb-actions{
    justify-content: center !important;
  }

  /* Keep the Gamezappy pill tidy and centered */
  .gh-brick .bb-home{
    max-width: 100%;
    align-self: center;
    display: inline-flex;
    margin-left: auto;
    margin-right: auto;
  }

  /* Make the meters rail align with the same width as well */
  .gh-brick .bb-meters{
    width: 100% !important;               /* inherit the rail width above */
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}
