:root {
    --purple: #4b0082;
    --royal-yellow: #ffd700;
    --lavender: #e6e6fa;
    --soft-white: #fafafa;
    --ivory: #fffff0;
    --deep-velvet: #2e003e;
    --soft-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --gold-shadow: 0 2px 10px rgba(75, 0, 130, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Serif JP', serif;
    background-color: var(--lavender);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(75, 0, 130, 0.05) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(255, 215, 0, 0.05) 0%, transparent 20%);
    color: var(--deep-velvet);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 20px;
    overflow-x: hidden;
}

/* 背景の装飾 */
.background-ornament {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    border: 15px solid transparent;
    border-image: linear-gradient(var(--purple), var(--royal-yellow)) 1;
    opacity: 0.2;
}

.container {
    background-color: rgba(255, 255, 255, 0.98);
    width: 100%;
    max-width: 500px;
    padding: 40px;
    border-radius: 8px;
    border: 3px solid var(--purple);
    box-shadow: var(--soft-shadow), inset 0 0 30px rgba(75, 0, 130, 0.05);
    position: relative;
}

.container::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 1px solid var(--royal-yellow);
    pointer-events: none;
    border-radius: 10px;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

.title {
    font-family: 'Dancing Script', cursive;
    font-size: 3rem;
    color: var(--purple);
    margin-bottom: 5px;
    text-shadow: 1px 1px 2px rgba(75, 0, 130, 0.2);
}

.subtitle {
    font-size: 0.9rem;
    letter-spacing: 0.2rem;
    color: var(--royal-yellow);
    background: var(--deep-velvet);
    -webkit-background-clip: text;
    background-clip: text;
    font-weight: 400;
}

/* 入力エリア */
.input-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    position: relative;
}

#todo-input {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-bottom: 2px solid var(--royal-yellow);
    background: transparent;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
}

#todo-input:focus {
    border-bottom-color: var(--purple);
    background: rgba(230, 230, 250, 0.3);
}

#add-btn {
    background: linear-gradient(135deg, var(--purple), var(--deep-velvet));
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(75, 0, 130, 0.3);
    transition: all 0.2s;
}

#add-btn:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 15px rgba(75, 0, 130, 0.5);
}

#add-btn .btn-icon {
    font-size: 1.2rem;
}

/* 装飾の強化 */
.container::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    pointer-events: none;
    border-radius: 4px;
}

/* コーナー装飾（SVG） */
.corner {
    position: absolute;
    width: 60px;
    height: 60px;
    fill: var(--royal-yellow);
    pointer-events: none;
    z-index: 2;
}
.top-left { top: -15px; left: -15px; }
.top-right { top: -15px; right: -15px; transform: rotate(90deg); }
.bottom-left { bottom: -15px; left: -15px; transform: rotate(-90deg); }
.bottom-right { bottom: -15px; right: -15px; transform: rotate(180deg); }

/* リスト表示 */
#todo-list {
    list-style: none;
}

.todo-item {
    background: white;
    margin-bottom: 20px;
    padding: 18px 25px;
    border: 1px solid rgba(75, 0, 130, 0.1);
    border-left: 5px solid var(--purple);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 2px 4px 10px rgba(0,0,0,0.03);
    animation: slideIn 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    transition: all 0.3s ease;
    border-radius: 4px;
}

.todo-item:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 8px 20px rgba(75, 0, 130, 0.1);
    border-color: var(--royal-yellow);
}

.todo-text {
    flex: 1;
    margin-right: 15px;
    font-size: 1.1rem;
    color: var(--deep-velvet);
    transition: all 0.4s;
}

.todo-item.completed {
    border-left-color: var(--royal-yellow);
    background: #fdfdfd;
    opacity: 0.8;
}

.todo-item.completed .todo-text {
    color: #999;
    text-decoration: line-through;
    font-style: italic;
}

.actions {
    display: flex;
    gap: 12px;
}

.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    padding: 5px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.complete-btn:hover {
    transform: scale(1.3) rotate(15deg);
    filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.5));
}

.delete-btn {
    color: #e0e0e0;
}

.delete-btn:hover {
    color: var(--purple);
    transform: rotate(90deg) scale(1.2);
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* レスポンシブ */
@media (max-width: 480px) {
    .container {
        padding: 40px 20px;
    }
    .title {
        font-size: 2.2rem;
    }
    .corner {
        width: 40px;
        height: 40px;
    }
}
