/* Three inputs, free-material pool and all four outcomes follow the supplied
   synthesis panel. Face artwork uses the same original character masters. */
#game-container .synthesis-panel { color:#5a5041; font:clamp(10px,1.15cqw,14px)/1.3 Tahoma,Arial,sans-serif; }
#game-container .synthesis-tabs { display:flex; justify-content:center; gap:4px; margin:0 0 .9cqw; }
#game-container .synthesis-tabs>button {
  flex:0 1 25%; min-width:0; min-height:30px; padding:.45cqw .7cqw;
  border:1px solid #b9ad97; border-bottom:2px solid #c8bda8; border-radius:9px 9px 0 0;
  background:linear-gradient(#fffdf8,#eee9df); color:#746d60;
  font:700 clamp(10px,1.25cqw,16px)/1.15 Tahoma,Arial,sans-serif;
}
#game-container .synthesis-tabs>button.active { color:#858141; background:#fffdf5; border-bottom-color:#fffdf5; }
#game-container .synthesis-tabs>button:disabled { cursor:default; color:#999083; opacity:.8; }
#game-container .synthesis-tabs small { display:block; font:400 9px/1.15 Tahoma,Arial,sans-serif; }
#game-container .synthesis-columns { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:2cqw; }
#game-container .synthesis-columns h3 { margin:0 0 .6cqw; font:700 clamp(11px,1.4cqw,18px)/1.2 Tahoma,Arial,sans-serif; color:#756b5c; }
#game-container .synthesis-inputs,#game-container .synthesis-pool { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.7cqw; }
#game-container :is(.synthesis-input,.synthesis-candidate) {
  display:flex; flex-direction:column; align-items:center; gap:2px; min-width:0; padding:3px 0;
  border:0; border-image:none; border-radius:0; background:none; color:var(--synthesis-grade,#a3977c);
  box-shadow:none; font:inherit; cursor:pointer;
}
#game-container :is(.synthesis-input,.synthesis-candidate):focus-visible { outline:2px solid #507c85; outline-offset:2px; border-radius:3px; }
#game-container :is(.synthesis-input,.synthesis-candidate)>strong { max-width:100%; font-size:clamp(10px,1.1cqw,14px); line-height:1.15; text-align:center; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#game-container :is(.synthesis-input,.synthesis-candidate)>small { color:#8d806f; font-size:clamp(9px,1cqw,12px); line-height:1.1; }
#game-container .synthesis-input.empty { opacity:.75; cursor:default; }
#game-container .synthesis-face {
  position:relative; display:grid; place-items:center; flex:none; overflow:hidden;
  width:clamp(34px,5.9cqw,76px); aspect-ratio:1; border:3px solid var(--synthesis-grade,#c1baa9);
  border-radius:5px; background:linear-gradient(135deg,#fffef3,#ddd6c8); box-shadow:inset 0 0 0 1px #fff7df,0 1px 3px #75695255;
}
#game-container .synthesis-face>.ninja-face-art { display:block; width:100%; height:100%; }
#game-container .synthesis-face>.ui-icon { width:45%; height:45%; opacity:.5; }
#game-container .synthesis-face>i { position:absolute; bottom:0; right:0; width:18px; height:18px; padding:2px; background:#4e714c; color:#fff; border-radius:4px 0 0 0; }
#game-container .synthesis-face>i>.ui-icon { width:100%; height:100%; }
#game-container .synthesis-candidate.is-selected>.synthesis-face { filter:brightness(.5) saturate(.65); }
#game-container :is(.synthesis-input,.synthesis-candidate):disabled:not(.empty) { opacity:.7; cursor:wait; }
#game-container .synthesis-force-note { margin:.65cqw 0 .4cqw; color:#b5634d; font-weight:700; }
#game-container .synthesis-duty-note { margin:0 0 .65cqw; color:#459eb0; font-size:clamp(10px,1.05cqw,13px); }
#game-container .synthesis-results { min-width:0; margin:.6cqw 0 0; padding:.5cqw .65cqw .65cqw; border:1px solid #b7af9c; border-radius:12px; background:none; }
#game-container .synthesis-results legend { padding:0 5px; color:#7b7163; font-size:clamp(11px,1.35cqw,17px); font-weight:700; }
#game-container .synthesis-grade-results { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:.6cqw; }
#game-container .synthesis-grade-result { display:flex; flex-direction:column; align-items:center; gap:2px; min-width:0; text-align:center; }
#game-container .synthesis-result-face { position:relative; display:grid; place-items:center; width:clamp(29px,4.5cqw,60px); aspect-ratio:1; overflow:hidden; border:2px solid var(--synthesis-grade); border-radius:5px; background:var(--synthesis-grade); box-shadow:inset 0 0 6px #ffffc288; }
#game-container .synthesis-result-face>.synthesis-unknown-ninja { width:92%; height:92%; fill:#20212b; opacity:.8; }
#game-container .synthesis-result-face>i { position:absolute; right:3px; top:0; color:white; font:900 clamp(17px,2.6cqw,32px)/1.1 Tahoma,Arial,sans-serif; text-shadow:0 1px 3px #46372e; }
#game-container .synthesis-grade-result>strong { color:var(--synthesis-grade); font-size:clamp(9px,1cqw,12px); }
#game-container .synthesis-grade-result>b { color:#736a5d; font-size:clamp(10px,1.15cqw,15px); }
#game-container .synthesis-panel .grade-blue { --synthesis-grade:#408fb0; }
#game-container .synthesis-panel .grade-purple { --synthesis-grade:#9c67ad; }
#game-container .synthesis-panel .grade-red { --synthesis-grade:#c4634f; }
#game-container .synthesis-panel .grade-gold { --synthesis-grade:#b89c44; }
#game-container .synthesis-right { display:flex; flex-direction:column; min-width:0; }
#game-container .synthesis-pool-heading { display:flex; align-items:baseline; justify-content:space-between; gap:5px; }
#game-container .synthesis-pool-heading>span { color:#8c8071; font-size:clamp(9px,1cqw,12px); }
#game-container .synthesis-pool { align-content:start; min-height:16cqw; }
#game-container .synthesis-empty { grid-column:1/-1; margin:1cqw 0; font-size:clamp(10px,1.1cqw,14px); }
#game-container .synthesis-pagination { display:flex; align-items:center; justify-content:center; gap:12px; margin:auto 0 0; padding-top:.8cqw; }
#game-container .synthesis-pagination>button { display:grid; place-items:center; width:27px; height:30px; padding:0; border:1px solid #9d8b62; border-radius:40%; background:linear-gradient(#fff6d0,#dac296); color:#7b6843; font:700 26px/1 Tahoma,Arial,sans-serif; }
#game-container .synthesis-pagination>button:disabled { opacity:.35; }
#game-container .synthesis-odds-note { margin:.7cqw 0 .3cqw; color:#8e7755; font-size:clamp(10px,1.05cqw,13px); }
#game-container .synthesis-status { margin:.3cqw 0 .5cqw; font-size:clamp(10px,1.05cqw,13px); color:#797262; }
#game-container .synthesis-last-result { margin:.4cqw 0; color:#52764e; }
#game-container .synthesis-footer { display:flex; justify-content:space-between; gap:2cqw; margin-top:.65cqw; padding:0 3cqw; }
#game-container .synthesis-footer>.button { width:42%; min-width:0; min-height:30px; font-size:clamp(10px,1.3cqw,16px); }
#game-container .synthesis-footer small { margin-left:5px; font-size:clamp(9px,1cqw,12px); }
/* Keep the transaction controls inside the frame. The existing material
   pager and explanatory pages handle extra content without a scroll region. */
#game-container[data-approved-ui="ready"] .approved-modal-shell.wide>.modal:has(>.synthesis-panel) {
  display:flex; flex-direction:column; overflow:hidden;
}
#game-container .modal:has(>.synthesis-panel)>.modal-heading { flex:none; }
#game-container .modal>.synthesis-panel { display:flex; flex-direction:column; flex:1 1 auto; min-height:0; }
#game-container .synthesis-panel>.synthesis-tabs { flex:none; }
#game-container .synthesis-panel>#synthesis-form { display:flex; flex-direction:column; flex:1 1 auto; min-height:0; }
#game-container #synthesis-form>.synthesis-columns { flex:1 1 auto; min-height:0; overflow:hidden; }
#game-container #synthesis-form>:is(.synthesis-odds-note,.synthesis-status,.synthesis-last-result,.synthesis-footer) { flex:none; }
#game-container[data-approved-ui="ready"] .approved-modal-shell.wide:has(>.modal>.synthesis-panel) { height:90cqh; }
#game-container .synthesis-panel :is(.synthesis-odds-note,.synthesis-status) { margin-top:3px; margin-bottom:3px; }
#game-container .synthesis-panel .synthesis-force-note { margin:3px 0 2px; }
#game-container .synthesis-panel .synthesis-duty-note { margin-bottom:3px; }
@container game (min-width:700px) {
  #game-container .synthesis-face { width:clamp(34px,5.5cqw,70px); }
  #game-container .synthesis-result-face { width:clamp(29px,4cqw,56px); }
  #game-container .synthesis-grade-result>b { font-size:clamp(10px,1.1cqw,14px); }
  #game-container .synthesis-results { padding:.3cqw .55cqw .45cqw; }
}
@container game (max-width:699px) {
  #game-container .synthesis-tabs>button { flex-basis:31%; padding:3px; }
  #game-container .synthesis-columns { gap:8px; }
  #game-container .synthesis-inputs,#game-container .synthesis-pool { gap:3px; }
  #game-container .synthesis-face { width:clamp(34px,6.5cqw,45px); border-width:2px; }
  #game-container .synthesis-pool { min-height:0; }
  #game-container .synthesis-pool-heading { align-items:flex-start; flex-direction:column; gap:0; }
  #game-container .synthesis-force-note,#game-container .synthesis-duty-note { margin-top:4px; }
  #game-container .synthesis-footer { padding:0; }
  #game-container .synthesis-footer>.button { width:47%; }
}

/* Candidate portraits yield height to their name and grade lines. The
   parent owns a definite center height; its three/six candidates are paged
   by the game, so intrinsic portrait sizes must not push the pager out. */
#game-container .synthesis-right{
  display:grid;grid-template-rows:auto minmax(0,1fr) auto;min-height:0;gap:3px;
}
#game-container .synthesis-pool{
  grid-template-rows:repeat(2,minmax(0,1fr));min-height:0;align-content:stretch;
}
#game-container .synthesis-panel[data-synthesis-page-size="3"] .synthesis-pool{
  grid-template-rows:minmax(0,1fr);
}
#game-container .synthesis-pool>.synthesis-candidate{
  display:grid;grid-template-rows:minmax(0,1fr) auto auto;justify-items:center;
  min-height:0;min-width:0;gap:2px;
}
#game-container .synthesis-pool>.synthesis-candidate>.synthesis-face{
  width:auto;height:100%;max-width:100%;max-height:70px;min-height:0;
  aspect-ratio:1;align-self:center;
}
#game-container .synthesis-pagination{min-height:30px;padding-top:0;margin-top:0;}
#game-container .synthesis-panel .synthesis-footer>.button{
  white-space:normal;line-height:1.1;padding:3px 6px;
}
