@charset "UTF-8";

.Z1{z-index: 1;}
.Z2{z-index: 2;}
.Z3{z-index: 3;}
.Z4{z-index: 4;}
.Z5{z-index: 5;}
.Z6{z-index: 6;}
.Z7{z-index: 7;}
.Z8{z-index: 8;}
.Z9{z-index: 9;}
.Z10{z-index: 10;}
.Z11{z-index: 11;}
.Z100{z-index: 100;}

.hide {
  opacity: 0;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.invisible {
  display:none;
  pointer-events: none;
}

#body {
  background-image: url(../img/bw-back.png);
  background-size: cover;
}

body.ready {
  opacity: 1;
}

body.fade-out {
  opacity: 0;
  transition: opacity 0.2s ease;
}

li{
    list-style: none;
}

#header {
  display:none;
  position: relative;
  z-index:10;
  align-items: center;
  margin: 0 auto;
  max-width: 380px;
  min-width: 300px;
  height: 50px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.4),rgba(0,0,0,0.0));
}

.back-button{
    position: absolute;
    top: 35%;
    left: 7%;
    
}

.arrow{
    width: 10px;
    height: 10px;
    border-top: 3px solid #000;
    border-left: 3px solid #000;
    transform: translateX(20%) rotate(-45deg);
}

.menu{
    position: absolute;
    top: 25%;
    right: 7%;
    width: 30px;
    height: 30px;
    justify-content: center;
    align-items: center;
    /*border: solid 1px #000;*/
}


.menu-line {
    width: 100%;
    height: 2px;
    background-color: #000;
    margin-top: 20%;
    margin-bottom: 5%;
}

.title{
    position: absolute;
    text-align: center;
    top: 25%;
    right: 0;
    left: 0;
    width: 210px;
    height: 23px;
    margin: 0 auto;
    padding: 0 auto;
    text-align: center;
    color: #333;
    font-weight: 700;
    font-size: 1.1em;
}

.main{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0 auto;
    transform-origin: center center;
}

.action-ui-container {
  z-index: 1000;
}

#CONTENTS{
    border: solid 2px #f00; 
    position: absolute;
    min-width: 414px; 
    top:40px;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
}

.DICE{ 
	width: 80px;
	height: 80px;
	/*border: solid 2px #000;*/
	z-index: 15;
}

.DICE .dice-inner{
	/* 焼き込み「さいころを振る」(diceB.png)は廃止 → #dice-prompt の文字で鮮明に表示。
	   回るダイス本体は 3D #cube (dice/1-6.jpg)。ダイス画像を一新する場合は面画像を差し替える。 */
    background-repeat: no-repeat;
}
/* 「さいころを振る」鮮明テキスト (ダイスが active のとき中央下に表示) */
/* 「さいころを振る」= 不透明な背景帯でマップと重ならず鮮明に */
#dice-prompt {
  position: fixed; top: 70%; left: 50%; transform: translateX(-50%);
  z-index: 10000; display: none;
  font-family: "Yuji Syuku", serif; font-weight: bold;
  font-size: clamp(1rem, 4.6vw, 1.5rem); color: #FFD700;
  letter-spacing: .12em;
  padding: .5em 1.3em;
  background: #2a1a3e;                 /* 不透明背景でマップと重ならない */
  border-radius: 8px;
  text-shadow: 0 1px 2px rgba(0,0,0,.8);
  pointer-events: none; white-space: nowrap;
  animation: dice-prompt-pulse 1.6s ease-in-out infinite;
}
#dice-prompt.show { display: block; }
@keyframes dice-prompt-pulse { 0%,100%{opacity:.85} 50%{opacity:1} }

/* 「挑戦」の札のとき、もう一度振れる説明を数秒表示するバナー */
#challenge-msg {
  position: fixed; top: 30%; left: 50%; transform: translateX(-50%);
  z-index: 10001; display: none;
  max-width: 80vw; text-align: center;
  font-family: "Yuji Syuku", serif; font-weight: bold;
  font-size: clamp(1rem, 4.4vw, 1.45rem); color: #fff;
  line-height: 1.7; letter-spacing: .08em;
  padding: .9em 1.4em;
  background: rgba(54,34,82,0.97);                 /* 不透明・濃紫でマップと重ならない */
  border: 1.5px solid rgba(206,170,108,0.85);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.55);
}
#challenge-msg.show { display: block; animation: chmsg-in .4s ease both; }
@keyframes chmsg-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.CARD{
    width: 80px;
    height: 80px;
    background-image: url(../img/img-compo/CardA.png);
    /*border: solid 2px #000;*/
    z-index: 15;
}

@keyframes jump{
 0% { transform:translateY(0) }
  10% { transform:translateY(0) }
  20% { transform:translateY(-12px) }
  25% { transform:translateY(0) }
  30% { transform:translateY(-5px) }
  50% { transform:translateY(0) }
  100% { transform:translateY(0) }
}

/*キャラクター一覧*/

.PARTI-wrapper {
  z-index: 15;
}

.PARTI-wrapper p{
    display: flex;
    align-items: center;
    color: #000;
    margin: 5px;
    font-weight: 700;
    font-size: .7em;
}

.PARTI-wrapper p::before,
.PARTI-wrapper p::after {
  content: '';
  flex-grow: 1;/* 余白を分け与える */
  height: 2px;
  background: red;
  margin-right: 10px;
  margin-left: 10px;
}

.heart{
    position: absolute;
    float: left;
    margin: 30px 0 0 35px; 
    width: 20px;
    height: 20px;
}


.tab {
    display: flex;
    flex-wrap: wrap;
    max-width: 100%;
    border-radius: 15px 3px 15px 3px;
    /* background-color: rgba(255,255,255,0.75);*/
}

.tab > label {
    flex: 1;
    order: -1;
    max-width: 80px;
    min-width: 40px;
    padding: .2em ;
    margin: .1em;
    background-color: #E0CB6E;
    color: #000000;
    font-weight: 700;
    font-size: .7em;
    text-align: center;
    cursor: pointer;
    border-radius: 15px 0px 15px 0px;
    /*border: solid 1.5px #D04B44;*/
}

.tab > label:hover {
    opacity: .8;
    background-color:#C6964C;
}

.tab input {
    display: none;
}

.tab > div {
    display: none;
    /* width: 100%; */
    /* height: 620px; */
    overflow-y: scroll;
    background-color: rgba(247,243,232,0.8);
    border: solid 1px #C6964C;
}

.tab label:has(:checked) {
    border-bottom: 5px solid #D04B44;
    color: #FEDF50;
    background-color: #000000;
}

.tab label:has(:checked) + div {
    display: block;
}

.person{
    font-weight: 600;
    font-size: 1.2em;
    width: 95%;
    margin: 3px;
    padding: 3px;
    border-bottom: dotted 2px #C6964C;
    overflow: hidden;
}

.setting{
    width: 100px;
    text-align: center;
    font-weight: 400;
    font-size: .8em;
    border: solid 1px #C6964C;
    color: #333;
    border-radius: 15px 15px 15px 15px;
    margin: 0px 10px 5px 5px;
    padding: 3px;
    background-color: #fff;
    float: right;
}

.frame{
    width: 40px;
    height: 40px;
    border-radius: 5px 5px 5px 5px;
}
.fA{border-bottom: solid 7px #f00;}
.fB{border-bottom: solid 7px #32cd32;}
.fC{border-bottom: solid 7px #8a2be2;}
.fD{border-bottom: solid 7px #d7cf3a;}
.fE{border-bottom: solid 7px #008db7;}


/*=====================
追加
=======================*/
.board {
  display: grid;
  background-color: pink;
}

/*マップ全体*/
.map-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-height: 100dvh;
    min-width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    /* background-color: #e0ffff; */
    z-index: 5;
    /* pointer-events: none; */
    padding:
    env(safe-area-inset-top)
    env(safe-area-inset-right)
    env(safe-area-inset-bottom)
    env(safe-area-inset-left);
}

@media (orientation: portrait) { /* 縦レイアウト */
  .map-container {
    width: 100%;
    height: auto;
  }
}
@media (orientation: landscape) { /* 横レイアウト */
  .map-container {
    width: auto;
    height: 100%;
  }
}

.map-back {
    width: 100%;
    height: 100%;
}


/*SVGの設定*/
 .map-svg {
    width: 100%;
    height: 100%;
    transform-origin: center center;
    transition: transform 0.5s ease;
    object-fit: cover;
    /* background-color: #F5F3E7; */
    background: transparent;
}

/*マップ線の設定*/

.route-line {
    display: none;
    /*
    fill: none;
    stroke: #2196f3;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    */
}
      
/*座標点*/
.marker {
    /*fill: #f0f;*/
    stroke: #333;
    stroke-width: 3;
}

/*マス番号*/
.marker-label {
    font-size: 13px;
    text-anchor: start;
    fill: #333;
    user-select: none;
}

/*マスの点滅*/
.flash-glow {
  fill: #f37d3e;
  stroke: #000;
  stroke-width: 3;
  opacity: 1;
  animation: flashGlow 1s infinite alternate;
}

@keyframes flashGlow {
  0% {
    opacity: 1;
    fill: #f37d3e;
  }
  50% {
    opacity: 0.3;
    fill: #ffae6a;
  }
  100% {
    opacity: 1;
    fill: #f37d3e;
  }
}

controls {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

#scene {
    perspective: 800px;
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    overflow: hidden;
}

#cube {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateX(0deg) rotateY(0deg);
}
#cube.hide {
    display:none;
}

#DICE.DICE.active {
  cursor: pointer;
}

#DICE.DICE.active .dice-inner {
  animation: jump 2s infinite ease-in-out;
}

#DICE.DICE.active {
  position: fixed; /* 画面に対して固定 */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(2.5); /* 中央配置 & 2.5倍 */
  z-index: 9999;
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); /* 弾むような動き */
  filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.5)); /* 黄金の光 */
  cursor: pointer;
  animation: dice-wait-float 2.5s ease-in-out infinite;
}

@keyframes dice-wait-float {
    0%, 100% { transform: translate(-50%, -50%) scale(2.5); filter: brightness(1); }
    50% { transform: translate(-50%, -55%) scale(2.7); filter: brightness(1.3); }
}

.face {
    position: absolute;
    width: 75px;
    height: 75px;
    backface-visibility: hidden;
}

.face img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.front {
    transform: rotateY(0deg) translateZ(75px);
}

.back {
    transform: rotateY(180deg) translateZ(75px);
}

.right {
    transform: rotateY(90deg) translateZ(75px);
}

.left {
    transform: rotateY(-90deg) translateZ(75px);
}

.top {
    transform: rotateX(90deg) translateZ(75px);
}

.bottom {
    transform: rotateX(-90deg) translateZ(75px);
}

.tab > label.turn {
	border-bottom: 5px solid #f2b7b3;
	color: #FEDF50;
	background-color: #a43f0f;
}

/* 拡大鏡用マスク */
#magnifierMaskCircle {
  fill: white;
}

/* 拡大鏡の枠 */
#magnifierBorder {
  fill: none;
  stroke: #333;
  stroke-width: 3;
}

/*カードを引く*/
/**
#draw-card-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  backg
round: black;
  z-index: 9998;
}
**/

xdraw-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  min-width: 100vw;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  /* pointer-events: none; */
  padding:
  env(safe-area-inset-top)
  env(safe-area-inset-right)
  env(safe-area-inset-bottom)
  env(safe-area-inset-left);
  z-index: 9998;   /* iframe の下にする */
}

@media (orientation: portrait) { /* 縦レイアウト */
  xdraw-card-overlay {
    width: 100%;
    height: auto;
  }
}
@media (orientation: landscape) { /* 横レイアウト */
 xdraw-card-overlay {
    width: auto;
    height: 100%;
  }
}

#draw-card {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  /** height: calc(100vh - 48px); **/
  height: 100vh;
  border: none;
  z-index: 9999;
  background-color: #FFF;
}

#draw-card.show {
  transition:opacity .5s;
  opacity:1;
}

@media (orientation: portrait) { /* 縦レイアウト */

  .main {
   display: grid;
   grid-template-rows: auto auto 1fr auto;
   height: 100%;
  }

  .ui-container {
  }

  .card-info-container {
   display: none;
  }

  .action-ui-container {
	width:100%;
	top:90%;
    position: absolute;
  }
  /* カード：左端 */
  .action-ui-container .CARD {
    position: absolute;
    left: 3%;
    transform: translateY(-50%);
  }

  /* サイコロ：右端 */
  .action-ui-container #DICE {
    position: absolute;
    right: 3%;
    transform: translateY(-50%);
  }
}

@media (orientation: landscape) { /* 横レイアウト */

  .main {
   display: grid;
   grid-template-columns: auto auto 1fr auto;
  }

  .ui-container {
    display: grid;
    grid-template-rows: 1fr 1fr;
    min-width: 0;      /* ← これが無いと確実に壊れます */
    width: auto;       /* 100% は禁止 */
    justify-self: end; /* 右寄せ */
  }
  .card-info-container {
   display: grid;
   place-items: center; /* 横・縦 両方中央 */
  }
  .card-info-box {
    height: 150px;
    aspect-ratio: 851 / 1489;
  }

  .card-info {
   background-image: url('../../澪_0.webp');  /* 既定(JSが card.filename で上書き)。画像は static/card/ 直下 */
    width: auto;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
  }

  .action-ui-container {
    right: 3%;
    left: auto;

    display: flex;
    flex-direction: row;
    align-items: center;
    /* gap: 12px; */
    justify-content: space-around;
    gap: 20px;
  }

  /* 上：カード */
  .action-ui-container .CARD {
    position: static;
    order: 1;
    transform: none;
  }

  /* 下：サイコロ */
  .action-ui-container #DICE {
    position: static;
    order: 2;
    transform: none;
  }
}

@media (orientation: portrait) { /* 縦レイアウト */

  .PARTI-wrapper {
    padding: 6px;
  }

  .tab {
    display: flex;
    flex-direction: row;
    justify-content: center;
  }

  /* 選択中だけ下に表示 */
  label:has(input:checked) + .detail {
    display: block;
    position: static;
    margin: 4px 0 0;
    background: transparent;
    box-shadow: none;
    background: #fff;
  }
}

@media (orientation: landscape) { /* 横レイアウト */

  .PARTI-wrapper {
  }

  .tab {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  label {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
  }

  /* 吹き出し本体 */
  label + .detail {
    display: none;
    opacity: 0;

    margin-left: 12px;
    padding: 10px 12px;
    min-width: 200px;

    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(0,0,0,.25);
    z-index: 100;
    position: fixed;
    top: 100px;
    left: 15%;
    transition: opacity .2s ease, transform .2s ease;
  }

  /* 選択中だけ表示 */
  label:has(input:checked) + .detail {
    display: block;
    opacity: 1;
    transform: translateY(-50%) scale(1);
  }

  /* 吹き出しのしっぽ */
  label + .detail::before {
    content: "";
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 8px 8px 8px 0;
    border-style: solid;
    border-color: transparent #fff transparent transparent;
  }
}
