/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-family: var(--font-main);
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    min-width: 44px;
    min-height: 44px;
    text-align: center;
}

.btn:active {
    transform: scale(0.97);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-text);
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--color-primary-hover);
}

.btn-secondary {
    background-color: var(--color-bg-light);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--color-bg-card);
}

.btn-danger {
    background-color: var(--color-error);
    color: var(--color-text);
}

.btn-danger:hover:not(:disabled) {
    background-color: #e05050;
}

.btn-block {
    display: block;
    width: 100%;
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 900;
}

.modal {
    background-color: var(--color-bg-light);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 24px;
    min-width: 320px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 16px;
    text-align: center;
}

.modal-body {
    margin-bottom: 20px;
}

.modal-footer {
    display: flex;
    justify-content: center;
    gap: 12px;
}

/* ===== Input ===== */
.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.input-text {
    width: 100%;
    padding: 10px 14px;
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    color: var(--color-text);
    font-size: 1rem;
    font-family: var(--font-main);
    outline: none;
    transition: border-color 0.2s;
    min-height: 44px;
}

.input-text:focus {
    border-color: var(--color-primary);
}

.input-text::placeholder {
    color: var(--color-text-muted);
}

/* ===== Toast ===== */
.toast-container {
    position: fixed;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.875rem;
    pointer-events: auto;
    animation: toastIn 0.3s ease-out;
    max-width: 400px;
    text-align: center;
}

.toast.info {
    background-color: rgba(74, 144, 217, 0.9);
    color: white;
}

.toast.success {
    background-color: rgba(64, 192, 96, 0.9);
    color: white;
}

.toast.error {
    background-color: rgba(208, 64, 64, 0.9);
    color: white;
}

.toast.warning {
    background-color: rgba(240, 192, 64, 0.9);
    color: #1a1a2e;
}

.toast.fade-out {
    animation: toastOut 0.3s ease-in forwards;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* ===== Card View (placeholder) ===== */
.card-view {
    width: var(--card-width);
    height: var(--card-height);
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
}

.card-view:hover {
    transform: scale(1.05);
}

/* ===== Card Composite (Illustration + Frame layering) ===== */
.card-composite {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
}

.card-composite .card-illust {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.card-composite .card-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
    z-index: 2;
    pointer-events: none;
}

.card-composite .card-fallback {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-card);
    color: var(--color-text);
    text-align: center;
    padding: 2px;
}

.card-composite .card-overlay-info {
    position: relative;
    z-index: 4;
    pointer-events: none;
}

.card-composite .card-overlay-level {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--color-text);
    font-size: 9px;
    font-weight: bold;
    padding: 1px 4px;
    border-radius: 2px;
    z-index: 5;
}

.card-composite .card-mini-remove {
    z-index: 10;
}
