body {
    font-family: sans-serif; /* MLBに類似したフォント */
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
	height: 100%;
    background-color: #383c3c;
}

.container {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    z-index: 10000;
    width: 90%;
    max-width: 764px;
    position: relative;
}
h1 span {
    line-height: 2em;
}

h1 img {
    vertical-align: middle;
    padding: 5px;
    width: 2em;
    height: 2em;
}

.header-logo {
    max-width: 100%;
    height: auto;
    margin-bottom: 10px; /* Add some space below the logo */
    width: 60%;
}

.form-group {
    margin-bottom: 10px;
    text-align: left;
}

.mobile-only-setting {
    display: none;
}

.checkbox-group {
    flex: 1;
    margin-right: 15px;
    width: 100% !important;
}

.checkbox-container {
    /*display: flex;
    width: 100%;
    */
    align-items: center;
}

.w50per > .form-group-checkboxes {
    /* width: 50%; */
}

.checkbox-group label,
.checkbox-group input {
    display: inline-block;
    vertical-align: middle;
    margin-bottom: 0;
}

.both_sided
{
	display: flex; /* ← 追加または修正 */
    flex-direction: row; /* ← 追加または修正 (横並びにするため) */
    justify-content: space-between; /* ← 追加 */
    align-items: center; /* ← 必要に応じて追加 (垂直方向の中央揃え) */
}

.w50per
{
	display: flex; /* ← 追加または修正 */
    flex-direction: row; /* ← 追加または修正 (横並びにするため) */
    justify-content: space-between; /* ← 追加 */
    align-items: start; /* ← 必要に応じて追加 (垂直方向の中央揃え) */
}

.w50per .form-group
{
	width: 50%;
}


label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input[type="text"],
input[type="number"],
input[type="file"] {
    width: calc(100% - 12px);
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

button {
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

button:hover {
    background-color: #0056b3;
}

#scoreboard {
    position: fixed; /* 既存のスタイル */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    color: white;
    display: flex;
    justify-content: space-around;
    align-items: center; /* 垂直方向の中央揃えは維持 */
    font-family: 'Arial Black', sans-serif; /* より力強いフォント */
    font-size: 10vw; /* 全画面に合わせて大きく表示 */
    text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.8);
    background-image: url(./img/scoreboard_default_bg.jpg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover; /* 画面全体を覆うように拡大縮小 */
    overflow: hidden; /* はみ出した部分を隠す */
    z-index: 9999; /* 最前面に表示 */
    flex-direction: row; /* プレイヤー1とプレイヤー2のボードを横並びにする */
    background-color: #383c3c; /* 初期状態の背景色をグレーに設定 */
    opacity: 1; /* 初期状態では不透明 */
    transition: opacity 0.5s ease-in-out; /* フェードアウト用 */
	font-weight:bold;
}

#win-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 20px;
    border-radius: 30px;
    text-align: center;
    font-size: 8vw; /* ← フォントサイズを大きくしました (5vw から 8vw に変更) */
    width: 80vw; /* ← 最大幅を画面の80%に設定 */
    font-family: 'Arial Black', sans-serif; /* ← 力強いフォントに変更 */
    z-index: 10002;
    opacity: 0; /* 最初は非表示 */
    word-break: auto-phrase;
    box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.8);
	animation: winMessageAnimation 0.5s ease-out,gradient 5s infinite cubic-bezier(.62, .28, .23, .99) both; /* アニメーションを適用 */
}

#win-message-decoration-up,
#win-message-decoration-down
{
	width:70vw;
	filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.8));
}

#draw-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    font-size: 10vw; /* ← フォントサイズを大きくしました (5vw から 8vw に変更) */
	width: 60vw; /* ← 最大幅を画面の80%に設定 */
    font-family: 'Arial Black', sans-serif; /* ← 力強いフォントに変更 */
    z-index: 10002;
    opacity: 0;
	word-break: auto-phrase;
	box-shadow:4px 4px 8px rgba(0, 0, 0, 0.8);
	transition: opacity 0.5s ease-in-out;
	animation: winMessageAnimation 0.5s ease-out,gradient 5s infinite cubic-bezier(.62, .28, .23, .99) both; /* アニメーションを適用 */
}

@keyframes winMessageAnimation {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(2);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

#player1Board,
#player2Board {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width:45%;
}

#player1NameDisplay,
#player2NameDisplay {
    font-size: 5vw;
    line-height: 1.2; /* Add line-height for better vertical alignment */
    margin: 0; /* Set margin to 0 to prevent misalignment */
    max-width: 45vw;
    word-break: auto-phrase;
    height: 12vw; /* Re-set fixed height */
    display: flex;
    align-items: center;
    justify-content: center;
}

#player1Score,
#player2Score {
    font-size: 15vw;
    margin-top: 0px;
    margin-bottom: 10px;
    transition: transform 0.1s ease-in-out; /* スケール変更のアニメーション */
}

.scoreboard-hidden {
    display: none;
}

.scoreboard-visible {
    display: flex;
}

.score-up-animation {
    transform: scale(1.75); /* 少し拡大 */
}

.score-down-animation {
    transform: scale(0.6); /* 少し拡大 */
}

.instructions {
    text-align: left; /* すべて左寄せ */
    margin-top: 20px;
    font-size: 0.9em;
    color: #777;
    border: 1px dotted #ccc; /* 点線で囲む */
    padding: 15px; /* 少し内側の余白を追加 */
    border-radius: 5px; /* 角を少し丸くする（任意） */
}

#darken-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: black;
    opacity: 0;
    z-index: 9997; /* スコアボードより奥 */
    transition: opacity 0.5s ease-in-out;
}

#result-announcement,
#semiresult-announcement {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10vw;
    color: #fff;
    text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.8);
    opacity: 0; /* 最初は非表示 */
    white-space: nowrap; /* 追加: 改行を防止 */
    z-index: 10001; /* 念のため z-index を上げる */
	background-color: #ffffff;
	padding:40px;
	border-radius: 50px;
	font-weight:bold;
	box-shadow:4px 4px 8px rgba(0, 0, 0, 0.8);
	width: 60vw; /* ← 最大幅を画面の80%に設定 */
	text-align:center;
}

.scoreboard-hidden {
    display: none;
}

.scoreboard-visible {
    display: flex;
}

.hide-cursor {
    cursor: none;
}

.addinfo-text {
    color:#777;
    font-size: 0.9em;
    margin-bottom: 10px;
    text-align: right;
}

/*メタリックカラー*/

.gold{
  background: linear-gradient(45deg, #ebd842 0%, #DAAF08 45%, #FEE9A0 70%, #DAAF08 85%, #ebd842 90% 100%);
  background-size: 800% 400%;
  animation: gradient 5s infinite cubic-bezier(.62, .28, .23, .99) both;
  animation-delay: 1s; /* ← ここに遅延時間を設定 */
}

.silver{
  background: linear-gradient(45deg, #afafb0 0%, #9E9E9E 45%, #E8E8E8 70%, #9E9E9E 85%, #afafb0 90% 100%);
  background-size: 800% 400%;
  animation: gradient 5s infinite cubic-bezier(.62, .28, .23, .99) both;
}

.bronze{
  background: linear-gradient(45deg, #a57e65 0%, #a57e65 45%, #f3cfb8 70%, #a57e65 85%, #a57e65 90% 100%);
  background-size: 800% 400%;
  animation: gradient 5s infinite cubic-bezier(.62, .28, .23, .99) both;
}


@keyframes gradient {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}


/* 紙吹雪用のスタイル */
        #confetti-container {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100vh;
            pointer-events: none;
            z-index: 9998; /* スコアボードより手前、WINメッセージより奥 */
        }
		.confetti {
			position: absolute;
			width: 10px;
			height: 10px;
			background-color: #f06;
			border-radius: 50%;
			opacity: 0;
			animation: fall 3s linear infinite, rotate 2s linear infinite;
			transform-origin: center center;
		}

		@keyframes fall {
			to {
				transform: translateY(2000px); 
				opacity: 1;
			}
		}
        @keyframes rotate {
            from {
                transform: rotate(0deg);
            }
            to {
                transform: rotate(360deg);
            }
        }
        #darken-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: black;
            opacity: 0;
            z-index: 9997; /* スコアボードより奥 */
            transition: opacity 0.5s ease-in-out;
        }
		
		
		
.lifewarelab-credit {
    margin-top: 30px;
    font-size: 0.8em;
    color: #555;
}

.lifewarelab-credit div{
  display: flex;
  justify-content: center;
  align-items: center;
}

.lifewarelab-credit span{
    margin: 10px 0;
}

.lifewarelab-logo {
    width: 100px; /* ロゴのサイズを調整 */
    height: auto;
    margin-left: 5px;
}

.lifewarelab-credit a {
    color: #007bff;
    text-decoration: none;

}

.lifewarelab-credit a:hover {
    text-decoration: underline;
}

/* Instructions for mobile */
.mobile-instructions {
    display: none;
}

#instructions-icon {
    width: 32px;
    height: 32px;
    vertical-align: middle;
    cursor: pointer;
}

/* Modal styles */
.modal {
    display: none; 
    position: fixed; 
    z-index: 10001; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgb(0,0,0); 
    background-color: rgba(0,0,0,0.4); 
}

.instructions-overlay-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    height: 100%;
    color: white;
    text-align: center;
}

.instruction-player-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 60vh; /* Adjust as needed */
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.instruction-action {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.instruction-action img {
    height: 2.5em;
}

.instruction-action .action-text {
    font-size: 4vw;
    margin-top: -2vw; /* Pull text closer to arrow */
}

.instruction-player-box .player-label {
    font-size: 3vw; /* Adjusted for new layout */
}

.hidden-button
{
    font-size: 0.8em;
    border: #fff 2px solid;
    padding:10px;
    border-radius: 10px;;
}

@media screen and (max-width: 1024px) {
    .pc-instructions {
        display: none;
    }
    .mobile-instructions {
        display: block;
        margin: 0 0 10px;

    }
    .mobile-only-setting {
        display: block;
    }

    /* Make form groups full width and stacked on mobile */
    .w50per-mobile-stack {
        flex-direction: column;
    }
    .w50per-mobile-stack .form-group {
        width: 100%;
    }

    /* Adjust buttons for mobile */
    .both_sided {
        flex-direction: column;
        align-items: stretch; /* Make children full width */
    }
    .both_sided > div { /* Target the div containing the reset buttons */
        width: 100%;
        display: flex;
        justify-content: space-between;
        margin-bottom: 10px;
    }
    .both_sided > div button {
        width: calc(50% - 5px);
    }
    #startButton {
        width: 100%;
        margin-top: 20px;
    }

    /* When scoreboard is visible on mobile, show the icons */
    .scoreboard-visible .scoreboard-icon {
        display: block;
        opacity: 0.4;
    }

    .w50per div
    {
        width: 100%;
    }

    .w50per > .form-group-checkboxes {
        width: auto !important;
    }
    .checkbox-container {
        display: block;
    }
}

/* Styles for scoreboard icons */
.scoreboard-icon {
    position: fixed;
    bottom: 20px;
    width: 40px;
    height: 40px;
    z-index: 10003; /* Above other scoreboard elements */
    cursor: pointer;
    display: none; /* Hide by default */
}

#settings-icon-scoreboard {
    left: 20px;
}

#instructions-icon-scoreboard {
    right: 20px;
}

@media screen and (orientation: landscape) and (max-height: 500px) {
    .settings-wrapper {
        display: flex;
        flex-direction: row;
        gap: 20px; /* Add some space between columns */
    }
    .settings-main {
        flex: 1; /* Take up available space */
    }
    .settings-side {
        flex: 1; /* Take up available space */
        display: flex;
        flex-direction: column;
    }
    .settings-side .both_sided {
        flex-direction: column;
        align-items: stretch;
    }
    .settings-side .both_sided > div {
        width: 100%;
        display: flex;
        justify-content: space-between;
        margin-bottom: 10px;
    }
    .settings-side .both_sided > div button {
        width: calc(50% - 5px);
    }
    .settings-side #startButton {
        width: 100%;
    }

    .hidden-button
    {
        font-size: 0.4em;
    }

}

.vertical-divider {
    width: 1px;
    background-color: white;
    height: 60vh; /* Match the height of instruction-player-box */
}

@media screen and (orientation: portrait) {
    .instruction-action img {
        height: 3.5em; /* Half of 10vw */
    }
}

.hidden-trigger-button {
    position: fixed;
    width: 50%;
    height: 100px;
    opacity: 0;
    z-index: 10004;
    cursor: pointer;
}

.top-left {
    top: 0;
    left: 0;
}

.top-right {
    top: 0;
    right: 0;
}

@media screen and (min-width: 1025px) {
    .hidden-trigger-button {
        display: none;
    }
}

h1 {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

@media screen and (min-width: 1025px), screen and (orientation: landscape) {
    h1 {
        flex-direction: row;
    }
}

.long-player-name {
    font-size: 0.7em;
}

.language-switcher {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10001; /* Ensure it's above other elements */
}

.language-switcher a {
    display: inline-block;
    padding: 8px 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
    margin-left: 10px;
    cursor: pointer;
}

.language-switcher a:hover {
    background-color: #0056b3;
}