/* 履歴画面 */

body * div {
  /*border: 0px solid red;*/
}

#history-screen {
  position: relative;
  overflow: hidden;
  z-index: 1;
  width: 100%;
  height: 100dvh; /* ← vhではなくdvh (ダイナミックビューポート) を使う */
}

#analysis-modal{
  position: absolute;  /* 固定位置に配置 */
  overflow: visible;
  display: flex;
  flex-direction: column;
  z-index: 2;
  gap: 0rem;
  top: 50%;
  left: 50%;
  width: 80%;
  height: 83%;
    /*max-height: 330px;*/

  transform: translate(-50%, -50%);
  background: linear-gradient(to bottom, rgba(45, 48, 48, 0.9), rgba(5, 6, 7, 0.8));
  box-shadow: 6px 6px 10px 0px rgba(0, 0, 0, 0.4);
}
.modal-content {
  height: 100%;      /* ← ここで制御！ */
}
#analysisModalClose {
  padding: 6px 16px;
  margin-top: 12px;
  border: none;
  border-radius: 6px;
  background: #444;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s ease;
  align-items: center;
  text-align: center;
  width: 100%;
}

#analysisModalClose:hover {
  background: #666;
}




#history-wrapper{
  position: absolute;  /* 固定位置に配置 */
  overflow: visible;
  display: flex;
  flex-direction: column;
  z-index: 2;
  gap: 0rem;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  width: 80%;
  height: 90%;

  border-radius: 10px;/*角丸*/
  padding: 0px 30px 18px 30px ;

  background: linear-gradient(to bottom, rgba(174, 230, 250, 0.9), rgba(8, 159, 246, 0.2));
  box-shadow: 6px 6px 10px 0px rgba(0, 0, 0, 0.4);

  /*font-size: 3vw;*/
  color: black;
}

#history-wrapper h2{
  font-family: 'Orbitron', sans-serif;
  font-size: 3vw;
  text-shadow: 1px 2px 3px #808080;
  padding: 15px 0px 0px 0px;
  margin: 0px 0px 0px 0px;
  color: #002e5c;
}


#history-list {
  max-height: 100%;
  overflow-y: auto;
  margin-top: 10px;
  margin-bottom: 10px;
}


.history-entry {
  margin-bottom: 10px;
  padding: 10px;
  background: #f5f5ff;
  border-left: 5px solid #88c;
  border-radius: 10px;
}


#history-item-head{
  display: flex;
  flex-direction: row;
  gap: 0px;
  width: 100%;
  font-size: 2.5vw;
  padding: 0px 0px 10px 0px;
  font-family: 'Orbitron', sans-serif;
}

#history-item-no{
  flex: 1.5;
  display: flex;
  justify-content: center;
  font-size: 2vw;
  padding-left: 0px;
  font-weight: bold;
  color: rgb(0, 0, 0);
  align-items: flex-end;
  text-shadow: 1px 2px 3px #808080;
}
#history-item-stage{
  flex: 3;
  display: flex;
  font-size: 1.8vw;
  font-weight: bold;
  color: rgb(49, 20, 239);
  align-items: flex-end;
  justify-content: center;
  text-shadow: 1px 2px 3px #808080;
}
#history-item-date{
  flex: 5;
  display: flex;
  font-size: 1.8vw;
  color: rgb(115, 6, 178);
  align-items: flex-end;
  justify-content: right;
  text-shadow: 1px 2px 3px #808080;
}


#history-item-body{
  display: flex;
  flex-direction: row;
  gap: 0px;
  width: 100%;
  font-size: 2.5vw;

  padding: 0px 0px 10px 0px;
  margin: 0px 0px 0px 0px;
}

#history-item-score{
  flex: 2;
  display: flex;
  font-size: 2vw;
  color: rgb(0, 0, 0);
  align-items: flex-end;
  justify-content: center;
  text-shadow: 1px 2px 3px #808080;
}
#history-item-paire{
  flex: 1;
  display: flex;
  font-size: 1.8vw;
  color: rgb(0, 0, 0);
  align-items: flex-end;
  justify-content: center;
  text-shadow: 1px 2px 3px #808080;
}
#history-item-miss{
  flex: 1;
  display: flex;
  font-size: 1.8vw;
  color: rgb(255, 14, 14);
  align-items: flex-end;
  justify-content: center;
  text-shadow: 1px 2px 3px #808080;
}
#history-item-Time{
  flex: 1;
  display: flex;
  font-size: 1.8vw;
  color: rgb(0, 0, 0);
  align-items: flex-end;
  justify-content: center;
  text-shadow: 1px 2px 3px #808080;
}
#history-item-Graph{
  flex: 0.5;
  display: flex;
  font-size: 2.8vw;
  color: rgb(0, 0, 0);
  align-items: flex-end;
  justify-content: center;
  text-shadow: 1px 2px 3px #808080;
  /*width: 10px;*/
}
#history-item-graph-button{
  font-size: 1.8vw;
}


.history-table{
  width: 100%;
  border-collapse:separate;
  border-spacing: 0;
}

.history-table th:first-child{
  border-radius: 5px 0 0 0;
}

.history-table th:last-child{
  border-radius: 0 5px 0 0;
  border-right: 0px solid #3c6690;
}

.history-table th{
  text-align: center;
  color:white;
  background: linear-gradient(#829ebc,#225588);
  border-left: 1px solid #3c6690;
  border-top: 1px solid #3c6690;
  border-bottom: 1px solid #3c6690;
  box-shadow: 0px 1px 1px rgba(255,255,255,0.3) inset;
  padding: 7px 0;
}

.history-table td{
  text-align: center;
  border-left: 1px solid #a8b7c5;
  border-bottom: 1px solid #a8b7c5;
  border-top:none;
  box-shadow: 0px -3px 5px 1px #eee inset;

  padding: 0px 0;
}

.history-table td:last-child{
  border-right: 1px solid #a8b7c5;
}

.history-table tr:last-child td:first-child {
  border-radius: 0 0 0 5px;
}

.history-table tr:last-child td:last-child {
  border-radius: 0 0 5px 0;
}

#history-item-table-rank{
  width: 70px;
}



.scrollable {
  max-height: 300px;
  overflow-y: auto;
  margin-top: 10px;
}

.stage-log summary {
  font-weight: bold;
  cursor: pointer;
  margin-top: 12px;
}





details {
  background: #fdfdfd;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 10px 0px 10px  0px;
  margin:  0px 0px 0px 0px;
  margin-bottom: 0px;
  transition: all 0.3s ease;
  color: rgb(25, 0, 117);
  text-shadow: 1px 2px 3px #808080;
}

summary {
  font-weight: bold;
  cursor: pointer;

}

details[open] {
  background: #f0f8ff;

}
.stage-log {
  margin: 5px 5px, 0,0;
  padding: 8px 0px 8px 0px;
  line-height: 1;
}

.stage-log summary {
  display: block;
  margin: 0;
  padding: 0;
  font-weight: bold;
  cursor: pointer;
  font-size: 1.5vw;
}


#history-back{
    display: flex;
    justify-content: center;
    align-items: center;
    width: 80%;
    margin: 0 auto;
    padding: .3em 2em;
    border: none;
    border-radius: 5px;
    background-image: linear-gradient(0deg, #2589d0 0%, #2589d080 50%);
    color: #fffbfb;
    font-weight: 600;
    font-size: 1em;
}



#score-chart {
  width: 100%;
  height: 300px;
}
