/* Group Shuffle Simple – group-shuffle-simple.css */
/* 修正: v3.0.0で以下を変更
   - タブ／単一textarea／男女2列textarea（.tabs/.tab/.grid/.g2 まわり）を廃止し、
     チップ入力（.gs-entry-row/.gs-entry-input/.gs-chips/.gs-chip*）に置き換え
   - STEP2ヘッダーのボタン列（.gs-fs-actions）を廃止し、右下フロートボタン
     （.gs-fab-stack/.gs-fab/.gs-fab-zoom-group）に置き換え */
:root{
  --base:#FFFFFF;
  --base-light:#FAFAFA;
  --base-dark:#F5F5F5;

  --main:#1e3a5f;
  --main-light:#2d5a8f;
  --main-dark:#0f1e3a;

  --accent:#d4af37;
  --accent-light:#f4cf5f;
  --accent-dark:#b8941f;

  --text:#2C3E50;
  --text-light:#7F8C8D;

  --border:#E8E8E8;

  --male:#378ADD;
  --male-bg:#E6F1FB;
  --male-text:#0C447C;

  --female:#D4537E;
  --female-bg:#FBEAF0;
  --female-text:#72243E;

  --shadow: 0 4px 20px rgba(30, 58, 95, 0.10);
  --shadow-hover: 0 8px 30px rgba(30, 58, 95, 0.15);

  --overlay: rgba(2,6,23,.55);
}

*{box-sizing:border-box}
html,body{
  height:100%;
  margin:0;
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,"Hiragino Kaku Gothic ProN",Meiryo,sans-serif;
  color:var(--text);
  background: linear-gradient(135deg, #FFFFFF 0%, #F8F9FA 50%, #F0F2F5 100%);
  font-size: 18px;
}
.gs-app{width:100%}

textarea{
  width:100%;
  border:2px solid var(--border);
  border-radius:18px;
  padding:16px;
  background: var(--base);
  color: var(--text);
  font-size:19px;
  line-height:1.6;
  resize:vertical;
  transition: border-color .2s ease, box-shadow .2s ease, transform .15s ease;
}
select, input[type="number"]{
  border:2px solid var(--border);
  border-radius:14px;
  padding:12px 14px;
  background: var(--base);
  color: var(--text);
  font-weight:900;
  font-size:19px;
  transition: border-color .2s ease, box-shadow .2s ease, transform .15s ease;
}
select:focus, input[type="number"]:focus{
  outline:none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(212,175,55,.15);
  transform: scale(1.01);
}

input[type="checkbox"]{
  appearance:none;
  width:22px;height:22px;
  border:2px solid var(--border);
  border-radius:6px;
  background: var(--base);
  cursor:pointer;
  position:relative;
  transition: all .18s ease;
}
input[type="checkbox"]:checked{
  border-color: var(--main);
  background: var(--main);
}
input[type="checkbox"]:checked::after{
  content:'✓';
  position:absolute;
  top:50%;left:50%;
  transform:translate(-50%,-54%);
  color: var(--accent);
  font-weight:1200;
  font-size:14px;
}

.row{display:flex;flex-wrap:wrap;gap:12px;align-items:center}

/* WPテーマのbutton/input既定幅で折り返される対策（「30」と「番号で一括生成」を1段に固定） */
.num-tools{flex-wrap:nowrap !important;}
#autoCount{width:110px !important; flex:0 0 auto !important;}
#fillNumbers{flex:0 0 auto !important; width:auto !important;}
@media (max-width: 520px){
  .num-tools{flex-wrap:wrap !important;}
  #autoCount{width:100% !important;}
  #fillNumbers{width:100% !important;}
}
.grow{flex:1}
.hr{
  height:2px;
  background: linear-gradient(90deg, transparent, rgba(212,175,55,.55), transparent);
  border-radius:1px;
  margin:14px 0;
}

.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 14px;
  border-radius:999px;
  background: #FFFCF5;
  border:2px solid rgba(212,175,55,.55);
  color: var(--main);
  font-weight:1100;
  font-size:16px;
  box-shadow: 0 2px 10px rgba(212,175,55,.10);
  user-select:none;
  white-space: nowrap;
}
.pill .dot{
  width:10px;height:10px;border-radius:999px;
  background: linear-gradient(135deg, var(--accent-light), var(--accent-dark));
  box-shadow: 0 2px 6px rgba(212,175,55,.25);
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:auto;
  max-width:none;
  appearance:none;
  border:none;
  cursor:pointer;
  border-radius:14px;
  padding:14px 18px;
  font-weight:1100;
  font-size:18px;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
  white-space:nowrap;
  user-select:none;
}
.btn:disabled{opacity:.55;cursor:not-allowed;transform:none !important}

.btn-primary{
  background: linear-gradient(135deg, var(--main-light) 0%, var(--main) 100%);
  color:#fff;
  box-shadow: 0 6px 16px rgba(30,58,95,.28);
}
.btn-primary:hover{
  background: linear-gradient(135deg, var(--main) 0%, var(--main-dark) 100%);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(30,58,95,.35);
}

.btn-gold{
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent) 100%);
  color: var(--main-dark);
  box-shadow: 0 6px 16px rgba(212,175,55,.22);
}

.btn-outline{
  background: var(--base);
  color: var(--main);
  border:2px solid var(--main);
  box-shadow: 0 3px 10px rgba(30,58,95,.10);
}
.btn-outline:hover{
  background: var(--main);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(30,58,95,.24);
}

.btn-ghost{
  background: var(--base);
  color: var(--main);
  border:2px dashed rgba(212,175,55,.85);
  box-shadow: none;
  padding: 12px 14px;
  font-size: 16px;
  border-radius: 14px;
}
.btn-ghost:hover{
  background: #FFFCF5;
  transform:none;
}

.warntext{
  color: #991b1b;
  background: #fff1f2;
  border:1px solid #fecdd3;
  border-radius:14px;
  padding:10px 12px;
  font-weight:1100;
  font-size:16px;
}

.groups{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap:18px;
}

.group{
  background: linear-gradient(135deg, var(--base) 0%, var(--base-light) 100%);
  border:2px solid var(--border);
  border-radius:18px;
  padding:16px;
  box-shadow: 0 8px 18px rgba(30,58,95,.08);
  transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease;
  position:relative;
  overflow:hidden;
}
.group::before{
  content:'';
  position:absolute;top:0;left:0;right:0;height:3px;
  background: linear-gradient(90deg, var(--main), var(--accent), var(--main));
  opacity:.22;
}
.group:hover{
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(30,58,95,.20);
}

.group h3{
  margin:0 0 10px;
  display:flex;align-items:baseline;gap:8px;flex-wrap:wrap;
  color: var(--main);
  font-weight:1100;
}
.gnum{
  font-size:30px;
  font-weight:1200;
  line-height:1;
  color: var(--main);
  letter-spacing:.5px;
}
.gcount{
  font-size:16px;
  color: var(--text-light);
  font-weight:900;
}

.member{
  margin:8px 0;
  padding:10px 12px;
  border-radius:14px;
  background: linear-gradient(135deg, #FFFFFF 0%, #FFFCF5 100%);
  border:1px solid rgba(212,175,55,.35);
  display:flex;align-items:center;justify-content:flex-start;gap:10px;
  transition: background .2s ease, border-color .2s ease;
}
.member:hover{
  background: linear-gradient(135deg, #FFFCF5 0%, #FFF3C4 100%);
  border-color: rgba(212,175,55,.65);
}
.mname{
  font-size:18px;
  font-weight:1100;
  line-height:1.2;
  word-break:break-word;
  flex:1;
}
.mname.is-num{
  font-size:34px;
  font-weight:1250;
  letter-spacing:.8px;
}

/* Pairs */
.groups.pairs{
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap:12px;
}
.pair{
  background: linear-gradient(135deg, var(--base) 0%, var(--base-light) 100%);
  border:2px solid var(--border);
  border-radius:16px;
  padding:12px;
  box-shadow: 0 8px 18px rgba(30,58,95,.07);
  position:relative;
  overflow:hidden;
}
.pair::before{
  content:'';
  position:absolute;top:0;left:0;right:0;height:3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light), var(--accent));
  opacity:.5;
}
.pair-title{
  margin:0 0 8px;
  display:flex;align-items:baseline;gap:8px;flex-wrap:wrap;
  color: var(--main);
  font-weight:1200;
  font-size:16px;
}
.pnum{
  font-size:30px;
  font-weight:1250;
  line-height:1;
  letter-spacing:.5px;
}
.pair-names{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}
.pair-name{
  padding:10px 10px;
  border-radius:14px;
  background: linear-gradient(135deg, #FFFFFF 0%, #FFFCF5 100%);
  border:1px solid rgba(212,175,55,.35);
  display:flex;align-items:center;justify-content:flex-start;gap:10px;
}
.pname{
  font-size:18px;
  font-weight:1100;
  line-height:1.2;
  word-break:break-word;
  flex:1;
}
.pname.is-num{
  font-size:32px;
  font-weight:1250;
  letter-spacing:.8px;
}

.hidden{display:none !important}
.spacer{height:12px}

.mini-dot{
  width:9px;height:9px;border-radius:999px;
  background: linear-gradient(135deg, var(--accent-light), var(--accent-dark));
  flex:0 0 auto;
}

/* ===== 起動ボタン（アプリを閉じている間、ページに残る入口） ===== */
.gs-launch-btn{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:14px 22px;
  border:none;
  border-radius:999px;
  cursor:pointer;
  background: linear-gradient(135deg, var(--main-light) 0%, var(--main) 100%);
  color:#fff;
  font-weight:1100;
  font-size:18px;
  box-shadow: 0 8px 24px rgba(30,58,95,.28);
  transition: transform .15s ease, box-shadow .2s ease;
}
.gs-launch-btn:hover{
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(30,58,95,.34);
}
.gs-launch-dot{
  width:10px;height:10px;border-radius:999px;
  background: linear-gradient(135deg, var(--accent-light), var(--accent-dark));
}

/* ===== STEP1: 名簿入力（モーダル） ===== */
.gs-overlay{
  position:fixed; inset:0;
  background: var(--overlay);
  display:none;
  align-items:center;
  justify-content:center;
  padding:14px;
  z-index:9999;
}
.gs-overlay.show{display:flex}

.gs-dialog{
  width:min(760px, 100%);
  max-height:min(92vh, 900px);
  background: rgba(255,255,255,.98);
  border:1px solid rgba(232,232,232,.9);
  border-radius:22px;
  box-shadow: 0 30px 90px rgba(2,6,23,.35);
  overflow:hidden;
  display:flex;
  flex-direction:column;
}

.gs-dialog-header{
  display:flex;
  align-items:center;
  gap:10px;
  padding:14px 16px;
  background: linear-gradient(135deg, var(--main-light) 0%, var(--main) 70%, var(--main-dark) 100%);
  border-bottom:3px solid var(--accent);
}
.gs-dialog-title{
  font-weight:1200;
  color:#fff;
  font-size:18px;
  display:flex;
  align-items:center;
  gap:8px;
  user-select:none;
}
.gs-dialog-body{
  padding:18px;
  overflow:auto;
  flex:1;
  min-height:0;
}

.gs-dialog-footer{
  flex:0 0 auto;
  padding:12px 18px;
  border-top:1px solid var(--border);
  background: rgba(255,255,255,.98);
  display:flex;
  justify-content:flex-end;
}

/* ===== STEP1: 人数タイル／男女ペアトグル ===== */
.gs-settings-block{
  display:flex;
  flex-direction:column;
  gap:14px;
}
.gs-settings-label{
  font-size:14px;
  font-weight:1000;
  color: var(--text-light);
}
.gs-tile-group{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.gs-tile{
  width:54px;
  height:54px;
  border-radius:16px;
  border:2px solid var(--border);
  background: var(--base);
  color: var(--main);
  font-weight:1200;
  font-size:21px;
  cursor:pointer;
  transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease, color .2s ease;
}
.gs-tile:hover{
  border-color: var(--accent);
  transform: translateY(-1px);
}
.gs-tile.active{
  background: linear-gradient(135deg, var(--main-light) 0%, var(--main) 100%);
  border-color: var(--main);
  color:#fff;
  box-shadow: 0 6px 16px rgba(30,58,95,.28);
  transform: translateY(-2px);
}

.gs-toggle-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  cursor:pointer;
}
.gs-toggle{
  position:relative;
  display:inline-flex;
  align-items:center;
  flex:0 0 auto;
}
.gs-toggle input{
  position:absolute;
  inset:0;
  opacity:0;
  margin:0;
  cursor:pointer;
}
.gs-toggle-track{
  width:52px;
  height:30px;
  border-radius:999px;
  background: var(--border);
  position:relative;
  transition: background .2s ease;
}
.gs-toggle-thumb{
  position:absolute;
  top:3px; left:3px;
  width:24px; height:24px;
  border-radius:50%;
  background:#fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
  transition: transform .2s ease;
}
.gs-toggle input:checked + .gs-toggle-track{
  background: var(--main);
}
.gs-toggle input:checked + .gs-toggle-track .gs-toggle-thumb{
  transform: translateX(22px);
}
.gs-toggle input:disabled + .gs-toggle-track{
  opacity:.4;
  cursor:not-allowed;
}

.gs-icon-btn{
  margin-left:auto;
  flex:0 0 auto;
  width:34px; height:34px;
  border:none;
  border-radius:999px;
  cursor:pointer;
  background: rgba(255,255,255,.15);
  color:#fff;
  font-size:20px;
  line-height:1;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  transition: background .2s ease, transform .15s ease;
}
.gs-icon-btn:hover{
  background: rgba(255,255,255,.28);
  transform: rotate(90deg);
}

/* ===== チップ入力（名簿） ===== */
.gs-entry-row{
  display:flex;
  gap:10px;
  align-items:flex-end;
}
.gs-entry-input{
  flex:1;
  min-height:52px;
  max-height:180px;
  border:2px solid var(--border);
  border-radius:16px;
  padding:14px 16px;
  background: var(--base);
  color: var(--text);
  font-size:18px;
  line-height:1.4;
  font-family:inherit;
  resize:none;
  overflow-y:auto;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.gs-entry-input:focus{
  outline:none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(212,175,55,.15);
}
.gs-entry-row .btn{
  flex:0 0 auto;
}

.gs-chips{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap:10px;
}
/* 全件が番号のときだけ、番号タイル用に列を詰める（renderChips()がJSでこのクラスを付け外しする） */
.gs-chips.gs-chips-compact{
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap:8px;
}
.gs-chips-empty{
  margin:4px 2px 0;
  font-size:15px;
  color: var(--text-light);
}

.gs-chip{
  display:inline-flex;
  align-items:center;
  justify-content:space-between;
  gap:6px;
  width:100%;
  padding:10px 8px 10px 14px;
  border-radius:999px;
  border:2px solid var(--border);
  background: var(--base);
  color: var(--text);
  font-weight:1000;
  font-size:17px;
  cursor:pointer;
  user-select:none;
  transition: transform .1s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease, opacity .2s ease;
}
.gs-chip:hover{
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(30,58,95,.10);
}
.gs-chip-label{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  flex:1;
  min-width:0;
  text-align:left;
}
.gs-chip-tag{
  font-size:12px;
  font-weight:1000;
  opacity:.75;
  flex:0 0 auto;
}
.gs-chip-U{border-color: var(--border); color: var(--text);}
.gs-chip-B{border-color: var(--male); background: var(--male-bg); color: var(--male-text);}
.gs-chip-G{border-color: var(--female); background: var(--female-bg); color: var(--female-text);}

/* 番号チップ：タップでON/OFF（削除ではなく一時的に対象から除外）。×やタグ文字は持たず、
   ON=色付き（塗り） / OFF=色なし（アウトラインのみ）の配色だけで状態を表す、コンパクトなタイル */
.gs-chip-num{
  justify-content:center;
  padding:10px 6px;
  font-size:18px;
  text-align:center;
  border-color: var(--main);
  background: linear-gradient(135deg, var(--main-light) 0%, var(--main) 100%);
  color:#fff;
}
.gs-chip-num .gs-chip-label{
  flex:0 0 auto;
  text-align:center;
  overflow:visible;
  text-overflow:clip;
}
.gs-chip-num.gs-chip-off{
  border-color: var(--border);
  background: var(--base);
  color: var(--text-light);
}

.gs-chip-del{
  width:22px; height:22px;
  border-radius:50%;
  border:none;
  cursor:pointer;
  background: rgba(0,0,0,.08);
  color: inherit;
  font-size:14px;
  line-height:1;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
}
.gs-chip-del:hover{background: rgba(0,0,0,.18);}

/* ===== STEP2: 結果（全画面アプリ画面） ===== */
.gs-fullscreen{
  position:fixed; inset:0;
  background: linear-gradient(135deg, #FFFFFF 0%, #F8F9FA 50%, #F0F2F5 100%);
  display:none;
  flex-direction:column;
  z-index:9998;
  --zoom: 1;
}
.gs-fullscreen.show{display:flex}

.gs-fs-header{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  padding:12px 16px;
  background: linear-gradient(135deg, var(--main-light) 0%, var(--main) 70%, var(--main-dark) 100%);
  border-bottom:3px solid var(--accent);
}
.gs-fs-title{
  font-weight:1200;
  color:#fff;
  font-size:17px;
  display:flex;
  align-items:center;
  gap:8px;
  user-select:none;
}
.gs-fs-body{
  flex:1;
  overflow:auto;
  padding:16px;
  padding-bottom:220px; /* 右下フロートボタンと結果カードが重ならないよう余白確保 */
}

.zoom-inner{
  zoom: var(--zoom);
  width:100%;
}
@supports not (zoom: 1){
  .zoom-inner{
    zoom: 1;
    transform: scale(var(--zoom));
    transform-origin: top left;
    width: 100%;
    display:inline-block;
  }
}
#zoomSpacer{height:0}

/* ===== 右下フロートボタン（FAB） ===== */
.gs-fab-stack{
  position:absolute;
  right:16px;
  bottom:16px;
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:10px;
  z-index:5;
}
.gs-fab{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:56px;
  height:52px;
  padding:0 18px;
  border-radius:999px;
  border:none;
  cursor:pointer;
  font-weight:1100;
  font-size:15px;
  white-space:nowrap;
  box-shadow: 0 8px 22px rgba(30,58,95,.26);
  transition: transform .15s ease, box-shadow .2s ease;
}
.gs-fab:hover{
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(30,58,95,.32);
}
.gs-fab-primary{
  background: linear-gradient(135deg, var(--main-light) 0%, var(--main) 100%);
  color:#fff;
}
.gs-fab-gold{
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent) 100%);
  color: var(--main-dark);
}
.gs-fab-outline{
  background: rgba(255,255,255,.96);
  color: var(--main);
  border:2px solid var(--main);
}

.gs-fab-zoom-group{
  display:flex;
  gap:6px;
  background: rgba(255,255,255,.96);
  border:2px solid var(--main);
  border-radius:999px;
  padding:6px;
  box-shadow: 0 8px 22px rgba(30,58,95,.2);
}
.gs-fab-zoom-group button{
  height:36px;
  min-width:36px;
  padding:0 10px;
  border-radius:999px;
  border:none;
  background: var(--base);
  color: var(--main);
  font-weight:1100;
  font-size:14px;
  cursor:pointer;
  transition: background .2s ease, color .2s ease;
}
.gs-fab-zoom-group button:hover{
  background: var(--main);
  color:#fff;
}

@media (max-width: 768px){
  html,body{font-size:17px}
  .groups{grid-template-columns:1fr}
  textarea{font-size:18px}
  .gnum{font-size:28px}
  .mname.is-num{font-size:30px}
  .pnum{font-size:26px}
  .pname.is-num{font-size:28px}
  /* タブレット・スマホではSTEP1モーダルも全画面表示にして操作領域を最大化 */
  .gs-dialog{width:100%; height:100%; max-height:100vh; border-radius:0;}
  .gs-fab-stack{right:10px; bottom:10px; gap:8px;}
  .gs-fab{height:46px; min-width:46px; padding:0 14px; font-size:14px;}
}

/* 印刷時：全画面レイヤーの固定表示・フロートボタン等を通常表示に戻す */
@media print{
  .gs-launch-btn, .gs-overlay, .gs-fs-header, .gs-fab-stack{display:none !important}
  .gs-fullscreen{position:static !important; display:block !important; background:none !important; height:auto !important;}
  .gs-fs-body{overflow:visible !important; padding:0 !important;}
  .zoom-inner{zoom:1 !important; transform:none !important;}
}
