body {
    font-family: 'Inter', sans-serif;
    background-color: #1a202c;
    color: #e2e8f0;
    min-width: 775px;
}
.playmat {
    display: grid;
    grid-template-columns: auto 1fr auto; /* Left | Center | Right */
    gap: 1.5rem;
    width: 100%;
    max-width: 1400px; 
    margin: auto;
    padding: 1rem;
}
.area-label {
    font-size: 0.8rem;
    color: #a0aec0;
    margin-bottom: 0.25rem;
    text-align: center;
}
.card-slot {
    width: 90px;
    height: 122px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    transition: background-color 0.2s, border-color 0.2s;
    position: relative; 
}
.card-slot .card-holder{
    display: flex;
    align-items: center;
    justify-content: center;
}
.stage-slot {
    width: 160px;
    height: 130px;
}
.card-slot.drag-over {
    background-color: rgba(66, 153, 225, 0.3);
    border-color: #4299e1;
}
.slot-count {
    position: absolute;
    bottom: 5px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 0.9rem;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 9999px;
    pointer-events: none;
    z-index: 5;
}
.card {
    width: 80px;      
    height: 112px;     
    background-color: #2d3748;
    border: 1px solid #4a5568;
    border-radius: 0.5rem;
    cursor: grab;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, box-shadow 0.2s, margin 0.2s;
    user-select: none;
    position: relative; 
    overflow: hidden;
    background-size: cover;
    background-position: center;
}
#oshi-holomen-slot .card {
    cursor: zoom-in;
}
.card:active {
    cursor: grabbing;
}
.card.tapped {
    transform: rotate(90deg) scale(0.9);
    margin: 11px 0;
}
/* Style for cards underneath the top one */
.card.stacked {
    transform: scale(0.95);
    opacity: 0.8;
    bottom:0px;
}
/* Combine stacked and tapped states */
.card.stacked.tapped {
    transform: rotate(90deg) scale(0.85); /* 0.9 * 0.95 */
    opacity: 0.8;
    bottom:0px;
}
.card.face-down {
    background: linear-gradient(135deg, #6b7280, #374151);
}
.card.face-down > div { display: none; }
.deck { position: relative; width: 90px; height: 122px; background-color: #4a5568; border: 2px solid #718096; color: white; display: flex; flex-direction: column; justify-content: center; align-items: center; font-size: 1.2rem; font-weight: bold; border-radius: 0.5rem; cursor: pointer; }
.deck-count { font-size: 1.5rem; }
.action-button { background-color: #4299e1; color: white; padding: 0.5rem 1rem; border-radius: 0.5rem; font-weight: bold; transition: background-color 0.2s; }
.action-button:hover { background-color: #3182ce; }
.action-button:disabled { background-color: #4a5568; cursor: not-allowed; }
.pip-button {
    background-color: #4a5568;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 9999px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    border: 1px solid rgba(0,0,0,0.2);
}
.pip-button:hover:not(:disabled) { background-color: #718096; }
.pip-button:disabled { opacity: 0.5; cursor: not-allowed; }
.backstage-button {
    background-color: rgba(45, 55, 72, 0.8);
    color: #cbd5e0;
    padding: 6px 2px;
    font-size: 0.45rem;
    border-radius: 0.25rem;
    border: 1px solid #4a5568;
    flex-grow: 1;
}
.backstage-button:hover {
     background-color: rgba(74, 85, 104, 0.8);
}
.small-action-button {
    background-color: #4a5568;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: none; justify-content: center; align-items: center; z-index: 1000;
}
.modal-content {
    background-color: #2d3748; padding: 2rem; border-radius: 0.5rem; width: 90%; max-width: 600px;
}
.info-modal-content-style {
    text-sm: 0.875rem;
    color: #cbd5e0;
    space-y: 1rem;
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 1rem;
}
#context-menu {
    position: fixed;
    display: none;
    background-color: #2d3748;
    border: 1px solid #4a5568;
    border-radius: 0.5rem;
    padding: 0.5rem;
    z-index: 2000;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}
.context-menu-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: 0.25rem;
}
.context-menu-item:hover {
    background-color: #4a5568;
}
#image-zoom-modal img {
    max-height: 80vh;
    max-width: 80vw;
}
.memo-input {
    width: 3em;
    height: 18px;
    font-size: 0.7rem;
    text-align: center;
    background-color: rgba(26, 32, 44, 0.8);
    color: #e2e8f0;
    border: 1px solid #4a5568;
    border-radius: 0.25rem;
    z-index: 10;
    padding: 1px;
    box-sizing: border-box;
}
#left-column { display: flex; flex-direction: column; gap: 1rem; }
#center-area { display: flex; flex-direction: column; align-items: center; gap: 1rem; min-width: 500px;}
#right-column { display: flex; flex-direction: column; gap: 1rem; }
#top-stages { display: flex; justify-content: center; gap: 1rem; align-items: flex-end; }
#deck-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
#hand-container { width: 100%; border-top: 2px solid #4a5568; padding-top: 1rem; margin-top: 1rem; }
#hand-area, .viewer-area { min-height: 122px; background-color: rgba(0, 0, 0, 0.2); border-radius: 0.5rem; padding: 0.5rem; display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 0.5rem;}
.viewer-container { display: none; margin-top: 1rem; padding: 1rem; border-top: 2px solid #4a5568; }
#oshi-holomen-slot {
    width: 120px;
    height: 158px;
}
#oshi-holomen-slot .card {
    width: 110px;
    height: 148px;
}
.sp-button {
    position: absolute;
    top: 4px;
    left: 4px;
    z-index: 20;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 9999px;
    background-color: #4a5568;
    color: white;
    border: 1px solid #2d3748;
    transition: background-color 0.2s;
}
.sp-button:not(:disabled):hover {
    background-color: #718096;
}
.sp-button.active {
    background-color: #e53e3e;
    color: white;
}
.sp-button.active:hover {
    background-color: #c53030;
}
#n-look-selector .n-look-button {
    border-radius: 0;
    margin-left: -1px; /* ボーダーを重ねる */
    position: relative;
}

#n-look-selector .n-look-button:hover {
    z-index: 1; /* ホバーしたボタンが手前に来るように */
}

#n-look-selector .n-look-button:first-child {
    border-top-left-radius: 0.5rem;
    border-bottom-left-radius: 0.5rem;
    margin-left: 0;
}

#n-look-selector .n-look-button:last-child {
    border-top-right-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

.list-inside {
    font-size:0.75rem;
}
/* ドラッグ中の要素がドロップされる位置に表示されるゴースト要素 */
.sortable-ghost {
    opacity: 0.4;
    background-color: #4a5568;
}

/* ドラッグ対象として選択されている要素 */
.sortable-chosen {
    cursor: grabbing; /* カーソルをつかんでいる形に変更 */
}

.memo-container {
    position: absolute;
    top: 1px;
    left: 1px;
    z-index: 10;
    display: flex;
    align-items: center;
}

.memo-input {
    /* 元のスタイルは維持し、角丸とボーダーのみ調整 */
    border-radius: 0;
    border-left: none;
    border-right: none;
}

.memo-adjust-button {
    width: 1em;
    height: 18px;
    padding: 0;
    box-sizing: border-box;
    background-color: rgba(45, 55, 72, 0.8);
    color: #cbd5e0;
    border: 1px solid #4a5568;
    font-size: 1.1rem;
    font-weight: bold;
    line-height: 14px;
    text-align: center;
    cursor: pointer;
}
.memo-adjust-button:hover { background-color: rgba(74, 85, 104, 0.8); }

/* 左端のボタンの角を丸める */
.memo-adjust-button:first-of-type {
    border-radius: 0.25rem 0 0 0.25rem;
}

/* 右端のボタンの角を丸める */
.memo-adjust-button:last-of-type {
    border-radius: 0 0.25rem 0.25rem 0;
}