:root {
  --bg: #f6f6f6;
  --card: #ffffff;
  --bd: #e3e3e3;
  --txt: #111;
  --muted: #666;
  --primary: #0b6;
  --danger: #d33;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Hiragino Kaku Gothic ProN","Noto Sans JP",sans-serif;
  background: var(--bg);
  color: var(--txt);
}

.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--card);
  border-bottom: 1px solid #ddd;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.title { font-weight: 800; font-size: 16px; }
.sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.bar__right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.badge {
  font-size: 12px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid #ddd;
  background: #fafafa;
}

.wrap {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 900px;
  margin: 0 auto;
}

.card {
  background: var(--card);
  border: 1px solid var(--bd);
  border-radius: 14px;
  padding: 10px;
}

h2 { margin: 0 0 8px; font-size: 16px; }

.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 10px 0;
}
.row.tight { margin: 6px 0; gap: 8px; }

label { font-size: 14px; color: #222; }

input[type="text"], select {
  font-size: 18px;
  padding: 12px 12px;
  border: 1px solid #ccc;
  border-radius: 12px;
  min-height: 46px;
}

select.compact {
  width: auto;
  min-width: 0;
  flex: 0 0 auto;
  padding: 10px 10px;
  font-size: 16px;
  min-height: 40px;
}

select.wide, input.wide {
  flex: 1 1 220px;
  min-width: 160px;
}

.seg {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.seg__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 12px;
  background: #fff;
  user-select: none;
}
.seg__item.small {
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 14px;
}
.compactSeg { gap: 6px; }

.pill {
  padding: 7px 10px;
  border-radius: 999px;
  background: #eee;
  font-size: 13px;
  border: 1px solid #ddd;
  white-space: nowrap;
}

.btn {
  font-size: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #ccc;
  background: #fff;
  cursor: pointer;
  min-height: 52px;
}
.btn.primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  font-weight: 800;
}
.btn.danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
  font-weight: 800;
}
.btn.full { width: 100%; }

.textarea {
  width: 100%;
  font-size: 15px;
  padding: 10px;
  border-radius: 14px;
  border: 1px dashed #bbb;
  background: #fafafa;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  line-height: 1.45;
}

.sendbar {
  position: sticky;
  bottom: 0;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(6px);
  border-top: 1px solid #eee;
  padding: 10px;
  border-radius: 14px;
  margin-top: 10px;
}

/* toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: rgba(20,20,20,0.85);
  color: #fff;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 999;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

/* スコア入力 */
.scoreBox {
  flex: 1 1 260px;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.scoreRow {
  display: flex;
  gap: 8px;
  align-items: center;
}
.scoreTeam {
  min-width: 64px;
  font-weight: 700;
  font-size: 14px;
  color: #222;
  white-space: nowrap;
}
.scoreInput {
  flex: 1 1 auto;
  min-width: 140px;
  font-size: 16px;
  padding: 10px 12px;
  min-height: 40px;
}
.scoreTotal{
  font-size: 13px;
  color: #333;
  background: #f2f2f2;
  border: 1px solid #e1e1e1;
  border-radius: 12px;
  padding: 8px 10px;
  white-space: nowrap;
}

.scoreTotal b{
  font-size: 16px;
}

.scoreInput{
  flex: 1 1 auto;
}
