@charset "utf-8";

@layer system {
/* // Name
---------------------------------------------------------------------------------------------------- */
#area-name {
  position: relative;
}
h1#character-name {
  padding: 1.7rem 1rem .3rem;
}
#area-name::before {
  content: "ハンドル";
  position: absolute;
  top: 0;
  left: .3em;
  line-height: 1;
  font-size: 1.2rem;
  font-weight: bold;
  font-family: var(--base-font-family-jp);
  text-shadow: none;
}

/* // Status
---------------------------------------------------------------------------------------------------- */
#area-status {
  display: grid;
  gap: var(--box-v-gap) var(--box-h-gap);
  grid-template-columns: 1fr 1fr 1.2fr;
  grid-template-areas:
    "PRF PRF IMG"
    "DRV DRV IMG"
    "STT STT IMG"
  ;
  @media screen and (width <= 735px){
    grid-template-columns: 1fr;
    grid-template-areas:
      "IMG"
      "PRF"
      "DRV"
      "STT"
    ;
  }
}
#area-status > #image   { grid-area: IMG; min-height: 30rem; }
#area-status > #profile { grid-area: PRF; }
#area-status > #status  { grid-area: STT; }
#area-status > #derived { grid-area: DRV; }

#character #profile {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  #profile-role {
    grid-column: span 2;
  }
  @media screen and (width <= 735px){
    grid-template-columns: repeat(2, 1fr);
    #profile-role {
      grid-column: span 2;
    }
  }
}
#character #derived {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  @media screen and (width <= 735px){
    grid-template-columns: repeat(2, 1fr);
    #ip {
      grid-column: span 2;
    }
  }
}
#status .status-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--box-h-gap);
}
#status .status-table {
  width: 100%;
  th.name {
    text-align: left;
    padding-left: .5em;
    white-space: nowrap;
  }
  td.base, td.add, td.total {
    text-align: center;
  }
  td.total {
    font-weight: bold;
    font-size: 110%;
  }
}
@media screen and (width <= 735px){
  #status .status-columns {
    grid-template-columns: 1fr;
    gap: var(--box-v-gap);
  }
}

/* // Layout Columns
---------------------------------------------------------------------------------------------------- */
.column {
  display: flex;
  flex-direction: column;
  gap: var(--box-v-gap);
}

/* // Skills
---------------------------------------------------------------------------------------------------- */
#skills .skill-columns {
  columns: 2 18rem;
  column-gap: var(--box-h-gap);
}
#skills .skill-table {
  width: 100%;
  break-inside: avoid;
  margin-bottom: .5em;
  td.stat, td.lv, td.add, td.total {
    text-align: center;
  }
  td.total {
    font-weight: bold;
  }
  tr.base-skill td.name {
    font-weight: bold;
  }
}

/* // Roles
---------------------------------------------------------------------------------------------------- */
#roles {
  grid-column: span 2;
  @media screen and (width <= 735px){
    grid-column: span 1;
  }
}
#roles .role-detail {
  margin-top: .5em;
  > dt {
    font-weight: bold;
  }
  > dd {
    display: inline-block;
    margin-right: 1em;
  }
}

/* // Equipment
---------------------------------------------------------------------------------------------------- */
#weapons table,
#armors table,
#shields table,
#cyberware table,
#cyberdeck table,
#items table,
#lifestyle-and-money table {
  width: 100%;
  td:not(.name, .note, .skill, .type) {
    text-align: center;
  }
}
#cyberware table {
  :is(th, td).name      { min-width: 10em; }
  :is(th, td).type      { width: 8.5em; }
  :is(th, td).place     { width: 7.5em; }
  :is(th, td).installed { width: 3.5em; text-align: center; }
  :is(th, td).note      { width: auto; text-align: left; }
}
#cyberdeck .deck-header {
  margin-bottom: 0.5em;
  .deck-main {
    margin: 0.2em 0;
    font-size: 1.05em;
  }
  .slots-badge {
    margin-left: 1em;
    padding: 0.1em 0.5em;
    background: #eef2f7;
    border-radius: 3px;
    font-size: 0.9em;
  }
  .deck-note {
    margin: 0.2em 0;
    color: #666;
    font-size: 0.9em;
  }
}
#cyberdeck table {
  :is(th, td).name  { min-width: 9em; }
  :is(th, td).class { width: 10em; }
  :is(th, td).slots { width: 4.2em; text-align: center; }
  :is(th, td):is(.per, .spd, .atk, .def, .rez) { width: 3.5em; text-align: center; }
  td.note { text-align: left; }
}
#weapons .ammo-stock {
  margin: 0.4em 0 0;
  text-align: right;
}
#items table {
  :is(th, td).qty {
    width: 5em;
    text-align: center;
  }
}

/* // History
---------------------------------------------------------------------------------------------------- */
#history {
  width: 100%;
  align-self: stretch;
}
#history table {
  width: 100%;
  > thead {
    .ip    { width: 4.5em; } /* IP */
    .money { width: 6em; }   /* 報酬(eb) */
    .grow  { width: 4.5em; } /* 成長 */
  }
  & tr td.money {
    text-align: right;
  }
  & tr td.ammo {
    text-align: left;
  }
}
}
