/* フォントの定義 */
@font-face {
    font-family: 'GenshinFont'; /* 好きな名前を付ける */
    src: url('assets/ja-jp.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

:root {
    --pyro: #ff4b3e;
    --hydro: #4cc9ff;
    --anemo: #72e2c3;
    --electro: #d688ff;
    --dendro: #a5ff8d;
    --cryo: #a0e9ff;
    --geo: #ffe072;
}

body {
    background: #0f1215;
    color: white;
    font-family: 'GenshinFont','Meiryo', sans-serif;
}

/* 元素ごとの背景設定（元素カラーをほわっと薄く光らせる） */
.element-default {
    background: radial-gradient(circle at 30% 40%, rgba(255, 255, 255, 0.10), transparent 60%), linear-gradient(135deg, #24262a, #101214);
    border: 2px solid #444;
}

.element-Pyro {
    background: radial-gradient(circle at 30% 40%, rgba(255, 75, 62, 0.35), transparent 60%), linear-gradient(135deg, #3d1010, #150505);
    border: 2px solid var(--pyro);
}

.element-Hydro {
    background: radial-gradient(circle at 30% 40%, rgba(76, 201, 255, 0.35), transparent 60%), linear-gradient(135deg, #101a3d, #050815);
    border: 2px solid var(--hydro);
}

.element-Anemo {
    background: radial-gradient(circle at 30% 40%, rgba(114, 226, 195, 0.35), transparent 60%), linear-gradient(135deg, #103d2e, #051510);
    border: 2px solid var(--anemo);
}

.element-Electro {
    background: radial-gradient(circle at 30% 40%, rgba(214, 136, 255, 0.35), transparent 60%), linear-gradient(135deg, #2a103d, #100515);
    border: 2px solid var(--electro);
}

.element-Dendro {
    background: radial-gradient(circle at 30% 40%, rgba(165, 255, 141, 0.35), transparent 60%), linear-gradient(135deg, #163d10, #081505);
    border: 2px solid var(--dendro);
}

.element-Cryo {
    background: radial-gradient(circle at 30% 40%, rgba(160, 233, 255, 0.35), transparent 60%), linear-gradient(135deg, #102d3d, #051015);
    border: 2px solid var(--cryo);
}

.element-Geo {
    background: radial-gradient(circle at 30% 40%, rgba(255, 224, 114, 0.35), transparent 60%), linear-gradient(135deg, #3d2d10, #151005);
    border: 2px solid var(--geo);
}

.player-info {
    position: absolute;
    bottom: 0px;
    left: 10px;
    max-width: 380px;
}

#nickName {
    font-size: 16px;
    font-weight: bolder;
    color: #ddd;
    margin: 0;
}

#playerLevel {
    font-size: 12px;
    font-weight: bold;
    color: #aaa;
    margin: 2px 0;
}

#playerSignature {
    font-size: 11px;
    color: #888;
    margin: 0;
    max-width: 380px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 保存済みUIDのクイック切替チップ */
.saved-uid-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 10px;
}

.uid-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #1a1e24;
    border: 1px solid #333;
    border-radius: 16px;
    padding: 4px 6px 4px 14px;
    font-size: 13px;
    color: #ccc;
}

.uid-chip.active {
    border-color: #a5ff8d;
    color: #a5ff8d;
}

.uid-chip .uid-chip-name {
    cursor: pointer;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.uid-chip .uid-chip-name:hover {
    color: #a5ff8d;
}

.uid-chip-remove {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    padding: 3px 6px;
    border-radius: 50%;
}

.uid-chip-remove:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.card {
    width: 1050px;
    height: 580px;
    padding: 25px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.main-content {
    display: flex;
    flex: 1;
    z-index: 1;
}

.character-box {
    width: 450px;
    position: relative;
}

.gacha-img {
    position: absolute;
    height: 130%;
    left: -330px;
    bottom: -50px;
    z-index: -1;
    scale: 0.8;
    filter: drop-shadow(10px 10px 20px rgba(0, 0, 0, 0.5));
}

.info-box {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.constellation-row {
    display: flex;
    position: absolute;
    flex-direction: column;
    gap: 10px;
    margin-left: 10px;
    left: 410px;
    top: 30px;
}

.constellation {
    width: 40px;
    text-align: center;
}

.constellation img {
    width: 40px;
    height: 40px;
    border-radius: 20px;
    background: rgb(0, 0, 0);
    transition: 0.2s;
}

/* 未凸: 少し暗く・彩度を落とす */
.constellation.locked img {
    filter: grayscale(0.8) brightness(0.45);
    opacity: 0.6;
}

/* 凸済み: ほんのり光らせる */
.constellation.unlocked img {
    box-shadow: 0 0 10px 2px rgba(255, 188, 0, 0.7);
}

.name-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.const-badge {
    display: inline-block;
    font-size: 14px;
    font-weight: bold;
    background: rgba(255, 188, 0, 0.15);
    border: 1px solid #ffbc00;
    color: #ffbc00;
    border-radius: 6px;
    padding: 2px 8px;
}

.talent-row {
    display: flex;
    position: absolute;
    gap: 14px;
    margin-top: 10px;
    right: 640px;
    bottom: 150px;
}

.talent {
    width: 50px;
    text-align: center;
}

.talent img {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    background: rgba(0,0,0,0.3);
}

.talent-lv {
    font-size: 10px;
    font-weight: bold;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    font-size: 18px;
}

.artifact {
    width: 200px;       /* 少し大きめに設定 */
    position: absolute;
    top: 50%;           /* 配置の微調整 */
    left: 50%;         /* 右側にはみ出させる例 */
    transform: translate(-50%, -50%); /* 位置調整 */
    opacity: 0.3;       /* 背景っぽく薄くするとおしゃれ */
    z-index: 1;
}

.score {
    position: relative;
    font-size: 30px;
    z-index: 2;         /* スコアが画像の上にくるように */
    font-weight: bold;
    color: #ffbc00;
    margin-top: 60px;   /* スコアの位置調整 */
}
.total-score-panel {
    height: 140px;
    margin-top: auto;
    text-align: right;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.score-num {
    font-size: 60px;
    font-weight: bold;
}

.rank-b {
    font-size: 50px;
    background: #ffbc00;
    color: black;
    padding: 0 20px;
    border-radius: 8px;
    margin-right: 15px;
}

.artifact-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-top: 20px;
    z-index: 2;
}

.art-card {
    background: rgba(255, 255, 255, 0.08);
    padding: 10px;
    height: 100px;
    border-radius: 8px;
    font-size: 13px;
    /* --- ここが重要 --- */
    position: relative; /* 子のabsoluteの基準点にする */
    overflow: hidden;   /* これで枠外が隠れるようになる */
}

.icon-selector {
    display: flex;
    gap: 15px;
    padding: 20px 0;
    overflow-x: auto;
}

.char-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 3px solid #333;
    cursor: pointer;
    transition: 0.3s;
}

.char-icon:hover {
    transform: scale(1.1);
    border-color: white;
}

#weaponIcon {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.233);
    top: 310px;
    left: 490px;
    position: absolute;
}

#weaponName {
    font-size: 18px;
    color: #ddd;
    top: 400px;
    left: 490px;
    position: absolute;
}

#weaponLevel {
    font-size: 25px;
    font-weight: bold;
    color: #ddd;
    top: 430px;
    left: 490px;
    position: absolute;
}

.action-btns {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.save-btn {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #444;
    background: #1a1e24;
    color: #ddd;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

.save-btn:hover {
    border-color: #a5ff8d;
    color: #a5ff8d;
}