/* ろじちるだけの見た目（カード・箱） */
.card {
  --cs: min(17vh, 15vw);
  position: relative; width: var(--cs); height: var(--cs); flex: none; border-radius: 22px; background: #fff;
  box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center; touch-action: none;
  transition: opacity .3s, background .3s, box-shadow .3s;
}
.card img, .card svg { width: 84%; height: 84%; object-fit: contain; pointer-events: none; }
.card.sel { box-shadow: 0 0 0 5px var(--blue), var(--shadow); }
.card.dragging { z-index: 20; transition: none; box-shadow: 0 14px 20px rgba(74, 52, 38, .25); }
.card.right { background: #e3f6ea; box-shadow: 0 0 0 5px var(--green), var(--shadow); }
.card.wrong { opacity: .45; }
.card.dim { opacity: .75; }
.card.shake, .sbox.shake { animation: shake .5s ease; }
.card .chip { position: absolute; bottom: -2.2em; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: min(2.6vh, 2.4vw); }
.card.dup { background: #fff1c9; box-shadow: 0 0 0 4px #f5b400, var(--shadow); }
.card.miss { background: #fde3dc; box-shadow: 0 0 0 4px var(--red), var(--shadow); }

.cards4 { display: flex; gap: 3vw; justify-content: center; padding-bottom: 3vh; }
.cards4.small .card { --cs: min(12vh, 11vw); }

/* 札（箱の名前） */
.chip { display: inline-flex; align-items: center; gap: .35em; background: #fff; border-radius: 999px; padding: .25em .8em; font-weight: 800; box-shadow: 0 3px 0 rgba(74, 52, 38, .15); }
.chip .dot { width: 1em; height: 1em; border-radius: 50%; display: inline-block; box-shadow: inset 0 0 0 2px rgba(74, 52, 38, .5); }
.chip .dot.big { width: 1.1em; height: 1.1em; background: #8a6a55; }
.chip .dot.small { width: .55em; height: .55em; background: #8a6a55; }
.chip .sh { display: inline-flex; width: 1.1em; height: 1.1em; }
.chip .sh svg { width: 100%; height: 100%; }

/* ---- なかまわけ ---- */
.scene[data-game="sort"] { justify-content: space-between; }
.tray { display: flex; flex-wrap: wrap; gap: 2vw; justify-content: center; align-items: center; min-height: min(15vh, 13vw); width: 100%; padding: 1vh 0; }
.tray .card { --cs: min(13vh, 11vw); }
.sort-bottom { display: flex; align-items: stretch; gap: 2vw; width: 100%; justify-content: center; }
.boxes { display: flex; gap: 2vw; flex: 1; justify-content: center; }
.sbox {
  flex: 1; max-width: 32vw; min-height: min(34vh, 30vw); background: #e7c79a; border-radius: 22px; padding: 1vh 1vw 1.4vh;
  box-shadow: inset 0 -8px 0 #c99b62, var(--shadow); display: flex; flex-direction: column; align-items: center; transition: background .3s;
}
.sbox.ok { background: #cfe9c8; box-shadow: inset 0 -8px 0 #9cc994, var(--shadow); }
.sbox-label { min-height: 2.2em; font-size: min(3vh, 2.8vw); display: flex; align-items: center; }
.sbox-cards { flex: 1; width: 100%; display: flex; flex-wrap: wrap; gap: 1vw; justify-content: center; align-content: flex-start; }
.sbox-cards .card { --cs: min(10vh, 8.6vw); border-radius: 16px; }
.done-btn {
  flex: none; align-self: center; font-size: min(4.2vh, 4vw); font-weight: 800; padding: 3vh 2.4vw; border-radius: 28px;
  background: var(--green); color: #fff; box-shadow: var(--shadow);
}
.done-btn:active { transform: translateY(4px); }

/* ---- ダブり・もれ ---- */
.lboxes { display: flex; gap: 3vw; justify-content: center; width: 100%; }
.lbox {
  flex: 1; max-width: 40vw; min-height: min(20vh, 18vw); background: #e7c79a; border-radius: 22px; padding: 1vh 1vw 1.6vh;
  box-shadow: inset 0 -8px 0 #c99b62, var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 1vh;
}
.lbox-head { font-size: min(3.6vh, 3.4vw); cursor: pointer; }
.lbox-cards { display: flex; flex-wrap: wrap; gap: 1vw; justify-content: center; }
.lbox-cards .card { --cs: min(13vh, 11vw); }
.lboxes.small .lbox { min-height: min(16vh, 14vw); }
.lboxes.small .lbox-head { font-size: min(2.8vh, 2.6vw); }
.lboxes.small .lbox-cards .card { --cs: min(9vh, 8vw); border-radius: 14px; }
.demo { display: flex; flex-direction: column; align-items: center; gap: 2vh; width: 100%; }
.demo .rest { display: flex; gap: 2vw; min-height: 2vh; }
.demo .rest .card { --cs: min(11vh, 10vw); }
.opts { display: flex; gap: 2vw; justify-content: center; flex-wrap: wrap; }
.opt { background: #fff; border-radius: 22px; padding: 1.6vh 1.6vw; box-shadow: var(--shadow); display: flex; align-items: center; gap: .5em; font-size: min(2.8vh, 2.5vw); }
.opt .to { font-weight: 800; }
.opt.right { box-shadow: 0 0 0 5px var(--green), var(--shadow); }
.opt.wrong { opacity: .45; }
.opt:active { transform: translateY(4px); }
