.gam-talk-container {
  max-width: 1120px;
}
.gam-talk-intro {
  padding: 1.2rem 1.4rem;
  border: 1px solid #d5e6e3;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(32, 69, 88, 0.08);
}
.gam-talk-intro h1 {
  margin: 0 0 0.4rem;
  color: #0d5c7a;
  font-size: 1.2rem;
}
.gam-talk-intro p {
  margin: 0;
  color: #64748b;
  font-size: 0.88rem;
}
.gam-talk-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}
.gam-talk-generator {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  border: 1px solid #d5e6e3;
  background: #fff;
  box-shadow: 0 14px 36px rgba(32, 69, 88, 0.09);
}
.gam-talk-stage {
  display: grid;
  place-items: center;
  padding: 1rem;
  background: #edf3f3;
  min-width: 0;
}
.gam-talk-stage canvas {
  display: block;
  width: auto;
  max-width: 100%;
  height: min(72vh, 760px);
  max-height: calc(100vw * 1.777);
  background: repeating-conic-gradient(#edf1f1 0 25%, #fff 0 50%) 50%/20px 20px;
  box-shadow: 0 10px 28px rgba(15, 49, 60, 0.2);
  cursor: grab;
  touch-action: auto;
}
.gam-talk-stage canvas.is-dragging {
  cursor: grabbing;
}
.gam-talk-editor {
  border-left: 1px solid #d5e6e3;
  background: #fbfdfd;
}
.gam-talk-editor section {
  padding: 1rem;
  border-bottom: 1px solid #e0ecea;
}
.gam-talk-editor h2 {
  margin: 0 0 0.65rem;
  color: #153f48;
  font-size: 0.88rem;
}
.gam-talk-file,
.gam-talk-controls button,
.gam-talk-frames button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid #bfd7d3;
  background: #fff;
  color: #17434b;
  font:
    700 0.76rem "Noto Sans JP",
    sans-serif;
  cursor: pointer;
}
.gam-talk-file {
  position: relative;
  gap: 0.4rem;
  overflow: hidden;
}
.gam-talk-file input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.gam-talk-controls {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  gap: 0.45rem;
  margin-top: 0.55rem;
}
.gam-talk-frames {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
}
.gam-talk-frames button.is-active {
  background: #0f766e;
  color: #fff;
  border-color: #0f766e;
}
.gam-talk-other {
  margin-top: 1.5rem;
  padding-top: 1.4rem;
  border-top: 1px solid rgba(15, 23, 42, 0.18);
}
.gam-talk-other header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}
.gam-talk-other h2 {
  margin: 0;
  color: #123f49;
  font-size: 1.05rem;
}
.gam-talk-other a {
  color: #0f766e;
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none;
}
.gam-talk-menu {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}
.gam-talk-menu a {
  overflow: hidden;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(32, 69, 88, 0.09);
}
.gam-talk-menu img {
  display: block;
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}
@media (max-width: 780px) {
  .gam-talk-generator {
    grid-template-columns: 1fr;
  }
  .gam-talk-editor {
    border-left: 0;
    border-top: 1px solid #d5e6e3;
  }
  .gam-talk-stage {
    padding: 0.5rem;
  }
  .gam-talk-stage canvas {
    width: 100%;
    height: auto;
  }
  .gam-talk-menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
  }
}
.gam-talk-frames {
  display: none;
}
.gam-talk-color {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  min-height: 44px;
  padding: 0.45rem 0.65rem;
  border: 1px solid #bfd7d3;
  border-radius: 8px;
  background: #fff;
  color: #17434b;
  font:
    700 0.75rem "Noto Sans JP",
    sans-serif;
  cursor: pointer;
}
.gam-talk-color span {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border: 1px solid rgba(15, 49, 60, 0.28);
  border-radius: 50%;
  background: var(--frame-gradient, var(--frame-color));
}
.gam-talk-color b {
  font: 700 0.75rem monospace;
}
.gam-talk-gradient-palette {
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.gam-talk-gradient-palette button {
  aspect-ratio: 1;
  border-radius: 14px;
}
.gam-talk-blur-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.gam-talk-blur-head h2 {
  margin: 0;
}
.gam-talk-switch {
  position: relative;
  width: 42px;
  height: 24px;
}
.gam-talk-switch input {
  position: absolute;
  opacity: 0;
}
.gam-talk-switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #b6c7c5;
  cursor: pointer;
}
.gam-talk-switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.18);
  transition: 0.2s;
}
.gam-talk-switch input:checked + span {
  background: #0f766e;
}
.gam-talk-switch input:checked + span::after {
  transform: translateX(18px);
}
.gam-talk-blur-range {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.8rem;
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 700;
}
.gam-talk-blur-range input {
  width: 100%;
  accent-color: #0f766e;
}
.gam-talk-text-input {
  display: block;
  width: 100%;
  min-height: 42px;
  padding: 0.6rem 0.7rem;
  border: 1px solid #cfe1de;
  border-radius: 8px;
  background: #fff;
  color: #153f48;
  font:
    500 0.82rem "CollageTextA",
    "Noto Sans JP",
    sans-serif;
  resize: vertical;
}
.gam-talk-text-input:focus {
  outline: 0;
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}
.gam-talk-dialogue-input {
  min-height: 110px;
  line-height: 1.65;
}
@font-face {
  font-family: "CollageTextA";
  src: url("../../assets/fonts/IBMPlexSansJP-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
.gam-talk-stage {
  position: relative;
}
.gam-talk-stage:not(.has-photo)::after {
  content: "写真を追加してください";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  transform: translate(-50%, -50%);
  padding: 0.65rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 4px 16px rgba(15, 49, 60, 0.12);
  color: #52636c;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
}
.gam-talk-photo-buttons {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 0.45rem;
}
.gam-talk-photo-buttons .gam-talk-file {
  min-width: 0;
}
.gam-talk-clipboard {
  display: grid;
  place-items: center;
  width: 40px;
  min-height: 40px;
  padding: 0;
  border: 1px solid #bfd7d3;
  background: #fff;
  color: #17434b;
  cursor: pointer;
}
.gam-talk-clipboard:hover {
  border-color: #0f766e;
  background: #eef8f6;
}
.gam-talk-setting-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.gam-talk-setting-head h2 {
  margin: 0;
}
.gam-talk-theme-fields {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.75rem;
}
.gam-talk-theme-fields.is-hidden {
  display: none;
}
.gam-talk-theme-note {
  margin: 0.65rem 0 0;
  color: #64748b;
  font-size: 0.68rem;
  line-height: 1.65;
}
.gam-talk-theme-fields .gam-talk-text-input {
  font-family: "CollageTextA", "Noto Sans JP", sans-serif;
  font-weight: 500;
}

.gam-talk-choice-list {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.gam-talk-choice-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 0.45rem;
}

.gam-talk-choice-input {
  min-height: 0;
  overflow: hidden;
  resize: none;
}

.gam-talk-choice-remove,
.gam-talk-choice-add {
  min-height: 40px;
  border: 1px solid #bfd7d3;
  background: #fff;
  color: #17434b;
  font: 700 0.76rem "Noto Sans JP", sans-serif;
  cursor: pointer;
}

.gam-talk-choice-remove {
  display: grid;
  place-items: center;
}

.gam-talk-choice-add {
  width: 100%;
  margin-top: 0.55rem;
}

.gam-talk-choice-remove:disabled,
.gam-talk-choice-add:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}


.gam-talk-page[data-ba-kind] {
  --ba-font-medium: "BaRoundedMedium", "Noto Sans JP", sans-serif;
  --ba-font-regular: "BaRoundedRegular", "Noto Sans JP", sans-serif;
}

@font-face {
  font-family: "BaRoundedMedium";
  src: url("../../assets/fonts/rounded-mplus-2c-medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "BaRoundedRegular";
  src: url("../../assets/fonts/rounded-mplus-2c-regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

.ba-preview {
  position: relative;
  width: 100%;
  line-height: 0;
}

#baHomeName,
#baName,
.ba-choice-input {
  font-family: var(--ba-font-medium);
  font-weight: 500;
}

#baTitle,
#baDialogue {
  font-family: var(--ba-font-regular);
  font-weight: 400;
}

.gam-talk-page[data-ba-kind] .gam-talk-stage {
  align-content: start;
}

.gam-talk-page[data-ba-kind="talk"] .gam-talk-stage {
  align-content: center;
}

.gam-talk-page[data-ba-kind] .gam-talk-stage:not(.has-photo) {
  cursor: pointer;
}

.ba-preview canvas {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  aspect-ratio: 2285 / 1274;
  touch-action: none;
}

.ba-copy {
  width: 100%;
  min-height: 38px;
  border: 1px solid #bfd7d3;
  border-radius: 8px;
  background: #fff;
  color: #17434b;
  font: 700 0.78rem "Noto Sans JP", sans-serif;
  cursor: pointer;
}

.ba-choice-list {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.ba-choice-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 0.45rem;
}

.ba-choice-remove {
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 1px solid #bfd7d3;
  border-radius: 8px;
  background: #fff;
  color: #17434b;
  cursor: pointer;
}

.ba-choice-remove:disabled,
.ba-copy:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.ba-help {
  margin: 0.6rem 0 0;
  color: #64748b;
  font-size: 0.72rem;
  line-height: 1.5;
}

.ba-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
  color: #153f48;
  font-size: 0.83rem;
  font-weight: 700;
  cursor: pointer;
}

.ba-check input {
  accent-color: #0f766e;
}

@media (max-width: 780px) {
  .gam-talk-stage canvas {
    max-height: none;
  }
}
