html, body{
	font-family: 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', 'Meiryo', sans-serif;
	background: url('../img/back16_23.png') repeat;
	background-size: auto;
	height:100%;
	width:100%;
	padding: 0;
	margin: 0;
}

:root{
	--battle-font-factor: 1;
}

.screen {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 98vh;
  width: 98vw;
  justify-content: flex-start;
  box-sizing: border-box;
  text-align: center;
  padding: 1vh 0vw 0vh 1vw;
}

.tab-bar.fixed {
    position: absolute;
    left: 2%;
    right: 2%;
    bottom: 0;
    height: 7%;
    min-height: 100px;
    margin: 0 auto;
    width: 96%;
    padding: 0.25rem 18%;
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    border-radius: 0;
    background-color: rgba(173, 216, 230, 0.8);
    z-index: 5;
    box-sizing: border-box;
  }

.tab-bar.fixed button {
  flex: 1 1 auto;
  aspect-ratio: 1 / 1;
  max-height: 100%;
  width: 100%;
  min-width: 70px;
  min-height: 70px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(0.95rem, 1.8vw, 1.4rem);
  padding: 0.25rem;
  border-radius: 16px;
  line-height: 1.1;
  text-align: center;
}

.home-nav-controls{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  justify-content: center;
  width: 100%;
}

.home-refresh-form{
  margin: 0;
}

.home-nav-buttons{
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.home-nav-buttons button{
  min-width: 80px;
  padding: 0.35rem 0.75rem;
}

.nav-shortcuts{
  position: fixed;
  left: 7rem;
  bottom: 4rem;
  display: flex;
  gap: 0.25rem;
  z-index: 15;
}

.nav-shortcuts button{
  min-width: 96px;
  min-height: 60px;
  padding: 0.5rem 0.9rem;
}

.shop-nav{
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 0.5rem;
}

.shop-note{
  margin: 0.5rem 0 0;
  color: #174ea6;
}

.shop-header{
  text-align: center;
  margin: 0.5rem auto 1rem;
}

.coin-note{
  text-align: center;
  font-weight: 700;
}

.shop-list{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  width: 90vw;
  max-width: 90vw;
  box-sizing: border-box;
  margin: 0 auto;
}

.shop-card{
  background: #ffffff;
  border: 1px solid #cfe2ff;
  border-radius: 10px;
  padding: 0.75rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  text-align: center;
}

.shop-card h3{
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.shop-card .shop-price{
  font-weight: 700;
  color: #0d47a1;
  margin-bottom: 0.4rem;
}

.shop-card .shop-owned{
  color: #2e7d32;
  font-weight: 700;
}

.shop-card button{
  min-width: 120px;
}

.shop-coin{
  font-weight: 700;
}

.deck-summary-row{
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.deck-cost-chart{
  border: 1px solid #000;
  display: block;
  width: 300px;
  height: 150px;
  padding: 4px;
  box-sizing: border-box;
  background: #fff;
}

.leader-skill-preview{
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #cfe2ff;
  border-radius: 8px;
  background: #f0f7ff;
  cursor: pointer;
  min-width: 240px;
}

.leader-skill-preview:hover{
  box-shadow: 0 0 8px rgba(0,0,0,0.15);
}

.leader-skill-preview__img-wrap{
  width: 60px;
  height: 60px;
  flex: 0 0 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 6px;
  border: 1px solid #d0d0d0;
  overflow: hidden;
}

.leader-skill-preview__img-wrap img{
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.leader-skill-preview__meta{
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.leader-skill-preview__name{
  font-weight: 700;
}

.leader-skill-preview__cost{
  font-size: 0.9rem;
  color: #174ea6;
}

.leader-skill-preview.is-empty{
  padding: 0.75rem 1rem;
  border: 1px dashed #bbb;
  background: #fafafa;
  color: #666;
}

.battle-mode-switch{
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin: 0 0 1rem;
}

.battle-mode-switch button{
  min-width: 120px;
  padding: 0.6rem 1.1rem;
  font-weight: 700;
}

.battle-mode-switch button.is-active{
  box-shadow: 0 0 0 3px rgba(30,136,229,0.35);
  border: 2px solid #1e88e5;
}

.battle-mode-placeholder{
  text-align: center;
  margin: 0.5rem 0 1rem;
  color: #174ea6;
}

.deck-create-desc{
  margin: 0.6rem 0 0.75rem;
  padding: 0.5rem 0.7rem;
  background: #ffffff;
  border: 1px solid #bfbfbf;
  border-radius: 6px;
  color: #333;
}

.deck-class-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.deck-class-button{
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  border: 2px solid #444;
  border-radius: 6px;
  background: #f5f5f5;
  cursor: pointer;
  font-weight: 700;
  text-align: left;
}

.deck-class-button img{
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
}

.deck-class-label{
  color: #000000;
}

.deck-class-button.is-selected{
  border-color: #1e88e5;
  box-shadow: 0 0 0 3px rgba(30,136,229,0.35);
  background: #eef6ff;
}

.home-join-notice{
  position: relative;
  display: table;
  margin: 0 auto 0.75rem;
  padding: 0.4rem 0.9rem;
  background: #fff3c4;
  color: #6a3a00;
  font-weight: 700;
  border-radius: 8px;
  box-shadow: 0 2px 0 rgba(0,0,0,0.15);
}

.home-nav-buttons button.is-join-blink,
.battle-mode-switch button.is-join-blink{
  animation: joinBlink 1.2s ease-in-out infinite;
}

@keyframes joinBlink{
  0%, 100%{
    box-shadow: 0 0 0 0 rgba(255,152,0,0.0);
  }
  50%{
    box-shadow: 0 0 0 6px rgba(255,152,0,0.4);
  }
}

.game-frame {
  position: relative;
  width: 100%;
  height: 100%;
  border: 4px solid #444;
  border-radius: 12px;
  box-sizing: border-box;
  background-color: rgb(136, 255, 136);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  overflow-y: auto;
  max-height: 97vh;
}

.welcome-tagline{
  margin: 0.75rem 0 1rem;
  padding: 0.35rem 0.9rem;
  text-align: center;
  font-family: "Cormorant Garamond", "Times New Roman", serif;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  color: #1b1b1b;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 999px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

.user-list-table{
  width: min(720px, 92vw);
  margin: 0 auto;
  background: #ffffff;
  border-collapse: collapse;
}

.user-list-table th,
.user-list-table td{
  padding: 0.4rem 0.6rem;
  text-align: left;
}

.user-list-table th{
  background: #f3f3f3;
}

.game-main{
  flex: 0 0 93%;
  height: 93%;
  width: 100%;
  overflow-y: auto;
  box-sizing: border-box;
  padding: 1vh 1vw 2vh;
}

.game-frame.battle-screen{
  height: 100vh;
  max-height: none;
  padding-bottom: 0;
  overflow: hidden;
  align-items: stretch;
  justify-content: flex-start;
}

table{
	margin-left:auto;
	margin-right:auto;
}

.hit-num__text span {
  font-weight: bold;
}

#search-result__list span {
  display: inline-block;
  background: #F2F2F2;
}
.target-area {
	margin: 0 0 0 0em;
	padding: 0;
}
.target-area .hidden {
  display: none
}
li{
	text-decoration: none ;
	list-style:none;
}

.action-bar {
  display: flex;
  gap: .5rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.name {
	display: inline-block;
	width:180px;
	height:45px;
}
.cost {
	background-color:#44ff44;
}
.unit-attack {
	display: inline-block;
	width:90px;
	height:20px;
	background-color:#ff5555;
}
.unit-hit-point {
	display: inline-block;
	width:90px;
	height:20px;
	background-color:#5555ff;
}
.spell {
	display: inline-block;
	width:180px;
	height:20px;
	background-color:#ffffff;
}
.item {
	display: inline-block;
	width:180px;
	height:20px;
	background-color:#ffffff;
}
.object {
	display: inline-block;
	width:180px;
	height:20px;
	background-color:#ffffff;
}
.card-frame {
	display: inline-block;
	height:60px;
	width:180px;
}

.rarity-frame {
	display: inline-block;
	width:35px;
	height:25px;
}
.r-bronze {
	background: url(..//img/rare/1.gif) no-repeat right 1px bottom 1px;
}
.r-silver {
	background: url(../img/rare/2.gif) no-repeat right 1px bottom 1px;
}
.r-gold {
	background: url(../img/rare/3.gif) no-repeat right 1px bottom 1px;
}
.r-legend {
	background: url(../img/rare/4.gif) no-repeat right 1px bottom 1px;
}
.r-special {
	background: url(../img/rare/5.gif) no-repeat right 1px bottom 1px;
}

.menu-btn:link,
.menu-btn:visited {
	text-transform: uppercase;
	text-decoration: none;
	color: rgb(27, 27, 27);
	border: 1px solid;
	border-radius: 1000px;
	display: inline-block;
	transition: all .2s;
	position: relative;
	background : #aaedaa;
	width:100%;
	height:100%;
}

.menu-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 10px 20px rgba(27, 27, 27, .5);
}

.menu-btn:active {
	transform: translateY(-1px);
}

.menu-btn::after {
	content: "";
	display: inline-block;
	height: 100%;
	width: 100%;
	border-radius: 100px;
	top: 0;
	left: 0;
	position: absolute;
	z-index: -1;
	transition: all .3s;
}

.menu-btn:hover::after {
	background-color: rgb(0, 238, 255);
	transform: scaleX(1.4) scaleY(1.5);
	opacity: 0;
}
label {
   border: 1px solid #8080ff;
   border-radius: 9px;
   padding: 2px 6px 2px 2px;
   margin-bottom: 4px;
   display: inline-block;
   cursor: pointer;
}
label:hover {
   background-color: #9999ff;
   color: white;
}

.dotted {
	border-bottom: 1px dotted black;
}

.blink {
	-webkit-animation: blink 0.75s ease-in-out infinite alternate;
	-moz-animation: blink 0.75s ease-in-out infinite alternate;
	animation: blink 0.75s ease-in-out infinite alternate;
}

.hover-bright {
	filter: brightness(1.0);
	cursor: pointer;
}

.hover-bright:hover{
	filter: brightness(1.5);
  transform: scale(1.1);
}

.close-button {
	position: absolute;
	top: 1%;
	right: 1%;
	cursor: pointer;
}

.close-button:hover {
	background-color: #ffaaaa;
}

@-webkit-keyframes blink {
	0% {
		opacity: 0;
	}

	100% {
		opacity: 1;
	}
}

@-moz-keyframes blink {
	0% {
		opacity: 0;
	}

	100% {
		opacity: 1;
	}
}

@keyframes blink {
	0% {
		opacity: 0;
	}

	100% {
		opacity: 1;
	}
}

data{
	display: none;
}

.button-image-link {
	text-decoration: none;
	cursor: pointer;
	border: none;
}

button,
input[type="submit"],
input[type="button"] {
	background-color: #2da0f1;
	color: #ffffff;
	padding: 0.25rem;
	font-size: 1rem;
	margin: 0.1em;
	cursor: pointer;
	border: none;
	border-radius: 0.5rem;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
	transition: background-color 0.2s ease, transform 0.1s ease;
}

button:disabled,
input[type="submit"]:disabled,
input[type="button"]:disabled {
	background-color: #cccccc;
	color: #666666;
	cursor: not-allowed;
	box-shadow: none;
	opacity: 0.7;
}

input[type="submit"].large-button{
	font-size: calc(1.05rem * var(--battle-font-factor));
	margin: 0.3em;
	padding: calc(0.55rem * var(--battle-font-factor)) calc(0.9rem * var(--battle-font-factor));
	min-height: calc(2.4rem * var(--battle-font-factor));
	border-radius: calc(0.45rem * var(--battle-font-factor));
}

button.large-button{
	font-size: calc(1.05rem * var(--battle-font-factor));
	margin: 0.3em;
	padding: calc(0.55rem * var(--battle-font-factor)) calc(0.9rem * var(--battle-font-factor));
	min-height: calc(2.4rem * var(--battle-font-factor));
	border-radius: calc(0.45rem * var(--battle-font-factor));
	flex-shrink: 0;
}

button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
	background-color: #52d5f8;
}

.blocked-icon {
	display: block;
	margin: 0 auto;
}

.card-rare-top{
	position: absolute;
	display: flex;
	justify-content: center;
	top: 0;
	left: 50%;
	transform: translateX(-50%);
}

.card-type-icon{
	position: absolute;
	display: flex;
	justify-content: center;
	bottom: 0;
	left: 50%;
	transform: translateX(-50%);
}

.card-image-icon{
	cursor: pointer;
	display: block;
	margin: 0 auto;
}

.card-image-icon:hover {
	filter: brightness(1.25);
}

.param-tmp {
	position: absolute;
	display: flex;
	justify-content: center;
	border-radius: 4px;
	z-index: 1;
}

.sts-cost {
	border: 1px solid black;
	background-color: #44cc44;
	left: 0px;
	top: 0px;
	width: 18px;
}

.sts-switch {
	border: 1px solid black;
	background-color: #cccc44;
	left: 0px;
	top: 0px;
	width: 25px;
}

.sts-evolve {
	left: 1px;
	top: 0px;
}

.sts-count {
	background-color: rgba(180, 180, 180, 0.7);
	right: 0px;
	bottom: 0px;
	width: 18px;
}

.sts-atk {
	background-color: #ff5555;
	left: 0px;
	bottom: 0px;
	width: 18px;
}

.sts-hp {
	background-color: #5555ff;
	right: 0px;
	bottom: 0px;
	width: 18px;
}

.sts-num {
	background-color: rgba(220, 220, 220, 0.8);
	right: 5px;
	top: 0px;
	width: 20px;
	padding: 0 5px 0 5px;
}

#orientationMessage {
	display: none; 
	position: fixed;
	z-index:10;
	top: 80%;
	left: 50%;
	transform: translate(-50%, -50%);
	padding: 5%;
	background-color: rgba(0, 0, 0, 0.8);
	color: #fff;
	font-size: 3em;
	text-align: center;
	width : 90%;
	border-radius: 5%;
}

@media screen and (orientation: portrait) {
	#orientationMessage {
		display: block;
	}
}

/* トーストコンテナ（画面上部中央） */
#toast-container {
	position: fixed;
	top: 10px;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	flex-direction: column; /* 上から順に積み重ねる */
	align-items: center;
	z-index: 9999;
  }
  
  /* 個々のトーストメッセージ */
  .toast-message {
	background-color: #4285f4; /* 青色背景 */
	color: #fff;              /* 文字色は白 */
	padding: 10px 20px;
	margin-top: 5px;
	border-radius: 4px;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  
	/* フェードアウトに使う (1秒かけて透明にする) */
	opacity: 1;
	transition: opacity 1s ease;
  }
  
  /* フェードアウト開始時に付与するクラス */
  .fade-out {
	opacity: 0;
  }

  .battle-screen{
	position: relative;
	font-family: 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', 'Meiryo', sans-serif;
	font-size: calc((0.25vw + 0.75rem) * var(--battle-font-factor));
	font-feature-settings: "palt";
  }

.battle-hand-row{
	background-color: rgb(136, 255, 136);
	display: flex;
	flex-wrap: nowrap;
	overflow-x: auto;
	overflow-y: hidden;
	width: 55vw;
	height: 17vh;
	position: absolute;
	z-index: 1;
	padding: 0.35rem;
	gap: 0.35rem;
  }


  .battle-hand-row--enemy{
	top: 0vh;
	left: 20vw;
  }

  .battle-log-panel{
    width:14vw;
    height:70vh;
    display:block;
    overflow-y:scroll;
    z-index:2;
    position:absolute;
    top:10vh;
    left:1vw;
  }

  .battle-leader{
	position: absolute;
	z-index: 1;
	border-radius: 10%;
  }

  .battle-leader--mine{
	top: 73vh;
	left: 40vw;
	background: #00aaff;
  }

  .battle-leader--enemy{
	top: 18vh;
	left: 40vw;
	background: #ffaa00;
  }

  .battle-leader__inspect{
    position:absolute;
    right:0.5rem;
    top:0px;
    z-index:1;
    cursor:pointer;
  }

  .battle-leader-ep{
	background: #555555;
  touch-action: none;
  }

  .battle-ep-hint{
	position: fixed;
	left: 0;
	top: 0;
	transform: translate(-100%, -50%);
	display: none;
	padding: 0.35rem 0.7rem;
	background: rgba(0, 0, 0, 0.8);
	color: #ffffff;
	border-radius: 0.6rem;
	font-size: 0.85rem;
	white-space: nowrap;
	pointer-events: none;
	z-index: 9500;
  }

  .battle-ep-hint::after{
	content: '';
	position: absolute;
	right: -6px;
	top: 50%;
	transform: translateY(-50%);
	border-width: 6px 0 6px 6px;
	border-style: solid;
	border-color: transparent transparent transparent rgba(0, 0, 0, 0.8);
  }

  .battle-ep-hint.is-visible{
	display: block;
  }

  .js-attack-source{
    touch-action: none;
  }

  .battle-responsive-shell{
	position: relative;
	width: 100%;
	height: 100vh;
	min-height: 600px;
	box-sizing: border-box;
	overflow: hidden;
  }

  .battle-stage-scale-wrapper{
	position: absolute;
	top: 0;
	left: 50%;
	width: 1920px;
	height: 1080px;
	transform: translateX(-50%);
	transform-origin: top center;
	will-change: transform;
  }

  .battle-comm-overlay{
	position: absolute;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.35);
	z-index: 9000;
	pointer-events: all;
  }

  .battle-comm-overlay.is-visible{
	display: flex;
  }

  .battle-comm-overlay__content{
	background: rgba(0, 0, 0, 0.75);
	color: #ffffff;
	padding: 0.7rem 1.4rem;
	border-radius: 999px;
	font-weight: 600;
	letter-spacing: 0.04em;
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  }

  .battle-orientation-alert{
	position: absolute;
	left: 50%;
	bottom: 1rem;
	transform: translateX(-50%);
	background: rgba(0, 110, 255, 0.9);
	color: #fff;
	padding: 0.4rem 1.2rem;
	border-radius: 999px;
	font-weight: 600;
	letter-spacing: 0.05em;
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 60;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  }

  .battle-screen .unit-icon{
	width: calc(2.35vw * var(--battle-font-factor));
	height: calc(2.35vw * var(--battle-font-factor));
  }

  .battle-screen .sleeve-icon{
	width: calc(2.62vw * var(--battle-font-factor));
	height: calc(3.67vw * var(--battle-font-factor));
  }

  .battle-screen .skin-icon{
	width: calc(5.22vw * var(--battle-font-factor));
	height: calc(5.22vw * var(--battle-font-factor));
  }

  .battle-screen .action-icon{
	width: calc(1.044vw * var(--battle-font-factor));
	height: calc(1.044vw * var(--battle-font-factor));
  }

  .battle-top-controls{
	position:absolute;
	top:1%;
	left:2%;
	z-index:5;
	display:flex;
	gap:0.5rem;
	flex-wrap:wrap;
  }

  .battle-turn-action-container{
	position:absolute;
	top:64vh;
	left: 74vw;
	z-index:5;
  }
  
  .battle-top-controls form,
  .battle-turn-action-container form{
	margin:0;
	display:inline-block;
  }

  .battle-result-banner{
	position:absolute;
	z-index:30;
	top:35%;
	left:40%;
	background:#aaccff;
	border-radius:10px;
	padding:12px 20px;
	font-size:2rem;
	display:none;
  }

  .leader-skill-icon{
	background-color: rgba(255,255,255,0.15);
	cursor: grab;
	transition: transform 0.15s ease, opacity 0.15s ease;
  }

  .leader-skill-icon.is-disabled{
	opacity: 0.35;
	cursor: not-allowed;
  }

  .leader-skill-icon.is-dragging{
	cursor: grabbing;
	transform: scale(0.9);
  }

  .leader-skill-icon.is-ready{
	box-shadow: 0 0 6px rgba(30,58,138,0.55);
  }

.leader-skill-control{
    border-radius: 4px;
    top: 0vh;
    right:0vw;
  }

  .modal-syncer{
	cursor: pointer;
  }

  .battle-screen svg{
	width: calc(1.9vw * var(--battle-font-factor));
	height: calc(1.9vw * var(--battle-font-factor));
  }

  .battle-status-stack{
	position: absolute;
	z-index: 1;
	top: 38vh;
	left: 72vw;
  }

.battle-status-card{
	border: calc(2px * var(--battle-font-factor)) solid;
	margin: calc(1px * var(--battle-font-factor));
	border-radius: calc(5px * var(--battle-font-factor));
}

.battle-status-card--timer{
    border:calc(2px * var(--battle-font-factor)) solid;
    margin:calc(1px * var(--battle-font-factor));
    background:#ccc;
    border-radius:calc(5px * var(--battle-font-factor));
    position:relative;
    width:calc(10vw * var(--battle-font-factor));
    height:calc(3vh * var(--battle-font-factor));
}

  .battle-timer-fill{
    height:100%;
    width:100%;
    background:green;
    border-radius:5px;
  }

  .battle-timer-label{
    position:absolute;
    top:0;
    left:0;
    width:100%;
    height:100%;
    text-align:center;
    line-height:25px;
    font-weight:bold;
  }

  .battle-berserk-icon{
	position: absolute;
	z-index: 1;
	display: none;
  }

  .battle-berserk-icon--mine{
	top: 73vh;
	left: 37vw;
  }

  .battle-berserk-icon--enemy{
	top: 18vh;
	left: 37vw;
  }

  .battle-weapon{
	position: absolute;
	z-index: 2;
	min-width: 60px;
  }

  .battle-weapon--mine{
	top: 80vh;
	left: 36vw;
  }

  .battle-weapon--enemy{
	top: 25vh;
	left: 36vw;
  }

  .battle-stage-field{
    overflow-x:scroll;
    width:50vw;
    height:42vh;
    position:absolute;
    z-index:1;
    top:30vh;
    left:20vw;
    text-align:center;
  }

.battle-stage-summary{
	background-color: #aaaaaa;
	border-radius: 0.53vw;
	margin: 0.5rem 0;
	padding: 0.5rem;
}
.battle-stage-summary.is-mine-turn{
	background-color: #4da3ff;
}
.battle-stage-summary.is-enem-turn{
	background-color: #ff6b6b;
}

  .battle-info-card{
	position: absolute;
	z-index: 1;
	border-style: solid;
	color: #fff;
	border-color: #000;
	background: #003300;
	border-radius: 10px;
	padding: 3px;
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
  }
  .battle-info-card .user-container{
	display: inline-flex;
	align-items: center;
	gap: 4px;
	line-height: 1.2;
  }
  .battle-info-card svg{
	vertical-align: middle;
	flex-shrink: 0;
  }

  .battle-sleeve-cell{
	position: relative;
  }


  /* ユーザーアイコン + ステータスバッジをまとめるコンテナ */
  .user-container {
	position: relative;     /* ステータス丸を絶対配置するため */
	display: inline-block;
	cursor: default;        /* クリックロジックがないので通常のカーソル */
  }

  /* ステータスバッジ */
  .status-badge {
	position: absolute;
	bottom: 0;              
	right: 0;
	width: 9px;
	height: 9px;
	border: 2px solid #ffffff; /* アイコンとの境界を目立たせるための枠線 */
	border-radius: 50%;
  }
  /* 各ステータスの色分け */
  .status-badge[data-status="online"] {
	background-color: #43b581; /* グリーン */
  }
  .status-badge[data-status="away"] {
	background-color: #faa61a; /* イエロー */
  }
  .status-badge[data-status="dnd"] {
	background-color: #f04747; /* レッド */
  }
  .status-badge[data-status="single"] {
	background-color: #0a1b80;
  }

.wsnr_table th,
.wsnr_table td {
  white-space: nowrap;
}

  /* ツールチップ */
  .tooltip {
	position: absolute;
	bottom: 100%; /* バッジの真上あたりに表示 */
	left: 50%;
	transform: translateX(-50%);
	background-color: rgba(0, 0, 0, 0.8);
	color: #fff;
	padding: 4px 8px;
	border-radius: 4px;
	white-space: nowrap;
	font-size: 14px;
	opacity: 0;             /* 初期状態は非表示 */
	pointer-events: none;   /* マウスイベントを通さない */
	transition: opacity 0.2s ease-in-out;
	z-index:30;
  }
  /* 三角マーク */
  .tooltip::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	border: 6px solid transparent;
	border-top-color: rgba(0, 0, 0, 0.8);
  }

  /* ホバーでツールチップを表示 */
  .user-container:hover .tooltip {
	opacity: 1;
	pointer-events: auto;
  }
  .stamina-container {
	width: 150px;
	height: 11px;
	background-color: #aaaaaa;
	border: 2px solid #000;
	border-radius: 5px;
	overflow: hidden;
	box-shadow: inset 0 0 5px #aaa;
	margin-bottom: 3px;
  }
  
  .stamina-bar {
	height: 100%;
	background-color: #4cff50; /* 緑色 */
	transition: width 0.3s ease;
  }
  
  .stamina-text {
	font-weight: bold;
	text-align: center;
	color: #333;
  }

  .my-hand{
    background-color:rgb(136, 255, 136);
    flex-wrap:nowrap;
    display:flex;
    overflow-x:scroll;
    overflow-y: hidden;
    width:75vw;
    height:20vh;
    position:absolute;
    z-index:12;
    top:85vh;
    left:20vw;
    transition: transform 0.15s ease, top 0.15s ease;
  }

  .my-hand:hover{
    top:75vh;
    transition: transform 0.15s ease, top 0.15s ease;
  }
 
  .g-adsense{
	width: 400px;
  }

  p {
  font-size: 0.9rem;
  margin: 0.1rem 0 0.1rem;
}

.battle_card{
	z-index:0;
	font-weight: normal;
	transition: font-weight 0.3s ease;
	position:relative;
	min-width:80px;
	max-width:80px;
	border-radius:10px;
	margin:5px;
	padding:5px;
	border:1px solid;
	cursor: pointer;
}

.battle_card:hover{
  margin:8px 5px 8px 5px ;
}

.battle_card.stacked-card{
  border:3px solid;
}

.battle_card.rap-drop-ready{
  background-color: rgba(0, 140, 255, 0.2) !important; /* override inline bg */
  opacity: 1;
  transition: background-color 0.1s ease, box-shadow 0.1s ease;
  box-shadow: 0 0 0 2px rgba(0,140,255,0.35);
}

.battle_card.rap-drop-hover{
  background-color: rgba(0, 140, 255, 0.35) !important; /* override inline bg */
  opacity: 1;
  box-shadow: 0 0 0 3px rgba(0,140,255,0.6);
}

.battle_card--drawn{
	animation: handCardDrawPop 0.8s ease-out;
	box-shadow: 0 0 12px rgba(255, 255, 255, 0.85);
}

@keyframes handCardDrawPop{
	0%{
		opacity:0;
		transform: translateY(30px) scale(0.9);
	}
	60%{
		opacity:1;
		transform: translateY(-8px) scale(1.05);
	}
	100%{
		opacity:1;
		transform: translateY(0) scale(1);
	}
}

.battle_card:hover{
	z-index:10;
	font-weight:bold;
}

.login-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  margin: 0.5rem auto;
  width: 100%;
  min-width:400px;
  max-width: 450px;
  background: rgba(255, 255, 255, 0.3);
  padding: 0.5rem;
  border-radius: 1rem;
  box-sizing: border-box;
}

.logo {
  max-width: 100%;
  height: auto;
  margin: 0 auto 1rem;
}

.auth-input {
  width: 100%;
  max-width: 300px;
  padding: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 0.5rem;
  font-size: 1rem;
  box-sizing: border-box;
}

.link-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.link-btn {
  background-color: #60f12d;
  color: #000;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  text-align: center;
  font-size: 1rem;
  text-decoration: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  min-width: 140px;
  transition: background-color 0.2s ease;
}

.link-btn:hover {
  background-color: #d5f852;
}

.image-link img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
}

.footer {
  text-align: center;
  font-size: 0.85rem;
  color: #333;
  background-color: transparent;
}

#online-window {
  position: fixed;
  bottom: 1vh;
  right: 1vw;
  width:150px;
  background-color: #f9f9f9;
  border: 1px solid #666;
  border-radius: 6px 6px 0 0;
  box-shadow: 0 -2px 6px rgba(0,0,0,0.2);
  font-size: 12px;
  z-index: 1000;
}

.online-title {
  background-color: #2da0f1;
  color: white;
  padding: 2px 4px;
  font-weight: bold;
  border-bottom: 1px solid #666;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.online-title-text {
  flex: 1;
  text-align: center;
}

#online-toggle {
  margin-left: 4px;
  flex-shrink: 0;
}

.online-indicator {
  --progress-deg: 0deg;
  --size: 28px;
  position: relative;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: #1e3a8a;
  background-color: #ffffff;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(30, 58, 138, 0.25);
  z-index: 0;
}

.online-indicator::before,
.online-indicator::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  pointer-events: none;
}

.online-indicator::before {
  background: conic-gradient(#1e3a8a var(--progress-deg), rgba(30, 58, 138, 0.12) 0);
  mask: radial-gradient(circle at center, transparent calc(50% - 2px), #000 calc(50% - 1px));
  -webkit-mask: radial-gradient(circle at center, transparent calc(50% - 2px), #000 calc(50% - 1px));
}

.online-indicator::after {
  border: 1px solid rgba(30, 58, 138, 0.15);
  mask: radial-gradient(circle at center, transparent calc(50% - 2px), #000 calc(50% - 2px));
  -webkit-mask: radial-gradient(circle at center, transparent calc(50% - 2px), #000 calc(50% - 2px));
}

.online-indicator.is-fetching::before {
  animation: online-indicator-pulse 0.9s linear infinite;
}

@keyframes online-indicator-pulse {
  0% {
    transform: scale(0.95);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(0.95);
  }
}

.online-body {
  padding: 1px;
  overflow-y: auto;
  height: calc(125px - 22px);
  text-align:left;
}

.online-body ul {
  margin: 0;
  padding-left: 1px; /* デフォルトのインデント */
  text-align: left;
}

.online-body-message {
  padding: 6px;
  text-align: center;
  opacity: 0.75;
}

.lobby-section-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0;
  font-weight: bold;
}


.card-display{
	display:none;
	position:fixed;
	z-index:12000;
	top:2%;
	right:2%;
	border-style:solid;
	color:#ffffff;
	border-color:#666666;
	background:#000000;
	border-radius:3%;
	opacity: 0.95;
	pointer-events: auto;
}

.mine-unit-slot {
	position: relative;
}

.mine-unit-slot .evolve-highlight {
	pointer-events: none;
	position: absolute;
	inset: 0;
	border-radius: 0.53vw;
	background: rgba(255, 255, 0, 0);
	opacity: 0;
	transition: opacity 0.12s ease, background-color 0.12s ease;
	z-index: 3;
}

.mine-unit-slot.is-evolve-available .evolve-highlight {
	background: rgba(255, 255, 0, 0.3);
	opacity: 1;
}

.mine-unit-slot.is-evolve-target .evolve-highlight {
	background: rgba(255, 255, 0, 0.5);
	opacity: 1;
}

.evolve-pointer-line {
	position: fixed;
	height: 4px;
	background: rgba(255, 255, 0, 0.65);
	border-radius: 4px;
	box-shadow: 0 0 8px rgba(255, 255, 0, 0.5);
	pointer-events: none;
	transform-origin: 0 50%;
	z-index: 4000;
	opacity: 0;
	transition: background-color 0.1s ease, box-shadow 0.1s ease, opacity 0.05s ease;
}

.evolve-pointer-line.is-visible {
	opacity: 1;
}

.mine-ep-trigger, .mine-unit-slot, .mine-unit-slot * {
	user-select: none;
	-webkit-user-select: none;
}

/* LPが解放可能なときに光る */
.mine-ep-trigger.can-evolve {
  animation: sparklePulse 1.2s infinite ease-in-out;
  box-shadow: 0 0 12px rgba(255, 255, 128, 0.8), 0 0 24px rgba(255, 255, 64, 0.5);
}

/* 解放ドラッグ中の強調 */
.mine-ep-trigger.evolving {
  animation: sparkleFlash 0.4s infinite alternate;
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.95), 0 0 32px rgba(255, 215, 0, 0.7);
}

/* ゆらめく光のアニメーション */
@keyframes sparklePulse {
  0% {
    filter: brightness(0.9);
	transform: scale(1);
    box-shadow: 0 0 8px rgba(255, 255, 100, 0.6);
  }
  50% {
    filter: brightness(1.6);
	transform: scale(1.1);
    box-shadow: 0 0 16px rgba(255, 255, 150, 1);
  }
  100% {
    filter: brightness(0.9);
	transform: scale(1);
    box-shadow: 0 0 8px rgba(255, 255, 100, 0.6);
  }
}

/* 解放開始時のパルス */
@keyframes sparkleFlash {
  from {
    transform: scale(1);
    box-shadow: 0 0 20px rgba(255, 255, 150, 0.7);
  }
  to {
    transform: scale(1.2);
    box-shadow: 0 0 30px rgba(255, 215, 0, 1);
  }
}

/* ===== 攻撃選択ハイライト（赤） ===== */
.mine-unit-slot .attack-highlight,
.enemy-unit-slot .attack-highlight,
.enemy-leader .attack-highlight {
  pointer-events: none;
  position: absolute;
  inset: 0;
  border-radius: 0.53vw;
  background: rgba(255, 0, 0, 0);
  opacity: 0;
  transition: opacity 0.12s ease, background-color 0.12s ease;
  z-index: 3;
}

/* 攻撃可能な候補として浮かび上がる（薄い赤） */
.is-attack-available .attack-highlight {
  background: rgba(255, 0, 0, 0.20);
  opacity: 1;
}

/* ホバー中（より濃い赤） */
.is-attack-target .attack-highlight {
  background: rgba(255, 0, 0, 0.45);
  opacity: 1;
}

/* 攻撃ドラッグ中のライン（赤） */
.attack-pointer-line {
  position: fixed;
  height: 4px;
  background: rgba(255, 64, 64, 0.7);
  border-radius: 4px;
  box-shadow: 0 0 8px rgba(255, 64, 64, 0.55);
  pointer-events: none;
  transform-origin: 0 50%;
  z-index: 4000;
  opacity: 0;
  transition: background-color 0.1s ease, box-shadow 0.1s ease, opacity 0.05s ease;
}
.attack-pointer-line.is-visible {
  opacity: 1;
}

.evolve-option-layer {
  position: fixed;
  inset: 0;
  z-index: 4500;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.evolve-option-layer.is-visible {
  opacity: 1;
}

.evolve-option-dim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.evolve-option-panel {
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 260px;
  max-width: 420px;
  max-height: 85vh;
  background: rgba(25, 25, 25, 0.95);
  color: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  font-size: 0.9rem;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
}

.evolve-option-title {
  font-weight: bold;
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.evolve-option-body {
  flex: 1 1 auto;
  max-height: 65vh;
  overflow-y: auto;
  padding-right: 4px;
}

.evolve-option-note {
  margin-top: 8px;
  font-weight: bold;
}

.evolve-option-buttons {
  display: none;
  margin-top: 16px;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.evolve-option-button {
  background: #ffe066;
  color: #333;
  border: none;
  border-radius: 6px;
  padding: 8px 12px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.12s ease;
}

.evolve-option-button.primary {
  background: #ffd24c;
}

.evolve-option-button:hover {
  background: #ffea99;
  transform: translateY(-1px);
}

.evolve-option-button.cancel {
  background: #666666;
  color: #ffffff;
}

.evolve-option-button.cancel:hover {
  background: #777777;
}

.evolve-option-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.evolve-option-grid-button {
  background: #ffffff;
  color: #333;
  border: none;
  border-radius: 6px;
  padding: 10px 12px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.12s ease;
}

.evolve-option-grid-button:hover {
	background: #ffe066;
	transform: translateY(-1px);
}

.evolve-option-choice-list {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-start;
}

.evolve-option-section-title {
  width: 100%;
  font-weight: bold;
  margin: 8px 0 4px;
  color: #fffae6;
  text-shadow: 0 1px 2px rgba(0,0,0,0.35);
}

.evolve-option-choice {
  background: rgba(150, 150, 255, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px;
  flex: 0 1 calc((100% - 24px) / 3);
  min-width: 120px;
  max-width: 220px;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
}

.evolve-option-choice:hover {
  border-color: rgba(255, 96, 96, 0.9);
  box-shadow: 0 0 10px rgba(255, 96, 96, 0.4);
  transform: translateY(-1px);
}

.evolve-option-choice.is-selected {
  border-color: rgba(255, 160, 80, 0.95);
  box-shadow: 0 0 12px rgba(255, 160, 80, 0.45);
}

.evolve-option-choice-preview {
  width: 45px;
  height: 45px;
  display: flex;
  justify-content: center;
}

.evolve-option-choice-preview img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  pointer-events: none;
}

.evolve-option-choice-placeholder {
  width: 100%;
  aspect-ratio: 3 / 4;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  font-weight: bold;
  font-size: 1.3rem;
  color: #ffe6c0;
}

.evolve-option-choice-label {
  font-weight: bold;
  font-size: 0.85rem;
  text-align: center;
  color: #ffffff;
}

.evolve-option-choice-detail {
    font-size: 0.75rem;
    opacity: 0.8;
    text-align: center;
    color: #f0f0f0;
}

.deck-card-name {
    font-size: 11px;
    font-weight: bold;
    color: #000;
    text-shadow: 0 1px 2px rgba(220,220,220,0.6);
    margin-top: 2px;
    margin-bottom: 2px;
    line-height: 1.2;
    text-align: center;
}

.owned-card-pager {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 6px 0;
}

.owned-card-page {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.select-action-choice-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.select-action-choice {
    flex: 1 1 auto;
    width: 100%;
    box-sizing: border-box;
    max-width: none;
    align-items: flex-start;
    text-align: left;
    background: linear-gradient(135deg, rgba(255, 202, 102, 0.15), rgba(255, 239, 179, 0.08));
    border-color: rgba(255, 208, 126, 0.9);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}

.select-action-choice:hover {
    border-color: rgba(255, 230, 150, 1);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.45);
    transform: translateY(-1px);
}

.select-action-choice .evolve-option-choice-label {
    width: 100%;
    text-align: left;
    color: #ffe08a;
    font-size: 0.95rem;
}

.select-action-choice-text {
    width: 100%;
    text-align: left;
    line-height: 1.5;
    opacity: 0.95;
}

.mine-unit-slot .play-highlight,
.mine-unit-slot--empty .play-highlight {
    pointer-events: none;
    position: absolute;
    inset: 0;
  border-radius: 0.53vw;
  background: rgba(64, 160, 255, 0);
  opacity: 0;
  transition: opacity 0.12s ease, background-color 0.12s ease;
  z-index: 3;
}

.is-play-available .play-highlight {
  background: rgba(64, 160, 255, 0.20);
  opacity: 1;
}

.is-play-target .play-highlight {
  background: rgba(64, 160, 255, 0.45);
  opacity: 1;
}

.play-pointer-line {
  position: fixed;
  height: 4px;
  background: rgba(64, 160, 255, 0.7);
  border-radius: 4px;
  box-shadow: 0 0 8px rgba(64, 160, 255, 0.55);
  pointer-events: none;
  transform-origin: 0 50%;
  z-index: 4000;
  opacity: 0;
  transition: background-color 0.1s ease, box-shadow 0.1s ease, opacity 0.05s ease;
}
.play-pointer-line.is-visible {
  opacity: 1;
}

.api-loading-indicator {
  position: fixed;
  bottom: 18px;
  right: 18px;
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.7);
  color: #ffffff;
  font-size: 0.85rem;
  z-index: 12000;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.api-loading-indicator.is-visible {
  display: inline-flex;
}

.api-loading-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: api-spinner 0.8s linear infinite;
}

.api-loading-text {
  letter-spacing: 0.02em;
}

@keyframes api-spinner {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.mulligan-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 5000;
  padding: 1rem;
  box-sizing: border-box;
}

.mulligan-overlay.is-visible {
  display: flex;
}

.mulligan-panel {
  width: 90%;
  max-width: 960px;
  max-height: 90vh;
  overflow-y: auto;
  background: #111;
  border: 2px solid #ffffff;
  border-radius: 16px;
  padding: 1.5rem;
  box-sizing: border-box;
  color: #fff;
}

.mulligan-status {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

.mulligan-hand {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  align-items: flex-start;
}

.mulligan-card {
  width: 14vw;
  height: 42vh;
  border: 2px solid #bbb;
  border-radius: 12px;
  padding: 0;
  background: #e8f2ff;
  position: relative;
  color: #111;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
  margin: 0 6px;
}

.mulligan-card,
.mulligan-card * {
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}

.mulligan-card-body {
  width: 100%;
  height: 100%;
  background: #f8fff8;
  position: relative;
  padding-bottom: 56px;
  box-sizing: border-box;
}

.m-card-header {
  position: relative;
  overflow: hidden;
  color: #fff;
  background: #e0e0e0;
  padding: 3px;
}

.m-card-name {
  width: 100%;
  background: #d32f2f;
  color: #fff;
  text-align: center;
  padding: 4px 4px;
  font-weight: bold;
  font-size: 0.95rem;
  border-radius: 6px;
}

.m-card-image-wrap {
  text-align: center;
  padding: 6px 0;
}

.m-card-cost {
  position: absolute;
  top: 6px;
  left: 6px;
  background: #44cc44;
  color: #fff;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  font-weight: bold;
  font-size: 0.9rem;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.35);
  z-index: 2;
}

.m-card-name {
  position: absolute;
  left: 8px;
  right: 20px;
  top: 6px;
  font-weight: bold;
  font-size: 0.95rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  z-index: 2;
}

.m-card-image {
  object-fit: cover;
}


.m-card-cost {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #44cc44;
  color: #fff;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  font-weight: bold;
  font-size: 0.9rem;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.35);
  z-index: 2;
}

.m-card-text {
  padding: 8px 10px;
  background: #f1fff1;
  color: #102010;
  line-height: 1.35;
  min-height: 110px;
  font-size: 0.9rem;
}

.m-card-text hr {
  border: none;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  margin: 6px 0;
}

.m-card-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  color: #fff;
  min-height: 48px;
  font-weight: bold;
  background: rgba(0, 0, 0, 0.08);
}

.m-card-type-icon {
  width: 26px;
  height: 26px;
}

.m-card-type-center {
  text-align: center;
  width: 100%;
}

.m-card-atk-box, .m-card-hp-box {
  position: absolute;
  bottom: 6px;
  padding: 2px 6px;
  border-radius: 6px;
  color: #fff;
  font-weight: bold;
  min-width: 32px;
  text-align: center;
}

.m-card-atk-box {
  left: 3px;
  background: #d32f2f;
}

.m-card-hp-box {
  right: 3px;
  background: #1976d2;
}

.m-card-type-icon {
  width: 26px;
  height: 26px;
}

.m-card-type-text {
  font-size: 0.9rem;
}

.m-card-stat {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-left: auto;
  font-size: 0.95rem;
}

.m-card-atk {
  color: #ffe066;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.4);
}

.m-card-hp {
  color: #ff8c8c;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.4);
}

.mulligan-card .card-name {
  margin-top: 0.4rem;
  font-size: 0.85rem;
  height: 2.5rem;
  overflow: hidden;
}

.mulligan-card .card-cost {
  position: absolute;
  top: 6px;
  left: 6px;
  background: #44cc44;
  color: #fff;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  font-weight: bold;
  font-size: 0.8rem;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.35);
}

.mulligan-card.is-selected {
  border-color: #ffcc00;
  border: 3px solid;
  box-shadow: 0 0 20px rgba(255, 204, 0, 0.7);
  transform: translateY(-5vh);
}

.mulligan-card.is-disabled {
  cursor: default;
  opacity: 0.65;
}

.mulligan-actions {
  margin-top: 1.5rem;
  text-align: center;
}

.mulligan-detail-button {
  position: absolute;
  right: 6px;
  top: 6px;
  width: 26px;
  height: 26px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease, transform 0.15s ease;
}

.mulligan-detail-button img {
  width: 16px;
  height: 16px;
}

.mulligan-detail-button:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: scale(1.05);
}



.mulligan-stage {
  margin-bottom: 1.5rem;
  text-align: center;
}

.mulligan-stage-label {
  font-size: 1rem;
  margin-bottom: 0.35rem;
  opacity: 0.85;
}

.mulligan-stage-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 1.25rem;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(0, 128, 255, 0.18);
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.mulligan-stage-button:hover {
  background: rgba(0, 128, 255, 0.35);
  transform: translateY(-2px);
}

.mulligan-stage-effect {
  margin-top: 0.6rem;
  margin-bottom: 1.2rem;
}

.mulligan-hand {
  margin-top: 1rem;
  display: flex;
  gap: 12px;
}

.mulligan-stage-effect fieldset {
  margin: 0 auto;
  padding: 0.6rem 0.85rem;
  max-width: 520px;
  text-align: left;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(0, 0, 0, 0.18);
}

.mulligan-stage-effect legend {
  padding: 0 8px;
  font-weight: bold;
  color: #fff;
}

.mulligan-stage-effect-text {
  line-height: 1.5;
  color: #f9f9f9;
}

.room-player__meta{
  display:flex;
  gap:6px;
  align-items:center;
}
.room-player__emblem{
  width:32px;
  height:32px;
  object-fit:contain;
}

/* Letter layout */
#letter .letter-layout{
  display:flex;
  flex-wrap:wrap;
  gap:16px;
  align-items:flex-start;
}
#letter .letter-panel{
  background-color:#99bbff;
  border-radius:10px;
  padding:12px 14px;
  box-shadow:0 2px 6px rgba(0,0,0,0.15);
}
#letter .letter-list-panel{
  flex:1 1 55%;
  min-width:360px;
}
#letter .letter-list-body{
  max-height:70vh;
  overflow:auto;
  background:#f7fbff;
  border-radius:6px;
  padding:8px;
}
#letter .letter-compose-panel{
  flex:0 1 32%;
  min-width:280px;
}
#letter .letter-form{
  display:flex;
  flex-direction:column;
  gap:10px;
}
#letter .letter-field span{
  display:block;
  font-weight:bold;
  margin-bottom:4px;
}
#letter .letter-field input,
#letter .letter-field textarea{
  width:100%;
  box-sizing:border-box;
}
#letter .letter-actions{
  text-align:right;
}
