﻿:root{
  --ink:#13213f;--muted:#697691;--line:#dde5f0;--surface:#fff;--soft:#f4f8fd;
  --blue:#2f78e9;--blue2:#20a7e8;--danger:#c73d52;--good:#16845d
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;font-family:Inter,system-ui,-apple-system,"Segoe UI",sans-serif;background:#f7fbff;color:var(--ink)}
body{background:radial-gradient(circle at 85% 0,#eaf2ff 0,transparent 27%),linear-gradient(#fbfdff,#f6fbff)}
.custom-shell{width:min(1200px,calc(100% - 32px));margin:0 auto;padding:54px 0 70px}
.custom-hero{max-width:760px;margin-bottom:28px}
.custom-kicker{font-size:12px;font-weight:900;letter-spacing:.13em;color:#0b83c6}
.custom-hero h1{font-size:clamp(2.3rem,5vw,4.7rem);line-height:.98;letter-spacing:-.055em;margin:14px 0 14px}
.custom-hero p{font-size:1.05rem;line-height:1.65;color:var(--muted);margin:0}
.custom-workspace{display:grid;grid-template-columns:minmax(520px,720px) 300px;gap:28px;align-items:start}
.custom-board-column{min-width:0}
.custom-toolbar{display:flex;justify-content:space-between;gap:16px;min-height:32px;color:var(--muted);font-size:13px;font-weight:800}
.custom-status{color:var(--good)}
.custom-status.error{color:var(--danger)}
.custom-grid{display:grid;grid-template-columns:repeat(9,1fr);aspect-ratio:1;background:#596781;gap:1px;border:3px solid #536079;border-radius:16px;overflow:hidden;box-shadow:0 20px 48px rgba(36,67,117,.12)}
.custom-cell{display:grid;place-items:center;background:#fff;color:#234cb2;font-size:clamp(22px,3vw,34px);font-weight:850;border:0;cursor:pointer;position:relative}
.custom-cell:nth-child(3n){box-shadow:inset -2px 0 0 #536079}
.custom-cell:nth-child(9n){box-shadow:none}
.custom-cell.row-cut{border-bottom:2px solid #536079}
.custom-cell.selected{background:#dceaff}
.custom-cell.conflict{background:#fff0f1;color:#ba263a}
.custom-controls{display:grid;gap:14px}
.control-card,.custom-tip{background:#fff;border:1px solid var(--line);border-radius:20px;padding:20px;box-shadow:0 10px 28px rgba(36,67,117,.06)}
.control-card h2{font-size:1.15rem;margin:0 0 8px}
.control-card p,.custom-tip{font-size:.9rem;line-height:1.55;color:var(--muted)}
.custom-pad{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;margin:16px 0 12px}
.custom-pad button{height:54px;border:0;border-radius:13px;background:linear-gradient(135deg,#4d50d8,#2f8be8);color:#fff;font-size:20px;font-weight:900;cursor:pointer}
.custom-actions{display:grid;gap:9px}
.small-actions{grid-template-columns:1fr 1fr}
.primary-btn,.soft-btn{min-height:46px;border-radius:13px;font-weight:850;cursor:pointer;padding:10px 14px}
.primary-btn{border:0;background:linear-gradient(135deg,var(--blue),var(--blue2));color:#fff}
.secondary-primary{background:#13213f}
.soft-btn{border:1px solid var(--line);background:#fff;color:var(--ink)}
.custom-tip{display:grid;gap:4px;background:#f4f8ff}
.custom-tip strong{color:var(--ink)}
@media(max-width:980px){.custom-workspace{grid-template-columns:1fr}.custom-controls{grid-template-columns:repeat(2,1fr)}.custom-tip{grid-column:1/-1}}
@media(max-width:640px){.custom-shell{width:min(100% - 18px,1200px);padding-top:30px}.custom-controls{grid-template-columns:1fr}.custom-tip{grid-column:auto}.custom-grid{border-radius:12px}.custom-cell{font-size:clamp(18px,7vw,28px)}}

body.dark{
  --ink:#f4f7ff;--muted:#b4bfd6;--line:#303a52;--surface:#181d2b;--soft:#222a3c;
  background:radial-gradient(circle at 85% 0,#28304b 0,transparent 27%),linear-gradient(#111622,#161c2a)
}
body.dark .custom-grid{background:#3b4359;border-color:#4b5670}
body.dark .custom-cell{background:#181d2b;color:#8fb4ff}
body.dark .custom-cell.selected{background:#273651}
body.dark .custom-cell.conflict{background:#48252d;color:#ff98a7}
body.dark .control-card,body.dark .custom-tip{background:#181d2b;border-color:var(--line)}
body.dark .custom-tip{background:#20283a}
body.dark .soft-btn{background:#181d2b;color:var(--ink);border-color:var(--line)}

.custom-app-promo{
  margin-top:34px;
  padding:24px;
  border:1px solid var(--line);
  border-radius:22px;
  background:linear-gradient(135deg,var(--surface),var(--soft));
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:22px;
}
.custom-app-promo h2{margin:8px 0 6px;font-size:1.45rem}
.custom-app-promo p{margin:0;color:var(--muted);max-width:680px}
.custom-store-row{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end}
.custom-store-badge{
  display:flex;align-items:center;gap:10px;min-width:205px;min-height:58px;padding:10px 13px;
  border-radius:14px;background:#0f1421;color:#fff;text-decoration:none;border:1px solid #232c3c
}
.custom-store-logo{width:32px;height:32px;display:grid;place-items:center;flex:0 0 32px}
.custom-store-logo svg{width:28px;height:28px;display:block}
.custom-store-badge>span:last-child{display:grid;gap:1px;line-height:1.03}
.custom-store-badge small{font-size:9px;letter-spacing:.08em;color:#d0d5df;font-weight:800}
.custom-store-badge strong{font-size:16px;color:#fff}
.custom-ad-slot{
  min-height:90px;margin-top:20px;border:1px dashed var(--line);border-radius:16px;
  display:grid;place-items:center;padding:12px;text-align:center;color:var(--muted);font-size:12px
}
@media(max-width:900px){
  .custom-app-promo{align-items:flex-start;flex-direction:column}
  .custom-store-row{justify-content:flex-start}
}
@media(max-width:520px){
  .custom-store-row{display:grid;width:100%;grid-template-columns:1fr}
  .custom-store-badge{min-width:0}
}

/* Keep the custom-puzzle editor fully usable on laptop/desktop screens. */
@media(min-width:981px){
  .custom-shell{
    width:min(1160px,calc(100% - 28px));
    padding:24px 0 42px;
  }
  .custom-hero{
    max-width:820px;
    margin-bottom:16px;
  }
  .custom-hero h1{
    font-size:clamp(2.35rem,4vw,3.6rem);
    margin:8px 0 8px;
    line-height:1;
  }
  .custom-hero p{
    font-size:.98rem;
    line-height:1.48;
  }
  .custom-workspace{
    --custom-board:min(590px,calc(100vh - 285px),calc(100vw - 450px));
    grid-template-columns:var(--custom-board) 300px;
    gap:24px;
    justify-content:center;
  }
  .custom-board-column,
  .custom-grid{
    width:var(--custom-board);
    max-width:var(--custom-board);
  }
  .custom-toolbar{
    min-height:26px;
    font-size:12px;
  }
  .control-card,.custom-tip{
    padding:16px;
  }
  .custom-pad{
    gap:8px;
    margin:12px 0 10px;
  }
  .custom-pad button{
    height:48px;
    font-size:18px;
  }
}
@media(min-width:981px) and (max-height:820px){
  .custom-shell{padding-top:14px}
  .custom-hero{margin-bottom:10px}
  .custom-hero h1{font-size:2.6rem;margin:6px 0}
  .custom-hero p{font-size:.9rem}
  .custom-workspace{
    --custom-board:min(520px,calc(100vh - 250px),calc(100vw - 440px));
    gap:20px;
  }
}


/* Final mobile fit for the custom-puzzle editor. */
@media(max-width:700px){
  html,body{width:100%;max-width:100%;overflow-x:hidden}
  .custom-shell{
    width:100%!important;
    max-width:100%!important;
    padding:24px 8px 40px!important;
    margin:0!important;
  }
  .custom-hero{
    width:100%!important;
    max-width:100%!important;
    margin-bottom:20px!important;
  }
  .custom-hero h1{
    max-width:100%!important;
    font-size:clamp(2rem,9.2vw,2.9rem)!important;
    line-height:1!important;
    overflow-wrap:anywhere!important;
  }
  .custom-hero p{font-size:.94rem!important;max-width:100%!important}
  .custom-workspace{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
  }
  .custom-board-column,.custom-grid{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
  }
  .custom-grid{border-radius:12px!important}
  .custom-cell{
    min-width:0!important;
    padding:0!important;
    font-size:clamp(17px,6.8vw,27px)!important;
  }
  .custom-controls{
    display:grid!important;
    grid-template-columns:1fr!important;
    width:100%!important;
    max-width:100%!important;
    margin-top:18px!important;
  }
  .control-card,.custom-tip{
    width:100%!important;
    max-width:100%!important;
    padding:16px!important;
  }
  .custom-pad{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:7px!important;
  }
  .custom-pad button{min-width:0!important;height:48px!important}
  .custom-app-promo{
    width:100%!important;
    max-width:100%!important;
    padding:18px!important;
    margin-top:22px!important;
  }
  .custom-store-row{
    width:100%!important;
    display:grid!important;
    grid-template-columns:1fr!important;
  }
  .custom-store-badge{width:100%!important;min-width:0!important}
  .custom-ad-slot{width:100%!important;max-width:100%!important}
}

/* 2026-09-30 wider custom editor + equal-size grid */
.custom-shell{width:min(1480px,calc(100% - 28px))!important}
.custom-workspace{
  grid-template-columns:minmax(560px,760px) minmax(300px,340px)!important;
  justify-content:center
}
.custom-grid{
  grid-template-columns:repeat(9,minmax(0,1fr))!important;
  grid-template-rows:repeat(9,minmax(0,1fr))!important;
}
.custom-cell{min-width:0!important;min-height:0!important;padding:0!important}
@media(max-width:980px){
  .custom-workspace{grid-template-columns:1fr!important}
}




/* ===== Custom Puzzle: app-parity build-around-my-numbers mode ===== */
.hidden{display:none!important}
.build-around-card{
  position:relative;
  overflow:hidden;
  background:
    radial-gradient(circle at 100% 0,rgba(47,120,233,.12),transparent 42%),
    linear-gradient(145deg,#fff,#f4f8ff)!important;
}
.build-around-card:after{
  content:"";
  position:absolute;
  width:110px;height:110px;
  right:-44px;bottom:-55px;
  border-radius:50%;
  background:rgba(88,86,218,.07);
  pointer-events:none;
}
.build-around-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  position:relative;
  z-index:1;
}
.build-around-head h2{margin-top:4px!important}
.custom-mini-kicker{
  color:#5657d8;
  font-size:9.5px;
  font-weight:950;
  letter-spacing:.12em;
}
.build-spark{
  flex:0 0 38px;
  width:38px;height:38px;
  display:grid;place-items:center;
  border-radius:12px;
  background:linear-gradient(135deg,#e8e8ff,#d9efff);
  color:#4f50d8;
  font-size:20px;
  box-shadow:inset 0 0 0 1px rgba(78,80,216,.08);
}
.difficulty-field{
  display:grid;
  gap:6px;
  margin:14px 0 10px;
  color:var(--ink);
  font-size:12px;
  font-weight:850;
  position:relative;
  z-index:1;
}
.difficulty-field select{
  width:100%;
  min-height:42px;
  border:1px solid var(--line);
  border-radius:12px;
  padding:8px 34px 8px 11px;
  background:var(--surface);
  color:var(--ink);
  font:750 12px/1.25 Inter,system-ui,-apple-system,"Segoe UI",sans-serif;
  outline:none;
}
.difficulty-field select:focus{
  border-color:var(--blue);
  box-shadow:0 0 0 3px rgba(47,120,233,.12);
}
.build-btn{
  width:100%;
  position:relative;
  z-index:1;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
}
.build-btn:disabled{opacity:.7;cursor:wait}
.build-spinner{
  width:15px;height:15px;
  border:2px solid rgba(255,255,255,.38);
  border-top-color:#fff;
  border-radius:50%;
  animation:customSpin .75s linear infinite;
}
@keyframes customSpin{to{transform:rotate(360deg)}}
.validation-message{
  margin:10px 0;
  padding:10px 11px;
  border-radius:11px;
  font-size:12px;
  line-height:1.45;
  font-weight:750;
  border:1px solid var(--line);
  background:var(--soft);
  color:var(--muted);
}
.validation-message.error{
  border-color:#f1c4cb;
  background:#fff1f3;
  color:#a62e43;
}
.validation-message.success{
  border-color:#bce1d3;
  background:#edfbf5;
  color:#116c4b;
}
.validation-message.info{
  border-color:#c9d9f3;
  background:#eff6ff;
  color:#28558e;
}
.use-my-numbers{
  border-color:#bfc8ff!important;
  background:#f0f1ff!important;
  color:#4245bd!important;
}
body.dark .build-around-card{
  background:
    radial-gradient(circle at 100% 0,rgba(83,124,224,.18),transparent 42%),
    linear-gradient(145deg,#181d2b,#20283a)!important;
}
body.dark .difficulty-field select{
  background:#181d2b;
  color:var(--ink);
}
body.dark .validation-message.error{
  background:#3d252d;color:#ff9aab;border-color:#69404a;
}
body.dark .validation-message.success{
  background:#17352c;color:#91e5c3;border-color:#285746;
}
body.dark .validation-message.info{
  background:#1d2f49;color:#9fc6ff;border-color:#33547d;
}
@media(max-width:980px){
  .build-around-card{grid-column:auto}
}


/* ===== Cache 119: compact custom-puzzle workspace ===== */
.custom-shell{
  padding-top:18px!important;
}
.custom-hero{
  max-width:920px!important;
  margin-bottom:10px!important;
}
.custom-hero h1{
  font-size:clamp(1.9rem,3.1vw,2.85rem)!important;
  line-height:1.02!important;
  margin:6px 0 6px!important;
  letter-spacing:-.035em!important;
}
.custom-hero p{
  font-size:.9rem!important;
  line-height:1.42!important;
  max-width:820px!important;
}
.custom-workspace{
  align-items:start!important;
}
.custom-board-column{
  min-width:0!important;
}
.board-primary-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-top:10px;
}
.board-primary-actions .primary-btn{
  min-height:42px;
}
.board-helper-action{
  width:100%;
  margin-top:8px;
}

.clue-info-card{
  position:relative;
  padding:14px 15px!important;
  background:linear-gradient(145deg,#f8fbff,#f2f7ff)!important;
}
.clue-info-head,
.numbers-card-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}
.clue-info-head h2,
.numbers-card-head h2{
  margin:2px 0 0!important;
}
.clue-info-card p{
  margin:7px 0 0!important;
  font-size:.78rem!important;
  line-height:1.42!important;
}
.clue-info-close{
  width:30px;
  height:30px;
  flex:0 0 30px;
  border:1px solid var(--line);
  border-radius:9px;
  background:var(--surface);
  color:var(--muted);
  cursor:pointer;
  font-size:18px;
  line-height:1;
}
.inline-info-btn{
  border:1px solid #c9d9f3;
  background:#eff6ff;
  color:#28558e;
  border-radius:999px;
  padding:5px 9px;
  font-size:10px;
  font-weight:850;
  cursor:pointer;
}

.share-card{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.share-card h2{margin:3px 0 0!important}
.share-card .soft-btn{min-width:150px}
.custom-tip{
  padding:12px 14px!important;
  font-size:.78rem!important;
  line-height:1.4!important;
}
.custom-pad{
  margin:10px 0 9px!important;
  gap:7px!important;
}
.custom-pad button{
  height:46px!important;
}
.control-card{
  padding:15px!important;
}
.control-card h2{
  font-size:1rem!important;
}
.build-around-card p{
  font-size:.78rem!important;
  line-height:1.42!important;
  margin:7px 0!important;
}
.build-note{
  display:block;
  margin-top:8px;
  font-size:10px;
  line-height:1.35;
  color:var(--muted);
}
.difficulty-field{
  margin:10px 0 8px!important;
}

.custom-cell.row-cut{
  border-bottom:0!important;
}
.custom-cell.row-cut::after{
  content:"";
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  height:2px;
  background:#536079;
  z-index:3;
  pointer-events:none;
}
@media(min-width:1181px){
  .custom-workspace{
    --custom-board:min(600px,calc(100dvh - 270px),calc(100vw - 720px))!important;
    grid-template-columns:var(--custom-board) minmax(560px,620px)!important;
    gap:24px!important;
    justify-content:center!important;
  }
  .custom-board-column{
    width:var(--custom-board)!important;
    max-width:var(--custom-board)!important;
  }
  .custom-grid{
    width:var(--custom-board)!important;
    max-width:var(--custom-board)!important;
  }
  .custom-controls{
    width:100%!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:12px!important;
    align-items:start!important;
  }
  .clue-info-card,
  .share-card,
  .custom-tip{
    grid-column:1/-1!important;
  }
}


/* ===== Cache 121: screenshot-driven custom puzzle balance ===== */
@media(min-width:1181px){
  .custom-controls{
    align-items:stretch!important;
  }
  .numbers-card,
  .build-around-card{
    min-height:344px!important;
    height:100%!important;
  }
  .numbers-card{
    display:flex!important;
    flex-direction:column!important;
  }
  .numbers-card .custom-pad{
    margin:18px 0 14px!important;
    gap:9px!important;
  }
  .numbers-card .custom-pad button{
    height:58px!important;
    border-radius:14px!important;
    font-size:21px!important;
    box-shadow:0 7px 16px rgba(55,91,210,.12)!important;
  }
  .numbers-card .small-actions{
    margin-top:auto!important;
  }
  .numbers-card .small-actions .soft-btn{
    min-height:48px!important;
    border-radius:13px!important;
  }
  .build-around-card{
    display:flex!important;
    flex-direction:column!important;
  }
  .build-around-card .build-btn{
    min-height:48px!important;
  }
  .build-around-card .build-note{
    margin-top:auto!important;
    padding-top:8px!important;
  }
}


/* Cache 125: compact AdSense rail placement beside the custom grid. */
@media(min-width:981px){
  .custom-side-ad{
    grid-column:1/-1!important;
    min-height:58px!important;
    margin:2px 0 0!important;
  }
}
@media(max-width:980px){
  .custom-side-ad{
    grid-column:1/-1!important;
    width:100%!important;
  }
}

/* Cache 134: stronger labels and controls on the custom-puzzle page. */
body{font-weight:500;text-rendering:optimizeLegibility}
.custom-toolbar,.control-card h2,.primary-btn,.soft-btn,.custom-tip strong{
  font-weight:850!important;
}
.control-card p,.custom-tip,.custom-hero p,.build-note{
  font-weight:550!important;
}
html[dir="rtl"] body,
html[dir="rtl"] button,
html[dir="rtl"] input,
html[dir="rtl"] select,
html[dir="rtl"] textarea{
  font-family:Tahoma,"Segoe UI",Arial,sans-serif;
}
