@charset "utf-8";

/* // 
---------------------------------------------------------------------------------------------------- */
:root {
  --box-v-gap: 20px;
}
@media screen and (max-width:735px){
  :root {
    --box-v-gap: 2.5em;
    --box-h-gap: 10px;
  }
}
body {
  grid-template-rows: 0 auto max-content;
}

button,
.button[onclick] {
  display: inline-block;
  padding: 5px 7px;
  line-height: 1;
  border-width: 1px;
  border-style: solid;
  border-radius: 5px;
  cursor: pointer;
  background: linear-gradient(to bottom, #f0f7ff, #c0c7cf);
  color: #000;
  text-shadow: none;
}
button:hover,
.button[onclick]:hover {
  background: #c0c7cf;
}

/* // フォーム設定
---------------------------------------------------------------------------------------------------- */
html {
  overflow: visible;
}
main {
  padding-top: 0;
  overflow: visible;
}
@media screen and (max-width:735px){
  main {
    padding-top: 6em;
    border-width: 0 10px;
    border-color: transparent;
    overflow-x: hidden;
  }
}
header {
  display: none;
}
footer {
  grid-row: 3;
}

select option,
select optgroup {
  background-color: #fff;
  color: #000;
}
input,
select {
  font-weight: inherit;
}
input[type=checkbox] {
  margin: 0 .2rem;
  transform: scale(1.3);
}
input::placeholder {
  opacity: 0.5;
}
input[list]::-webkit-calendar-picker-indicator {
  width: .5em !important;
  padding-inline-start: 2px !important;
  padding-inline-end: 2px !important;
}
input[list]:is(:not(:hover),:focus)::-webkit-calendar-picker-indicator {
  display: none !important;
}

h2[onclick],
h4[onclick] {
  cursor: pointer;
}
h2[onclick]:hover,
h4[onclick]:hover {
  background: linear-gradient(to top, #cef 20%, transparent 30%, transparent);
}
input.fail,
select.fail,
.fail input,
.fail select {
  background-color: rgba(125,125,125,0.2);
}
dt.fail, dt.fail + dd {
  background-color: rgba(125,125,125,0.2) !important;
  opacity: 0.9;
}
dt.fail::before {
  content: "✖ ";
  font-weight: bold;
  color: #c00;
}
.night dt.fail::before {
  color: #e80;
}
dt.fail > select,
dt.fail + dd > input {
  background-color: transparent;
}
.fail select option,
.fail select optgroup {
  background-color: #ddd;
  color: #000;
}
input.error,
select.error,
label.error,
.error input,
.error select {
  color: #c00;
  border-color: #f00;
  border-style: dotted !important;
  background-color: rgba(255,0,0,0.1);
}
.night input.error,
.night select.error,
.night label.error,
.night .error input,
.night .error select {
  color: #ea0;
  border-color: #f70;
  background-color: rgba(255,0,0,0.1);
}
.mark input,
.mark select,
input.mark,
select.mark,
span.mark {
  background: rgba(255,200,0,0.3);
  font-weight: bold;
}
span.mark {
  padding: 1px 3px;
  border-radius: 5px;
  border-width: 1px;
  border-style: solid;
}

label:is(.radio-button, .check-button) {
  display: inline-block;
  margin: 0 1px;
  padding: 3px 4px 1px 2px;
  border-width: 1px;
  border-style: solid;
  border-radius: 5px;
  line-height: 1;
  font-size: 88%;
  cursor: pointer;
  user-select: none;
}
label:is(.radio-button, .check-button) input {
  cursor: pointer;
  margin: 0 .1em 0 0 !important;
  transform: none !important;
  vertical-align: text-top;
}
label:is(.radio-button, .check-button):not(:has(span)) {
  padding-right: 2px;
}
label:is(.radio-button, .check-button):not(:has(span)) input {
  margin-right: 0 !important;
  transform: scale(1.2) !important;
}
label:is(.radio-button, .check-button) span {
  opacity: 0.6;
}
label:is(.radio-button, .check-button):hover span {
  opacity: 1;
}
label:is(.radio-button, .check-button) input:checked + span {
  opacity: 1;
}
label:is(.radio-button, .check-button) span::before {
  display: inline-block;
  margin-right: .2em;
  transform: scale(1.3) translateY(1px);
}

.select-input.free {
  display: inline-block;
  line-height: 1;
}
.select-input.free select {
  margin-bottom: 0 !important;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.select-input.free input  {
  margin-top: 0 !important;
  border-top: 0;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}
.select-input:not(.free) input { display: none; }

/* 非表示 */
.hidden {
  display: none;
}
/* テーブル */
.edit-table,
.edit-tables table,
.edit-tables ul,
.edit-tables dl {
  width: 100%;
  border-style: hidden hidden none;
}
@media screen and (max-width:735px){
  .edit-table,
  .edit-tables table,
  .edit-tables ul,
  .edit-tables dl {
    min-width: calc(100% - 1rem);
  }
}
.edit-table.side-margin,
.edit-tables.side-margin table,
.edit-tables.side-margin ul,
.edit-tables.side-margin dl {
  width: calc(100% - 1rem);
  margin: 0 .5rem;
}
.edit-table:last-child,
.edit-tables table {
  border-bottom-style: hidden;
}
table.edit-table:not(.side-margin) thead th,
.edit-tables:not(.side-margin) table thead th {
  padding: .3rem 0 .2rem;
  border-width: 0;
  line-height: 1;
}
table.edit-table > tbody tr,
.edit-tables table tbody tr {
  border-width: 1px 0;
  border-style: solid;
}
table.edit-table:last-child {
  border-bottom-style: hidden !important;
}
table.edit-table:not(.side-margin):not(.no-border-cells) tbody > tr > *,
.edit-tables:not(.side-margin):not(.no-border-cells) table tbody > tr > * {
  border-left-width: 1px;
  border-right-width: 1px;
  border-left-style: dotted;
  border-right-style: dotted;
}
table.edit-table.line-tbody.no-border-cells tbody > tr {
  border-width: 0px;
}
table.edit-table.line-tbody.no-border-cells tbody {
  border-width: 1px 0;
  border-style: solid;
}
table.edit-table:not(.line-tbody).no-border-cells tbody tr > * {
  padding-top: 2px;
  padding-bottom: 2px;
}
table.edit-table.line-tbody.no-border-cells tbody tr:first-child > * {
  padding-top: 2px;
}
table.edit-table.line-tbody.no-border-cells tbody tr:last-child > * {
  padding-bottom: 2px;
}
table.edit-table tbody td select,
table.edit-table tbody td textarea,
table.edit-table tbody td input[type="text"],
table.edit-table tbody td input[type="number"],
table.edit-table tbody td input[type="url"] {
  width: calc(100% - 2px);
  margin: 1px;
}
table.edit-table.no-border-cells tbody td select,
table.edit-table.no-border-cells tbody td textarea,
table.edit-table.no-border-cells tbody td input[type="text"],
table.edit-table.no-border-cells tbody td input[type="number"],
table.edit-table.no-border-cells tbody td input[type="url"] {
  width: calc(100% - 1px);
  margin: 1px 1px 1px 0;
}
table.edit-table:not(.side-margin).line-tbody tbody:nth-of-type(even),
table.edit-table:not(.side-margin):not(.line-tbody) tbody tr:nth-of-type(even),
.edit-tables:not(.side-margin) table.line-tbody tbody:nth-of-type(even),
.edit-tables:not(.side-margin) table:not(.line-tbody) tbody tr:nth-of-type(even) {
  background-color: var(--box-even-rows-bg-color);
}

ul.edit-table > li,  .edit-tables ul  > li,
dl.edit-table > *,   .edit-tables dl  > *  {
  border-width: 0 0 1px;
  border-style: solid;
}
ul.edit-table:last-child > li:last-child,
dl.edit-table:last-child > dt:last-of-type,
dl.edit-table:last-child > dt:last-of-type ~ dd,
.edit-tables ul:last-child > li:last-child,
.edit-tables dl:last-child > dt:last-of-type,
.edit-tables dl:last-child > dt:last-of-type ~ dd {
  border-bottom-style: hidden;
}

input.auto {
  text-align: center;
  border: hidden;
  background-color: transparent;
  font-size: 100%;
  cursor: inherit;
}
/* Sortable */
.sortable-drag {
}
.sortable-chosen {
}
.sortable-ghost {
  background-color: hsla(50,100%,50%,0.3) !important;
}
.sortable-swap-highlight {
  background-color: hsla(100,100%,50%,0.3) !important;
}
.handle {
  cursor: ns-resize;
}
.handle::before {
  content: '::';
  font-family: Arial;
  font-weight: bold;
  white-space: nowrap;
}

/* // メニュー
---------------------------------------------------------------------------------------------------- */
#header-menu {
  position: sticky;
  top: 0px;
  z-index: 1;
  background: rgba(90,90,90,0.9);
  border-width: 0 1px 1px;
  border-style: solid;
  border-color: transparent;
  border-radius: 0 0 .5em .5em;
  color: #fff;
}
#header-menu h2 {
  display: grid;
  align-items: flex-end;
  height: calc(1.6em + 6px);
  padding: 1px .2em 3px;
  border-width: 0 0 1px;
  border-style: solid;
  border-color: rgba(200,200,200,0.3);
  font-size: 130%;
  font-family: var(--base-font-family-min);
  line-height: 1;
  text-shadow: #000 0px 0px .1rem,
    #000  .1rem .1rem, #000 -.1rem -.1rem,
    #000 -.1rem .1rem, #000  .1rem -.1rem,
    #000  .0rem .1rem, #000  .0rem -.1rem,
    #000 -.1rem .0rem, #000  .1rem  .0rem;
  white-space: nowrap;
  overflow: hidden;
}
#header-menu h2 .aka {
  margin-right: .5em;
}
#header-menu h2 ruby rt {
  font-size: 0.6em;
}
@-moz-document url-prefix() {
  #header-menu h2 ruby rt {
    margin-bottom: -.8ex;
  }
}
#header-menu ul {
  display: flex;
  line-height: 1;
  font-weight: bold;
}
#header-menu ul li {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0 1rem;
  cursor: pointer;
  user-select: none;
}
#header-menu ul li:not(.buttons) {
  border-width: 0 1px 0 0;
  border-style: solid;
  border-color: rgba(200,200,200,0.3);
}
#header-menu ul li:not(.buttons):hover {
  background: rgba(0,0,0,0.5) !important;
}
#header-menu ul li span {
  display: inline-block;
}

#header-menu ul li.buttons {
  display: flex;
  flex-wrap: nowrap;
  margin-left: auto;
  padding: 0;
}
#header-menu ul li.buttons li {
  padding: .4em .5em;
  border-width: 0 0 0 1px;
  border-radius: 0;
}
#header-menu ul li.buttons li.submit {
  padding: .3em 1em;
  background: #3a55;
  border-radius: 0 0 5px 0;
}
#header-menu ul li.buttons li.submit.dimmed {
  opacity: 0.3;
  cursor: progress;
}
section {
  margin-top: 2em;
}
section > h2 {
  margin-top: var(--box-v-gap);
}

#header-menu ul li[title] {
  position: relative;
}
#header-menu ul li[title]:hover::after {
  content: attr(title);
  position: absolute;
  display: block;
  width: max-content;
  padding: .5em;
  background: rgba(0,0,0,0.5);
  font-size: 90%;
  font-weight: normal;
  bottom: -2em;
}

#header-menu ul li[class$=icon] {
  width: 3em;
}
#header-menu ul li:is(.help-icon, .color-icon, .view-icon, .nightmode-icon)::before {
  font-family: "Material Symbols Outlined";
  font-variation-settings: 'FILL' 1;
  transform: scale(1.3);
}
.help-icon::before {
  content: '\e887';
}
.color-icon::before {
  content: '\e23a';
}
.view-icon::before {
  content: '\e8f4';
}
#header-menu ul li .view-icon {
  position: relative;
}
#header-menu ul li .view-icon a {
  position: absolute;
  inset: 0;
  background: none;
}

@media screen and (max-width:735px){
  #header-menu {
    position: fixed;
    left: 0;
    right: 0;
    border-radius: 0;
  }
  #header-menu ul {
    bottom: calc(-1em - 3px - 2rem);
  }
  #header-menu ul li:not(.buttons) {
    min-width: 2.5em;
    text-align: center;
    white-space: nowrap;
  }
  #header-menu ul li[class$=icon] {
    font-size: 150%;
  }
  #header-menu ul li.buttons .submit {
    font-size: 130%;
  }
}


/* 保存状態 */
#save-state {
  position: absolute;
  width: max-content;
  top  : 0;
  right: 0;
  padding: 6px .5em 6px 2em;
  background-image: linear-gradient(to left, #222e 70%, transparent);
  color: #fff;
  font-weight: bold;
  user-select: none;
}
#save-state:empty {
  display: none;
}
#save-state.unsaved {
  background-image: linear-gradient(to left, #530e 70%, transparent);
}
#save-state.saved {
  background-image: linear-gradient(to left, #093e 70%, transparent);
  opacity: 0;
  animation-name: savedFade;
  animation-duration: 3s;
  animation-timing-function: ease-in;
}

@keyframes savedFade {
  0%  { opacity: 1; }
 100% { opacity: 0; }
}


/* // フッタ付近
---------------------------------------------------------------------------------------------------- */
article > form > hr {
  margin: 5rem 0px;
  border-width: 1px 0 0;
  border-style: solid;
}

.deleteform {
  margin-top: 5rem;
  padding-top: 5rem;
  border-width: 1px 0 0;
  border-style: solid;
  text-align: right;
}
.deleteform input[type="submit"] {
  margin-left: .5rem;
  padding: .3rem .5rem;
}
/* // ボックス
---------------------------------------------------------------------------------------------------- */
.box input[type="text"],
.box input[type="url"],
.box input[type="number"],
.box select,
.box textarea {
  width: calc(100% - 4px);
  min-width: 3em;
  margin: 2px;
  padding: 2px;
}
.box textarea {
  resize: vertical;
}
.box input[type="text"],
.box input[type="url"],
.box input[type="number"],
.box select {
  height: calc(1.2em + 3px * 2);
  line-height: 1.2;
}
input[type="number"] {
  text-align: center;
}
@media screen and (max-width:735px){
  .box {
    max-width: 100%;
    font-size: 2.2rem;
  }
  .box h2,
  .box dt,
  .box th,
  .box summary {
    font-size: 2rem;
  }
  .box input[type="text"],
  .box input[type="url"],
  .box input[type="number"],
  .box select {
    height: calc(1.6em + 3px * 2);
    font-size: 2.2rem;
  }
  .box textarea {
    font-size: 2.2rem;
  }
}

input[type="button"] {
  background: linear-gradient(to bottom, #e0e7ef, #c0c7cf);
  box-shadow: 1px 1px 0 0 #ffffff inset, -1px -1px 0 0 #bbbbdd inset;
}
input[type="submit"] {
  background: linear-gradient(to bottom, #ddeeff, #ccccff);
  box-shadow: 1px 1px 0 0 #ffffff inset, -1px -1px 0 0 #bbbbee inset;
}
input[type="button"]:hover,
input[type="submit"]:hover {
  background: linear-gradient(to bottom, rgba(50,150,250,0.5), rgba(50,50,250,0.5));
  color: #ffffff;
}
.night input[type="button"] {
  background: linear-gradient(to bottom, #50575f, #30373f);
  box-shadow: 1px 1px 0 0 #777788 inset, -1px -1px 0 0 #000000 inset;
}
.night input[type="submit"] {
  background: linear-gradient(to bottom, #445566, #333355);
  box-shadow: 1px 1px 0 0 #777788 inset, -1px -1px 0 0 #000000 inset;
}
.night input[type="button"]:hover,
.night input[type="submit"]:hover {
  background: linear-gradient(to bottom, rgba(50,150,250,0.5), rgba(50,50,250,0.5));
  color: #ffffff;
}
/* 行追加ボタン */
.box .add-del-button {
  text-align: center;
}
.add-del-button a {
  display: inline-block;
  margin: 0px 2em;
  transform: scale(3.5, 1);
}
.add-del-button a:hover {
  opacity: 0.5;
}
.add-del-button a::before {
  display: block;
  transform: scale(0.4, 1);
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  color: var(--bg-color);
  font-family: var(--base-font-family-mono);
}
.add-del-button a[onclick*="add"]::before {
  content:"+";
}
.add-del-button a[onclick*="del"]::before {
  content:"-";
}
/* メッセージ・注釈 */
.message {
  max-width: 500px;
  margin: 2rem auto;
  padding: 1rem;
  border: 1px solid #aaa;
  border-radius: 5px;
  text-align: center;
}
.message:empty {
  display: none;
}
.message h2 {
  font-size: 110%;
}
.message dl {
  text-align: left;
}
.message dd {
  margin-left: .25em;
  padding-left: .25em;
  border-left: 2px solid var(--box-head-bg-color-pale);
}

.box .annotate {
  font-size: 90%;
  padding: 0 1rem;
}
@media screen and (max-width:735px){
  .box .annotate {
    position: sticky;
    left: 0;
  }
}
.box .add-del-button + .annotate {
  border-top-width: 1px;
  border-top-style: solid;
}
.example {
  background: rgba(170,170,170,0.2);
}

/* // 共通設定欄
---------------------------------------------------------------------------------------------------- */
/* 名前 */
#name-form {
  display: grid;
  grid-template-columns: 3fr 1fr;
  grid-gap: 1em;
  margin: var(--box-v-gap) 0;
  position: relative;
}
#name-form input {
  width: calc(100% - 4px);
  min-width: 3em;
  margin: 0 2px;
  padding: 2px;
}
#name-form dl {
  display: grid;
  grid-template-rows: max-content auto;
  width: 100%;
  padding: 0 0 3px 2px;
  font-size: inherit;
  font-family: inherit;
}
#name-form dl dt {
  grid-row: 1;
  display: grid;
  font-weight: bold;
  text-align: left;
}
#name-form dl dd {
  grid-row: 2;
}
#name-form #character-name {
}
#name-form dl dt.ruby {
  align-self: flex-end;
  font-size: 85%;
}
#name-form #player-name {
  padding-bottom: 2px;
  border-width: 0 0 0 1px;
  border-style: solid;
}
@media screen and (max-width:735px){
  #name-form {
    display: block;
  }
  #name-form dl {
    display: block;
  }
  #name-form dl#aka,
  #name-form dl#player-name {
    border-width: 1px 0 0 !important;
    border-style: solid;
    margin-top: .5em;
  }
}

/* 編集保護 */
#edit-protect {
  margin-top: var(--box-v-gap);
}
/* 閲覧可否 */
#hide-options {
  width: fit-content;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  margin-top: var(--box-v-gap);
  align-items: center;
}
#forbidden-checkbox {
  flex-basis:  10em;
  text-align: left;
}
#hide-checkbox {
  text-align: left;
}
#hide-options select {
  width: auto;
}
#hide-options dd:last-child {
  margin-left: auto;
  padding-right: .2rem;
  align-self: flex-end;
  font-size: 85%;
}
@media screen and (max-width:735px){
  #edit-protect {
  }
  #hide-options dt {
    flex-basis: 100%;
  }
  #hide-options select {
    float: left;
  }
}

/* グループ */
#group {
  margin-top: var(--box-v-gap);
}
#group dl {
  display: grid;
  grid-template-columns: 4em 1fr 2.5em 3fr;
  grid-template-rows: auto;
  text-align: right;
}
#group dl > * {
  display: flex;
  align-items: center;
  justify-content: center;
}
#group dl > dt:not(:first-child) {
  justify-content: flex-end;
}
@media screen and (max-width:735px){
  #group dl {
    grid-template-columns: 4em 1fr;
    grid-template-rows: auto auto;
  }
  #group dl dt {
    grid-column: 1;
  }
}
/* レギュレーション */
#regulation {
  margin: var(--box-v-gap) 0;
  overflow-y: auto;
}
#regulation > dl {
  display: grid;
  grid-template-rows: auto;
  margin: 10px 0 0;
}
#regulation dl dt {
  grid-row: 1 / 2;
  padding-left: 2px;
}
#regulation dl dd {
  grid-row: 2 / 3;
  font-size: 1.2rem;
}
#regulation dl.regulation-note {
  display: grid;
  grid-template-columns: 3em 1fr;
}
#regulation dl.regulation-note dt {
  text-align: center;
  align-self: center;
}
#regulation dl.regulation-note dd {
  grid-row: 1;
}
/* 履歴 */
#free-note,
#free-history,
#history {
  position: relative;
}
button.set-newest {
  position: absolute;
  inset: -1px 0 auto auto;
}
#history{
  overflow-x: auto;
  overflow-y: hidden;
}
#history table {
  width: calc(100% - 1px);
}
#history table thead td {
  padding: 1px;
  border-width: 1px;
  border-style: solid dotted;
  font-size: inherit;
}
#history table tbody td {
  padding: .4rem 0 .1rem !important;
  vertical-align: top;
}
#history table tbody td.handle {
  vertical-align: middle;
}
#history table tbody td.left {
  padding: 0 0 .4rem !important;
}
#history table tfoot {
  border-top-width: 0;
  background: transparent !important;
}
#history table tfoot td {
  border-top-width: 3px;
  border-top-style: double;
}
#history table tfoot th {
  border-top-width: 1px;
  border-top-style: solid;
  vertical-align: top;
}
#history table tbody:last-of-type:nth-of-type(odd) + tfoot td {
  background-color: var(--box-even-rows-bg-color);
}

#history .annotate {
  width: 70%;
  margin: auto 3px auto auto;
}


/* 画像 */
#area-status #image {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  
  cursor: unset;

  image-rendering: -webkit-optimize-contrast;
}
#image > h2 {
  background-image: linear-gradient(to bottom, var(--box-head-bg-color), transparent);
  text-shadow: var(--bg-color) 0px 0px .5em,
    var(--bg-color)  .1rem .1rem, var(--bg-color) -.1rem -.1rem,
    var(--bg-color) -.1rem .1rem, var(--bg-color)  .1rem -.1rem,
    var(--bg-color)  .0rem .1rem, var(--bg-color)  .0rem -.1rem,
    var(--bg-color) -.1rem .0rem, var(--bg-color)  .1rem  .0rem;
}
#image > p {
  background: rgba(255,255,255,0.4);
  text-shadow: 0 0 3px var(--bg-color), 0 0 3px var(--bg-color), 0 0 3px var(--bg-color),
               0 0 3px var(--bg-color), 0 0 3px var(--bg-color), 0 0 3px var(--bg-color),
               0 0 3px var(--bg-color), 0 0 3px var(--bg-color), 0 0 3px var(--bg-color),
               0 0 3px var(--bg-color), 0 0 3px var(--bg-color), 0 0 3px var(--bg-color),
               0 0 3px var(--bg-color), 0 0 3px var(--bg-color), 0 0 3px var(--bg-color);
}
.night #image > p {
  background: rgba(0,0,0,0.5);
}
#area-status #image h2 {
  margin-bottom: 0;
  padding-bottom: 0;
}
#area-status #image p {
  padding: .5em .1em;
  text-align: center;
  line-height: 1.2;
}
#area-status #image p+p {
  margin-top: 1em;
}
#area-status #image p:last-child {
  margin-bottom: .5em;
}
#area-status #image select {
  width: calc(100% - 6.5em);
}
#area-status #image input[type="checkbox"] {
  transform: scale(1.1)
}

#area-status #image .words-input select {
  width: auto;
}

/* // 画像ビュー
---------------------------------------------------------------------------------------------------- */
#image-custom {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: auto;
  
  display: grid;
  grid-template-columns: 1fr 400px;
  grid-template-rows: 1fr max-content;
  
  background-color: hsla(0, 0%, 50%, 0.8);
  
  z-index: 100;
}
.image-custom-view-area {
  grid-row: span 2;
  display: grid;
  grid-gap: 0 5em;
  grid-template-columns: 1fr 25vh 350px 1fr;
  grid-template-rows: 1fr max-content max-content minmax(3em,1fr);
  background-color: hsla(0, 0%, 10%, 0.6);
  image-rendering: -webkit-optimize-contrast;
}
.image-custom-view-area > div.image-custom-frame {  }
.image-custom-view-area > div#image-custom-frame-M  { grid-column: 3; grid-row: 2 / span 2; height: 567px; }
.image-custom-view-area > div#image-custom-frame-S1 { grid-column: 2; grid-row: 2; width: 20vh; height: 40vh; margin-top: 0; }
.image-custom-view-area > div#image-custom-frame-S2 { grid-column: 2; grid-row: 3; width: 25vh; height: 30vh; margin-top: 3em; }
.image-custom-view-area > div#image-custom-frame-M {
  cursor: grab;
}
.image-custom-view-area > div#image-custom-frame-M:active {
  cursor:grabbing;
}
.image-custom-view-area > div.image-custom-frame {
  position: relative;
  background-color: transparent;
  background-repeat: no-repeat;
  background-color: var(--bg-color);
  background-image: url(../img/back-pattern.png);
  background-repeat: repeat;
  border-radius: 5px;
}
.image-custom-view-area > div.image-custom-frame .image-custom-view {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-repeat: no-repeat;
  border-radius: 5px;
}
.image-custom-view-area > div.image-custom-frame b {
  display: block;
  margin-top: -1.5em;
  padding-left: .5em;
  color: #fff;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}
.image-custom-view-area > div.image-custom-frame .words {
  pointer-events: none;
  user-select: none;
}
.image-custom-view-area > div.image-custom-frame input[name="imagePositionX"] {
  position: absolute;
  bottom: -1.5em;
  width: 100%;
}
.image-custom-view-area > div.image-custom-frame input[name="imagePositionY"] {
  position: absolute;
  top: 50%;
  right: calc(-567px /2 - 1em);
  width: 567px;
  transform: rotate(90deg);
}
.image-custom-view-area #image-custom-numberview {
  position: absolute;
  bottom: -5em;
  margin-left: auto;
}
.image-custom-form {
  background-color: var(--bg-color);
  background-image: linear-gradient(var(--box-base-bg-color), var(--box-base-bg-color));
  border-top: 1px solid hsla(0,0%,50%,0.2);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.image-custom-form h3 {
  padding: .5em .5rem 1rem;
}
.image-custom-form h3:not(:first-child) {
  border-top-width: 1px;
  border-top-style: solid;
}
.image-custom-form p {
  margin: 0em auto 1em;
  padding: 0em 1em;
}
.image-custom-form p#image-drop-area {
  background-color: hsla(0,0%,50%,0.2);
  margin: 0 1em 1em;
  padding: 1em;
}
.image-custom-form p input,
.image-custom-form p select,
.image-custom-form p textarea {
  padding: .2em .5em;
}
#words-preview {
  position: absolute;
  padding-top: 1em;
  padding-bottom: 1em;
  writing-mode: vertical-rl;
  font-weight: bold;
  font-size: 2rem;
  color: var(--text-color);
  text-shadow:
    var(--bg-color) .2rem  .0rem, var(--bg-color) -.2rem  .0rem,
    var(--bg-color) .0rem -.2rem, var(--bg-color)  .0rem  .2rem,
    var(--bg-color) .2rem  .2rem, var(--bg-color) -.2rem  .2rem,
    var(--bg-color) .2rem -.2rem, var(--bg-color) -.2rem -.2rem,
    var(--bg-color) .1rem  .2rem, var(--bg-color) -.1rem  .2rem,
    var(--bg-color) .1rem -.2rem, var(--bg-color) -.1rem -.2rem,
    var(--bg-color) .2rem  .1rem, var(--bg-color) -.2rem  .1rem,
    var(--bg-color) .2rem -.1rem, var(--bg-color) -.2rem -.1rem;
}
#words-preview span {
  display: inline-block;
}
#words-preview span.brackets {
  text-indent: -1em;
}
#image-copyright-preview {
  position: absolute;
  right: 0;
  bottom: 0;
  padding: 0 5px;
  color: #fff;
  text-shadow: 
    #000  .1rem .1rem, #000 -.1rem -.1rem,
    #000 -.1rem .1rem, #000  .1rem -.1rem,
    #000  .0rem .1rem, #000  .0rem -.1rem,
    #000 -.1rem .0rem, #000  .1rem  .0rem,
    #000 0 0 .3rem, #000 0 0 .3rem, #000 0 0 .3rem;
  word-break: break-all;
}
#image-custom .close-button {
  background-color: #777;
}
#image-custom .close-button .button {
  display: block;
  margin: 1em 2em;
  padding: 1rem;
  text-align: center;
}
@media screen and (max-width:1155px){
  .image-custom-view-area {
    grid-template-columns: 1fr 350px 1fr;
  }
  .image-custom-view-area > div#image-custom-frame-M { grid-column: 2; grid-row: 2 / span 1; }
  .image-custom-view-area > div#image-custom-frame-S1,
  .image-custom-view-area > div#image-custom-frame-S2 { display: none; }
}
@media screen and (max-width:860px){
  #image-custom {
    grid-template-columns: 1fr 370px;
  }
  .image-custom-view-area {
    grid-template-columns: 1fr 35vw 1fr;
  }
  .image-custom-view-area > div#image-custom-frame-M { height: 56.7vw; }
  .image-custom-view-area > div.image-custom-frame input[name="imagePositionY"] {
    right: calc(-56.7vw /2 - 1em);
    width: 56.7vw;
  }
  #words-preview {
    font-size: 2vw;
  }
}
@media screen and (max-width:735px){
  #image-custom {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 40vh max-content;
  }
  #image-custom .close-button {
    right: 0;
  }
  .image-custom-view-area {
    grid-row: span 1;
    display: grid;
    grid-template-columns: 1fr 25vh 1fr;
    grid-template-rows: 1fr max-content 1fr;
  }
  .image-custom-view-area > div#image-custom-frame-M { grid-column: 2; grid-row: 2 / span 1; height: 46vh; }
  .image-custom-view-area > div.image-custom-frame input[name="imagePositionY"] {
    right: calc(-46vh /2 - 1em);
    width: 46vh;
  }
  .image-custom-form {
    grid-column: 1;
  }
  #words-preview {
    font-size: 1.8vh;
  }
}

/* // パレット
---------------------------------------------------------------------------------------------------- */
#section-palette .box {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
#section-palette .box > * {
  grid-column: span 2;
}
#section-palette .box > .palette-column {
  grid-column: span 1;
}


/* // カラーカスタム
---------------------------------------------------------------------------------------------------- */
.box.color-custom {
  margin: 0 0 1em !important;
}
.box.color-custom + .box.color-custom {
  border-top-width: 1px;
}
.box.color-custom table {
  margin-left: 1em;
}
.box.color-custom table td {
  padding: .5em;
}
.box.color-custom table td:last-child {
  width: 4em;
}
.box.color-custom .color-range-R th { color: #f00; }
.box.color-custom .color-range-G th { color: #0f0; }
.box.color-custom .color-range-B th { color: #00f; }
.box.color-custom input[type="range"] {
  width: 361px;
}
@media screen and (max-width:735px){
  .box.color-custom table table,
  .box.color-custom table tbody,
  .box.color-custom table th,
  .box.color-custom table td {
    display: block;
    padding: 0;
  }
  .box.color-custom table tr {
    display: grid;
    grid-template-columns: 5em 1fr;
  }
  .box.color-custom table td:last-child {
    grid-column: 2;
    grid-row: 1;
  }
  .box.color-custom input[type="range"] {
    width: 90vw;
  }
}
.box.color-custom input[type=range] {
  -webkit-appearance:none;
  background: #000;
  height: 14px;
  border-radius: 0px;
}
.box.color-custom .color-range-H input[type=range] {
  background: linear-gradient(to right, #f00,#ff0,#0f0,#0ff,#00f,#f0f,#f00);
}
.box.color-custom .color-range-S input[name=colorHeadBgS] {
  background: linear-gradient(to right, hsl(var(--box-head-bg-color-h),0%,50%), hsl(var(--box-head-bg-color-h),100%,50%));
}
.box.color-custom .color-range-L input[name=colorHeadBgL] {
  background: linear-gradient(to right, #000, hsl(var(--box-head-bg-color-h),var(--box-head-bg-color-s),50%), #fff);
}
.box.color-custom .color-range-S input[name=colorBaseBgS] {
  background: linear-gradient(to right, #fff, hsla(var(--box-base-bg-color-h),70%,83%,0.5));
}
.night .box.color-custom .color-range-S input[name=colorBaseBgS] {
  background: linear-gradient(to right, #111, hsla(var(--box-base-bg-color-h),100%,15%,0.5));
}
.box.color-custom input[type=range]::-webkit-slider-thumb{
  -webkit-appearance:none;
  border: 1px solid #777;
  background: linear-gradient(to bottom, #fff, #bbb);
  box-shadow: #fff inset 0 0 .1rem .1rem;
  height: 20px;
  width: 10px;
  border-radius: 0px;
}
.box.color-custom input[type=range]::-ms-tooltip{
  display:none;
}
.box.color-custom input[type=range]::-moz-range-track{
  height:0;
}
.box.color-custom input[type=range]::-webkit-slider-thumb{
  -webkit-appearance:none;
  border: 1px solid #777;
  background: linear-gradient(to bottom, #fff, #bbb);
  height: 20px;
  width: 10px;
  border-radius: 0px;
}
.color-sample {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 30px;
  margin-top: 25px;
}
.color-sample .night {
  background-color: #000;
  color: #fff;
  outline: 15px solid #000;
}
.color-sample .name {
  padding: 0 .5em;
  background-image: linear-gradient(to right, var(--box-head-bg-color), var(--box-base-bg-color));
  border-width: 2px 0;
  border-style: solid;
  border-color: var(--box-outside-border-color, inherit);
  font-family: var(--base-font-family-min);
  font-weight: bold;
}
.color-sample .light .name::after,
.night .color-sample .night .name::after {
  content: "：ライトモード";
}
.night .color-sample .light .name::after,
.color-sample .night .name::after {
  content: "：ナイトモード";
}
.color-sample .box {
  margin-top: var(--box-v-gap);
}
.night .color-sample .night {
  background-color: #fff;
  color: #000;
  outline: 15px solid #fff;
}
.night .color-sample .night {
  --box-base-bg-color-d: var(--box-base-bg-color-l);
}
.night .color-sample .night .box {
  box-shadow: 1px 1px 2px 0px #ccc;
}
.night .color-sample .night .box h2 {
  text-shadow: 0px 0px .3em #fff;
}

.color-sample .light .box a.link    { color: hsl(var(--box-head-bg-color-h,230),90%,40%); }
.color-sample .light .box a.visited { color: hsl(var(--box-base-bg-color-h,270),40%,40%); }
.color-sample .night .box a.link    { color: hsl(var(--box-head-bg-color-h,210),100%,80%); }
.color-sample .night .box a.visited { color: hsl(var(--box-base-bg-color-h,270), 40%,75%); }


.night .color-sample .night .box a {
  background: linear-gradient(to top, hsla(var(--box-head-bg-color-h,230),100%,80%,0.7) .2rem, transparent .2rem, transparent);
}
.night .color-sample .light .box a.link    { color: hsl(var(--box-head-bg-color-h,210),100%,80%); }
.night .color-sample .light .box a.visited { color: hsl(var(--box-base-bg-color-h,270), 40%,75%); }
.night .color-sample .night .box a.link    { color: hsl(var(--box-head-bg-color-h,230),90%,40%); }
.night .color-sample .night .box a.visited { color: hsl(var(--box-base-bg-color-h,270),40%,40%); }
.night .color-sample .night .box a:hover   { color: #000; background: hsla(var(--box-head-bg-color-h,230),100%,80%,0.7); }


/* // ヘルプ
---------------------------------------------------------------------------------------------------- */
.sticky-footer {
  position: sticky;
  bottom: 0;
  margin-top: 1em;
  padding: .2rem 0 .5rem;
  border-radius: 0;
  border-width: 2px 0 0;
  border-style: solid;
  background: var(--bg-color);
}
@media screen and (max-width:735px){
  .sticky-footer {
    position: fixed;
  }
}
.sticky-footer h2 {
  margin: 0;
  padding: .2em;
  border-width: 0 0 1px;
  border-style: dotted;
  font-size: 1.2em;
  line-height: 1;
}
.sticky-footer h2::before {
  display: inline-block;
  font-family: "Material Symbols Outlined";
  font-variation-settings: 'FILL' 1;
  content: '\e887';
  font-size: 1.2em;
  line-height: 1;
  vertical-align: text-top;
}
.sticky-footer .close-button {
  position: absolute;
  top: 1px;
  right: 1px;
}
.sticky-footer .close-button::before {
  font-family: "Material Symbols Outlined";
  content: '\e5c9';
  font-weight: bold;
  font-style: normal;
  font-size: 1.8em;
  line-height: 1;
  cursor: pointer;
}
.sticky-footer > div {
  max-height: 20vh;
  padding: 0 1em;
  font-size: 85%;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* // 
---------------------------------------------------------------------------------------------------- */
@media screen and (min-width:1300px){
  body {
    grid-template-columns: 1fr minmax(auto, 900px) 1fr;
  }
  header nav {
    max-width: 900px;
  }
  article{
    max-width: 860px;
    display: block;
  }
}