@import url('https://fonts.googleapis.com/css2?family=M+PLUS+1p:wght@100;300;400;500;700;800;900&family=Montserrat:ital,wght@1,100..900&display=swap');

:root {
    --difficulty-one: linear-gradient(0deg, rgba(30, 57, 218, 1) 0%, rgba(79, 241, 244, 1) 80%);
    --difficulty-two: linear-gradient(0deg, rgba(177, 39, 235, 1) 0%, rgba(235, 171, 254, 1) 80%);
    --difficulty-three: linear-gradient(0deg, rgba(253, 246, 191, 1) 0%, rgba(202, 172, 30, 1) 80%);
    --difficulty-four: linear-gradient(0deg, rgba(237, 135, 38, 1) 0%, rgba(251, 226, 32, 1) 80%);
    --difficulty-player: linear-gradient(0deg, #ff8c00 0%, #ffd700 80%);
    --difficulty-default: #e0e0e0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: "M PLUS 1p", sans-serif;
}

header {
    width: 100%;
    background-image: linear-gradient(90deg, #23bff9, #2283ff);
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
    height: 72px;
    filter: drop-shadow(0 0 0.75rem rgba(0, 0, 0, 0.3));
}

.header-icon {
    z-index: 1;
    position: absolute;
    top: 0;
    bottom: 0;
    height: 128px;
    transform: rotate(30deg);
    filter: invert(48%) sepia(91%) saturate(3383%) hue-rotate(205deg) brightness(101%) contrast(101%);
}

header h1{
    z-index: 50;
    color: white;
    position: absolute;
    top: 0;
    left: 20px;
}

h1, h2 {
    color: black;
    font-weight: 800;
}

.container {
    width: 100%;
    max-width: 1200px; /* コンテンツの最大幅を設定 */
}

#settings-panel, #tournament-panel {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

#settings-panel {
    margin: 0 auto;
}

.settings-panel-content {
    display: grid;
    grid-template-columns: 1fr 2fr; /* 1/3と2/3の比率 */
    gap: 20px; /* カラム間の隙間 */
}

.settings-panel-content h2 {
    grid-column: 1 / -1; /* タイトルは全幅に表示 */
    text-align: center;
    margin-top: 0;
}

.settings-left-column {
    grid-column: 1 / 2; /* 左カラム */
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.setting-item {
    margin-bottom: 0; /* settings-left-column 内でgapを使うのでmarginをリセット */
}

.opponent-list-container {
    grid-column: 2 / 3; /* 右カラム */
}

.opponent-filter-controls {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap; /* 画面が狭い時に折り返すように */
}

.opponent-filter-controls fieldset {
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 4px;
    margin: 0;
}

fieldset legend {
    padding: 0 5px;
}

.tolerance-inputs {
    display: flex;
    gap: 10px;
}

.opponent-filter-controls div {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.opponent-filter-controls label {
    margin-bottom: 0; /* ラジオボタンのラベルのmarginをリセット */
    font-weight: normal;
    cursor: pointer;
    display: inline-block;
}

.opponent-filter-controls input[type="radio"] {
    margin-right: 2px;
}

.opponent-list-container .opponent-list-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.opponent-list-container .opponent-list-controls button {
    background-color: #6c757d;
    font-size: 12px;
    padding: 5px 10px;
}
.opponent-list-container .opponent-list-controls button:hover {
    background-color: #5a6268;
}

#opponent-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 4px;
}

#opponent-list div {
    margin-bottom: 5px;
}

.tournament-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.tournament-header h2 {
    margin: 0;
}

#back-to-settings-btn {
    background-color: transparent;
    color: #1a73e8;
    font-size: 14px;
    padding: 5px;
}
#back-to-settings-btn:hover {
    background-color: #f0f2f5;
}

.match-list {
    list-style: none;
    padding: 0;
}

.match-item {
    background-color: transparent;
    border: none;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.match-teams {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-grow: 1;
}

.match-teams::after {
    content: 'vs';
    font-size: 2em;
    font-weight: bold;
    color: #333;
}

.team-details {
    font-size: 0.8em;
    color: #555;
    font-weight: normal;
    margin-left: 5px;
}

.winner-display {
    color: #28a745;
    font-weight: bold;
}

.winner-button {
    margin-left: 10px;
    font-size: 12px;
    padding: 5px 10px;
}

/* Inazuma Card Styles */
.inazuma-card {
    transform: scale(0.7);
    transform-origin: top left;
    width: 400px;
    height: 250px;
    margin-right: calc(400px * (1 - 0.7) * -1);
    margin-bottom: calc(250px * (1 - 0.7) * -1);
    background: var(--difficulty-one); /* Default color */
    border-radius: 30px;
    position: relative;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    flex-shrink: 0;
    overflow: hidden; /* Prevent content from overflowing during scaling */
}

.inazuma-card.difficulty-two {
    background: var(--difficulty-two);
}

.inazuma-card.difficulty-three {
    background: var(--difficulty-three);
}

.inazuma-card.difficulty-four {
    background: var(--difficulty-four);
}

.player-card {
    background: var(--difficulty-player);
}

.empty-card {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--difficulty-default);
    color: #999;
    font-size: 1.5em;
    font-weight: bold;
}

.iz-card-bg-holo {
    position: absolute;
    top: 0;
    left:0;
    height: 100%;
    width: 100%;

    mix-blend-mode: multiply;
    opacity: 0.3;
}

.iz-card-bg-thunder {
    height: 250px;
    width: 250px;
    background-color: rgba(255,255,255,0.4);
    clip-path: polygon(70% 0, 53% 36%, 73% 33%, 28% 100%, 37% 51%, 16% 56%, 31% 0);
    position: absolute;
    right: -20%;
    mix-blend-mode: overlay;
}

.iz-card-bg-series {
    font-family: "Montserrat", sans-serif;
    font-weight: bold;
    font-style: italic;
    color: rgba(255, 255, 255, 0.7);
    font-size: 96px;
    position: absolute;
    top: -12%;
    left: -1%;
    letter-spacing: -3px;

}

.iz-card-level {
    font-family: "Montserrat", sans-serif;
    font-weight: bold;
    color: white;
    font-size: 72px;
    position: absolute;
    bottom: -4px;
    right: 20px;
    text-align: center;
}

.iz-card-info {
    font-family: "M PLUS 1p", sans-serif;
    font-weight: 900;
    color: white;
    font-size: 16px;
    position: absolute;
    transform: translate(0, -50%);
    top: 50%;
    left: 12px;
    width: calc(100% - 24px); /* Prevent text from overflowing */
}

.iz-card-team-name {
    font-size: 28px;
}
