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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1a1a2e;
    color: #eee;
    padding-bottom: 20px;
}

.header {
    background: linear-gradient(135deg, #16213e, #0f3460);
    padding: 20px;
    text-align: center;
}

.header h1 {
    font-size: 24px;
    margin-bottom: 15px;
}

.hp-bar {
    position: relative;
    width: 100%;
    height: 30px;
    background: #333;
    border-radius: 15px;
    overflow: hidden;
    margin: 10px 0;
}

.hp-fill {
    height: 100%;
    background: linear-gradient(90deg, #e74c3c, #2ecc71);
    transition: width 0.5s;
    width: 100%;
}

.hp-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    text-shadow: 1px 1px 2px #000;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
    font-size: 14px;
    flex-wrap: wrap;
}

.regen-timer {
    text-align: center;
    font-size: 12px;
    color: #2ecc71;
    margin-top: 5px;
    font-family: monospace;
}

.info-link {
    color: #3498db;
    text-decoration: underline;
    cursor: pointer;
}

.info-link:hover {
    color: #2980b9;
}

.tooltip-container {
    position: relative;
    width: 100%;
    text-align: center;
    min-height: 10px;
}

.tooltip {
    display: none;
    background: #16213e;
    border: 1px solid #e94560;
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
    max-width: 500px;
    font-size: 13px;
    line-height: 1.5;
    z-index: 100;
    text-align: left;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.tooltip.show {
    display: block;
}

#tooltip-effect {
    display: none;
    background: #16213e;
    border: 1px solid #27ae60;
    border-radius: 8px;
    padding: 10px;
    font-size: 12px;
    line-height: 1.4;
    text-align: left;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    max-width: 400px;
}

#tooltip-effect.show {
    display: block;
}

.effects-bar {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
}

.effect-tag {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
}

.effect-tag.buff {
    background: #27ae60;
    color: white;
}

.effect-tag.debuff {
    background: #e74c3c;
    color: white;
}

.tabs {
    display: flex;
    background: #16213e;
}

.tab {
    flex: 1;
    padding: 15px;
    border: none;
    background: transparent;
    color: #eee;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.tab.active {
    background: #0f3460;
    border-bottom: 3px solid #e94560;
}

.tab-content {
    display: none;
    padding: 15px;
}

.tab-content.active {
    display: block;
}

.habit-card {
    background: #16213e;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: transform 0.2s;
}

.habit-card:hover {
    transform: translateY(-2px);
}

.habit-card.enemy {
    border-left: 4px solid #e74c3c;
}

.habit-card.friend {
    border-left: 4px solid #2ecc71;
}

.habit-card h3 {
    font-size: 16px;
    margin-bottom: 5px;
}

.habit-card .value {
    font-size: 14px;
    color: #aaa;
}

.stats-section {
    margin-bottom: 20px;
}

.stats-section h3 {
    margin-bottom: 10px;
    color: #e94560;
}

.action-item, .effect-item {
    background: #1a1a2e;
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 5px;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.delete-btn {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    margin-left: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.delete-btn:hover {
    background: #c0392b;
}

.action-item .hp-change.positive { color: #2ecc71; }
.action-item .hp-change.negative { color: #e74c3c; }

.effect-item.buff { border-left: 3px solid #2ecc71; }
.effect-item.debuff { border-left: 3px solid #e74c3c; }

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
}

.modal-content {
    position: relative;
    background: #16213e;
    margin: 50px auto;
    padding: 20px;
    width: 90%;
    max-width: 500px;
    border-radius: 10px;
}

.close {
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 28px;
    cursor: pointer;
}

.modal-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.modal-actions input {
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #555;
    background: #1a1a2e;
    color: #eee;
    width: 80px;
}

.btn-primary {
    padding: 10px 20px;
    background: #e94560;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.btn-primary:hover {
    background: #c73e54;
}

#modalResult {
    margin-top: 15px;
    padding: 10px;
    border-radius: 5px;
    display: none;
}

#modalResult.success {
    background: #27ae60;
    display: block;
}

#modalResult.error {
    background: #e74c3c;
    display: block;
}
